Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Reuse Commands in plugin.xml in form toolbar
Reuse Commands in plugin.xml in form toolbar [message #538732] Tue, 08 June 2010 13:54 Go to next message
Martin Lange is currently offline Martin LangeFriend
Messages: 16
Registered: May 2010
Location: Munich, Germany
Junior Member

Hi,

I have a little problem (I hope) with an eclipse rcp application I am developing right now.

In this application I defined a few command added them to the menubar and assigned different handler for these commands depending on the selection state of the application.

Now I'd like to reuse this commands in a view I have created based on the Eclipse UI Form Toolkit.

The question is, how can I add commands defined in the plugin.xml to the toolbar of an UI Toolkit Form?

Something like:
// ...
ScrolledForm form = managedForm.getForm();
// ...
form.getToolBarManager().add( /* command from plugin.xml */ );
// ...
form.getToolBarManager().update(true);


Thanks in advance

-- Martin
Re: Reuse Commands in plugin.xml in form toolbar [message #538847 is a reply to message #538732] Tue, 08 June 2010 18:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There is
org.eclipse.ui.menus.IMenuService.populateContributionManage r(ContributionManager,
String). You would use releaseContributions(*) when you're done to
avoid leaking them.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Reuse Commands in plugin.xml in form toolbar [message #538988 is a reply to message #538732] Wed, 09 June 2010 09:22 Go to previous message
Martin Lange is currently offline Martin LangeFriend
Messages: 16
Registered: May 2010
Location: Munich, Germany
Junior Member

Thats great, thanks a lot.

-- Martin
Previous Topic:Accessing the EditorInput in IdetailsPage
Next Topic:Unwanted menu contributions
Goto Forum:
  


Current Time: Fri Apr 26 15:33:30 GMT 2024

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

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

Back to the top