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

    1. <legend id='TpILi'><style id='TpILi'><dir id='TpILi'><q id='TpILi'></q></dir></style></legend>
      • <bdo id='TpILi'></bdo><ul id='TpILi'></ul>

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

    2. 如何从插件编写到 Eclipse 控制台的超链接

      How to write a hyperlink to an eclipse console from a plugin(如何从插件编写到 Eclipse 控制台的超链接)

      <small id='7Rl3Z'></small><noframes id='7Rl3Z'>

            • <bdo id='7Rl3Z'></bdo><ul id='7Rl3Z'></ul>

              <tfoot id='7Rl3Z'></tfoot>
              <i id='7Rl3Z'><tr id='7Rl3Z'><dt id='7Rl3Z'><q id='7Rl3Z'><span id='7Rl3Z'><b id='7Rl3Z'><form id='7Rl3Z'><ins id='7Rl3Z'></ins><ul id='7Rl3Z'></ul><sub id='7Rl3Z'></sub></form><legend id='7Rl3Z'></legend><bdo id='7Rl3Z'><pre id='7Rl3Z'><center id='7Rl3Z'></center></pre></bdo></b><th id='7Rl3Z'></th></span></q></dt></tr></i><div id='7Rl3Z'><tfoot id='7Rl3Z'></tfoot><dl id='7Rl3Z'><fieldset id='7Rl3Z'></fieldset></dl></div>
                <tbody id='7Rl3Z'></tbody>
            • <legend id='7Rl3Z'><style id='7Rl3Z'><dir id='7Rl3Z'><q id='7Rl3Z'></q></dir></style></legend>
              1. 本文介绍了如何从插件编写到 Eclipse 控制台的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想将文件的位置作为超链接写入 Eclipse 控制台.当您单击它时,它应该在 eclipse 中打开该文件.我目前正在做这样的事情(但链接不显示)

                I would like to write the location of a file to the eclipse console as a hyperlink. When you click on it it should open the file in eclipse. I'm currently doing something like this (but the link doesn't show up)

                console = new MessageConsole("myconsole", null);
                console.activate();
                ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ console });
                
                IPath path = Path.fromOSString(filePath);
                IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
                FileLink fileLink = new FileLink(file, null, 0, 0, 0);
                console.addHyperlink(fileLink, 0, 0);
                

                我可能不应该为偏移量、文件长度参数等传入 0.

                I should probably not pass in 0 for the offset, filelength parameters etc.

                任何帮助表示赞赏.

                推荐答案

                好吧,结果我写的代码很好,除了 2 个小改动它实际上应该是

                Well, turns out the code I wrote is fine except for 2 minor changes it should actually be

                console = new MessageConsole("myconsole", null);
                console.activate();
                ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ console });
                
                IPath path = Path.fromOSString(filePath);
                IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
                FileLink fileLink = new FileLink(file, null, -1, -1, -1);
                console.addHyperlink(fileLink, 10, 5); 
                

                我有点惊讶必须提供偏移量 (10),它从控制台输出的开头开始计算.为什么你甚至想自己计算,但这是另一个讨论.

                I was a little suprised that the offset (10) had to be provided, which counts from the beginning of the console output. Why would you even want to calculate that yourself, but that's another discussion.

                这篇关于如何从插件编写到 Eclipse 控制台的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                • <small id='j91gX'></small><noframes id='j91gX'>

                  1. <legend id='j91gX'><style id='j91gX'><dir id='j91gX'><q id='j91gX'></q></dir></style></legend>
                      <tbody id='j91gX'></tbody>

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

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