1
edit
Changes
→Use The Command in The Menu
==== Use The Command in The Menu ====
At this point we have a "Print" command but is not yet accessible to the user. In order to expose the command to the user, we have to add this command to the top bar menu. Following these steps will add the print command as a button to the top bar (we are not adding the command to a sub menu, but we are directly adding it to the top bar menu):<br/><br/>Add another extension point called "org.eclipse.ui.menus" in the Extensions tab of the plugin.xml screen.<br/>
[[Image: RCPCommand8.jpg | 500px]]<br/>
<br/>
Then right click on the added extention point and choose New > menuContribution.M<br/>
[[Image: RCPCommand9.jpg | 500px]]<br/>
<br/>
In the menueContribution's Extention Element Details section set the locationURI to :"menu:org.eclipse.ui.main.menu" (make sure it is typed correctly).<br/>
[[Image: RCPCommand10.jpg | 400px]]<br/>
<br/>
Then right click on the menuContibution in All Extentions section and select New > command.<br/>
[[Image: RCPCommand11.jpg | 400px]]<br/>
<br/>