Eclipse强制处理程序重新评估 [英] Eclipse force handlers to to re-evaluate

查看:144
本文介绍了Eclipse强制处理程序重新评估的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何强制Eclipse对所有处理程序的活动状态进行重新评估?

How can I force Eclipse to do a re-evaluation of the activeWhen-conditions of all handlers?

情况:
我已经定义了一个命令一个TreeViewer。该命令有多个可能的处理程序。处理程序已经定义了一些条件来决定处理程序是否被激活。

Situation: I have defined a command on a TreeViewer. This command has more than one possible handlers. Handlers have defined some conditions to decide whether the handler shall be activated or not.

我的问题是,在我取消选择之前,没有重新评估处理程序条件树中的项目(例如选择另一个项目)并再次选择。

My problem is that there is no re-evaluation of the handler conditions until I de-seclect the item in the tree (e.g. select another item) and select it again.

如果选择没有改变,但是升高条件(例如由于更新元素)将执行错误的处理程序。

If the selection does not change but the raise conditions do (e.g. due to an update of the element) the wrong handler will be executed.

有没有办法手动强制处理程序重新评估选择?

Is there a way to manually force an Handler re-evaluation on the selection?

推荐答案

如果您的条件使用属性测试人员检查您的treeviewer选择中的状态,则需要通知IEvaluationService相关属性已更改。见 org.eclipse.ui.services.IEvaluationService.requestEvaluation(String)

If your condition examines state in your treeviewer selection using property testers, then you need to notify the IEvaluationService that the property in question has changed. See org.eclipse.ui.services.IEvaluationService.requestEvaluation(String)

这篇关于Eclipse强制处理程序重新评估的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆