sebaestschjin
sebaestschjin

Reputation: 99

Disable selection change in JFace TreeViewer

I have a TreeViewer in my view. Whenever I press a button (say s), the viewer selects the first item in the tree starting with this letter (say stackoverflow). Is there a way to disable this behaviour?

Thank you.

Upvotes: 1

Views: 800

Answers (1)

sambi reddy
sambi reddy

Reputation: 3085

Restricting all key events on Tree looks promising but you would loose navigating the tree structure and expand/collapse on tree node and all other functionality.

tree.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
         e.doit = false;
      }
    });

Upvotes: 1

Related Questions