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

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

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

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

      1. 获取编辑器的内容

        Get contents of editor(获取编辑器的内容)
        <legend id='mgmwY'><style id='mgmwY'><dir id='mgmwY'><q id='mgmwY'></q></dir></style></legend>
          <bdo id='mgmwY'></bdo><ul id='mgmwY'></ul>

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

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

                    <tbody id='mgmwY'></tbody>
                  本文介绍了获取编辑器的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试开发一个简单的 Eclipse 插件来了解它的工作原理.

                  I am trying to develop a simple Eclipse plugin to understand how it works.

                  对此我有两个问题:

                  如何获取活动编辑器的内容?

                  How can I get the content of the active editor?

                  你有关于生命周期插件和合作的好的文档吗?我在 Google 上找不到真正好的文档.

                  Do you have a good documentation about life cycle plugin and co? I can't find real good documentation on Google.

                  推荐答案

                  关于当前编辑器的内容,有几种方法可以做到这一点.以下代码未经测试:

                  Regarding the content of the current editor, there are several ways to do this. The following code is not tested:

                  public String getCurrentEditorContent() {
                      final IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                              .getActiveEditor();
                      if (activeEditor == null)
                          return null;
                      final IDocument doc = (IDocument) activeEditor.getAdapter(IDocument.class);
                      if (doc == null) return null;
                  
                      return doc.get();
                  }
                  

                  这篇关于获取编辑器的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 中的默认语言环境设置以使其保持一致?)
                  <legend id='b3Cz1'><style id='b3Cz1'><dir id='b3Cz1'><q id='b3Cz1'></q></dir></style></legend>
                    <tbody id='b3Cz1'></tbody>

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

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

                            <tfoot id='b3Cz1'></tfoot>