private static Editor createEditor(final Project project, final String text, final String fileName) { final FileType fileType = getFileType(fileName); final Document doc = createDocument(fileName, fileType, text); final Editor editor = EditorFactory.getInstance().createEditor(doc, project); ((EditorEx)editor).setEmbeddedIntoDialogWrapper(true); final EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setFoldingOutlineShown(false); settings.setRightMarginShown(false); settings.setLineMarkerAreaShown(false); settings.setIndentGuidesShown(false); ((EditorEx)editor).setHighlighter(HighlighterFactory.createHighlighter(fileType, DefaultColorSchemesManager.getInstance().getFirstScheme(), project)); return editor; }
public EditorColorsManagerImpl(DefaultColorSchemesManager defaultColorSchemesManager, SchemesManagerFactory schemesManagerFactory) { myDefaultColorSchemesManager = defaultColorSchemesManager; mySchemesManager = schemesManagerFactory.createSchemesManager( FILE_SPEC, new MySchemeProcessor(), RoamingType.PER_USER); addDefaultSchemes(); // Load default schemes from providers if (!isUnitTestOrHeadlessMode()) { loadSchemesFromBeans(); } loadAllSchemes(); loadAdditionalTextAttributes(); setGlobalScheme(myDefaultColorSchemesManager.getAllSchemes()[0]); }
private static EditorColorsSchemeImpl loadSchemeFromDocument(final Document document, final boolean isEditable) throws InvalidDataException { final Element root = document.getRootElement(); if (root == null || !SCHEME_NODE_NAME.equals(root.getName())) { throw new InvalidDataException(); } final EditorColorsSchemeImpl scheme = isEditable // editable scheme ? new EditorColorsSchemeImpl(null, DefaultColorSchemesManager.getInstance()) //not editable scheme : new ReadOnlyColorsSchemeImpl(null, DefaultColorSchemesManager.getInstance()); scheme.readExternal(root); return scheme; }
protected AbstractColorsScheme(EditorColorsScheme parentScheme, DefaultColorSchemesManager defaultColorSchemesManager) { myParentScheme = parentScheme; myDefaultColorSchemesManager = defaultColorSchemesManager; myFontPreferences.setChangeListener(new Runnable() { @Override public void run() { initFonts(); } }); }
@Override public Object clone() { EditorColorsSchemeImpl newScheme = new EditorColorsSchemeImpl(myParentScheme, DefaultColorSchemesManager.getInstance()); copyTo(newScheme); newScheme.setName(getName()); return newScheme; }
private MyColorScheme(EditorColorsScheme parentScheme) { super(parentScheme, DefaultColorSchemesManager.getInstance()); parentScheme.getFontPreferences().copyTo(getFontPreferences()); setLineSpacing(parentScheme.getLineSpacing()); parentScheme.getConsoleFontPreferences().copyTo(getConsoleFontPreferences()); setConsoleLineSpacing(parentScheme.getConsoleLineSpacing()); setQuickDocFontSize(parentScheme.getQuickDocFontSize()); myName = parentScheme.getName(); if (parentScheme instanceof ExternalizableScheme) { getExternalInfo().copy(((ExternalizableScheme)parentScheme).getExternalInfo()); } initFonts(); }
public DefaultColorsScheme(DefaultColorSchemesManager defaultColorSchemesManager) { super(null, defaultColorSchemesManager); }
public ReadOnlyColorsSchemeImpl(final EditorColorsScheme parenScheme, final DefaultColorSchemesManager defaultColorSchemesManager) { super(parenScheme, defaultColorSchemesManager); }
@NotNull private static DefaultColorsScheme getDefaultScheme() { return DefaultColorSchemesManager.getInstance().getAllSchemes()[0]; }
public AbstractColorsScheme(DefaultColorSchemesManager defaultColorSchemesManager) { myDefaultColorSchemesManager = defaultColorSchemesManager; }
public EditorColorsSchemeImpl(EditorColorsScheme parentScheme, DefaultColorSchemesManager defaultColorSchemesManager) { super(parentScheme, defaultColorSchemesManager); }