Java 类com.intellij.openapi.editor.event.EditorEventMulticaster 实例源码

项目:appetizer-intellij    文件:RemoteCallComponent.java   
public void initComponent() {
  final int port = mySettings.getPortNumber();
  final boolean allowRequestsFromLocalhostOnly = mySettings.isAllowRequestsFromLocalhostOnly();
  EditorEventMulticaster eventMulticaster = EditorFactory.getInstance().getEventMulticaster();
  eventMulticaster.addDocumentListener(new DocumentChangeListener());
  try {
    serverSocket = new ServerSocket();
    serverSocket.bind(new InetSocketAddress(allowRequestsFromLocalhostOnly ? "localhost" : "0.0.0.0", port));
    log.info("Listening " + port);
  }
  catch (IOException e) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      public void run() {
        Messages.showMessageDialog("Can't bind with " + port + " port. Appetizer plugin won't work", "Appetizer Plugin Error",
                                   Messages.getErrorIcon());
      }
    });
    return;
  }

  MessageNotifier messageNotifier = new SocketMessageNotifier(serverSocket);
  messageNotifier.addMessageHandler(new OpenFileMessageHandler(new FileNavigatorImpl()));
  listenerThread = new Thread(messageNotifier);
  listenerThread.start();
}
项目:DarkyenusTimeTracker    文件:TimeTrackerWidget.java   
private void setupAutoStartDocumentListener(boolean enabled) {
    final EditorEventMulticaster editorEventMulticaster = EditorFactory.getInstance().getEventMulticaster();
    if (autoStartDocumentListener != null) {
        editorEventMulticaster.removeDocumentListener(autoStartDocumentListener);
        autoStartDocumentListener = null;
    }
    if (enabled) {
        editorEventMulticaster.addDocumentListener(autoStartDocumentListener = new DocumentListener() {
            @Override
            public void documentChanged(DocumentEvent e) {
                if (running) return;
                //getSelectedTextEditor() must be run from event dispatch thread
                EventQueue.invokeLater(() -> {
                    final Editor selectedTextEditor = FileEditorManager.getInstance(project).getSelectedTextEditor();
                    if (selectedTextEditor == null) return;
                    if(e.getDocument().equals(selectedTextEditor.getDocument())) {
                        setRunning(true);
                    }
                });
            }
        });
    }
}
项目:stylint-plugin    文件:StylintConfigFileChangeTracker.java   
public void startIfNeeded() {
    if (TRACKING.compareAndSet(false, true))
        ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
            VirtualFileManager.getInstance().addVirtualFileListener(new StylintConfigFileVfsListener(), StylintConfigFileChangeTracker.this.project);
            EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
            multicaster.addDocumentListener(new StylintConfigFileDocumentListener(), StylintConfigFileChangeTracker.this.project);
        }));
}
项目:sass-lint-plugin    文件:SassLintConfigFileListener.java   
private void startListener() {
    if (LISTENING.compareAndSet(false, true))
        ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {
                    public void run() {
                        VirtualFileManager.getInstance().addVirtualFileListener(new SassLintConfigFileVfsListener(), SassLintConfigFileListener.this.project);
                        EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
                        multicaster.addDocumentListener(new SassLintConfigFileDocumentListener(), SassLintConfigFileListener.this.project);
                    }
                });
            }
        });
}
项目:coffee-lint-plugin    文件:CoffeeLintConfigFileListener.java   
private void startListener() {
    if (LISTENING.compareAndSet(false, true))
        ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {
                    public void run() {
                        VirtualFileManager.getInstance().addVirtualFileListener(new CoffeeLintConfigFileVfsListener(), CoffeeLintConfigFileListener.this.project);
                        EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
                        multicaster.addDocumentListener(new CoffeeLintConfigFileDocumentListener(), CoffeeLintConfigFileListener.this.project);
                    }
                });
            }
        });
}
项目:eslint-plugin    文件:ESLintConfigFileListener.java   
private void startListener() {
    if (LISTENING.compareAndSet(false, true))
        ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {
                    public void run() {
                        VirtualFileManager.getInstance().addVirtualFileListener(new ESLintConfigFileVfsListener(), ESLintConfigFileListener.this.project);
                        EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
                        multicaster.addDocumentListener(new ESLintConfigFileDocumentListener(), ESLintConfigFileListener.this.project);
                    }
                });
            }
        });
}
项目:intellij-ce-playground    文件:MockEditorFactory.java   
@Override
@NotNull
public EditorEventMulticaster getEventMulticaster() {
  return new MockEditorEventMulticaster();
}
项目:intellij-ce-playground    文件:EditorFactoryImpl.java   
@Override
@NotNull
public EditorEventMulticaster getEventMulticaster() {
  return myEditorEventMulticaster;
}
项目:tools-idea    文件:MockEditorFactory.java   
@Override
@NotNull
public EditorEventMulticaster getEventMulticaster() {
  return new MockEditorEventMulticaster();
}
项目:tools-idea    文件:EditorFactoryImpl.java   
@Override
@NotNull
public EditorEventMulticaster getEventMulticaster() {
  return myEditorEventMulticaster;
}
项目:consulo    文件:MockEditorFactory.java   
@Override
@Nonnull
public EditorEventMulticaster getEventMulticaster() {
  return new MockEditorEventMulticaster();
}
项目:consulo    文件:EditorFactoryImpl.java   
@Override
@Nonnull
public EditorEventMulticaster getEventMulticaster() {
  return myEditorEventMulticaster;
}
项目:intellij-ce-playground    文件:EditorFactory.java   
/**
 * Returns the service for attaching event listeners to all editor instances.
 *
 * @return the event multicaster instance.
 */
@NotNull
public abstract EditorEventMulticaster getEventMulticaster();
项目:tools-idea    文件:EditorFactory.java   
/**
 * Returns the service for attaching event listeners to all editor instances.
 *
 * @return the event multicaster instance.
 */
@NotNull
public abstract EditorEventMulticaster getEventMulticaster();
项目:consulo    文件:EditorFactory.java   
/**
 * Returns the service for attaching event listeners to all editor instances.
 *
 * @return the event multicaster instance.
 */
@Nonnull
public abstract EditorEventMulticaster getEventMulticaster();