0

I'm working with Eclipse Standard Widget Toolkit (SWT), I have a TreeView object with items and an double click event (addDoubleClickListener) works fine, but I don't know how implement the right click for delete an item.

Baz
  • 36,440
  • 11
  • 68
  • 94
Miguel Ángel
  • 693
  • 1
  • 6
  • 10

1 Answers1

0
  1. To listen to right clicks, use addMenuListener. Eclipse RCP has its own more advanced mechanisms, but this should be enough for your purposes.

  2. In SelectionListener for your MenuItem, remove the item from your model and refresh the viewer.

Community
  • 1
  • 1
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487