Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Checking if a project was selected(Showing a popup menu entry only if a project is selected)
Checking if a project was selected [message #650725] Wed, 26 January 2011 04:42 Go to next message
geX is currently offline geX
Messages: 6
Registered: July 2010
Junior Member
Hi, I want to show a contribution to the popup menu of, for example, the package explorer only if a project is selected. This can be any project, not only a java project.

How can I do this? There seems to be no common superclass for projects.

For example, JavaProject only inherits from IAdaptable, but all other entries in the package explorer do the same, so I cannot make a distinction based on this class. How can I check (in an extension, i.e. plugin.xml) if the selection is any kind of project.

Thank you in advance for your hepl
Re: Checking if a project was selected [message #650762 is a reply to message #650725] Wed, 26 January 2011 07:48 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6857
Registered: July 2009
Location: Ottawa
Senior Member

IProject is the project class to check for. You also need to adapt
before you check, that will convert entries like IJavaProject.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic: failed oracle connection - not a valid base URI
Next Topic:File opened in two edtiors.
Goto Forum:
  


Current Time: Wed Jul 23 05:57:05 EDT 2014

Powered by FUDForum. Page generated in 0.01639 seconds