Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How can I register a toolbar?
How can I register a toolbar? [message #327439] Sun, 20 April 2008 10:32 Go to next message
Eclipse UserFriend
Originally posted by: phillipus.nowhere.net

Hi,

I have an EditorPart that uses many trees and tables and many toolbars
(ToolBarManagers) for each tree and table. I am able to register popup
context menus for these so that other plugins may contribute to the
context menu by a call such as:

myEditor.getSite().registerContextMenu("myid.popupmenu", menuMgr,
treeViewer);

But is it possible to do the same for a toolbar so that other plugins
can add their own toolbar buttons/actions?

Thanks in advance.

P
Re: How can I register a toolbar? [message #327440 is a reply to message #327439] Sun, 20 April 2008 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phillipus.nowhere.net

Phillipus wrote:
> Hi,
>
> I have an EditorPart that uses many trees and tables and many toolbars
> (ToolBarManagers) for each tree and table. I am able to register popup
> context menus for these so that other plugins may contribute to the
> context menu by a call such as:
>
> myEditor.getSite().registerContextMenu("myid.popupmenu", menuMgr,
> treeViewer);
>
> But is it possible to do the same for a toolbar so that other plugins
> can add their own toolbar buttons/actions?
>
> Thanks in advance.
>
> P


I should make it clear that the toolbar is not a main toolbar. It is
one of many in a composite view.

P.
Re: How can I register a toolbar? [message #327444 is a reply to message #327439] Sun, 20 April 2008 14:56 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can register a toolbar for command contributions, org.eclipse.ui.menus.

When creating the toolbar use the IMenuService to populate it with an ID
unique to that view/toolbar and use the IMenuService to released the
toolbar before disposing it.

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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: How can I register a toolbar? [message #327448 is a reply to message #327444] Sun, 20 April 2008 22:01 Go to previous message
Eclipse UserFriend
Originally posted by: phillipus.nowhere.net

Paul Webster wrote:
> You can register a toolbar for command contributions, org.eclipse.ui.menus.
>
> When creating the toolbar use the IMenuService to populate it with an ID
> unique to that view/toolbar and use the IMenuService to released the
> toolbar before disposing it.
>
> PW
>
>

Paul, you are a star! Many, many thanks for this info, it works exactly
as required.

Have a peaceful day!

Phillipus
Previous Topic:eclipse freezes after field retrieving
Next Topic:How to use MessageConsole?
Goto Forum:
  


Current Time: Thu Jun 27 19:39:19 GMT 2024

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

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

Back to the top