Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Popup menus in Pkg explorer and Navigator view
Popup menus in Pkg explorer and Navigator view [message #83161] Tue, 05 August 2003 09:31 Go to next message
Eclipse UserFriend
Originally posted by: amanaval.sybase.com

Hi,

I am trying to get popup menus on a right click on the Project. I tried the
ObjectContribution, but that doesn't work for both, since the Project in
Navigator is IProject and its IJavaProject in Pkg Explorer. So, tried the
ViewerContribution - still not able to get it working.

Any help is appreciated.

thanks,
-Anou

<extension
point="org.eclipse.ui.popupMenus">
<viewerContribution
targetID="org.eclipse.ui.views.ResourceNavigator"
id="org.xyz.version.eclipse.contribution1">
<menu id="org.xyz.version.eclipse.showview"
label="Versions"
path="additions">
<separator name="group1"/>
</menu>
<action
label="Environment Versions"

class="org.xyz.version.eclipse.actions.ShowVersionViewAction "
menubarPath="org.xyz.version.eclipse.showview/group1"

id="org.xyz.version.eclipse.actions.ShowVersionViewAction">
</action>
<action
label="Classpath"

class="org.xyz.version.eclipse.actions.ShowClasspathAction"
menubarPath="org.xyz.version.eclipse.showview/group1"

id="org.xyz.version.eclipse.actions.ShowClasspathAction">
</action>

</viewerContribution>
<viewerContribution
targetID="org.eclipse.jdt.ui.PackageExplorer"
id="org.xyz.version.eclipse.contribution2">
<menu id="org.xyz.version.eclipse.showjpview"
label="Versions"
path="additions">
<separator name="group1"/>
</menu>
<action
label="Environment Versions"

class="org.xyz.version.eclipse.actions.ShowVersionViewAction "

menubarPath="org.xyz.version.eclipse.showjpview/group1"

id="org.xyz.version.eclipse.actions.ShowVersionViewAction">
</action>
<action
label="Classpath"

class="org.xyz.version.eclipse.actions.ShowClasspathAction"

menubarPath="org.xyz.version.eclipse.showjpview/group1"

id="org.xyz.version.eclipse.actions.ShowClasspathAction">
</action>

</viewerContribution>
</extension>
Re: Popup menus in Pkg explorer and Navigator view [message #83520 is a reply to message #83161] Wed, 06 August 2003 16:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dale.sherwood.SPAM-BITBUCKET-nyab.com

Anou:

I'm an Eclipse newbie, but this works for me. The key to making it work for
both IProject and IJavaProject (and other projects) seems to be
adaptable="true"--without it, it only pops up in Navigator views.

<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
objectClass="org.eclipse.core.resources.IProject"
id="com.nyab.tools.project">
<action
label="Hello, world!"
class="com.nyab.tools.PopupMenuActionHello"
enablesFor="1"
id="com.nyab.tools.project.hello">
</action>
</objectContribution>
</extension>

->>>--Dale-Sherwood-->
New York Air Brake Corp.
TDS Group

"Anou Manavalan" <amanaval@sybase.com> wrote in message
news:bgobil$a4q$1@eclipse.org...
> Hi,
>
> I am trying to get popup menus on a right click on the Project. I tried
the
> ObjectContribution, but that doesn't work for both, since the Project in
> Navigator is IProject and its IJavaProject in Pkg Explorer. So, tried the
> ViewerContribution - still not able to get it working.
>
> Any help is appreciated.
>
> thanks,
> -Anou
>
[snip]
Re: Popup menus in Pkg explorer and Navigator view [message #83766 is a reply to message #83520] Thu, 07 August 2003 09:23 Go to previous message
Eclipse UserFriend
Originally posted by: amanaval.sybase.com

Thanks Dale,

But, I actually had the adabtable=true in the objectContribution, I do see
the the first level of pop menu, but my submenus are all greyed up in the
pkg explorer.

And see that the ObjectClass mentions IProject - The first menu probably
gets visible because that adaptable overrides that, but for submenus
something is getting screwed up with Object Class taking precedence. The
project in the Pkg explorer is IJavaProject and is in no way connected ( no
interface implementation or subclass ) to the IProject which I wonder why..
and so using ObjectContribution should not even make the first menu to be
visible. And I can't seem to get any answer for this.

If it is IFile and if adaptable is true, then it will work, since the pkg
explorer has ICompilationUnit, which is derived from a file. But in case of
IProject - there is no relationship between IJavaProject and IProject except
that they are adaptable - which I am not quite sure is helping here.

regards,
-Anou



"Dale Sherwood" <dale.sherwood@SPAM-BITBUCKET-nyab.com> wrote in message
news:bgrpeb$u9c$1@eclipse.org...
> Anou:
>
> I'm an Eclipse newbie, but this works for me. The key to making it work
for
> both IProject and IJavaProject (and other projects) seems to be
> adaptable="true"--without it, it only pops up in Navigator views.
>
> <extension
> point="org.eclipse.ui.popupMenus">
> <objectContribution
> adaptable="true"
> objectClass="org.eclipse.core.resources.IProject"
> id="com.nyab.tools.project">
> <action
> label="Hello, world!"
> class="com.nyab.tools.PopupMenuActionHello"
> enablesFor="1"
> id="com.nyab.tools.project.hello">
> </action>
> </objectContribution>
> </extension>
>
> ->>>--Dale-Sherwood-->
> New York Air Brake Corp.
> TDS Group
>
> "Anou Manavalan" <amanaval@sybase.com> wrote in message
> news:bgobil$a4q$1@eclipse.org...
> > Hi,
> >
> > I am trying to get popup menus on a right click on the Project. I tried
> the
> > ObjectContribution, but that doesn't work for both, since the Project in
> > Navigator is IProject and its IJavaProject in Pkg Explorer. So, tried
the
> > ViewerContribution - still not able to get it working.
> >
> > Any help is appreciated.
> >
> > thanks,
> > -Anou
> >
> [snip]
>
>
Previous Topic:How to Register Adapters permanently
Next Topic:M2 - Absent line number information
Goto Forum:
  


Current Time: Wed May 07 23:42:58 EDT 2025

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

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

Back to the top