|
|
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   |
Eclipse User |
|
|
|
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 #332575 is a reply to message #332573] |
Wed, 29 October 2008 14:20   |
Eclipse User |
|
|
|
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 #333269 is a reply to message #332614] |
Tue, 02 December 2008 21:11   |
Eclipse User |
|
|
|
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
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04037 seconds