Search in sources :

Example 21 with TextEditor

use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.

the class FindUsagesManager method showHintOrStatusBarMessage.

private void showHintOrStatusBarMessage(String message, FileEditor fileEditor) {
    if (fileEditor instanceof TextEditor) {
        TextEditor textEditor = (TextEditor) fileEditor;
        showEditorHint(message, textEditor.getEditor());
    } else {
        StatusBar.Info.set(message, myProject);
    }
}
Also used : TextEditor(com.intellij.openapi.fileEditor.TextEditor)

Example 22 with TextEditor

use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.

the class FindUtil method searchBack.

public static void searchBack(Project project, FileEditor fileEditor, @Nullable DataContext dataContext) {
    if (!(fileEditor instanceof TextEditor))
        return;
    TextEditor textEditor = (TextEditor) fileEditor;
    Editor editor = textEditor.getEditor();
    searchBack(project, editor, dataContext);
}
Also used : TextEditor(com.intellij.openapi.fileEditor.TextEditor) TextEditor(com.intellij.openapi.fileEditor.TextEditor) FileEditor(com.intellij.openapi.fileEditor.FileEditor)

Example 23 with TextEditor

use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.

the class FindUtil method searchAgain.

public static boolean searchAgain(Project project, FileEditor fileEditor, @Nullable DataContext context) {
    if (!(fileEditor instanceof TextEditor))
        return false;
    TextEditor textEditor = (TextEditor) fileEditor;
    Editor editor = textEditor.getEditor();
    return searchAgain(project, editor, context);
}
Also used : TextEditor(com.intellij.openapi.fileEditor.TextEditor) TextEditor(com.intellij.openapi.fileEditor.TextEditor) FileEditor(com.intellij.openapi.fileEditor.FileEditor)

Example 24 with TextEditor

use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.

the class SearchAgainAction method update.

@Override
public void update(AnActionEvent event) {
    Presentation presentation = event.getPresentation();
    Project project = event.getData(CommonDataKeys.PROJECT);
    if (project == null) {
        presentation.setEnabled(false);
        return;
    }
    FileEditor editor = event.getData(PlatformDataKeys.FILE_EDITOR);
    presentation.setEnabled(editor instanceof TextEditor);
}
Also used : Project(com.intellij.openapi.project.Project) FileEditor(com.intellij.openapi.fileEditor.FileEditor) TextEditor(com.intellij.openapi.fileEditor.TextEditor)

Example 25 with TextEditor

use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.

the class WolfTheProblemSolverImpl method willBeHighlightedAnyway.

private boolean willBeHighlightedAnyway(final VirtualFile file) {
    // opened in some editor, and hence will be highlighted automatically sometime later
    FileEditor[] selectedEditors = FileEditorManager.getInstance(myProject).getSelectedEditors();
    for (FileEditor editor : selectedEditors) {
        if (!(editor instanceof TextEditor))
            continue;
        Document document = ((TextEditor) editor).getEditor().getDocument();
        PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getCachedPsiFile(document);
        if (psiFile == null)
            continue;
        if (Comparing.equal(file, psiFile.getVirtualFile()))
            return true;
    }
    return false;
}
Also used : FileEditor(com.intellij.openapi.fileEditor.FileEditor) TextEditor(com.intellij.openapi.fileEditor.TextEditor) Document(com.intellij.openapi.editor.Document)

Aggregations

TextEditor (com.intellij.openapi.fileEditor.TextEditor)81 FileEditor (com.intellij.openapi.fileEditor.FileEditor)57 Editor (com.intellij.openapi.editor.Editor)32 VirtualFile (com.intellij.openapi.vfs.VirtualFile)28 Project (com.intellij.openapi.project.Project)21 Document (com.intellij.openapi.editor.Document)14 FileEditorManager (com.intellij.openapi.fileEditor.FileEditorManager)13 Nullable (org.jetbrains.annotations.Nullable)13 PsiFile (com.intellij.psi.PsiFile)11 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)6 NotNull (org.jetbrains.annotations.NotNull)6 Disposable (com.intellij.openapi.Disposable)3 EditorEx (com.intellij.openapi.editor.ex.EditorEx)3 EditorNotificationPanel (com.intellij.ui.EditorNotificationPanel)3 LightweightHint (com.intellij.ui.LightweightHint)3 NonNls (org.jetbrains.annotations.NonNls)3 HighlightingPass (com.intellij.codeHighlighting.HighlightingPass)2 TextEditorHighlightingPass (com.intellij.codeHighlighting.TextEditorHighlightingPass)2 TemplateBuilder (com.intellij.codeInsight.template.TemplateBuilder)2 UndoManager (com.intellij.openapi.command.undo.UndoManager)2