Filter context menu (objectContribution) based on self-defined property
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, November 15, 2005 04:49 AM

Hello I have an object contribution (extension org.eclipse.ui.popupMenus) to which i want to add my own filter. If i add a pre-defined filter like projectNature it works fine. But i also want to filter on the basis of another property, for which the property value will be returned by a java method. In nutshell i want to show a context menu on a folder only if projectNature is 'my_own_nature' and another property called my_property is tested in a java method. Java Method can return value my_value if some conditions are passed. adaptable="true" id="com.xyz.id" objectClass="org.eclipse.core.resources.IFolder&   More>>

Hello


I have an object contribution (extension org.eclipse.ui.popupMenus) to which i want to add my own filter.
If i add a pre-defined filter like projectNature it works fine. But i also want to filter on the basis of another property, for which the property value will be returned by a java method.

In nutshell i want to show a context menu on a folder only if projectNature is 'my_own_nature' and another property called my_property is tested in a java method.
Java Method can return value my_value if some conditions are passed.

			

adaptable="true"
id="com.xyz.id"
objectClass="org.eclipse.core.resources.IFolder">

class="com.xyz.actionclass"
id="com.xyz.actionID"
label="Build"
menubarPath="additions"
/>

name="projectNature"
value="my_own_nature"/>

name="my_property"
value="my_value"/>



I see IActionFilter is an interface but it is applicable only if class value in objectClass implements this.

Since i am using IFolder , i cannot implement IActionInterface

Any other way - enablements, defining your own adapter etc etc

Thanx    <<Less
About | Sitemap | Contact