1. <tfoot id='eprNr'></tfoot>

  2. <small id='eprNr'></small><noframes id='eprNr'>

      • <bdo id='eprNr'></bdo><ul id='eprNr'></ul>
      <legend id='eprNr'><style id='eprNr'><dir id='eprNr'><q id='eprNr'></q></dir></style></legend>
      <i id='eprNr'><tr id='eprNr'><dt id='eprNr'><q id='eprNr'><span id='eprNr'><b id='eprNr'><form id='eprNr'><ins id='eprNr'></ins><ul id='eprNr'></ul><sub id='eprNr'></sub></form><legend id='eprNr'></legend><bdo id='eprNr'><pre id='eprNr'><center id='eprNr'></center></pre></bdo></b><th id='eprNr'></th></span></q></dt></tr></i><div id='eprNr'><tfoot id='eprNr'></tfoot><dl id='eprNr'><fieldset id='eprNr'></fieldset></dl></div>

      您如何在 Eclipse 中向编辑器上下文菜单提供命令

      时间:2023-08-21

        <tbody id='RHjVY'></tbody>

          <tfoot id='RHjVY'></tfoot>
          • <bdo id='RHjVY'></bdo><ul id='RHjVY'></ul>
          • <small id='RHjVY'></small><noframes id='RHjVY'>

            <i id='RHjVY'><tr id='RHjVY'><dt id='RHjVY'><q id='RHjVY'><span id='RHjVY'><b id='RHjVY'><form id='RHjVY'><ins id='RHjVY'></ins><ul id='RHjVY'></ul><sub id='RHjVY'></sub></form><legend id='RHjVY'></legend><bdo id='RHjVY'><pre id='RHjVY'><center id='RHjVY'></center></pre></bdo></b><th id='RHjVY'></th></span></q></dt></tr></i><div id='RHjVY'><tfoot id='RHjVY'></tfoot><dl id='RHjVY'><fieldset id='RHjVY'></fieldset></dl></div>

            <legend id='RHjVY'><style id='RHjVY'><dir id='RHjVY'><q id='RHjVY'></q></dir></style></legend>

                本文介绍了您如何在 Eclipse 中向编辑器上下文菜单提供命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想在选择文本时向任何文本编辑器的上下文菜单提供一个命令.在过去"中,我会使用 objectContribution 和带有enablesFor='+'"的嵌套操作来完成此操作.

                I want to contribute a command to the context menu of any text editor when text is selected. In "the old days", I would have done this using objectContribution and a nested action with "enablesFor='+'".

                如何使用命令而不是操作来做到这一点?

                How does one do this using commands instead of actions?

                推荐答案

                我阅读了有关命令表达式中可用变量的更多信息,我接近自己想弄清楚它,但失败了.然后我在 eclipse 新闻组上问了一个类似的问题,并被引导到正确的方向.下面是一个示例,说明如何主要做我正在寻找的事情:

                I read more about the variables available in command expressions, and I came close to figuring it out on my own, but failed. I then asked a similar question on the eclipse newsgroup and was led in the right direction. Here's an example of how to do mostly what I was looking for:

                 <command
                      commandId="org.marcesher.blogcodeformatter.commands.wikiFormatterCommand"
                      tooltip="Format And Copy to Clipboard"
                      id="org.marcesher.blogcodeformatter.popup.wikiFormatterCommand">
                    <visibleWhen>
                       <with variable="selection">
                          <instanceof value="org.eclipse.jface.text.ITextSelection"/>
                       </with>
                    </visibleWhen>
                

                这篇关于您如何在 Eclipse 中向编辑器上下文菜单提供命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Eclipse 包和插件有什么区别? 下一篇:JUnit Eclipse 插件源代码?

                相关文章

              • <i id='FeOdL'><tr id='FeOdL'><dt id='FeOdL'><q id='FeOdL'><span id='FeOdL'><b id='FeOdL'><form id='FeOdL'><ins id='FeOdL'></ins><ul id='FeOdL'></ul><sub id='FeOdL'></sub></form><legend id='FeOdL'></legend><bdo id='FeOdL'><pre id='FeOdL'><center id='FeOdL'></center></pre></bdo></b><th id='FeOdL'></th></span></q></dt></tr></i><div id='FeOdL'><tfoot id='FeOdL'></tfoot><dl id='FeOdL'><fieldset id='FeOdL'></fieldset></dl></div>

              • <tfoot id='FeOdL'></tfoot>

                1. <small id='FeOdL'></small><noframes id='FeOdL'>

                    <bdo id='FeOdL'></bdo><ul id='FeOdL'></ul>
                    <legend id='FeOdL'><style id='FeOdL'><dir id='FeOdL'><q id='FeOdL'></q></dir></style></legend>