use of com.intellij.openapi.editor.EditorSettings in project intellij-community by JetBrains.
the class TemplateEditorUtil method createEditor.
private static Editor createEditor(boolean isReadOnly, final Document document, final Project project) {
EditorFactory editorFactory = EditorFactory.getInstance();
Editor editor = (isReadOnly ? editorFactory.createViewer(document, project) : editorFactory.createEditor(document, project));
editor.getContentComponent().setFocusable(!isReadOnly);
EditorSettings editorSettings = editor.getSettings();
editorSettings.setVirtualSpace(false);
editorSettings.setLineMarkerAreaShown(false);
editorSettings.setIndentGuidesShown(false);
editorSettings.setLineNumbersShown(false);
editorSettings.setFoldingOutlineShown(false);
editorSettings.setCaretRowShown(false);
EditorColorsScheme scheme = editor.getColorsScheme();
VirtualFile file = FileDocumentManager.getInstance().getFile(document);
if (file != null) {
EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(file, scheme, project);
((EditorEx) editor).setHighlighter(highlighter);
}
return editor;
}
use of com.intellij.openapi.editor.EditorSettings in project intellij-community by JetBrains.
the class FileTemplateConfigurable method createEditor.
private Editor createEditor() {
EditorFactory editorFactory = EditorFactory.getInstance();
Document doc = myFile == null ? editorFactory.createDocument(myTemplate == null ? "" : myTemplate.getText()) : PsiDocumentManager.getInstance(myFile.getProject()).getDocument(myFile);
assert doc != null;
Editor editor = editorFactory.createEditor(doc, myProject);
EditorSettings editorSettings = editor.getSettings();
editorSettings.setVirtualSpace(false);
editorSettings.setLineMarkerAreaShown(false);
editorSettings.setIndentGuidesShown(false);
editorSettings.setLineNumbersShown(false);
editorSettings.setFoldingOutlineShown(false);
editorSettings.setAdditionalColumnsCount(3);
editorSettings.setAdditionalLinesCount(3);
editorSettings.setCaretRowShown(false);
editor.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
onTextChanged();
}
});
((EditorEx) editor).setHighlighter(createHighlighter());
JPanel topPanel = new JPanel(new BorderLayout());
JPanel southPanel = new JPanel(new HorizontalLayout(40));
southPanel.add(myAdjustBox);
southPanel.add(myLiveTemplateBox);
topPanel.add(southPanel, BorderLayout.SOUTH);
topPanel.add(editor.getComponent(), BorderLayout.CENTER);
mySplitter.setFirstComponent(topPanel);
return editor;
}
use of com.intellij.openapi.editor.EditorSettings 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.EditorSettings in project intellij-community by JetBrains.
the class EditorActionTest method testDownWithSelectionWhenCaretsAreAllowedInsideTabs.
public void testDownWithSelectionWhenCaretsAreAllowedInsideTabs() throws Exception {
init("<caret>text", TestFileType.TEXT);
final EditorSettings editorSettings = myEditor.getSettings();
final boolean old = editorSettings.isCaretInsideTabs();
try {
editorSettings.setCaretInsideTabs(true);
executeAction("EditorDownWithSelection");
checkResultByText("<selection>text<caret></selection>");
} finally {
editorSettings.setCaretInsideTabs(old);
}
}
use of com.intellij.openapi.editor.EditorSettings in project intellij-community by JetBrains.
the class IpnbEditorUtil method setupEditor.
private static void setupEditor(@NotNull final EditorEx editor) {
editor.setBackgroundColor(getEditablePanelBackground());
noScrolling(editor);
editor.getScrollPane().setBorder(null);
final EditorSettings editorSettings = editor.getSettings();
editorSettings.setLineMarkerAreaShown(false);
editorSettings.setIndentGuidesShown(false);
editorSettings.setLineNumbersShown(false);
editorSettings.setFoldingOutlineShown(false);
editorSettings.setAdditionalPageAtBottom(false);
editorSettings.setAdditionalColumnsCount(0);
editorSettings.setAdditionalLinesCount(0);
editorSettings.setRightMarginShown(false);
}
Aggregations