How to select something in ComboViewer
I'm using a ContentAssist in my ComboViewer and if I choose something from
the ContentAssist my selection in the ComboViewer won't get updated. I
need to update the Viewer because I listen to changes there.
Here is my code for reacting to "Enter" pressed in the ContentAssist:
private class ComboCategorysKey extends KeyAdapter {
@Override
public void keyPressed(KeyEvent arg0) {
try {
if (arg0.keyCode ==
KeyStroke.getInstance("Enter").getNaturalKey()) {
IStructuredSelection selection = (IStructuredSelection)
comboViewer.getSelection();
if (selection.size() > 0) {
System.out.println("Shout out loud!");
}
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}
How can I update the selection of the ComboViewer when I only got my
results from ContentAssist.
Excuse me for my bad english.
No comments:
Post a Comment