use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.
the class RunIdeConsoleAction method configureConsole.
public static void configureConsole(@NotNull VirtualFile file, @NotNull FileEditorManager source) {
MyRunAction runAction = new MyRunAction();
for (FileEditor fileEditor : source.getEditors(file)) {
if (!(fileEditor instanceof TextEditor))
continue;
Editor editor = ((TextEditor) fileEditor).getEditor();
runAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, editor.getComponent());
}
}
use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.
the class FindManagerImpl method findNextUsageInFile.
private boolean findNextUsageInFile(@NotNull FileEditor fileEditor, @NotNull SearchResults.Direction direction) {
if (fileEditor instanceof TextEditor) {
TextEditor textEditor = (TextEditor) fileEditor;
Editor editor = textEditor.getEditor();
editor.getCaretModel().removeSecondaryCarets();
if (tryToFindNextUsageViaEditorSearchComponent(editor, direction)) {
return true;
}
RangeHighlighter[] highlighters = ((HighlightManagerImpl) HighlightManager.getInstance(myProject)).getHighlighters(editor);
if (highlighters.length > 0) {
return highlightNextHighlighter(highlighters, editor, editor.getCaretModel().getOffset(), direction == SearchResults.Direction.DOWN, false);
}
}
if (direction == SearchResults.Direction.DOWN) {
return myFindUsagesManager.findNextUsageInFile(fileEditor);
}
return myFindUsagesManager.findPreviousUsageInFile(fileEditor);
}
use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.
the class FindManagerImpl method findUsagesInEditor.
@Override
public void findUsagesInEditor(@NotNull PsiElement element, @NotNull FileEditor fileEditor) {
if (fileEditor instanceof TextEditor) {
TextEditor textEditor = (TextEditor) fileEditor;
Editor editor = textEditor.getEditor();
Document document = editor.getDocument();
PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(document);
myFindUsagesManager.findUsages(element, psiFile, fileEditor, false, null);
}
}
use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.
the class IntentionWrapper method applyFix.
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
VirtualFile virtualFile = myFile.getVirtualFile();
if (virtualFile != null) {
FileEditor editor = FileEditorManager.getInstance(project).getSelectedEditor(virtualFile);
myAction.invoke(project, editor instanceof TextEditor ? ((TextEditor) editor).getEditor() : null, myFile);
}
}
use of com.intellij.openapi.fileEditor.TextEditor in project intellij-community by JetBrains.
the class EditorOptionsPanel method clearAllIdentifierHighlighters.
private static void clearAllIdentifierHighlighters() {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
for (FileEditor fileEditor : FileEditorManager.getInstance(project).getAllEditors()) {
if (fileEditor instanceof TextEditor) {
Document document = ((TextEditor) fileEditor).getEditor().getDocument();
IdentifierHighlighterPass.clearMyHighlights(document, project);
}
}
}
}
Aggregations