Recheck rcp handler after execute
I’m having an issue with our propertyTester and enabling handlers. The property is areUpdatesAvailable and the handler is enabled when this property is true. After the handler executes the areUpdatesAvailable value becomes false, but how I currently have it set up, it only checks when the selection changes. So if I right click on an item and call the Update handler and then right click on the item again without changing my selection, the update is still enabled because it’s not calling the property tester again. Is there a way to make it check again after the handler has been executed?
<handler
class="com.cerner.automation.touchstone.handlers.UpdateExternalReference"
commandId="com.cerner.automation.touchstone.workflow.Update">
<enabledWhen>
<with
variable="selection">
<test
property="com.cerner.automation.touchstone.testers.nodeItem.areUpdatesAvailable" value="true" forcePluginActivation="true">
</test>
<iterate
ifEmpty="false"
operator="and">
<instanceof
value="com.cerner.automation.touchstone.model.ExternalReferenceItem">
</instanceof>
</iterate>
<test
forcePluginActivation="true"
property="com.cerner.automation.touchstone.testers.nodeItem.isInternal"
value="true">
开发者_如何学编程 </test>
</with>
</enabledWhen>
</handler>
What I ended up doing was using the requestEvaluation after the handler was complete.
final IEvaluationService evaluationService = (IEvaluationService) window.getService(IEvaluationService.class);
evaluationService.requestEvaluation(property);
精彩评论