[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Menu Contribution for RCP

Hi,

im not sure if it works in your case but you can contribute actions by using RetargetActions and actionhandler.
For example ActionFactory.UNDO.create(window) creates an LabelRetargetAction which you can add to your menubar. But this action doesnt provide any logic. To define this any view (or maybe plugin) can define an actionhandler with the actions they should be performed.


UndoActionHandler undoHandler = new UndoActionHandler(getViewSite(),IOperationHistory.GLOBAL_UNDO_CONTEXT);
IActionBars actionBar = getViewSite().getActionBars();
actionBar.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoHandler);


So it is possible to implement special behavior of an action for every view part.

May you use these technique to contribute your actions. But how i mentioned above: Im not sure :)

Best regards & Good luck
René

S Prabhu wrote:
Hello,

I have developed an RCP with few menus.... and developed plug-in for that RCP which will contribute menu items for windows menus of the RCP (My Custom RCP), But i am not able to view this menu item in my RCP.....

Note: When i add my plug-in with eclipse i am able to see those menu items

I have add my both application code here...

"fillMenuBar method from ActionBarAdvisor class"
------------------------------------------------

protected void fillMenuBar(IMenuManager menuBar)
{
MenuManager windowMenu=new MenuManager ("&Window", IWorkbenchActionConstants.M_WINDOW);
menuBar.add (windowMenu);
windowMenu.add (new GroupMarker ("window.undo"));
windowMenu.add (new GroupMarker ("window.redo"));


// This following line added later even i am not able to see the menuitem
windowMenu.add (new Separator ("additions"));
}



And plug-in.xml of plug-in for menu contribution... -----------------------------------------------------

<extension point="org.eclipse.ui.actionSets">
    <actionSet
          id="msk.eclipse.ime.action.set.menu.window"
          label="%window_menu_actionSet.label"
          visible="true">
        <action
                  class="plugin.test.MYTestAction"
                 id="ID.MYTestAction"
                  label="MY Test Action"
                 menubarPath="window/additions"
                  style="push"/>
     </actionSet>
</extension>


Please help how to contribute the menu items for Custom developed plug-ins

Thanks
S.Prabhu