use of com.intellij.openapi.editor.EditorFactory in project intellij-community by JetBrains.
the class CallerChooserBase method createEditor.
private Editor createEditor() {
final EditorFactory editorFactory = EditorFactory.getInstance();
final Document document = editorFactory.createDocument("");
final Editor editor = editorFactory.createViewer(document, myProject);
((EditorEx) editor).setHighlighter(HighlighterFactory.createHighlighter(myProject, myFileName));
return editor;
}
use of com.intellij.openapi.editor.EditorFactory in project intellij-community by JetBrains.
the class QuickDocOnMouseOverManager method setEnabled.
/**
* Instructs the manager to enable or disable 'show quick doc automatically when the mouse goes over an editor element' mode.
*
* @param enabled flag that identifies if quick doc should be automatically shown
*/
public void setEnabled(boolean enabled) {
myEnabled = enabled;
myApplicationActive = enabled;
if (!enabled) {
closeQuickDocIfPossible();
myAlarm.cancelAllRequests();
}
EditorFactory factory = EditorFactory.getInstance();
if (factory == null) {
return;
}
for (Editor editor : factory.getAllEditors()) {
if (enabled) {
registerListeners(editor);
} else {
unRegisterListeners(editor);
}
}
}
use of com.intellij.openapi.editor.EditorFactory in project intellij-community by JetBrains.
the class AnalyzeStacktraceUtil method createEditorPanel.
public static StacktraceEditorPanel createEditorPanel(Project project, @NotNull Disposable parentDisposable) {
EditorFactory editorFactory = EditorFactory.getInstance();
Document document = editorFactory.createDocument("");
Editor editor = editorFactory.createEditor(document, project);
EditorSettings settings = editor.getSettings();
settings.setFoldingOutlineShown(false);
settings.setLineMarkerAreaShown(false);
settings.setIndentGuidesShown(false);
settings.setLineNumbersShown(false);
settings.setRightMarginShown(false);
StacktraceEditorPanel editorPanel = new StacktraceEditorPanel(project, editor);
editorPanel.setPreferredSize(JBUI.size(600, 400));
Disposer.register(parentDisposable, editorPanel);
return editorPanel;
}
use of com.intellij.openapi.editor.EditorFactory in project intellij-plugins by JetBrains.
the class MarkdownCssSettingsForm method createEditor.
@NotNull
private static Editor createEditor() {
EditorFactory editorFactory = EditorFactory.getInstance();
Document editorDocument = editorFactory.createDocument("");
EditorEx editor = (EditorEx) editorFactory.createEditor(editorDocument);
fillEditorSettings(editor.getSettings());
setHighlighting(editor);
return editor;
}
use of com.intellij.openapi.editor.EditorFactory in project intellij-community by JetBrains.
the class DiffUtil method createEditor.
public static EditorEx createEditor(Document document, Project project, boolean isViewer, @Nullable FileType fileType) {
EditorFactory factory = EditorFactory.getInstance();
EditorEx editor = (EditorEx) (isViewer ? factory.createViewer(document, project) : factory.createEditor(document, project));
editor.putUserData(DiffManagerImpl.EDITOR_IS_DIFF_KEY, Boolean.TRUE);
editor.getGutterComponentEx().revalidateMarkup();
if (fileType != null && project != null && !project.isDisposed()) {
CodeStyleFacade codeStyleFacade = CodeStyleFacade.getInstance(project);
editor.getSettings().setTabSize(codeStyleFacade.getTabSize(fileType));
editor.getSettings().setUseTabCharacter(codeStyleFacade.useTabCharacter(fileType));
}
return editor;
}
Aggregations