0

What is the best way to do "context aware" menu for table in Eclipse scout.

For example, lets assume that table has boolean row "Additional", and we want :

if Additional is true show menu :

Edit
Add
Additional

if false

Edit 
Add
Delete

How to do this ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Marko Zadravec
  • 8,298
  • 10
  • 55
  • 97

1 Answers1

2

From Eclipse Scout 4 and newer: What you want is to override execOwnerValueChanged(Object) on your menu items. You will be passed a List<ITableRow> as argument with which you can decide if the menu item should be visible/enabled.

I'd suggest you create 2 menu items for Delete and Additional and then implement the solution above.

See also the wiki page in the Scout Eclipsepedia.

Patrick
  • 4,720
  • 4
  • 41
  • 71
  • 1
    See also this discussion on the Eclipse Scout Forum: [execAboutToShow()](https://www.eclipse.org/forums/index.php?t=msg&th=914212&goto=1556463msg_1556463) – Jmini Jan 26 '15 at 06:04