Recipe 12.8 Creating a Plug-in Menu from Scratch

     

12.8.1 Problem

You have a plug-in action set, and you want to create a new menu using it.

12.8.2 Solution

To create a new menu, right-click an action set in the Extensions tab, and select New Menu.

12.8.3 Discussion

We'll continue the example developed in the previous recipe by adding a new menu to the action set created in that recipe. Right-click Action Set 1 in the Extensions tab, and select New Menu. In the Properties view, set the id property of the new menu to Menu1 and the label property to Menu 1 , as shown in Figure 12-19, where the new menu appears under Action Set 1 .

Figure 12-19. A new menu
figs/ecb_1219.gif

We're going to add a menu separator to this menu as a placeholder that will enable us to add other items to the menu later, grouping menu items together. To create a menu separator, right-click the menu, Menu 1 , and select New Separator. Set the separator's name property to Group1 , in the Properties view, as shown in Figure 12-20.

Figure 12-20. A new menu separator
figs/ecb_1220.gif

This creates a new menu and adds it to the action set. Now you've got to create some menu items and connect an action to them to make something happen. See the next recipe for details.

12.8.4 See Also

Recipe 12.9 on creating actions; Recipe 12.10 on coding plug-in actions; Chapter 11 and Chapter 12 of Eclipse ( O'Reilly).



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net