Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:40 Go to next message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
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 13:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 11:24 Go to previous message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
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: Fri Apr 26 04:26:47 GMT 2024

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

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

Back to the top