Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using commands inside a form
Using commands inside a form [message #545002] Tue, 06 July 2010 10:32 Go to next message
SlowStrider Mising name is currently offline SlowStrider Mising name
Messages: 115
Registered: July 2009
Senior Member
Hello,

Can I programmatically place toolbars inside an editor (or view) to which I can contribute commands? (Just like I can register popup menu's for controls by using getSite().registerContextMenu(...)).

I have one form editor with multiple TableViewers that are in Sections. In the top right corner of the section title bar I made new/add buttons (with SWT designer) which should invoke a command when pressed.

I already know I can do this programmatically by adding a selection listener and using the handler service. But this way some functionality is bypassed such as enabled/disabled through activeWhen and other plugins cannot contribute.
Re: Using commands inside a form [message #545044 is a reply to message #545002] Tue, 06 July 2010 13:43 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If you use a ToolBarManager you can call
org.eclipse.ui.menus.IMenuService.populateContributionManage r(ContributionManager,
String) with an ID like toolbar:my.view.id.section1 ... then commands
can be contributed to your toolbar from the plugin.xml.

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: Using commands inside a form [message #545106 is a reply to message #545002] Tue, 06 July 2010 16:10 Go to previous message
SlowStrider Mising name is currently offline SlowStrider Mising name
Messages: 115
Registered: July 2009
Senior Member
Allright thank you!
Previous Topic:I've problems when I go import a class another project!
Next Topic:How do I set initial RCP window size
Goto Forum:
  


Current Time: Thu Oct 23 08:16:19 GMT 2014

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

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