Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » add toolbar for section of form using plugin
add toolbar for section of form using plugin [message #483599] Wed, 02 September 2009 05:40 Go to next message
Eclipse UserFriend
Hi,
I need to add a toolbar to a particular section of eclipse form in my
application. I want to do this using plugins so that i can reuse the
commands.... Is there a way to do that....this form is on my editor.....
Re: add toolbar for section of form using plugin [message #483651 is a reply to message #483599] Wed, 02 September 2009 09:26 Go to previous messageGo to next message
Eclipse UserFriend
Once you have the toolbar added to your section through the form toolkit you can get its ToolBarManager.

You can then use the IMenuService to populate your toolbar from an ID:
IMenuService m = (IMenuService) getSite().getService(IMenuService.class);
m.populateContributionManager(tbManager, "toolbar:my.editor.id.section.id");

You just have to remember to releaseContributions(tbManager) when the toolbar/section/editor gets disposed.

PW
Re: add toolbar for section of form using plugin [message #483845 is a reply to message #483651] Thu, 03 September 2009 07:24 Go to previous message
Eclipse UserFriend
Hi Paul,
Thanks for your suggestion. That looks fine.But i m stuck on how to actually
add a toolbar to a form section?
I can add the toolbar to a form as
formToolbar=(ToolBarManager)form.getToolBarManager();

IMenuService

ms=(IMenuService)getSite().getService(IMenuService.class);

ms.populateContributionManager((ContributionManager) formToolbar,

"toolbar:Prototype.src.com.ibm.safr.we.ui.editors.Lookup");

formToolbar.update(true);

Is there a way to do it similarly with sections?



"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:h7lrpd$gpo$1@build.eclipse.org...

> Once you have the toolbar added to your section through the form toolkit
> you can get its ToolBarManager.
>
> You can then use the IMenuService to populate your toolbar from an ID:
> IMenuService m = (IMenuService) getSite().getService(IMenuService.class);
> m.populateContributionManager(tbManager,
> "toolbar:my.editor.id.section.id");
>
> You just have to remember to releaseContributions(tbManager) when the
> toolbar/section/editor gets disposed.
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
Previous Topic:Create a Combo in the CoolBar of the RCP
Next Topic:Re: PDE Build issue
Goto Forum:
  


Current Time: Sun Jul 13 10:57:51 EDT 2025

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

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

Back to the top