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

项目:MissingInActions    文件:Plugin.java   
private void editorCreated(@NotNull EditorFactoryEvent event) {
    final Editor editor = event.getEditor();
    LineSelectionManager manager = new LineSelectionManager(editor);
    myLineSelectionManagers.put(editor, manager);
    myDelayedRunner.addRunnable(editor, () -> {
        myLineSelectionManagers.remove(editor);
        Disposer.dispose(manager);
    });

    if (editor.getProject() != null) {
        PluginProjectComponent projectComponent = editor.getProject().getComponent(PluginProjectComponent.class);
        if (projectComponent != null) {
            projectComponent.editorCreated(editor);
            myDelayedRunner.addRunnable(editor, () -> {
                projectComponent.editorReleased(editor);
            });
        }
    }

    if (mySettings.isOverrideStandardPaste()) {
        registerPasteOverrides(editor);
        myDelayedRunner.addRunnable(editor, () -> unRegisterPasteOverrides(editor));
    }
}
项目:intellij-ce-playground    文件:EditorFactoryImpl.java   
@Override
public void releaseEditor(@NotNull Editor editor) {
  try {
    myEditorFactoryEventDispatcher.getMulticaster().editorReleased(new EditorFactoryEvent(this, editor));
  }
  finally {
    try {
      ((EditorImpl)editor).release();
    }
    finally {
      myEditors.remove(editor);
      if (LOG.isDebugEnabled()) {
        LOG.debug("number of Editor's:" + myEditors.size());
      }
    }
  }
}
项目:intellij-ce-playground    文件:TemplateManagerImpl.java   
public TemplateManagerImpl(Project project) {
  myProject = project;
  final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() {
    @Override
    public void editorReleased(@NotNull EditorFactoryEvent event) {
      Editor editor = event.getEditor();
      if (editor.getProject() != null && editor.getProject() != myProject) return;
      if (myProject.isDisposed() || !myProject.isOpen()) return;
      TemplateState state = getTemplateState(editor);
      if (state != null) {
        state.gotoEnd();
      }
      clearTemplateState(editor);
    }
  };
  EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject);
}
项目:intellij-ce-playground    文件:ChangeSignatureGestureDetector.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final EditorEx editor = (EditorEx)event.getEditor();
  final Document document = editor.getDocument();

  VirtualFile file = myDocumentManager.getFile(document);
  if (file == null) {
    file = editor.getVirtualFile();
  }
  if (file != null && file.isValid()) {
    for (FileEditor fileEditor : myFileEditorManager.getAllEditors(file)) {
      if (fileEditor instanceof TextEditor && ((TextEditor)fileEditor).getEditor() != editor) {
        return;
      }
    }
  }
  removeDocListener(document, file);
}
项目:intellij-ce-playground    文件:CoverageDataManagerImpl.java   
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != myProject) return;
  try {
    final SrcFileAnnotator fileAnnotator;
    synchronized (ANNOTATORS_LOCK) {
      fileAnnotator = myAnnotators.remove(editor);
    }
    if (fileAnnotator != null) {
      Disposer.dispose(fileAnnotator);
    }
  }
  finally {
    final Runnable request = myCurrentEditors.remove(editor);
    if (request != null) {
      myAlarm.cancelRequest(request);
    }
  }
}
项目:intellij-joined-tab-scrolling    文件:JoinedScroller.java   
@Override
public void editorCreated(@NotNull EditorFactoryEvent event) {
  Editor editor = event.getEditor();
  if (!openedEditors.contains(editor)) {
    reflectivelyCheckCurrentListeners("editorCreated.before", editor);
    openedEditors.add(editor);
    editor.getScrollingModel().addVisibleAreaListener(this);

    logger.info("editorCreated: createdCount=" + editorCreatedCount.incrementAndGet()
        + " listening for editor=" + shortObjectString(editor)
        + " openedEditors=" + listShortObjects(openedEditors));
    reflectivelyCheckCurrentListeners("editorCreated.after", editor);
  } else {
    logger.warn("editorCreated: createdCount=" + editorCreatedCount.incrementAndGet()
        + " (should not happen) already contains editor=" + shortObjectString(editor));
  }
}
项目:intellij-joined-tab-scrolling    文件:JoinedScroller.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  Editor editor = event.getEditor();
  if (openedEditors.contains(editor)) {
    logger.info("editorReleased: releasedCount=" + editorReleasedCount.incrementAndGet()
        + " removed listener for editor=" + shortObjectString(editor)
        + " openedEditors=" + listShortObjects(openedEditors));
    reflectivelyCheckCurrentListeners("editorReleased.before", editor);

    editor.getScrollingModel().removeVisibleAreaListener(this);
    openedEditors.remove(editor);
    reflectivelyCheckCurrentListeners("editorReleased.after", editor);
  } else {
    logger.warn("editorReleased: releasedCount=" + editorReleasedCount.incrementAndGet()
        + " (should not happen) released editor we were not tracking editor="
        + shortObjectString(editor));
  }
}
项目:jetbrains-plugin-st4    文件:STGroupPluginController.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
    Editor editor = event.getEditor();
    final Document doc = editor.getDocument();
    if (editor.getProject() != null && editor.getProject() != project) {
        return;
    }
    STGroupFileEditorListener listener = editor.getUserData(EDITOR_DOCUMENT_LISTENER_KEY);
    if (listener != null) {
        doc.removeDocumentListener(listener);
        doc.putUserData(EDITOR_DOCUMENT_LISTENER_KEY, null);
    }
    DocumentListener listener2 = editor.getUserData(EDITOR_STRUCTVIEW_LISTENER_KEY);
    if (listener2 != null) {
        doc.removeDocumentListener(listener2);
        doc.putUserData(EDITOR_STRUCTVIEW_LISTENER_KEY, null);
    }
}
项目:tools-idea    文件:LineStatusTrackerManager.java   
public void editorCreated(@NotNull EditorFactoryEvent event) {
  // note that in case of lazy loading of configurables, this event can happen
  // outside of EDT, so the EDT check mustn't be done here
  Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document document = editor.getDocument();
  final VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document);

  new AbstractCalledLater(myProject, ModalityState.NON_MODAL) {
    @Override
    public void run() {
      if (shouldBeInstalled(virtualFile)) {
        installTracker(virtualFile, document);
      }
    }
  }.callMe();
}
项目:tools-idea    文件:TemplateManagerImpl.java   
@Override
public void projectOpened() {
  final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() {
    @Override
    public void editorReleased(@NotNull EditorFactoryEvent event) {
      Editor editor = event.getEditor();
      if (editor.getProject() != null && editor.getProject() != myProject) return;
      if (myProject.isDisposed() || !myProject.isOpen()) return;
      TemplateState tState = getTemplateState(editor);
      if (tState != null) {
        tState.gotoEnd();
      }
      editor.putUserData(TEMPLATE_STATE_KEY, null);
    }
  };
  EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject);
}
项目:tools-idea    文件:ChangeSignatureGestureDetector.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final EditorEx editor = (EditorEx)event.getEditor();
  final Document document = editor.getDocument();

  VirtualFile file = myDocumentManager.getFile(document);
  if (file == null) {
    file = editor.getVirtualFile();
  }
  if (file != null && file.isValid()) {
    for (FileEditor fileEditor : myFileEditorManager.getAllEditors(file)) {
      if (fileEditor instanceof TextEditor && ((TextEditor)fileEditor).getEditor() != editor) {
        return;
      }
    }
  }
  removeDocListener(document, file);
}
项目:consulo    文件:CoverageDataManagerImpl.java   
public void editorReleased(@Nonnull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != myProject) return;
  try {
    final SrcFileAnnotator fileAnnotator;
    synchronized (ANNOTATORS_LOCK) {
      fileAnnotator = myAnnotators.remove(editor);
    }
    if (fileAnnotator != null) {
      Disposer.dispose(fileAnnotator);
    }
  }
  finally {
    final Runnable request = myCurrentEditors.remove(editor);
    if (request != null) {
      myAlarm.cancelRequest(request);
    }
  }
}
项目:consulo    文件:EncodingManagerImpl.java   
public EncodingManagerImpl(@Nonnull EditorFactory editorFactory) {
  editorFactory.getEventMulticaster().addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      Document document = e.getDocument();
      if (isEditorOpenedFor(document)) {
        queueUpdateEncodingFromContent(document);
      }
    }
  }, this);
  editorFactory.addEditorFactoryListener(new EditorFactoryAdapter() {
    @Override
    public void editorCreated(@Nonnull EditorFactoryEvent event) {
      queueUpdateEncodingFromContent(event.getEditor().getDocument());
    }
  }, this);
}
项目:consulo    文件:EditorUtil.java   
public static void disposeWithEditor(@Nonnull Editor editor, @Nonnull Disposable disposable) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (Disposer.isDisposed(disposable)) return;
  if (editor.isDisposed()) {
    Disposer.dispose(disposable);
    return;
  }
  // for injected editors disposal will happen only when host editor is disposed,
  // but this seems to be the best we can do (there are no notifications on disposal of injected editor)
  Editor hostEditor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor;
  EditorFactory.getInstance().addEditorFactoryListener(new EditorFactoryAdapter() {
    @Override
    public void editorReleased(@Nonnull EditorFactoryEvent event) {
      if (event.getEditor() == hostEditor) {
        Disposer.dispose(disposable);
      }
    }
  }, disposable);
}
项目:consulo    文件:EditorFactoryImpl.java   
@Override
public void releaseEditor(@Nonnull Editor editor) {
  try {
    myEditorFactoryEventDispatcher.getMulticaster().editorReleased(new EditorFactoryEvent(this, editor));
  }
  finally {
    try {
      ((EditorImpl)editor).release();
    }
    finally {
      myEditors.remove(editor);
      if (LOG.isDebugEnabled()) {
        LOG.debug("number of Editors after release: " + myEditors.size());
      }
    }
  }
}
项目:consulo    文件:TemplateManagerImpl.java   
public TemplateManagerImpl(Project project) {
  myProject = project;
  final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() {
    @Override
    public void editorReleased(@Nonnull EditorFactoryEvent event) {
      Editor editor = event.getEditor();
      if (editor.getProject() != null && editor.getProject() != myProject) return;
      if (myProject.isDisposed() || !myProject.isOpen()) return;
      TemplateState state = getTemplateState(editor);
      if (state != null) {
        state.gotoEnd();
      }
      clearTemplateState(editor);
    }
  };
  EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject);
}
项目:educational-plugin    文件:StudyEditorFactoryListener.java   
@Override
public void editorCreated(@NotNull final EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  final Project project = editor.getProject();
  if (project == null) {
    return;
  }

  final Document document = editor.getDocument();
  final VirtualFile openedFile = FileDocumentManager.getInstance().getFile(document);
  if (openedFile != null) {
    final TaskFile taskFile = StudyUtils.getTaskFile(project, openedFile);
    if (taskFile != null) {
      WolfTheProblemSolver.getInstance(project).clearProblems(openedFile);
      final ToolWindow studyToolWindow = ToolWindowManager.getInstance(project).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
      if (studyToolWindow != null) {
        StudyUtils.updateToolWindows(project);
        studyToolWindow.show(null);
      }
      Course course = StudyTaskManager.getInstance(project).getCourse();
      if (course == null) {
        return;
      }

      StudyEditor.addDocumentListener(document, new EduDocumentListener(taskFile, true));

      if (!taskFile.getAnswerPlaceholders().isEmpty()) {
        StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
        boolean isStudyProject = EduNames.STUDY.equals(course.getCourseMode());
        StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
        if (isStudyProject) {
          editor.addEditorMouseListener(new WindowSelectionListener(taskFile));
        }
      }
    }
  }
}
项目:educational-plugin    文件:StudyEditorFactoryListener.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  final Document document = editor.getDocument();
  StudyEditor.removeListener(document);
  editor.getMarkupModel().removeAllHighlighters();
  editor.getSelectionModel().removeSelection();
}
项目:intellij-ce-playground    文件:EncodingManagerImpl.java   
public EncodingManagerImpl(@NotNull EditorFactory editorFactory) {
  editorFactory.getEventMulticaster().addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      queueUpdateEncodingFromContent(e.getDocument());
    }
  }, this);
  editorFactory.addEditorFactoryListener(new EditorFactoryAdapter() {
    @Override
    public void editorCreated(@NotNull EditorFactoryEvent event) {
      queueUpdateEncodingFromContent(event.getEditor().getDocument());
    }
  }, this);
}
项目:intellij-ce-playground    文件:EditorFactoryImpl.java   
private Editor createEditor(@NotNull Document document, boolean isViewer, Project project) {
  Document hostDocument = document instanceof DocumentWindow ? ((DocumentWindow)document).getDelegate() : document;
  EditorImpl editor = new EditorImpl(hostDocument, isViewer, project);
  myEditors.add(editor);
  myEditorEventMulticaster.registerEditor(editor);
  myEditorFactoryEventDispatcher.getMulticaster().editorCreated(new EditorFactoryEvent(this, editor));

  if (LOG.isDebugEnabled()) {
    LOG.debug("number of Editor's:" + myEditors.size());
  }

  return editor;
}
项目:intellij-ce-playground    文件:LineStatusTrackerManager.java   
@Override
public void editorCreated(@NotNull EditorFactoryEvent event) {
  // note that in case of lazy loading of configurables, this event can happen
  // outside of EDT, so the EDT check mustn't be done here
  Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document document = editor.getDocument();
  final VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document);
  if (virtualFile == null) return;
  if (shouldBeInstalled(virtualFile)) {
    installTracker(virtualFile, document);
  }
}
项目:intellij-ce-playground    文件:LineStatusTrackerManager.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document doc = editor.getDocument();
  final Editor[] editors = event.getFactory().getEditors(doc, myProject);
  if (editors.length == 0) {
    releaseTracker(doc);
  }
}
项目:intellij-ce-playground    文件:EditorTracker.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  unregisterEditor(editor);
  executeOnRelease(editor);
}
项目:intellij-ce-playground    文件:CCEditorFactoryListener.java   
@Override
public void editorCreated(@NotNull EditorFactoryEvent event) {
  Editor editor = event.getEditor();
  Project project = editor.getProject();
  if (project == null) {
    return;
  }
  VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(editor.getDocument());
  if (virtualFile == null) {
    return;
  }
  final CCProjectService service = CCProjectService.getInstance(project);
  Course course = service.getCourse();
  if (course == null) {
    return;
  }
  final VirtualFile taskDir = virtualFile.getParent();
  if (taskDir == null || !taskDir.getName().contains(EduNames.TASK)) {
    return;
  }
  final VirtualFile lessonDir = taskDir.getParent();
  if (lessonDir == null) return;
  final TaskFile taskFile = service.getTaskFile(virtualFile);
  if (taskFile == null) {
    return;
  }
  EduDocumentListener listener = new EduDocumentListener(taskFile, true, true);
  CCProjectService.addDocumentListener(editor.getDocument(), listener);
  editor.getDocument().addDocumentListener(listener);
  EditorActionManager.getInstance()
    .setReadonlyFragmentModificationHandler(editor.getDocument(), new EduAnswerPlaceholderDeleteHandler(editor));
  service.drawAnswerPlaceholders(virtualFile, editor);
  editor.getColorsScheme().setColor(EditorColors.READONLY_FRAGMENT_BACKGROUND_COLOR, null);
  EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile, false);
}
项目:intellij-ce-playground    文件:CCEditorFactoryListener.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  Editor editor = event.getEditor();
  Document document = editor.getDocument();
  EduDocumentListener listener = CCProjectService.getListener(document);
  if (listener != null) {
    document.removeDocumentListener(listener);
    CCProjectService.removeListener(document);
  }
  editor.getMarkupModel().removeAllHighlighters();
  editor.getSelectionModel().removeSelection();
}
项目:intellij-ce-playground    文件:StudyEditorFactoryListener.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  final Document document = editor.getDocument();
  StudyEditor.removeListener(document);
  editor.getMarkupModel().removeAllHighlighters();
  editor.getSelectionModel().removeSelection();
}
项目:intellij-ce-playground    文件:XmlTagNameSynchronizer.java   
public XmlTagNameSynchronizer(EditorFactory editorFactory, FileDocumentManager manager, CommandProcessor processor) {
  myFileDocumentManager = manager;
  editorFactory.addEditorFactoryListener(new EditorFactoryAdapter() {
    @Override
    public void editorCreated(@NotNull EditorFactoryEvent event) {
      installSynchronizer(event.getEditor());
    }
  }, ApplicationManager.getApplication());
  processor.addCommandListener(this);
}
项目:jetbrains-plugin-st4    文件:STGroupPluginController.java   
@Override
public void editorCreated(@NotNull EditorFactoryEvent event) {
    final Editor editor = event.getEditor();
    final Document doc = editor.getDocument();
    VirtualFile vfile = FileDocumentManager.getInstance().getFile(doc);
    if ( vfile!=null && vfile.getName().endsWith(".stg") ) {
        STGroupFileEditorListener listener = new STGroupFileEditorListener();
        doc.putUserData(EDITOR_DOCUMENT_LISTENER_KEY, listener);
        doc.addDocumentListener(listener);
    }
}
项目:watchdog    文件:EditorWindowListener.java   
@Override
public void editorCreated(EditorFactoryEvent editorFactoryEvent) {
    if(!editorBelongsToThisProject(editorFactoryEvent)) {
        return;
    }

    Editor editor = editorFactoryEvent.getEditor();
    focusListener = new EditorFocusListener(editor);
    editor.getContentComponent().addFocusListener(focusListener);
    editorListenerMap.put(editor, new EditorListener(editor));
}
项目:watchdog    文件:EditorWindowListener.java   
@Override
public void editorReleased(EditorFactoryEvent editorFactoryEvent) {
    if(!editorBelongsToThisProject(editorFactoryEvent)) {
        return;
    }

    Editor editor = editorFactoryEvent.getEditor();
    editor.getContentComponent().removeFocusListener(focusListener);
    editorListenerMap.remove(editor).removeListeners();
}
项目:watchdog    文件:EditorWindowListener.java   
private boolean editorBelongsToThisProject(EditorFactoryEvent editorFactoryEvent) {
    try {
        return editorFactoryEvent.getEditor().getProject().getName().equals(myProjectName);
    }
    catch(NullPointerException e) {
        return false;
    }
}
项目:tools-idea    文件:EncodingManagerImpl.java   
public EncodingManagerImpl(@NotNull EditorFactory editorFactory) {
  editorFactory.getEventMulticaster().addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      queueUpdateEncodingFromContent(e.getDocument());
    }
  }, this);
  editorFactory.addEditorFactoryListener(new EditorFactoryAdapter() {
    @Override
    public void editorCreated(@NotNull EditorFactoryEvent event) {
      queueUpdateEncodingFromContent(event.getEditor().getDocument());
    }
  }, this);
}
项目:tools-idea    文件:EditorFactoryImpl.java   
private Editor createEditor(@NotNull Document document, boolean isViewer, Project project) {
  Document hostDocument = document instanceof DocumentWindow ? ((DocumentWindow)document).getDelegate() : document;
  EditorImpl editor = new EditorImpl(hostDocument, isViewer, project);
  myEditors.add(editor);
  myEditorEventMulticaster.registerEditor(editor);
  myEditorFactoryEventDispatcher.getMulticaster().editorCreated(new EditorFactoryEvent(this, editor));

  if (LOG.isDebugEnabled()) {
    LOG.debug("number of Editor's:" + myEditors.size());
  }

  return editor;
}
项目:tools-idea    文件:EditorFactoryImpl.java   
@Override
public void releaseEditor(@NotNull Editor editor) {
  try {
    ((EditorImpl)editor).release();
  }
  finally {
    myEditors.remove(editor);
    myEditorFactoryEventDispatcher.getMulticaster().editorReleased(new EditorFactoryEvent(this, editor));

    if (LOG.isDebugEnabled()) {
      LOG.debug("number of Editor's:" + myEditors.size());
      //Thread.dumpStack();
    }
  }
}
项目:tools-idea    文件:LineStatusTrackerManager.java   
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document doc = editor.getDocument();
  final Editor[] editors = event.getFactory().getEditors(doc, myProject);
  if (editors.length == 0) {
    new AbstractCalledLater(myProject, ModalityState.NON_MODAL) {
      @Override
      public void run() {
        releaseTracker(doc);
      }
    }.callMe();
  }
}
项目:tools-idea    文件:EditorTracker.java   
@Override
public void editorReleased(@NotNull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  unregisterEditor(editor);
  dispose(editor);
}
项目:consulo    文件:EditorFactoryImpl.java   
private Editor createEditor(@Nonnull Document document, boolean isViewer, Project project) {
  Document hostDocument = document instanceof DocumentWindow ? ((DocumentWindow)document).getDelegate() : document;
  EditorImpl editor = new EditorImpl(hostDocument, isViewer, project);
  myEditors.add(editor);
  myEditorEventMulticaster.registerEditor(editor);
  myEditorFactoryEventDispatcher.getMulticaster().editorCreated(new EditorFactoryEvent(this, editor));

  if (LOG.isDebugEnabled()) {
    LOG.debug("number of Editors after create: " + myEditors.size());
  }

  return editor;
}
项目:consulo    文件:LineStatusTrackerManager.java   
@Override
public void editorCreated(@Nonnull EditorFactoryEvent event) {
  // note that in case of lazy loading of configurables, this event can happen
  // outside of EDT, so the EDT check mustn't be done here
  Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document document = editor.getDocument();
  final VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document);
  if (virtualFile == null) return;
  if (shouldBeInstalled(virtualFile)) {
    installTracker(virtualFile, document);
  }
}
项目:consulo    文件:LineStatusTrackerManager.java   
@Override
public void editorReleased(@Nonnull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  final Document doc = editor.getDocument();
  final Editor[] editors = event.getFactory().getEditors(doc, myProject);
  if (editors.length == 0 || (editors.length == 1 && editor == editors[0])) {
    releaseTracker(doc);
  }
}
项目:consulo    文件:EditorTracker.java   
@Override
public void editorReleased(@Nonnull EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  if (editor.getProject() != null && editor.getProject() != myProject) return;
  unregisterEditor(editor);
  executeOnRelease(editor);
}