Created
August 6, 2010 22:45
-
-
Save jvanzyl/512151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchText = new Text(this, SWT.BORDER); | |
searchText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1)); | |
searchText.addKeyListener(new KeyAdapter() { | |
public void keyPressed(KeyEvent e) { | |
if(e.keyCode == SWT.ARROW_DOWN) { | |
searchResultViewer.getTree().setFocus(); | |
if(searchResultViewer.getTree().getItemCount()>0) { | |
searchResultViewer.setSelection(new StructuredSelection(searchResultViewer.getTree().getItem(0)), true); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment