Time for action – defining the pop-up view in the fragment

The pop-up menu can be created in an almost identical way to the view menu. As before, it needs to be registered with the menu service but the code can be dramatically simplified by representing it in the fragment.e4xmi file.

  1. Go to the fragment.e4xmi file, and go to the Menus element beneath the Sample View part descriptor. Add a child Popup Menu to the Menus element, either with the context-sensitive menu and by choosing Add child | Popup Menu, or by selecting Popup Menu from the dropdown and clicking on the Add button.
  2. In the newly created Popup Menu, set the ID to com.packtpub.e4.migration.views.SampleView.popup.
  3. Select Handled Menu Item from the dropdown and click on Add.
  4. Add the Action ...

Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.