Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Menu imple be a code
Menu imple be a code [message #665752] Fri, 15 April 2011 18:03 Go to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
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 18:48 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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] Sat, 16 April 2011 01:45 Go to previous messageGo to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
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: Sat, 16 April 2011 02:03]

Report message to a moderator

Re: Menu imple be a code [message #665795 is a reply to message #665752] Sat, 16 April 2011 02:14 Go to previous messageGo to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
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 11:28 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Fri Mar 29 00:48:37 GMT 2024

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

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

Back to the top