The view menu is the dropdown shown with a triangular icon, and is currently created in the SampleView
class in the createView
method. This can be recreated in the fragment editor by adding a view menu to the part descriptor.
Open the
fragment.e4xmi
file and navigate to the Sample View part descriptor. Under that, there is a Menus element and a dropdown choice box. Select View Menu from the list and click on the Add button to add a View Menu.In the newly created View Menu, there is a drop-down choice box. Choose Handled Menu Item and click on Add.
Add the following to the Handled Menu Item:
Label:
Action 1
Tooltip:
Action 1 tooltip
Icon URI:
platform:/plugin/org.eclipse.ui/icons/full/obj16/info_tsk.png
or use the Find … button as beforeEnsure that the Enabled checkbox is selected
Click on the Find … button next to the Command field and choose the Action 1 command from the list
The Handled Menu Item should look like this:
Comment out the
createViewMenu...