fNavigable.setSelection(newCaret, newCaret);
if (newCaret != BreakIterator.DONE) fNavigable.setSelection(newCaret, newCaret);
		private KeyAdapter getKeyListener() {			if (fKeyListener == null) {				fKeyListener= new KeyAdapter() {					private static final String TEXT_EDITOR_CONTEXT_ID= "org.eclipse.ui.textEditorScope"; //$NON-NLS-1$					private final boolean IS_WORKAROUND= (fNavigable instanceof ComboNavigable)							|| (fNavigable instanceof TextNavigable && TextNavigable.BUG_106024_TEXT_SELECTION);					private List/*<Submission>*/ fSubmissions;					public void keyPressed(KeyEvent e) {						if (IS_WORKAROUND) {							if (e.keyCode == SWT.ARROW_LEFT && e.stateMask == SWT.MOD2) {								int caretPosition= fNavigable.getCaretPosition();								if (caretPosition != 0) {									Point selection= fNavigable.getSelection();									if (caretPosition == selection.x)										fNavigable.setSelection(selection.y, caretPosition - 1);									else										fNavigable.setSelection(selection.x, caretPosition - 1);								}								e.doit= false;								return;															} else if (e.keyCode == SWT.ARROW_RIGHT && e.stateMask == SWT.MOD2) {								String text= fNavigable.getText();								int caretPosition= fNavigable.getCaretPosition();								if (caretPosition != text.length()) {									Point selection= fNavigable.getSelection();									if (caretPosition == selection.y)										fNavigable.setSelection(selection.x, caretPosition + 1);									else										fNavigable.setSelection(selection.y, caretPosition + 1);								}								e.doit= false;								return;							}						}						int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(e);						KeySequence keySequence = KeySequence.getInstance(SWTKeySupport.convertAcceleratorToKeyStroke(accelerator));						getSubmissions();						for (Iterator iter= getSubmissions().iterator(); iter.hasNext();) {							Submission submission= (Submission) iter.next();							TriggerSequence[] triggerSequences= submission.getTriggerSequences();							for (int i= 0; i < triggerSequences.length; i++) {								if (triggerSequences[i].equals(keySequence)) { // XXX does not work for multi-stroke bindings									e.doit= false;									submission.execute();									return;								}							}						}					}										private List/*<Submission>*/ getSubmissions() {						if (fSubmissions != null)							return fSubmissions;												fSubmissions= new ArrayList();												IContextService contextService= (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);						ICommandService commandService= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);						IHandlerService handlerService= (IHandlerService) PlatformUI.getWorkbench().getAdapter(IHandlerService.class);						IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);						if (contextService == null || commandService == null || handlerService == null || bindingService == null)							return fSubmissions;												IContextActivation[] contextActivations;						contextActivations= new IContextActivation[] {								contextService.activateContext(IContextService.CONTEXT_ID_WINDOW), // XXX relying on workbench feature https://bugs.eclipse.org/bugs/show_bug.cgi?id=115460#c11								contextService.activateContext(TEXT_EDITOR_CONTEXT_ID)						};												fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.SELECT_WORD_NEXT)) {							public void execute() {								fIterator.setText(fNavigable.getText());								int caretPosition= fNavigable.getCaretPosition();								int newCaret= fIterator.following(caretPosition);								if (newCaret != BreakIterator.DONE) {									Point selection= fNavigable.getSelection();									if (caretPosition == selection.y)										fNavigable.setSelection(selection.x, newCaret);									else										fNavigable.setSelection(selection.y, newCaret);								}								fIterator.setText(EMPTY_TEXT);							}						});						fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.SELECT_WORD_PREVIOUS)) {							public void execute() {								fIterator.setText(fNavigable.getText());								int caretPosition= fNavigable.getCaretPosition();								int newCaret= fIterator.preceding(caretPosition);								if (newCaret != BreakIterator.DONE) {									Point selection= fNavigable.getSelection();									if (caretPosition == selection.x)										fNavigable.setSelection(selection.y, newCaret);									else										fNavigable.setSelection(selection.x, newCaret);								}								fIterator.setText(EMPTY_TEXT);							}						});						fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.WORD_NEXT)) {							public void execute() {								fIterator.setText(fNavigable.getText());								int caretPosition= fNavigable.getCaretPosition();								int newCaret= fIterator.following(caretPosition);								fNavigable.setSelection(newCaret, newCaret);								fIterator.setText(EMPTY_TEXT);							}						});						fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.WORD_PREVIOUS)) {							public void execute() {								fIterator.setText(fNavigable.getText());								int caretPosition= fNavigable.getCaretPosition();								int newCaret= fIterator.preceding(caretPosition);								fNavigable.setSelection(newCaret, newCaret);								fIterator.setText(EMPTY_TEXT);							}						});						fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD)) {							public void execute() {								Point selection= fNavigable.getSelection();								String text= fNavigable.getText();								int start;								int end;								if (selection.x != selection.y) {									start= selection.x;									end= selection.y;								} else {									fIterator.setText(text);									start= fNavigable.getCaretPosition();									end= fIterator.following(start);									fIterator.setText(EMPTY_TEXT);									if (end == BreakIterator.DONE)										return;								}								fNavigable.setText(text.substring(0, start) + text.substring(end));								fNavigable.setSelection(start, start);							}						});						fSubmissions.add(new Submission(bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD)) {							public void execute() {								Point selection= fNavigable.getSelection();								String text= fNavigable.getText();								int start;								int end;								if (selection.x != selection.y) {									start= selection.x;									end= selection.y;								} else {									fIterator.setText(text);									end= fNavigable.getCaretPosition();									start= fIterator.preceding(end);									fIterator.setText(EMPTY_TEXT);									if (start == BreakIterator.DONE)										return;								}								fNavigable.setText(text.substring(0, start) + text.substring(end));								fNavigable.setSelection(start, start);							}						});												for (int i= 0; i < contextActivations.length; i++) {							contextService.deactivateContext(contextActivations[i]);						}												return fSubmissions;					}									};			}			return fKeyListener;		}