title: Java ComboViewer react on edit, KeyListener?
body: <p>I am using a JFace ComboViewer in my Plugin. As a convenience feature I'd like to change the current selection just by starting typing.
  For that I added a KeyListener to the underlying Combo Element</p>
  
  <p>What I get is an event as soon as I start typing, but unfortunately I do not get the changed value, but only the one before I started typing.</p>
  
  <p>My keylistener, which has a reference tot he ComboViewer reacts currently in this way:</p>
  
  <pre><code>@Override
      public void keyPressed(KeyEvent e) {
            ISelection selection = combo.getSelection(); //combo is the ComboViewer
  
          if (selection instanceof IStructuredSelection &amp;&amp; !selection.isEmpty()) {
  
              IStructuredSelection strucSel = (IStructuredSelection) selection;
  
              node = (TreeNode) strucSel.getFirstElement();
  ...}
  </code></pre>
  
  <p>The first character I type actually makes it through the if-statement, any further typed character causes the selection to be empty.</p>
  
  <p>So how do I get always a "current selection" and how can I obtain the changed value, it seems like reacting in the keylistener is to early, because the text-field I am typing in is not yet updated and thus will always provide old information?</p>
  
  <p>Maybe I understood something wrong, but I could not imagine that I could be so hard getting an up-to-date information from a text field. 
  Any advices? </p>