Skip to content

Instantly share code, notes, and snippets.

@jvanzyl
Created August 6, 2010 22:45
Show Gist options
  • Save jvanzyl/512151 to your computer and use it in GitHub Desktop.
Save jvanzyl/512151 to your computer and use it in GitHub Desktop.
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