[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Eclipse 3.3 commands and property testers

I am trying to utilize the new org.eclipse.ui.menus/commands interfaces in Eclipse 3.3m6.

I have been experimenting with the IElementUpdater interface with success to update the labels and decorations of menus. However, I also need to control the enablement of the menu, and so I have attempted to implement a PropertyTester. However, no matter what I do, it appears that the PropertyTester is never actually used.

My PropertyTester only returns true or false, but the value never seems to actually be used for the enablement of the menu (it is always disabled). I also inserted some println statements in there, which are never printed to stdout.


Here is my property tester:

<extension
     point="org.eclipse.core.expressions.propertyTesters">
  <propertyTester
        class="com.foo.menus.MenuPropertyTester"
        id="com.foo.menus.MenuPropertyTester"
        namespace="com.foo.menus"
        properties="test123"
        type="java.lang.Object">
  </propertyTester>
</extension>


Here is my handler: <handler class="com.foo.menus.MenuRetrievalHandler" commandId="com.foo.menus.bundleProductRetrieval"> <enabledWhen> <with variable="activeContexts"> <test property="com.foo.menus.test123"> </test> </with> </enabledWhen> </handler>


And here is the class: public class MenuPropertyTester extends PropertyTester {


public MenuPropertyTester() { System.out.println("!!! Constructor Called"); }

/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
@Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {

System.out.println("!!! test Called");
return true;
}


	
	
	
}




Any suggestions would be greatly appreciated!