Bug 27005 [typing] Smart string wrapping
Using1119, I noticed something quite annoying. Consider the following code: String s = ""; If you copy some code like: class A { // comment } And then you paste it between the double-quotes, you will end up with: String s = "public class A { // comment" + "}"; The problem is that this code is not equivalent. I should have a line break at the end of the first line. Otherwise the code contained in my string s doesn't even compile. So the feature is nice, but cannot be used till a line break is added at the end of each part of the string concatenation. So in the above example, I would expect: String s = "public class A { // comment\n" + "}"; or String s = "public class A { // comment\r\n" + "}"; or String s = "public class A { // comment\r" + "}"; The line break could be chosen according to the line breaks in the current file or the platform line delimiter.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
public void widgetDefaultSelected(SelectionEvent e) {}
		});		
	}
	private Control createContentAssistPage(Composite parent) {
		Composite contentAssistComposite= new Composite(parent, SWT.NULL);
		GridLayout layout= new GridLayout(); 
		layout.numColumns= 2;
		contentAssistComposite.setLayout(layout);
		addCompletionRadioButtons(contentAssistComposite);
		String label;		
		label= PreferencesMessages.getString("JavaEditorPreferencePage.insertSingleProposalsAutomatically"); 
		addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOINSERT, 0);		
		label= PreferencesMessages.getString("JavaEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext"); 
		addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, 0);
		
		label= PreferencesMessages.getString("JavaEditorPreferencePage.presentProposalsInAlphabeticalOrder"); 
		addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS, 0);
		
		label= PreferencesMessages.getString("JavaEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName"); 
		addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ADDIMPORT, 0);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.fillArgumentNamesOnMethodCompletion"); 
		Button button= addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, 0);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.guessArgumentNamesOnMethodCompletion"); 
		fGuessMethodArgumentsButton= addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, 0);
		createDependency(button, fGuessMethodArgumentsButton);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.enableAutoActivation"); 
		final Button autoactivation= addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION, 0);
		autoactivation.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected(SelectionEvent e) {
            	updateAutoactivationControls();