Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » popup menu contribution for IProject type not showing up in Package Explorer
popup menu contribution for IProject type not showing up in Package Explorer [message #117442] Wed, 27 August 2003 13:03 Go to next message
Eclipse UserFriend
Originally posted by: mpjohn.us.ibm.com

I have an Eclipse feature I've developed (using Eclipse 2.0.1) that I now
want to enhance with a popup menu item for resources of type IProject having
a particular nature. I've prototyped this popup menu by adding it to my
plugin.xml. I've defined a perspective for my feature that includes the
Navigator and Package Explorer Views. This new popup menu item works fine
in the Navigator View, but it doesn't even show up in the Package Explorer
View. Here's the object contribution XML:

<extension
id="com.ibm.jsdt.eclipse.ui.solutionMenu"
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IProject"
id="com.ibm.jsdt.eclipse.ui.solutionBuilder">
<filter
name="projectNature"
value="com.ibm.jsdt.eclipse.main.solutionProjectNature">
</filter>
<menu
label="Solution Enabler Tools"
path="addition"
id="com.ibm.jsdt.eclipse.ui.solutionMenu">
<separator
name="group1">
</separator>
</menu>
<action
label="Build Solution"
menubarPath="com.ibm.jsdt.eclipse.ui.solutionMenu/group1"
enablesFor="1"
id="com.ibm.jsdt.eclipse.ui.solutionBuilderAction">
</action>
</objectContribution>
</extension>

==================

Related to the above, I've also added a menu item under the main "Project"
menu that is intended to perform the same action as the object contribution
above when a particular project type is selected. Again, the behavior
differs between the Navigator View and the Package Explorer View.
Everything works as expected in the Navigator View. In the Package Explorer
View, the submenu shows up under the "Project" menu, but the specific menu
item is disabled even when a project of the correct type is selected.
Here's the actionSets XML:

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="testplugin actionSet 5"
id="testplugin.actionSet5">
<menu id="testplugin.project.menu.se"
label="Solution Enabler Tools"
path="project/additions">
<separator name="group1"/>
</menu>
<action id="testplugin.buildsolution.action"
menubarPath="project/testplugin.project.menu.se/group1"
label="Build Solution"
enablesFor="1">
<enablement>
<and>
<objectClass
name="org.eclipse.core.resources.IProject"/>
<objectState name="nature"
value="com.ibm.jsdt.eclipse.main.solutionProjectNature"/>
</and>
</enablement>
</action>
</actionSet>
</extension>


============



Can anyone help me figure out what I'm doing wrong?

Thanks.
Maynard
Re: popup menu contribution for IProject type not showing up in Package Explorer [message #123468 is a reply to message #117442] Fri, 05 September 2003 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

The menu path should be "additions", not "addition". Not sure if that'll solve your problem though.

Knut
"Maynard Johnson" <mpjohn@us.ibm.com> wrote in message news:biio9f$a7$1@eclipse.org...
> I have an Eclipse feature I've developed (using Eclipse 2.0.1) that I now
> want to enhance with a popup menu item for resources of type IProject having
> a particular nature. I've prototyped this popup menu by adding it to my
> plugin.xml. I've defined a perspective for my feature that includes the
> Navigator and Package Explorer Views. This new popup menu item works fine
> in the Navigator View, but it doesn't even show up in the Package Explorer
> View. Here's the object contribution XML:
>
> <extension
> id="com.ibm.jsdt.eclipse.ui.solutionMenu"
> point="org.eclipse.ui.popupMenus">
> <objectContribution
> objectClass="org.eclipse.core.resources.IProject"
> id="com.ibm.jsdt.eclipse.ui.solutionBuilder">
> <filter
> name="projectNature"
> value="com.ibm.jsdt.eclipse.main.solutionProjectNature">
> </filter>
> <menu
> label="Solution Enabler Tools"
> path="addition"
> id="com.ibm.jsdt.eclipse.ui.solutionMenu">
> <separator
> name="group1">
> </separator>
> </menu>
> <action
> label="Build Solution"
> menubarPath="com.ibm.jsdt.eclipse.ui.solutionMenu/group1"
> enablesFor="1"
> id="com.ibm.jsdt.eclipse.ui.solutionBuilderAction">
> </action>
> </objectContribution>
> </extension>
>
> ==================
>
> Related to the above, I've also added a menu item under the main "Project"
> menu that is intended to perform the same action as the object contribution
> above when a particular project type is selected. Again, the behavior
> differs between the Navigator View and the Package Explorer View.
> Everything works as expected in the Navigator View. In the Package Explorer
> View, the submenu shows up under the "Project" menu, but the specific menu
> item is disabled even when a project of the correct type is selected.
> Here's the actionSets XML:
>
> <extension
> point="org.eclipse.ui.actionSets">
> <actionSet
> label="testplugin actionSet 5"
> id="testplugin.actionSet5">
> <menu id="testplugin.project.menu.se"
> label="Solution Enabler Tools"
> path="project/additions">
> <separator name="group1"/>
> </menu>
> <action id="testplugin.buildsolution.action"
> menubarPath="project/testplugin.project.menu.se/group1"
> label="Build Solution"
> enablesFor="1">
> <enablement>
> <and>
> <objectClass
> name="org.eclipse.core.resources.IProject"/>
> <objectState name="nature"
> value="com.ibm.jsdt.eclipse.main.solutionProjectNature"/>
> </and>
> </enablement>
> </action>
> </actionSet>
> </extension>
>
>
> ============
>
>
>
> Can anyone help me figure out what I'm doing wrong?
>
> Thanks.
> Maynard
>
>
Re: popup menu contribution for IProject type not showing up in Package Explorer [message #131949 is a reply to message #123468] Thu, 18 September 2003 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mpjohn.us.ibm.com

Thanks for the response, Knut. But apparently, that error in menu path
specification was being ignored by Eclipse and it was defaulting to
"additions" anyway. So, correcting that had no effect. However, I did find
a way to get this to work in the Package Explorer view -- by adding the
'adaptable="true"' attribute in the objectContribution. I have no idea why
this is needed for it to behave properly in Package Explorer, but not
Navigator, but it is.

"Knut Radloff" <knut_radloff@oti.com> wrote in message
news:bjasur$9vf$1@eclipse.org...
> The menu path should be "additions", not "addition". Not sure if that'll
solve your problem though.
>
> Knut
> "Maynard Johnson" <mpjohn@us.ibm.com> wrote in message
news:biio9f$a7$1@eclipse.org...
> > I have an Eclipse feature I've developed (using Eclipse 2.0.1) that I
now
> > want to enhance with a popup menu item for resources of type IProject
having
> > a particular nature. I've prototyped this popup menu by adding it to my
> > plugin.xml. I've defined a perspective for my feature that includes the
> > Navigator and Package Explorer Views. This new popup menu item works
fine
> > in the Navigator View, but it doesn't even show up in the Package
Explorer
> > View. Here's the object contribution XML:
> >
> > <extension
> > id="com.ibm.jsdt.eclipse.ui.solutionMenu"
> > point="org.eclipse.ui.popupMenus">
> > <objectContribution
> > objectClass="org.eclipse.core.resources.IProject"
> > id="com.ibm.jsdt.eclipse.ui.solutionBuilder">
> > <filter
> > name="projectNature"
> > value="com.ibm.jsdt.eclipse.main.solutionProjectNature">
> > </filter>
> > <menu
> > label="Solution Enabler Tools"
> > path="addition"
> > id="com.ibm.jsdt.eclipse.ui.solutionMenu">
> > <separator
> > name="group1">
> > </separator>
> > </menu>
> > <action
> > label="Build Solution"
> >
menubarPath="com.ibm.jsdt.eclipse.ui.solutionMenu/group1"
> > enablesFor="1"
> > id="com.ibm.jsdt.eclipse.ui.solutionBuilderAction">
> > </action>
> > </objectContribution>
> > </extension>
> >
> > ==================
> >
> > Related to the above, I've also added a menu item under the main
"Project"
> > menu that is intended to perform the same action as the object
contribution
> > above when a particular project type is selected. Again, the behavior
> > differs between the Navigator View and the Package Explorer View.
> > Everything works as expected in the Navigator View. In the Package
Explorer
> > View, the submenu shows up under the "Project" menu, but the specific
menu
> > item is disabled even when a project of the correct type is selected.
> > Here's the actionSets XML:
> >
> > <extension
> > point="org.eclipse.ui.actionSets">
> > <actionSet
> > label="testplugin actionSet 5"
> > id="testplugin.actionSet5">
> > <menu id="testplugin.project.menu.se"
> > label="Solution Enabler Tools"
> > path="project/additions">
> > <separator name="group1"/>
> > </menu>
> > <action id="testplugin.buildsolution.action"
> > menubarPath="project/testplugin.project.menu.se/group1"
> > label="Build Solution"
> > enablesFor="1">
> > <enablement>
> > <and>
> > <objectClass
> > name="org.eclipse.core.resources.IProject"/>
> > <objectState name="nature"
> > value="com.ibm.jsdt.eclipse.main.solutionProjectNature"/>
> > </and>
> > </enablement>
> > </action>
> > </actionSet>
> > </extension>
> >
> >
> > ============
> >
> >
> >
> > Can anyone help me figure out what I'm doing wrong?
> >
> > Thanks.
> > Maynard
> >
> >
>
>
Re: popup menu contribution for IProject type not showing up in Package Explorer [message #132070 is a reply to message #131949] Thu, 18 September 2003 10:44 Go to previous message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

It's because the project object you see in the package explorer is not an
IProject instance, but some other object. But this objecy "adapts" to
IProject, therefore the need for "adaptable=true"

Simon :-)

"Maynard Johnson" <mpjohn@us.ibm.com> wrote in message
news:bkcb1e$dva$1@eclipse.org...
> Thanks for the response, Knut. But apparently, that error in menu path
> specification was being ignored by Eclipse and it was defaulting to
> "additions" anyway. So, correcting that had no effect. However, I did
find
> a way to get this to work in the Package Explorer view -- by adding the
> 'adaptable="true"' attribute in the objectContribution. I have no idea
why
> this is needed for it to behave properly in Package Explorer, but not
> Navigator, but it is.
>
> "Knut Radloff" <knut_radloff@oti.com> wrote in message
> news:bjasur$9vf$1@eclipse.org...
> > The menu path should be "additions", not "addition". Not sure if that'll
> solve your problem though.
> >
> > Knut
> > "Maynard Johnson" <mpjohn@us.ibm.com> wrote in message
> news:biio9f$a7$1@eclipse.org...
> > > I have an Eclipse feature I've developed (using Eclipse 2.0.1) that I
> now
> > > want to enhance with a popup menu item for resources of type IProject
> having
> > > a particular nature. I've prototyped this popup menu by adding it to
my
> > > plugin.xml. I've defined a perspective for my feature that includes
the
> > > Navigator and Package Explorer Views. This new popup menu item works
> fine
> > > in the Navigator View, but it doesn't even show up in the Package
> Explorer
> > > View. Here's the object contribution XML:
> > >
> > > <extension
> > > id="com.ibm.jsdt.eclipse.ui.solutionMenu"
> > > point="org.eclipse.ui.popupMenus">
> > > <objectContribution
> > > objectClass="org.eclipse.core.resources.IProject"
> > > id="com.ibm.jsdt.eclipse.ui.solutionBuilder">
> > > <filter
> > > name="projectNature"
> > > value="com.ibm.jsdt.eclipse.main.solutionProjectNature">
> > > </filter>
> > > <menu
> > > label="Solution Enabler Tools"
> > > path="addition"
> > > id="com.ibm.jsdt.eclipse.ui.solutionMenu">
> > > <separator
> > > name="group1">
> > > </separator>
> > > </menu>
> > > <action
> > > label="Build Solution"
> > >
> menubarPath="com.ibm.jsdt.eclipse.ui.solutionMenu/group1"
> > > enablesFor="1"
> > > id="com.ibm.jsdt.eclipse.ui.solutionBuilderAction">
> > > </action>
> > > </objectContribution>
> > > </extension>
> > >
> > > ==================
> > >
> > > Related to the above, I've also added a menu item under the main
> "Project"
> > > menu that is intended to perform the same action as the object
> contribution
> > > above when a particular project type is selected. Again, the behavior
> > > differs between the Navigator View and the Package Explorer View.
> > > Everything works as expected in the Navigator View. In the Package
> Explorer
> > > View, the submenu shows up under the "Project" menu, but the specific
> menu
> > > item is disabled even when a project of the correct type is selected.
> > > Here's the actionSets XML:
> > >
> > > <extension
> > > point="org.eclipse.ui.actionSets">
> > > <actionSet
> > > label="testplugin actionSet 5"
> > > id="testplugin.actionSet5">
> > > <menu id="testplugin.project.menu.se"
> > > label="Solution Enabler Tools"
> > > path="project/additions">
> > > <separator name="group1"/>
> > > </menu>
> > > <action id="testplugin.buildsolution.action"
> > >
menubarPath="project/testplugin.project.menu.se/group1"
> > > label="Build Solution"
> > > enablesFor="1">
> > > <enablement>
> > > <and>
> > > <objectClass
> > > name="org.eclipse.core.resources.IProject"/>
> > > <objectState name="nature"
> > > value="com.ibm.jsdt.eclipse.main.solutionProjectNature"/>
> > > </and>
> > > </enablement>
> > > </action>
> > > </actionSet>
> > > </extension>
> > >
> > >
> > > ============
> > >
> > >
> > >
> > > Can anyone help me figure out what I'm doing wrong?
> > >
> > > Thanks.
> > > Maynard
> > >
> > >
> >
> >
>
>
Previous Topic:completing the install... - cannot replace splash screen bmp
Next Topic:Eclipse and Firewall
Goto Forum:
  


Current Time: Mon Jul 21 22:09:04 EDT 2025

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

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

Back to the top