Example usage for com.intellij.openapi.fileEditor FileEditorManagerEvent getManager

List of usage examples for com.intellij.openapi.fileEditor FileEditorManagerEvent getManager

Introduction

In this page you can find the example usage for com.intellij.openapi.fileEditor FileEditorManagerEvent getManager.

Prototype

@NotNull
    public FileEditorManager getManager() 

Source Link

Usage

From source file:com.atlassian.theplugin.idea.ui.linkhiglighter.FileEditorListenerImpl.java

License:Apache License

public void selectionChanged(final FileEditorManagerEvent event) {
    final FileEditorManager editorManager = event.getManager();
    if (project != editorManager.getProject()) {
        assert false : this;
        return;/*w w w . ja v a 2 s.  com*/
    }
    VirtualFile newFile = event.getNewFile();

    VirtualFile oldFile = event.getOldFile();

    if (oldFile != null && newFile == null) {
        removeHighlighter(oldFile);
        linkHighlighters.remove(oldFile);

    } else if (newFile != null && !linkHighlighters.containsKey(newFile)) {
        PsiFile psiFile = safeFindFile(newFile);
        if (psiFile != null) {
            Editor editor = editorManager.getSelectedTextEditor();
            if (editor != null) {
                addHighlighter(newFile, psiFile, editor);
            }
        }
    }
}

From source file:com.chrisrm.idea.tabs.MTTabsEditorAdapter.java

License:Open Source License

@Override
public void selectionChanged(@NotNull final FileEditorManagerEvent event) {
    final Project project = event.getManager().getProject();
    final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
    final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);

    final VirtualFile newFile = event.getNewFile();

    for (final EditorWindow editorWindow : manager.getWindows()) {
        if (newFile != null) {
            processActiveTab(fileStatusManager, newFile, editorWindow);
        }/*from   w w w. j a v  a  2 s .  c  om*/
    }
}

From source file:com.intellij.lang.jsgraphql.schema.ide.project.JSGraphQLSchemaLanguageProjectService.java

License:Open Source License

@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
    if (event.getNewFile() != null) {
        selectProjectSchemaInTree(event);
        markSchemaFileAsViewer(event.getManager(), event.getNewFile());
    }/*from ww w.j a  v  a2 s .  c  om*/
}

From source file:idea.plugin.psiviewer.controller.project.EditorListener.java

License:Open Source License

public void selectionChanged(@Nonnull FileEditorManagerEvent event) {
    debug("selection changed " + event.toString());

    if (event.getNewFile() == null)
        return;/*from   w ww .j ava  2 s  . c o  m*/

    Editor newEditor = event.getManager().getSelectedTextEditor();

    if (_currentEditor != newEditor && _currentEditor != null)
        _currentEditor.getCaretModel().removeCaretListener(this);

    _viewer.selectElementAtCaret();

    if (newEditor != null)
        _currentEditor = newEditor;

    _currentEditor.getCaretModel().addCaretListener(this);
}

From source file:org.intellij.plugins.junit.UntestedMethodHighlighter.java

License:Open Source License

public void selectionChanged(FileEditorManagerEvent event) {
    selectedEditor = event.getManager().getSelectedTextEditor();
    if (selectedEditor != null && started) {
        markUntestedMethodsInEditor(selectedEditor);
    } else {//w  w  w .j av a2  s . co m
        removeUntestedMethodHighlighters(selectedEditor);
    }
}