Bug 30941 Preferences default initialization. Can not do a syncExec
20030204 The initialization of the preference default currently contains a final Display display= Display.getDefault(); display.syncExec(new Runnable() { public void run() { Color c= display.getSystemColor(SWT.COLOR_GRAY); rgbs[0]= c.getRGB(); c= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); rgbs[1]= c.getRGB(); c= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); rgbs[2]= c.getRGB(); } }); We should avoid and remove this as this is a candidate for a deadlock.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
layout.numColumns= 2;
		group.setLayout(layout);
		group.setText(PreferencesMessages.getString("JavaEditorPreferencePage.typing.description")); 
		label= PreferencesMessages.getString("JavaEditorPreferencePage.wrapStrings"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_WRAP_STRINGS, 1);
		
		label= PreferencesMessages.getString("JavaEditorPreferencePage.smartPaste"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_SMART_PASTE, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.insertSpaceForTabs"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_SPACES_FOR_TABS, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.closeStrings"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_CLOSE_STRINGS, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.closeBrackets"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.closeBraces"); 
		addCheckBox(group, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.closeJavaDocs"); 
		Button button= addCheckBox(group, label, PreferenceConstants.EDITOR_CLOSE_JAVADOCS, 1);
		label= PreferencesMessages.getString("JavaEditorPreferencePage.addJavaDocTags"); 
		fAddJavaDocTagsButton= addCheckBox(group, label, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, 1);
		createDependency(button, fAddJavaDocTagsButton);
		return composite;
	}
	private void addFiller(Composite composite) {
		Label filler= new Label(composite, SWT.LEFT );
		GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
		gd.horizontalSpan= 2;
		gd.heightHint= convertHeightInCharsToPixels(1) / 2;
		filler.setLayoutData(gd);
	}