<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 控制台的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                • <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>