StringBuffer buf= new StringBuffer(""); if ((stateMask & SWT.CTRL) == SWT.CTRL) appendModifierString(buf, SWT.CTRL); if ((stateMask & SWT.ALT) == SWT.ALT) appendModifierString(buf, SWT.ALT); if ((stateMask & SWT.SHIFT) == SWT.SHIFT) appendModifierString(buf, SWT.SHIFT); if ((stateMask & SWT.COMMAND) == SWT.COMMAND) appendModifierString(buf,  SWT.COMMAND); fBrowserLikeLinksKeyModifierText.setText(buf.toString());
fBrowserLikeLinksKeyModifierText.setText(EditorUtility.getModifierString(stateMask));
	private Control createNavigationPage(Composite parent) {		Composite composite= new Composite(parent, SWT.NULL);		GridLayout layout= new GridLayout(); layout.numColumns= 2;		composite.setLayout(layout);						String text= PreferencesMessages.getString("JavaEditorPreferencePage.navigation.browserLikeLinks"); //$NON-NLS-1$		fBrowserLikeLinksCheckBox= addCheckBox(composite, text, PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS, 0);		fBrowserLikeLinksCheckBox.addSelectionListener(new SelectionListener() {			public void widgetSelected(SelectionEvent e) {				boolean state= fBrowserLikeLinksCheckBox.getSelection();				fBrowserLikeLinksKeyModifierText.setEnabled(state);				handleBrowserLikeLinksKeyModifierModified();			}			public void widgetDefaultSelected(SelectionEvent e) {			}		});				// Text field for modifier string		text= PreferencesMessages.getString("JavaEditorPreferencePage.navigation.browserLikeLinksKeyModifier"); //$NON-NLS-1$		fBrowserLikeLinksKeyModifierText= addTextField(composite, text, PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS_KEY_MODIFIER, 20, 0, false);		fBrowserLikeLinksKeyModifierText.setTextLimit(Text.LIMIT);				if (computeStateMask(fOverlayStore.getString(PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS_KEY_MODIFIER)) == -1) {			// Fix possible illegal modifier string			int stateMask= fOverlayStore.getInt(PreferenceConstants.EDITOR_BROWSER_LIKE_LINKS_KEY_MODIFIER_MASK);			StringBuffer buf= new StringBuffer(""); //$NON-NLS-1$			if ((stateMask & SWT.CTRL) == SWT.CTRL)				appendModifierString(buf, SWT.CTRL);			if ((stateMask & SWT.ALT) == SWT.ALT)				appendModifierString(buf, SWT.ALT);			if ((stateMask & SWT.SHIFT) == SWT.SHIFT)				appendModifierString(buf, SWT.SHIFT);			if ((stateMask & SWT.COMMAND) == SWT.COMMAND)				appendModifierString(buf,  SWT.COMMAND);			fBrowserLikeLinksKeyModifierText.setText(buf.toString());		}				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) {// && e.time -time < 1000) {					String modifierString= fBrowserLikeLinksKeyModifierText.getText();					Point selection= fBrowserLikeLinksKeyModifierText.getSelection();					int i= selection.x - 1;					while (i > -1 && Character.isWhitespace(modifierString.charAt(i))) {						i--;					}					boolean needsPrefixDelimiter= i > -1 && !String.valueOf(modifierString.charAt(i)).equals(DELIMITER);					i= selection.y;					while (i < modifierString.length() && Character.isWhitespace(modifierString.charAt(i))) {						i++;					}					boolean needsPostfixDelimiter= i < modifierString.length() && !String.valueOf(modifierString.charAt(i)).equals(DELIMITER);					String insertString;					if (needsPrefixDelimiter && needsPostfixDelimiter)						insertString= PreferencesMessages.getFormattedString("JavaEditorPreferencePage.navigation.insertDelimiterAndModifierAndDelimiter", new String[] {Action.findModifierString(e.stateMask)}); //$NON-NLS-1$					else if (needsPrefixDelimiter)						insertString= PreferencesMessages.getFormattedString("JavaEditorPreferencePage.navigation.insertDelimiterAndModifier", new String[] {Action.findModifierString(e.stateMask)}); //$NON-NLS-1$					else if (needsPostfixDelimiter)						insertString= PreferencesMessages.getFormattedString("JavaEditorPreferencePage.navigation.insertModifierAndDelimiter", new String[] {Action.findModifierString(e.stateMask)}); //$NON-NLS-1$					else						insertString= Action.findModifierString(e.stateMask);					fBrowserLikeLinksKeyModifierText.insert(insertString);				}			}		});		fBrowserLikeLinksKeyModifierText.addModifyListener(new ModifyListener() {			public void modifyText(ModifyEvent e) {				handleBrowserLikeLinksKeyModifierModified();			}		});		return composite;	}