code from two years back必須升級到E4,現在一堆東西不再工作了。其中一個是IEvaluationService
如果使用的話是這樣的:PropertyTester的觸發器評估
<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測試了這個問題。
見這並不只針對標籤'',不''工作。但是'IEvaluationService'也適用於''。 –