Pop-up and view menus are defined declaratively in the Application.e4xmi
file. These are specific to a part, so the option is defined underneath the part declaration.
Open the
Application.e4xmi
file.Navigate to the Application | Windows and Dialogs | Trimmed Window | Controls | Perspective Stack | Perspective | Controls | PartSashContainer | Part Stack | Part (Hello) | Menus node.
Right-click on the Menus node and choose Add child | Popup Menu. Set the ID to
com.packtpub.e4.application.popupmenu.hello
, which will be used in code later.Right-click on the Popup Menu and choose Add child | Handled Menu Item. This is exactly the same as for other menus; fill in the details as follows:
Label:
Hello
Command:
helloCommand - com.packtpub.e4.application.command.hello
Right-click on the Menus node again, and choose Add child | View Menu. Give the menu a label
View Menu
and right-click to choose Add child | Handled Menu Item. Use the same label...