Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Menu item from menuContribution extension element(How to create MenuItem from menuContributiom extension element)
Menu item from menuContribution extension element [message #1726806] Wed, 16 March 2016 15:42
Serhiy Davydiuk is currently offline Serhiy DavydiukFriend
Messages: 6
Registered: March 2016
Junior Member
Hi,

I trying to customize the context menu of a partStack's tab to show my own entries. For this I extend StackRenderer and modify it MenuDetectListener. All works fine if I create Menu and its items in my StackRenderer class.
But, I need to fill this menu in another plugin. I create extension point and used scheme menus.exsd, so in second plugin it is possible to create menu, but I can't understand how I can create menu from these data.

private Menu createEditorTabMenu(CTabFolder folder, MPart part) {
        Menu menu = new Menu(folder);
        IExtensionRegistry reg = Platform.getExtensionRegistry();
        IConfigurationElement[] extensions = reg.getConfigurationElementsFor(TAB_POPUP_MENU_EXTENSION_ID);
        for (IConfigurationElement elements : extensions) {
            // can get elements here but how create menu item from it?
            IConfigurationElement[] el = elements.getChildren();
            

            // MenuItem item = new MenuItem(menu, SWT.NONE);
            // item.setText("Item label1");
        }
        return menu;
    }


Maybe someone can help, how Eclipse do it? Or maybe I choose wrong way?
Thanks
Previous Topic:Importing a class from a hosted plugin
Next Topic:Karel Screen Shots
Goto Forum:
  


Current Time: Thu Apr 25 17:28:00 GMT 2024

Powered by FUDForum. Page generated in 0.02932 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top