我看过这个问题Eclipse 强制处理程序重新评估以及保罗·韦伯斯特提供的答案。为什么这不能使用活动时间处理程序中的元素?仅当我更改以下plug-in.xml以使用启用时间元素。一旦运行命令,我的特定命令就不应再启用。
<handler
commandId="org.eclipse.jpt.jpa.ui.xmlFileUpgradeToLatestVersion"
class="org.eclipse.jpt.jpa.ui.internal.commands.UpgradeXmlFileVersionHandler">
<activeWhen>
<iterate ifEmpty="false">
<or>
<adapt type="org.eclipse.jpt.jpa.core.context.XmlFile">
<test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
</adapt>
<adapt type="org.eclipse.jpt.common.core.resource.xml.JptXmlResource">
<test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
</adapt>
</or>
</iterate>
</activeWhen>
</handler>
在处理程序执行结束时,我调用:
IEvaluationService service = (IEvaluationService) activeWorkbenchWindow.getService(IEvaluationService.class);
service.requestEvaluation("org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion");
Update:
我做了更多调查,发现 4.2.1 与 3.8.1 相比有所回归。即使我切换到使用启用时间并使用对 requestEvaluation 的调用,我仍然在快速访问中看到该命令。我通过快速访问使用该命令,然后立即再次使用快速访问,我看到该命令仍然存在,如果单击它,则会出现 NotEnabledException。这在 3.8.1 中工作得很好。
此特定命令不会打开对话框,但我添加了一个确认对话框,现在我的命令已从快速访问中删除!这甚至没有使用 IValuationService.requestEvaluation。焦点的变化是否会导致处理程序被重新评估?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)