Bug 94643 [preferences] Java Editor Preferences page: mnemonics only work on second stroke
I20050509-2010 On the Java > Editor preference page, I have to press a mnemonic twice to make it really work. E.g. - click on "Mark Occurrences", press Alt+O -> focus is somewhere "between" tab and contents - press Alt+O again -> checkbox gets switched now
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeAssistConfigurationBlock.java
private void addSortingSection(Composite composite) {
		String label;
		label= PreferencesMessages.JavaEditorPreferencePage_presentProposalsInAlphabeticalOrder; 
		addCheckBox(composite, label, PREF_CODEASSIST_ORDER_PROPOSALS, trueFalse, 0);
		
		label= PreferencesMessages.JavaEditorPreferencePage_showOnlyProposalsVisibleInTheInvocationContext; 
		addCheckBox(composite, label, PREF_CODEASSIST_SHOW_VISIBLE_PROPOSALS, trueFalse, 0);
		
		label= PreferencesMessages.CodeAssistConfigurationBlock_hideDiscouraged_label;
		String[] vals= {JavaCore.NEVER, JavaCore.ERROR, JavaCore.WARNING};
		String[] labels= {
				PreferencesMessages.CodeAssistConfigurationBlock_hideDiscouraged_value_never,
				PreferencesMessages.CodeAssistConfigurationBlock_hideDiscouraged_value_error,
				PreferencesMessages.CodeAssistConfigurationBlock_hideDiscouraged_value_warning
		};
		addComboBoxWithLink(composite, label, PREF_CODEASSIST_HIDE_RESTRICTED_REFERENCES, vals, labels, 0);
	}
	
	protected Combo addComboBoxWithLink(Composite parent, String html, Key key, String[] values, String[] valueLabels, int indent) {
		GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
		gd.horizontalIndent= indent;
				
		final Link link= new Link(parent, SWT.LEFT);
		link.setText(html);
		link.setLayoutData(gd);
		link.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, null); 
			}
		});