Java Code Examples for com.intellij.openapi.editor.EditorSettings#setLineMarkerAreaShown()
The following examples show how to use
com.intellij.openapi.editor.EditorSettings#setLineMarkerAreaShown() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PromptConsole.java From reasonml-idea-plugin with MIT License | 6 votes |
private void setupOutputEditor() { ((EditorEx) m_outputEditor).getContentComponent().setFocusCycleRoot(false); ((EditorEx) m_outputEditor).setHorizontalScrollbarVisible(true); ((EditorEx) m_outputEditor).setVerticalScrollbarVisible(true); ((EditorEx) m_outputEditor).getScrollPane().setBorder(null); EditorSettings editorSettings = ((EditorEx) m_outputEditor).getSettings(); editorSettings.setLineNumbersShown(false); editorSettings.setIndentGuidesShown(false); editorSettings.setLineMarkerAreaShown(false); editorSettings.setFoldingOutlineShown(true); editorSettings.setRightMarginShown(false); editorSettings.setVirtualSpace(false); editorSettings.setAdditionalPageAtBottom(false); editorSettings.setAdditionalLinesCount(0); editorSettings.setAdditionalColumnsCount(0); editorSettings.setLineCursorWidth(1); editorSettings.setCaretRowShown(false); // output only editor m_outputEditor.setRendererMode(true); // tiny separation between output and prompt m_outputEditor.getComponent().setBorder(new SideBorder(JBColor.LIGHT_GRAY, SideBorder.BOTTOM)); }
Example 2
Source File: SettingsPanel.java From json2java4idea with Apache License 2.0 | 6 votes |
private void createUIComponents() { final EditorFactory editorFactory = EditorFactory.getInstance(); previewDocument = editorFactory.createDocument(EMPTY_TEXT); previewEditor = editorFactory.createEditor(previewDocument, null, JavaFileType.INSTANCE, true); final EditorSettings settings = previewEditor.getSettings(); settings.setWhitespacesShown(true); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); settings.setLineNumbersShown(false); settings.setFoldingOutlineShown(false); settings.setRightMarginShown(false); settings.setVirtualSpace(false); settings.setWheelFontChangeEnabled(false); settings.setUseSoftWraps(false); settings.setAdditionalColumnsCount(0); settings.setAdditionalLinesCount(1); previewPanel = (JPanel) previewEditor.getComponent(); previewPanel.setName(PREVIEW_PANEL_NAME); previewPanel.setPreferredSize(new Dimension(PREFERRED_PREVIEW_WIDTH, PREFERRED_PREVIEW_HEIGHT)); }
Example 3
Source File: NewClassDialog.java From json2java4idea with Apache License 2.0 | 6 votes |
private void createUIComponents() { final EditorFactory editorFactory = EditorFactory.getInstance(); jsonDocument = editorFactory.createDocument(EMPTY_TEXT); jsonEditor = editorFactory.createEditor(jsonDocument, project, JsonFileType.INSTANCE, false); final EditorSettings settings = jsonEditor.getSettings(); settings.setWhitespacesShown(true); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); settings.setLineNumbersShown(true); settings.setFoldingOutlineShown(false); settings.setRightMarginShown(false); settings.setVirtualSpace(false); settings.setWheelFontChangeEnabled(false); settings.setUseSoftWraps(false); settings.setAdditionalColumnsCount(0); settings.setAdditionalLinesCount(1); final EditorColorsScheme colorsScheme = jsonEditor.getColorsScheme(); colorsScheme.setColor(EditorColors.CARET_ROW_COLOR, null); jsonEditor.getContentComponent().setFocusable(true); jsonPanel = (JPanel) jsonEditor.getComponent(); }
Example 4
Source File: ProjectViewUi.java From intellij with Apache License 2.0 | 6 votes |
private static EditorEx createEditor(String tooltip) { Project project = getProject(); Document document = LanguageTextField.createDocument( /* value= */ "", ProjectViewLanguage.INSTANCE, project, new SimpleDocumentCreator()); EditorEx editor = (EditorEx) EditorFactory.getInstance() .createEditor(document, project, ProjectViewFileType.INSTANCE, false); final EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setLineMarkerAreaShown(false); settings.setFoldingOutlineShown(false); settings.setRightMarginShown(false); settings.setAdditionalPageAtBottom(false); editor.getComponent().setMinimumSize(getEditorSize()); editor.getComponent().setPreferredSize(getEditorSize()); editor.getComponent().setToolTipText(tooltip); editor.getComponent().setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null); editor.getComponent().setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null); return editor; }
Example 5
Source File: TemplateConfigurable.java From android-codegenerator-plugin-intellij with Apache License 2.0 | 6 votes |
private Editor createEditorInPanel(String string) { EditorFactory editorFactory = EditorFactory.getInstance(); Editor editor = editorFactory.createEditor(editorFactory.createDocument(string)); 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); editor.getDocument().addDocumentListener(new DocumentAdapter() { @Override public void documentChanged(DocumentEvent e) { onTextChanged(); } }); ((EditorEx) editor).setHighlighter(getEditorHighlighter()); addEditorToPanel(editor); return editor; }
Example 6
Source File: IdeUtils.java From StringManipulation with Apache License 2.0 | 6 votes |
public static EditorImpl createEditorPreview(String text, boolean editable) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); ColorAndFontOptions options = new ColorAndFontOptions(); options.reset(); options.selectScheme(scheme.getName()); EditorFactory editorFactory = EditorFactory.getInstance(); Document editorDocument = editorFactory.createDocument(text); EditorEx editor = (EditorEx) (editable ? editorFactory.createEditor(editorDocument) : editorFactory.createViewer(editorDocument)); editor.setColorsScheme(scheme); EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(true); settings.setWhitespacesShown(false); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); settings.setFoldingOutlineShown(false); settings.setAdditionalColumnsCount(0); settings.setAdditionalLinesCount(0); settings.setRightMarginShown(false); return (EditorImpl) editor; }
Example 7
Source File: Utils.java From idea-gitignore with MIT License | 6 votes |
/** * Creates and configures template preview editor. * * @param document virtual editor document * @param project current project * @return editor */ @NotNull public static Editor createPreviewEditor(@NotNull Document document, @Nullable Project project, boolean isViewer) { EditorEx editor = (EditorEx) EditorFactory.getInstance().createEditor(document, project, IgnoreFileType.INSTANCE, isViewer); editor.setCaretEnabled(!isViewer); final EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setAdditionalColumnsCount(1); settings.setAdditionalLinesCount(0); settings.setRightMarginShown(false); settings.setFoldingOutlineShown(false); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); settings.setVirtualSpace(false); settings.setWheelFontChangeEnabled(false); EditorColorsScheme colorsScheme = editor.getColorsScheme(); colorsScheme.setColor(EditorColors.CARET_ROW_COLOR, null); return editor; }
Example 8
Source File: GoalEditor.java From MavenHelper with Apache License 2.0 | 6 votes |
@NotNull private static Editor createEditor() { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); ColorAndFontOptions options = new ColorAndFontOptions(); options.reset(); options.selectScheme(scheme.getName()); EditorFactory editorFactory = EditorFactory.getInstance(); Document editorDocument = editorFactory.createDocument(""); EditorEx editor = (EditorEx) (true ? editorFactory.createEditor(editorDocument) : editorFactory.createViewer(editorDocument)); editor.setColorsScheme(scheme); EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setUseSoftWraps(true); settings.setWhitespacesShown(false); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); settings.setFoldingOutlineShown(false); settings.setAdditionalColumnsCount(0); settings.setAdditionalLinesCount(0); settings.setRightMarginShown(false); return editor; }
Example 9
Source File: ExportToFileUtil.java From consulo with Apache License 2.0 | 6 votes |
@Override protected JComponent createCenterPanel() { final Document document = ((EditorFactoryImpl)EditorFactory.getInstance()).createDocument(true); ((DocumentImpl)document).setAcceptSlashR(true); myTextArea = EditorFactory.getInstance().createEditor(document, myProject, PlainTextFileType.INSTANCE, true); final EditorSettings settings = myTextArea.getSettings(); settings.setLineNumbersShown(false); settings.setLineMarkerAreaShown(false); settings.setFoldingOutlineShown(false); settings.setRightMarginShown(false); settings.setAdditionalLinesCount(0); settings.setAdditionalColumnsCount(0); settings.setAdditionalPageAtBottom(false); ((EditorEx)myTextArea).setBackgroundColor(UIUtil.getInactiveTextFieldBackgroundColor()); return myTextArea.getComponent(); }
Example 10
Source File: TemplateEditorUtil.java From consulo with Apache License 2.0 | 6 votes |
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)); EditorSettings editorSettings = editor.getSettings(); editorSettings.setVirtualSpace(false); editorSettings.setLineMarkerAreaShown(false); editorSettings.setIndentGuidesShown(false); editorSettings.setLineNumbersShown(false); editorSettings.setFoldingOutlineShown(false); EditorColorsScheme scheme = editor.getColorsScheme(); scheme.setColor(EditorColors.CARET_ROW_COLOR, null); VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file != null) { EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(file, scheme, project); ((EditorEx) editor).setHighlighter(highlighter); } return editor; }
Example 11
Source File: AnalyzeStacktraceUtil.java From consulo with Apache License 2.0 | 6 votes |
public static StacktraceEditorPanel createEditorPanel(Project project, @Nonnull 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(new Dimension(600, 400)); Disposer.register(parentDisposable, editorPanel); return editorPanel; }
Example 12
Source File: QueryPanel.java From nosql4idea with Apache License 2.0 | 5 votes |
private static void fillEditorSettings(final EditorSettings editorSettings) { editorSettings.setWhitespacesShown(true); editorSettings.setLineMarkerAreaShown(false); editorSettings.setIndentGuidesShown(false); editorSettings.setLineNumbersShown(false); editorSettings.setAllowSingleLogicalLineFolding(true); editorSettings.setAdditionalColumnsCount(0); editorSettings.setAdditionalLinesCount(1); editorSettings.setUseSoftWraps(true); editorSettings.setUseTabCharacter(false); editorSettings.setCaretInsideTabs(false); editorSettings.setVirtualSpace(false); }
Example 13
Source File: CopyrightConfigurable.java From consulo with Apache License 2.0 | 5 votes |
static void setupEditor(Editor editor) { EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setFoldingOutlineShown(false); settings.setIndentGuidesShown(false); settings.setLineMarkerAreaShown(false); }