Search code examples
eclipse-rcpe4

Different menu item types in Eclipse 4


When I right click on a menu and select Add child, I am presented with several options:

  • Handled Menu Item
  • Menu
  • Direct Menu Item
  • Dynamic Menu Contribution
  • VisibleWhen Core Expression

What is the difference between each of these choices?

enter image description here


Solution

    • Handled Menu Item

      This is a menu item that uses a command id (and therefore one or more handlers).

    • Direct Menu Item

      This is a menu item where you specify the class to handle the item directly without using a command id.

    • Menu

      This adds a new sub-menu.

    • Dynamic Menu Contribution

      This lets you specify a class that can add multiple menu items dynamically. See here

    • VisibleWhen Core Expression

      This lets you add a 'core expression' to the current menu item to control when it is visible. See the Eclipse help for details of core expressions. Eclipse Oxygen also now supports Imperative Expressions where you can specify a Java class to control the menu visibility.