Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » menubarPath -- Did this function change in 3.1?
menubarPath -- Did this function change in 3.1? [message #286256] Mon, 06 June 2005 09:20 Go to next message
Eclipse UserFriend
Originally posted by: gary.karasiuk.com

In 3.0.2, I was able to have one plug-in add menu items to another plug-ins
menu.

Here is a fragment from the plug.xml of the plug-in that is being extended:

<extension point="org.eclipse.ui.actionSets">
<actionSet label="%ActionSet.label" visible="true"
id="org.eclipse.perfmsr.ui.actions">
<menu
label="%Menu.label"
id="org.eclipse.perfmsr.menu">
<separator name="snapshots"></separator>
<separator name="all"></separator>
<separator name="other"></separator>
<!-- This group can be extended by other plugins. -->
<separator name="additions"></separator>
</menu>

And here is a fragment from the plugin.xml that is trying to add some
additional menu items:

<action
label="%OpenSnapshots.label"
tooltip="%OpenSnapshots.tootip"

class=" org.eclipse.perfmsr.ui.client.OpenSnapshotsViewActionDelegat e "
menubarPath="org.eclipse.perfmsr.menu/additions"
id="org.eclipse.perfmsr.ui.client.opensnapshotsview">
</action>

Am I doing something wrong? In 31RC1 I now get:

Invalid Menu Extension (Path is invalid):
org.eclipse.perfmsr.ui.client.opensnapshotsview
Re: menubarPath -- Did this function change in 3.1? [message #286397 is a reply to message #286256] Wed, 08 June 2005 09:50 Go to previous messageGo to next message
Eclipse UserFriend
I too am trying to this kind of thing, and I get the same error message.
Only I *am* using Eclipse 3.0.2 and it doesn't work for me. I spent
most of yesterday afternoon searching the web for a solution, but all
the Eclipse documentation I can find on the subject suggests that it
should work. In particular the "Menu and toolbar paths" help page ends
with the section "Using path's from another plug-in" which very strongly
suggests that the below show work, and recommends that plug-in's
document which menus are meant to be extended by other plug-in's (which
I see Gary has done as well).

Now, I have noticed that if I redeclare the menu in the other plug-in's
action set, then it seems to work, but it's ridiculous that I should
have to redeclare the menu.

--Aaron


Gary Karasiuk wrote:
> In 3.0.2, I was able to have one plug-in add menu items to another plug-ins
> menu.
>
> Here is a fragment from the plug.xml of the plug-in that is being extended:
>
> <extension point="org.eclipse.ui.actionSets">
> <actionSet label="%ActionSet.label" visible="true"
> id="org.eclipse.perfmsr.ui.actions">
> <menu
> label="%Menu.label"
> id="org.eclipse.perfmsr.menu">
> <separator name="snapshots"></separator>
> <separator name="all"></separator>
> <separator name="other"></separator>
> <!-- This group can be extended by other plugins. -->
> <separator name="additions"></separator>
> </menu>
>
> And here is a fragment from the plugin.xml that is trying to add some
> additional menu items:
>
> <action
> label="%OpenSnapshots.label"
> tooltip="%OpenSnapshots.tootip"
>
> class=" org.eclipse.perfmsr.ui.client.OpenSnapshotsViewActionDelegat e "
> menubarPath="org.eclipse.perfmsr.menu/additions"
> id="org.eclipse.perfmsr.ui.client.opensnapshotsview">
> </action>
>
> Am I doing something wrong? In 31RC1 I now get:
>
> Invalid Menu Extension (Path is invalid):
> org.eclipse.perfmsr.ui.client.opensnapshotsview
>
>
Re: menubarPath -- Did this function change in 3.1? [message #286401 is a reply to message #286397] Wed, 08 June 2005 10:23 Go to previous messageGo to next message
Eclipse UserFriend
Aaron Greenhouse wrote:

> Now, I have noticed that if I redeclare the menu in the other plug-in's
> action set, then it seems to work, but it's ridiculous that I should
> have to redeclare the menu.

I spent a few more minutes searching, and I have discovered Eclipse bug
report 15670 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=15670>
"Improve support for plug-ins contributing to other plug-ins' menus"
which as been open for 3 years. The recommended work around is to
redeclare the menu. The claim in the bug report is that "action sets
should be self contained." But this already isn't true because
toolbarPaths are not self-contained, and don't even have to be declared
to begin with.

In any case, it is still true that the existing documentation implies
that we shouldn't have to redeclare the menus.

> In particular the "Menu and toolbar paths" help page ends
> with the section "Using path's from another plug-in" which very
> strongly suggests that the below show work, and recommends that
> plug-in's document which menus are meant to be extended by other
> plug-in's (which I see Gary has done as well).


> Gary Karasiuk wrote:
>
>> In 3.0.2, I was able to have one plug-in add menu items to another
>> plug-ins
>> menu.
>>
>> Here is a fragment from the plug.xml of the plug-in that is being
>> extended:
>>
>> <extension point="org.eclipse.ui.actionSets">
>> <actionSet label="%ActionSet.label" visible="true"
>> id="org.eclipse.perfmsr.ui.actions">
>> <menu
>> label="%Menu.label"
>> id="org.eclipse.perfmsr.menu">
>> <separator name="snapshots"></separator>
>> <separator name="all"></separator>
>> <separator name="other"></separator>
>> <!-- This group can be extended by other plugins. -->
>> <separator name="additions"></separator>
>> </menu>
>>
>> And here is a fragment from the plugin.xml that is trying to add some
>> additional menu items:
>>
>> <action
>> label="%OpenSnapshots.label"
>> tooltip="%OpenSnapshots.tootip"
>>
>> class=" org.eclipse.perfmsr.ui.client.OpenSnapshotsViewActionDelegat e "
>> menubarPath="org.eclipse.perfmsr.menu/additions"
>> id="org.eclipse.perfmsr.ui.client.opensnapshotsview">
>> </action>
>>
>> Am I doing something wrong? In 31RC1 I now get:
>>
>> Invalid Menu Extension (Path is invalid):
>> org.eclipse.perfmsr.ui.client.opensnapshotsview
>>
>>
Re: menubarPath -- Did this function change in 3.1? [message #286430 is a reply to message #286401] Thu, 09 June 2005 09:24 Go to previous message
Eclipse UserFriend
Another related piece of inconsistent behavior is dealing with popup
menus. I am able to create a new sub-menu in an <objectContribution> in
one plug-in and add actions to that sub-menu from an
<objectContribution> of another plug-in. But, I cannot add a
sub-sub-menu to that sub-menu from another plug-in, which doesn't make a
lot sense.

That is the following works:

=== Start ===

first plugin.xml
-----------------
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
id="edu.cmu.sei.osate.ui.actions.Aadl1">
<menu
label="%popupMenus.aadl.label"
path="additions"
id="popupMenu.Aadl">
<groupMarker name="basic.grp"/>
<separator name="contributed.grp"/>
</menu>

<menu
label="Schedule"
path="popupMenu.Aadl/contributed.grp"
id="rsrc.popup">
<groupMarker name="top.grp"/>
</menu>
</objectContribution>

<objectContribution
objectClass="org.eclipse.core.resources.IFile"
id="edu.cmu.sei.osate.ui.actions.Aadl">
<visibility> ... </visibility>
<action
label="&amp;Remove Problem Markers"
icon="icons/none.gif"
tooltip="Remove problem markers from file"
class="edu.cmu.sei.osate.ui.actions.ResetMarkers"
menubarPath="popupMenu.Aadl/basic.grp"
enablesFor="1"
id="edu.cmu.sei.osate.ui.actions.ResetMarkers"/>
</objectContribution>
</extension>

second plugin.xml
------------------
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
id="edu.cmu.sei.osate.ui.actions.Aadl2">
<action
id="resourcemanagement.actions.CheckPriorityInversion"

class=" edu.cmu.sei.aadl.resourcemanagement.actions.CheckPriorityInv ersion "
enablesFor="1"
icon="icons/inversion.gif"
label="&amp;Check Priority Inversion"
menubarPath="popupMenu.Aadl/rsrc.popup/top.grp"/>
</objectContribution>
</extension>


=== End ===

But the following does not work. I get an "invalid path" error when I
try to add the "Schedule" menu from the second plugin.xml, and
naturally, an "invalid path" error on the action as well.

=== Start ===

first plugin.xml
-----------------
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
id="edu.cmu.sei.osate.ui.actions.Aadl1">
<menu
label="%popupMenus.aadl.label"
path="additions"
id="popupMenu.Aadl">
<groupMarker name="basic.grp"/>
<separator name="contributed.grp"/>
</menu>
</objectContribution>
</extension>

second plugin.xml
------------------
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
id="edu.cmu.sei.osate.ui.actions.Aadl">
<visibility>
<objectState name="extension" value="aaxl"/>
</visibility>

<menu
label="Schedule"
path="popupMenu.Aadl/contributed.grp"
id="rsrc.popup">
<groupMarker name="top.grp"/>
</menu>

<action
id="resourcemanagement.actions.CheckPriorityInversion"

class=" edu.cmu.sei.aadl.resourcemanagement.actions.CheckPriorityInv ersion "
enablesFor="1"
icon="icons/inversion.gif"
label="&amp;Check Priority Inversion"
menubarPath="popupMenu.Aadl/rsrc.popup/top.grp"/>
</objectContribution>
</extension>

=== End ===

All of this seems completely turned-around to me because it requires the
original plug-in to predict exactly what menus any subsequent plug-ins
might want to use. This is not how extensibility should work. Even the
whole idea that the menubarPath should contain the complete menu
hierarchy is wrong, it seems. A menu should exist and have a unique
identifier. When I create that menu I should be able to put it inside
of another menu by referencing that menus unique id, but I shouldn't
have to care where that other menu is located. That is, menus and
actions sould be placed inside of other menus by referencing the unique
id of that menu plus the group id only.
Previous Topic:Help with editor for manifest.mf files
Next Topic:UI Conventions for error marking in multipage editors?
Goto Forum:
  


Current Time: Tue Jul 22 22:54:33 EDT 2025

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

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

Back to the top