• <legend id='maxHM'><style id='maxHM'><dir id='maxHM'><q id='maxHM'></q></dir></style></legend>

    <small id='maxHM'></small><noframes id='maxHM'>

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

          <bdo id='maxHM'></bdo><ul id='maxHM'></ul>
      1. <tfoot id='maxHM'></tfoot>

        如何在 Eclipse 中扩展源菜单?(或:它的 locationURI 是什么?)

        时间:2023-08-23

        1. <tfoot id='d0Iwe'></tfoot>
            <bdo id='d0Iwe'></bdo><ul id='d0Iwe'></ul>

              <legend id='d0Iwe'><style id='d0Iwe'><dir id='d0Iwe'><q id='d0Iwe'></q></dir></style></legend>
                <tbody id='d0Iwe'></tbody>

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

                • 本文介绍了如何在 Eclipse 中扩展源菜单?(或:它的 locationURI 是什么?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个 Eclipse 插件并尝试在 Eclipse 3.7 中扩展源菜单(mainMenubar/Source - 在 java-editor 中编辑时可见).

                  I am developing an eclipse plugin and trying to extend the source menu (mainMenubar/Source - visible when editing in the java-editor) in Eclipse 3.7.

                  documentation 表示依赖于 org.eclipse.ui.menus-extension 点,因为旧的扩展点已被弃用.对我来说,在哪里获得可靠的 locationURI 是一个完全的秘密,但我终于设法通过 Plugin Spy 找到了一些似是而非的 URI(遵循建议 这里).所以下面的应该是plugin.xml的扩展片段:

                  The documentation says to rely on the org.eclipse.ui.menus-extension point since the older extension points are deprecated. It is a complete secret to me where to obtain reliable locationURIs, but I finally managed to find some plausible URI with the Plugin Spy (following an advice here). So the following should be the extension snippet for the plugin.xml:

                  <extension
                   point="org.eclipse.ui.menus">
                   <menuContribution
                       locationURI="menu:org.eclipse.jdt.ui.source.menu">
                    <command
                      commandId="some.command.id"
                          label="Some label"
                          style="push">
                    </command>
                   </menuContribution>
                  </extension>
                  

                  不幸的是,在为我的开发 IDE 运行插件时,没有出现任何命令,也没有错误消息.只是什么都没有发生.当我将 locationURI 设置为menu:help"时,新命令出现在帮助菜单中,所以问题似乎真的是 locationURI.

                  Unfortunately, when running the plugin for my development IDE no command appears, and also no error message. Just nothing happens. When I set the locationURI to "menu:help", the new command appears in the help menu, so the problem seems to be really the locationURI.

                  推荐答案

                  我遇到了同样的问题.我终于发现使用(推荐的)扩展点 org.eclipse.ui.menus 扩展源菜单是不可能的.

                  I ran into the same problem. I finally figured out that extending the Source menu using the (recommended) extension point org.eclipse.ui.menus is not possible.

                  原因是在处理 org.eclipse.ui.menus-extensions 之后创建了一个旧样式 actionSet 中定义的菜单(类似于 Source 菜单).事实上,这些扩展只能对现有菜单做出贡献.

                  The reason is that a menu defined in an old style actionSet (like the Source menu) is created after the processing of org.eclipse.ui.menus-extensions. The way it is, these extensions can only contribute to already existing menus.

                  因此,在 jdt 插件迁移到新方法之前,坚持使用旧 API(如 VonC 所建议)可能是最佳选择...

                  So sticking to the old API (as suggested by VonC) is probably the best option until the jdt plugin is migrated to the new approach...

                  这篇关于如何在 Eclipse 中扩展源菜单?(或:它的 locationURI 是什么?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何以编程方式从完整的类名中找到 eclipse 中的 java 文件? 下一篇:如何转换旧的“plugin.xml"到新的“manifest.mf"文件?

                  相关文章

                      <bdo id='wmNn6'></bdo><ul id='wmNn6'></ul>

                      <small id='wmNn6'></small><noframes id='wmNn6'>

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

                      <legend id='wmNn6'><style id='wmNn6'><dir id='wmNn6'><q id='wmNn6'></q></dir></style></legend>
                    1. <tfoot id='wmNn6'></tfoot>