jface.Action 类有一个 setActionDefinitionId 方法。我想知道这个有什么用。
以下内容来自 setAccelerator javadoc:
If you set an accelerator using this method, then it will not work in the workbench if it conflicts any existing key binding, or if there is a different key binding defined for this action's definition id. The definition id should be used instead -- referring to the command in the workbench from which the key binding should be retrieved.
我在任何地方都找不到有关定义 id 的任何相关信息。
希望有人能帮忙。
最佳答案
操作定义 ID 用于将操作绑定(bind)到命令。如果命令的ID被设置为该 Action 的 Action 定义ID,则该 Action 被视为该命令的处理程序。
如果您想要将 Eclipse 应用程序从使用操作迁移到使用命令框架,这非常有用。它允许顺利迁移,因为您可以重用现有代码的一部分,而无需将所有操作转换为命令处理程序。
参见http://wiki.eclipse.org/FAQ_How_do_I_associate_an_action_with_a_command%3F了解更多信息。
关于java - JFace 操作的定义 ID 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9413465/