Unable to fire propertyTester [message #1046797] |
Mon, 22 April 2013 11:34 |
Pavan D Messages: 7 Registered: February 2011 |
Junior Member |
|
|
I am trying to add a new entry into the context menu in our application. I want it to get enabled when a certain condition is met. I have looked up for PropertyTesters and tried to give it a shot. This is what I have come up with.
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=group.immunity">
<command commandId="MultipleERPContext.commands.sampleCommand" id="com.rac.samplecmd">
<visibleWhen>
<and>
<test
forcePluginActivation="true"
property="com.rac.kernel.MyTCComponent.isERPConfigured">
</test>
</and>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="testers.ERPTester"
id="com.tcs.rac.testers.ERPTester"
namespace="com.rac.kernel.MyTCComponent"
properties="isERPConfigured"
type="com.teamcenter.rac.kernel.TCComponent">
</propertyTester>
</extension>
public class ERPTester extends PropertyTester
{
@Override
public boolean test(Object arg0, String arg1, Object[] arg2, Object arg3)
{
System.out.println("Reached the method test");
return true;
}
}
Everything seems to be fine...but somehow, that menu entry is not coming up at all. Moreover, I am not able to see my 'test' method getting hit.
Requesting you to share your thoughts on it.
thanks, Pavan.
[Updated on: Mon, 22 April 2013 11:35] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02451 seconds