|
Re: Adding a file menu item via an extension point [message #526356 is a reply to message #526348] |
Fri, 09 April 2010 19:11 |
Eclipse User |
|
|
|
Originally posted by: rjl.third-monday.com
In your actionSets extension point, specify the correct 'menubarPath'
string:
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="com.<MY>.objects"
label="MyObjects"
>
<action
class="com.<MY>.Action"
menubarPath="File/additions"
/>
</actionSet>
</extension>
I'm not sure on the exact path, I can only guess that it's 'File'.
On 04/09/2010 01:02 PM, 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.
>
> Thanks
>
> GB
>
>
|
|
|
|
|
|
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 Messages: 853 Registered: July 2009 |
Senior Member |
|
|
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
> skeleton.
>
> 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,
Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.04556 seconds