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

        <tfoot id='q2a1R'></tfoot><legend id='q2a1R'><style id='q2a1R'><dir id='q2a1R'><q id='q2a1R'></q></dir></style></legend>

      2. 创建带有文本悬停的 Eclipse 插件

        时间:2023-08-23
        1. <tfoot id='n7fxA'></tfoot>

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

                <tbody id='n7fxA'></tbody>

              <i id='n7fxA'><tr id='n7fxA'><dt id='n7fxA'><q id='n7fxA'><span id='n7fxA'><b id='n7fxA'><form id='n7fxA'><ins id='n7fxA'></ins><ul id='n7fxA'></ul><sub id='n7fxA'></sub></form><legend id='n7fxA'></legend><bdo id='n7fxA'><pre id='n7fxA'><center id='n7fxA'></center></pre></bdo></b><th id='n7fxA'></th></span></q></dt></tr></i><div id='n7fxA'><tfoot id='n7fxA'></tfoot><dl id='n7fxA'><fieldset id='n7fxA'></fieldset></dl></div>
            1. <legend id='n7fxA'><style id='n7fxA'><dir id='n7fxA'><q id='n7fxA'></q></dir></style></legend>
                  <bdo id='n7fxA'></bdo><ul id='n7fxA'></ul>
                  本文介绍了创建带有文本悬停的 Eclipse 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想做一个 Eclipse 插件(文本编辑器).我会阅读"光标下的文本并显示取决于文本的动态生成悬停.现在我的问题是我不知道如何阅读文本并添加"悬停.

                  I would like to make a Eclipse plugin (text editor). I would "read" the text under the cursor and show a dynamical generated hover that depends on the text. Now I have the problem that I don't know how I can read the text and "add" the hover.

                  这是我的第一个 Eclipse 插件,所以我很高兴能得到每一个提示.

                  It's my first Eclipse Plugin so I am happy for each tip I can get.

                  我想将它集成到默认的 Eclipse Java 编辑器中.我曾尝试使用编辑器模板创建一个新的 plugin,但我认为这是错误的方式.

                  I'd like to integrate it into the default Eclipse Java editor. I have tried to create a new plugin with a editor template but I think it is the wrong way.

                  上次

                  来自 PKeidel 的答案正是我想要的 :)

                  The answer from PKeidel is exactly what I'm looking for :)

                  感谢 PKeidel

                  推荐答案

                  你的错是你创建了一个全新的编辑器,而不是为现有的 Java 编辑器创建一个插件.插件将通过 extension points 激活.在您的情况下,您必须使用 org.eclipse.jdt.ui.javaEditorTextHovers 更多....

                  Your fault is that you created a completly new Editor instead of a plugin for the existing Java Editor. Plugins will be activated via extension points. In your case you have to use org.eclipse.jdt.ui.javaEditorTextHovers more....

                  <plugin>
                     <extension
                           point="org.eclipse.jdt.ui.javaEditorTextHovers">
                        <hover
                              activate="true"
                              class="path.to_your.hoverclass"
                              id="id.path.to_your.hoverclass">
                        </hover>
                     </extension>
                  
                  </plugin>
                  


                  class 参数保存实现 IJavaEditorTextHover 的类的路径.

                  public class LangHover implements IJavaEditorTextHover
                  {
                      @Override
                      public String getHoverInfo(ITextViewer textviewer, IRegion region)
                      {
                           if(youWantToShowAOwnHover)
                             return "Your own hover Text goes here"";
                           return null; // Shows the default Hover (Java Docs)
                      }
                  }
                  

                  应该这样做;-)

                  这篇关于创建带有文本悬停的 Eclipse 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:尝试运行 Eclipse 产品时出现异常 下一篇:在命令行中执行无头 Eclipse

                  相关文章

                • <small id='OvIaj'></small><noframes id='OvIaj'>

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

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