Java Code Examples for com.intellij.openapi.editor.EditorSettings#setAdditionalLinesCount()
The following examples show how to use
com.intellij.openapi.editor.EditorSettings#setAdditionalLinesCount() .
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: 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 5
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 6
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 7
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 8
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 9
Source File: PromptConsole.java From reasonml-idea-plugin with MIT License | 5 votes |
private void setupPromptEditor() { EditorSettings editorSettings = ((EditorEx) m_promptEditor).getSettings(); editorSettings.setAdditionalLinesCount(0); m_promptEditor.getComponent().setPreferredSize(new Dimension(0, 100)); // add copy/paste actions m_promptEditor.addEditorMouseListener(EditorActionUtil.createEditorPopupHandler(IdeActions.GROUP_CUT_COPY_PASTE)); // hook some key event on prompt editor m_promptEditor.getContentComponent().addKeyListener(new KeyAdapter() { @Override public void keyReleased(@NotNull KeyEvent e) { if (m_promptEnabled && e.isControlDown()) { int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_ENTER) { String command = normalizeCommand(m_promptEditor.getDocument().getText()); m_history.addInHistory(command); m_consoleView.print(command + "\r\n", USER_INPUT); m_consoleView.scrollToEnd(); ApplicationManager.getApplication().runWriteAction(() -> setPromptCommand("")); } else if (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN) { String history = m_history.getFromHistory(keyCode == KeyEvent.VK_DOWN); if (history != null) { ApplicationManager.getApplication().runWriteAction(() -> setPromptCommand(history)); } } } } }); }
Example 10
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); }