1. <small id='EGRiv'></small><noframes id='EGRiv'>

    2. <legend id='EGRiv'><style id='EGRiv'><dir id='EGRiv'><q id='EGRiv'></q></dir></style></legend>

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

        <bdo id='EGRiv'></bdo><ul id='EGRiv'></ul>
        <tfoot id='EGRiv'></tfoot>

        每当在 Eclipse 中打开新编辑器时,我如何得到通知?

        How do I get notified whenever a new editor is opened in Eclipse?(每当在 Eclipse 中打开新编辑器时,我如何得到通知?)

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

              <tbody id='kfGXP'></tbody>
          • <small id='kfGXP'></small><noframes id='kfGXP'>

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

                  <tfoot id='kfGXP'></tfoot>
                1. 本文介绍了每当在 Eclipse 中打开新编辑器时,我如何得到通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个视图希望收到所有当前打开的编辑器的通知.我在哪里可以添加监听器来实现这一点?

                  I have a view which would like to be notified about all the currently opened editors. Where can I add a listener to achieve this?

                  我希望 WorkbenchPage 或 EditorManager 有一些合适的监听器注册表,但我找不到它.

                  I was expecting WorkbenchPage or EditorManager to have some appropriate listener registry, but I couldn't find it.

                  推荐答案

                  您的视图是否使用 org.eclipse.ui.IPartListener2 ?

                  Does your view uses a org.eclipse.ui.IPartListener2 ?

                  这就是使用这个 EditorListener,其工作是针对给定视图对编辑器事件(包括打开和关闭)做出反应

                  That is what is using this EditorListener, whose job is to react, for a given view, to Editor events (including open and close)

                  public class EditorListener implements ISelectionListener, IFileBufferListener,
                  IPartListener2 {
                      protected BytecodeOutlineView view;
                  
                      EditorListener(BytecodeOutlineView view){
                          this.view = view;
                      }
                  
                  [...] 
                  
                      /**
                       * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
                       */
                      public void partOpened(IWorkbenchPartReference partRef) {
                          view.handlePartVisible(partRef.getPart(false));
                      }
                  

                  <小时>

                  现在,如果您的 ViewPart 直接实现 IPartListener2,它可以将自己注册到各种 Editors,就像这样 BytecodeReferenceView


                  Now if your ViewPart directly implements an IPartListener2, it can register itself to the various Editors, like this BytecodeReferenceView

                  public class BytecodeReferenceView extends ViewPart implements IPartListener2, ISelectionListener {
                  
                      [...]
                  
                      public void createPartControl(Composite parent) {
                          browser = new Browser(parent, SWT.BORDER);
                          browser.setText(BytecodeOutlinePlugin.getResourceString(NLS_PREFIX
                              + "empty.selection.text"));
                          final IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
                          workbenchWindow.getPartService().addPartListener(this);
                      [...]
                  

                  这篇关于每当在 Eclipse 中打开新编辑器时,我如何得到通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  How can I specify the default JVM arguments for programs I run from eclipse?(如何为从 Eclipse 运行的程序指定默认 JVM 参数?)
                  Class JavaLaunchHelper is implemented in both ... libinstrument.dylib. One of the two will be used. Which one is undefined(JavaLaunchHelper 类在... libinstrument.dylib 中都实现了.将使用两者之一.哪个是未定义的) - IT屋-程序员软件开发技术分享
                  Running Eclipse on Windows 7 JRE and JDK not found(找不到在 Windows 7 JRE 和 JDK 上运行 Eclipse)
                  StringBuilder vs. .concat vs. quot;+quot; Operator relative performance different in eclipse than command line?(StringBuilder vs. .concat vs. “+eclipse中的操作员相对性能与命令行不同?)
                  Is there a maximum number you can set Xmx to when trying to increase jvm memory?(尝试增加 jvm 内存时,您可以将 Xmx 设置为最大数量吗?)
                    <tbody id='xlZeS'></tbody>

                    <bdo id='xlZeS'></bdo><ul id='xlZeS'></ul>
                  • <small id='xlZeS'></small><noframes id='xlZeS'>

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

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