|Re: Adding a file menu item via an extension point [message #526670 is a reply to message #526627]
||Mon, 12 April 2010 14:38
| Daniel KrÃ¼gler
Registered: July 2009
On 12.04.2010 15:09, Paul Webster wrote:|
> Greg Babcock wrote:
>> I am trying to add menu item to the file menu via an extension point.
>> I have done some experimenting and a lot of googleing but have not
>> been able to get it to work. Is it possible to contribute via an
>> extension point to a menu that was created via code? If so can someone
>> provide an example or point to the appropriate documentation.
> If you are creating some of your main menus in your ActionBarAdvisor,
> you can still use org.eclipse.ui.menus to add commands to them using
> their ID. ex: in the IDE, WorkbenchActionBuilder creates the main menu
> I can add to it using locationURI="menu:file?after=additions"
I agree that this works, but it looks like an unfortunate constraint.
In fact, I can create my complete menu structure without any code
within the ActionBarAdvisor, except until I need to provide at least
a single action via code. E.g. ActionFactory.RESET_PERSPECTIVE has
no command pendant and I cannot use a wrapping command for this
functionality. Therefore I must provide it via the ActionBarAdvisor,
in which I *also* need to define a new menu manager given some ID,
e.g. IWorkbenchActionConstants.M_WINDOW. Unfortunately it seems as
if I cannot refer to a manager for some identifiable menu contribution
already defined via plugin.xml - or did I miss something?
Greetings from Bremen,
Powered by FUDForum
. Page generated in 0.06424 seconds