Bug 31328 hover key modifier text field: selection is not replaced by new modifier
- given text: Ctrl - select text: Ctrl - press: Shift -> result: Ctrl + Shift expected: Shift (the same holds for the key modifier text field of 'hyperlink style navigation', please fix it too or reassign the bug to me once it is fixed for the hovers pref. page)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorHoverConfigurationBlock.java
boolean state= fEnableField.getSelection();
				fModifierEditor.setEnabled(state);
				fHoverConfigs[i].fIsEnabled= state;
				handleModifierModified();
			}
			public void widgetDefaultSelected(SelectionEvent e) {
			}
		});
		
		label= new Label(stylesComposite, SWT.LEFT);
		label.setText(PreferencesMessages.getString("JavaEditorHoverConfigurationBlock.JavaEditorHoverConfigurationBlock.keyModifier")); 
		fModifierEditor= new Text(stylesComposite, SWT.BORDER);
		gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
		fModifierEditor.setLayoutData(gd);
		fModifierEditor.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= fModifierEditor.getText();
					if (text.length() > 0)
						text= PreferencesMessages.getFormattedString("JavaEditorHoverConfigurationBlock.JavaEditorHoverConfigurationBlock.appendModifier", new String[] {text, Action.findModifierString(e.stateMask)}); 
					else
						text= Action.findModifierString(e.stateMask);
					fModifierEditor.setText(text);
					fModifierEditor.setSelection(text.length(), text.length());
				}