Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Display actions when a project has a certain file
Display actions when a project has a certain file [message #326087] Fri, 07 March 2008 03:59 Go to next message
Eclipse UserFriend
Hi,

I was able to show/hide menus when a project has this certain nature.

(posting it in case someone will find this useful)
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
id="menu"
objectClass="org.eclipse.core.resources.IProject">

<action
class="action.MyAction"
enablesFor="1"
id="action.MyAction"
label="My Action"
menubarPath="submenu/contents">
<enablement>
<objectState name="projectNature"
value="org.eclipse.jdt.core.javanature"/>
</enablement>
</action>
</objectContribution>
</extension>

I'd like to add another condition to display the menus, like if the
project has a pom file. I've read about propertyTester extension points
but i'm not sure how to and still reading about it. Aside from
propertyTester, is there other way of adding the condition?

Thanks
Re: Display actions when a project has a certain file [message #326122 is a reply to message #326087] Fri, 07 March 2008 08:38 Go to previous message
Eclipse UserFriend
Your best bet is to have <something> create a persistent property on the
project when a pom file is created.

Then you can property test for the persistent property.

That works with property testers (objectClass/enablement) as well as the
IActionFilter based filtering (there should be some kind of named
property for it).

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:How to test internationalization plugin
Next Topic:Loading a non-properties files from a fragment into and editor
Goto Forum:
  


Current Time: Wed Apr 16 13:56:42 EDT 2025

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

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

Back to the top