Skip to main content

Development Workflow for Basic Menus

The development workflow for adding a menu contribution follows:

  1. Create your editor, view, or custom command and handler. The view can be either vertical or horizontal.

  2. Use Eclipse to add the menus extension. The values for some of the properties depend on values that you added when you created either an editor, a view, or a generic command. The step-by-step procedures explain how to map these values.

  3. Add the locationURI syntax for the type of menu contribution that you are making. The topics that contain "locationURI syntax" explain how to identify menu contributions in your plug-in.

  4. For views, use the visibleWhen element to define rules about the visibility of menu entries to end-users. If you design your view to function only with other components, it is recommended that the menu entry become visible only when the other components are in use. If your view is simple and does not depend on other components, it is not necessary to set conditions for visibility. You can also add advanced conditional activation.

  5. In order to display an item or execute a command that is associated with your menu item, add a handler and assign it to the command.

  6. (Optional) Contribute to the status line.

You do not need to write Java code for menu contributions unless you want to execute another task. In this case, writing the Java code is a separate activity from adding the menu contribution. The code must be embedded either in an editor, a view, or a generic command and handler.