Skip to main content



      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 09:54 Go to next message
Eclipse UserFriend
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 14:42 Go to previous messageGo to next message
Eclipse UserFriend
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 05:22 Go to previous message
Eclipse UserFriend
Thats great, thanks a lot.

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


Current Time: Wed Jul 23 21:54:32 EDT 2025

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

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

Back to the top