Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Menu URI to make contributions to Context menu on Coolbar.
Menu URI to make contributions to Context menu on Coolbar. [message #332502] Thu, 23 October 2008 18:04 Go to next message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Is there an RCP defined popup URI that allows menuContributions to the
coolbar popup?
Re: Menu URI to make contributions to Context menu on Coolbar. [message #332520 is a reply to message #332502] Fri, 24 October 2008 19:24 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

kevin j miles wrote:
> Is there an RCP defined popup URI that allows menuContributions to the
> coolbar popup?

Those system menus don't have contribution URIs at the moment. That
would have to be an enhancement request (and targetted for 3.5)

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


Re: Menu URI to make contributions to Context menu on Coolbar. [message #332561 is a reply to message #332520] Tue, 28 October 2008 20:19 Go to previous messageGo to next message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Where is it defined in the IDE... i've been trying to find the URI
definition somewhere in the ide jars.

This is what i'm doing

IMenuService menuService =
(IMenuService)PlatformUI.getWorkbench().getService( IMenuService.class );



MenuManager menuMgr = new MenuManager( "ToolbarPopup",
"popup:my.popup.id" );

menuMgr.add( new Separator(
IWorkbenchActionConstants.MB_ADDITIONS ) );

menuService.populateContributionManager( menuMgr,
"popup:my.popup.id" );

Menu m = menuMgr.createContextMenu( coolbar );

coolbar.setMenu( m );



In my plugin.xmls i just make contributions the the
"popup:my.popup.id?after=additions"

This works... i was just trying to figure out the proper way since i'm
seeing some funny business when toolbars show/hide themselves.

Paul Webster wrote:
> kevin j miles wrote:
>> Is there an RCP defined popup URI that allows menuContributions to the
>> coolbar popup?
>
> Those system menus don't have contribution URIs at the moment. That
> would have to be an enhancement request (and targetted for 3.5)
>
> PW
>
Re: Menu URI to make contributions to Context menu on Coolbar. [message #332573 is a reply to message #332561] Wed, 29 October 2008 13:25 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Amongst other things, you are overriding the workbench provided popup.
That doesn't sound like a good idea to me, and what about a Menu that
already exists there (we shouldn't leak 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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Menu URI to make contributions to Context menu on Coolbar. [message #332575 is a reply to message #332573] Wed, 29 October 2008 14:20 Go to previous messageGo to next message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Paul,

Thanks a ton for the input!

I need to make contributions to the popup on the coolbar.

I understand that I may be doing it incorrectly but how do I do it
properly?

I'm sure this is straight forward... every application that uses the RCP
would want this??

kjm

Paul Webster wrote:
> Amongst other things, you are overriding the workbench provided popup.
> That doesn't sound like a good idea to me, and what about a Menu that
> already exists there (we shouldn't leak it).
>
> PW
>
Re: Menu URI to make contributions to Context menu on Coolbar. [message #332614 is a reply to message #332575] Fri, 31 October 2008 14:59 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

kevin j miles wrote:
> Paul,
>
> Thanks a ton for the input!
>
> I need to make contributions to the popup on the coolbar.
>
> I understand that I may be doing it incorrectly but how do I do it
> properly?

You can't. There's no API to contribute to that menus (controlled by
the internal window, I believe. Same thing with the editor or view
stack tab menus. They're owned by the presentation and so are not
currently extensible.

That doesn't mean that they cannot be extended, but AFAIK there's no API
to do 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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Menu URI to make contributions to Context menu on Coolbar. [message #333269 is a reply to message #332614] Tue, 02 December 2008 21:11 Go to previous messageGo to next message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Paul, I've done some research and found where the IDE plugins define the
coolbar popup:

org.eclipse.ui.internal.ide.WorkbenchActionBuilder:

protected void fillCoolBar(ICoolBarManager coolBar)
{
IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2)
getActionBarConfigurer();

{ // Set up the context Menu
coolbarPopupMenuManager = new MenuManager();
coolbarPopupMenuManager.add(new
ActionContributionItem(lockToolBarAction));
coolbarPopupMenuManager.add(new
ActionContributionItem(editActionSetAction));
coolBar.setContextMenuManager(coolbarPopupMenuManager);
IMenuService menuService = (IMenuService)
window.getService(IMenuService.class);
menuService.populateContributionManager( coolbarPopupMenuManager,
"popup:windowCoolbarContextMenu");
}
}

I've tried this and it seems to work great if all toolbar items were
added programatically but as soon as a declared toolbar item shows up
the active toolbar doesn't seem to fwd the 'getmenu' call up to the
Coolbar. It seems to ALWAYS work when you right click on any toolbars
handle ( vertical dots ).

Is this behavior you expect or is there some code that i'm missing to
make sure that the popup menu shows on all toolbars in the coolbar?

Thanks in advance.

kjm




Paul Webster wrote:
> kevin j miles wrote:
>> Paul,
>>
>> Thanks a ton for the input!
>>
>> I need to make contributions to the popup on the coolbar.
>>
>> I understand that I may be doing it incorrectly but how do I do it
>> properly?
>
> You can't. There's no API to contribute to that menus (controlled by
> the internal window, I believe. Same thing with the editor or view
> stack tab menus. They're owned by the presentation and so are not
> currently extensible.
>
> That doesn't mean that they cannot be extended, but AFAIK there's no API
> to do it.
>
> PW
>
>
Re: Menu URI to make contributions to Context menu on Coolbar. [message #333298 is a reply to message #333269] Wed, 03 December 2008 15:37 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

kevin j miles wrote:
> protected void fillCoolBar(ICoolBarManager coolBar)
> {
> IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2)
> getActionBarConfigurer();
>
> { // Set up the context Menu
> coolbarPopupMenuManager = new MenuManager();
> coolbarPopupMenuManager.add(new
> ActionContributionItem(lockToolBarAction));
> coolbarPopupMenuManager.add(new
> ActionContributionItem(editActionSetAction));
> coolBar.setContextMenuManager(coolbarPopupMenuManager);
> IMenuService menuService = (IMenuService)
> window.getService(IMenuService.class);
> menuService.populateContributionManager(
> coolbarPopupMenuManager, "popup:windowCoolbarContextMenu");
> }
> }

Wow, that looks odd :-)

> Is this behavior you expect or is there some code that i'm missing to
> make sure that the popup menu shows on all toolbars in the coolbar?

This sounds like a bug (although the contributed commands and created
actions should work the same way). Please open a bug with a
reproducible test case at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&short_desc=[Contributions]

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


Re: Menu URI to make contributions to Context menu on Coolbar. [message #333355 is a reply to message #333298] Thu, 04 December 2008 20:32 Go to previous message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Bug 257612 [Contributions] Problems with Context Menu on Coolbar.

Paul Webster wrote:
>
> This sounds like a bug (although the contributed commands and created
> actions should work the same way). Please open a bug with a
> reproducible test case at
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&short_desc=[Contributions]
>
>
> PW
>
>
Previous Topic:Does the Common Navigator Framework (CNF) support Capabilities?
Next Topic:Change to shift click function
Goto Forum:
  


Current Time: Thu Apr 25 04:02:37 GMT 2024

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

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

Back to the top