【发布时间】:2017-09-25 03:49:19
【问题描述】:
code from two years back 必须升级到 E4,现在一堆东西不能用了。其中之一是IEvaluationService,如果这样使用:
<handler class="org.acme.PrintHandler" commandId="org.eclipse.ui.file.print">
<activeWhen>
<with variable="activePart">
<test property="org.acme.printable" />
</with>
</activeWhen>
</handler>
IEvaluationService service = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class);
service.requestEvaluation("org.acme.printable");
我如何(重新)触发对PropertyTester 的评估?由于 E4 实际上还没有准备好投入生产,我需要 E3(兼容层)的解决方法。
Related question - 但该用户正在 E4 中搜索等价物,而我需要在 E3 中工作的。
有趣的是,如果我用<enabledWhen> 替换<activeWhen> 标签,它就可以工作。在这种情况下,IEventBroker#post 和 IEventBroker#send 也可以工作。
这是similar question。该用户使用 Eclipse 4.2 - 我测试了 4.5、4.6 和 4.7 的问题。
【问题讨论】:
标签: eclipse-plugin e4