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
fBrowserLikeLinksCheckBox.addSelectionListener(new SelectionListener() {
			public void widgetSelected(SelectionEvent e) {
				boolean state= fBrowserLikeLinksCheckBox.getSelection();
				fBrowserLikeLinksKeyModifierText.setEnabled(state);
				handleBrowserLikeLinksKeyModifierModified();
			}
			public void widgetDefaultSelected(SelectionEvent e) {
			}
		});
		
		
		text= PreferencesMessages.getString("JavaEditorPreferencePage.navigation.browserLikeLinksKeyModifier"); 
		fBrowserLikeLinksKeyModifierText= addTextField(composite, text, PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS_KEY_MODIFIER, 20, 0, false);
		
		fBrowserLikeLinksKeyModifierText.addKeyListener(new KeyListener() {
			private boolean isModifierCandidate;
			public void keyPressed(KeyEvent e) {
				isModifierCandidate= e.keyCode > 0 && e.character == 0 && e.stateMask == 0;
			}
		
			public void keyReleased(KeyEvent e) {
				if (isModifierCandidate && e.stateMask > 0 && e.stateMask == e.stateMask && e.character == 0) {
					String text= fBrowserLikeLinksKeyModifierText.getText();
					if (text.length() > 0)
						text= PreferencesMessages.getFormattedString("JavaEditorPreferencePage.navigation.appendModifier", new String[] {text, Action.findModifierString(e.stateMask)}); 
					else
						text= Action.findModifierString(e.stateMask);
					fBrowserLikeLinksKeyModifierText.setText(text);
					fBrowserLikeLinksKeyModifierText.setSelection(text.length(), text.length());
				}