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);
}
}
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);
}
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);
}
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);
}
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;
}
Aggregations