Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Menu imple be a code
Menu imple be a code [message #665752] Fri, 15 April 2011 14:03 Go to next message
Eclipse UserFriend
Hi,

How to read menu extension point programtically
and add this as view menu bar..... i,e via code

Note all are command handler not Action

in the Same fashion how we use actionbar or actionset

thanks
Ashok

<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:com.jobsleaf.myview">
<command
commandId="com.jobsleaf.command.displaydata"
label="Display"
mnemonic="n"
style="push">
</command>
<command
commandId="com.jobsleaf.command.print"
label="Print"
style="push">
</command>
</menuContribution>
</extension>
Re: Menu imple be a code [message #665761 is a reply to message #665752] Fri, 15 April 2011 14:48 Go to previous messageGo to next message
Eclipse UserFriend
If you create your own MenuManager for some reason, you can fill it in
just the same as the main menu bar by getting the IMenuService and then
using populateContributions on the manager, with the locationURI you want.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Re: Menu imple be a code [message #665794 is a reply to message #665761] Fri, 15 April 2011 21:45 Go to previous messageGo to next message
Eclipse UserFriend
HI,

How to add command handler to the menumanager because

Menumanager has add method which accept action has input it will not accept command handler...

IMenuService menuservice = (IMenuService)PlatformUI.getWorkbench().getActiveWorkbenchWi ndow().getService(IMenuService.class);
ICommandService commadnService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getServ ice(ICommandService.class);
Command cmnd = commadnService.getCommand("com.jobsleaf.comman.display");
MenuManager menumgr = new MenuManager();

/// how can i add command to menu manager

menuservice.populateContributionManager(menumgr,"menu:com.ericsson.properties.view.view4 ");


Please help me i am half the way of the problem

Thanks
Ashok

[Updated on: Fri, 15 April 2011 22:03] by Moderator

Re: Menu imple be a code [message #665795 is a reply to message #665752] Fri, 15 April 2011 22:14 Go to previous messageGo to next message
Eclipse UserFriend
Can u please look into this ur also


http://www.eclipse.org/forums/index.php?t=msg&th=207760& amp;start=0&S=c1c24ff1d380427bb1a218b47644e4f8

http://www.eclipse.org/forums/index.php?t=msg&th=207594& amp;start=0&S=c1c24ff1d380427bb1a218b47644e4f8

http://www.eclipse.org/forums/index.php?t=msg&th=206041& amp;start=0&S=c1c24ff1d380427bb1a218b47644e4f8
Re: Menu imple be a code [message #665964 is a reply to message #665794] Mon, 18 April 2011 07:28 Go to previous message
Eclipse UserFriend
On 04/15/2011 09:45 PM, ash wrote:
> HI,
>
> How to add command handler to the menumanager because
> Menumanager has add method which accept action has input it will not
> accept command handler...

You can either use IMenuService to populate your MenuManager from the
org.eclipse.ui.menus extension point, or you can simply add
CommandContributionItems (construct them with
CommandContributionItemParameter).

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:ViewPart closing - causing content provider to be disposed
Next Topic:remove Finsh button From Wizard Dialog
Goto Forum:
  


Current Time: Wed Jul 23 13:39:29 EDT 2025

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

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

Back to the top