diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java index e62a382ea6b2..a3f59fd481ae 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java @@ -348,7 +348,8 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract private static class FontConfigurableFactory implements ColorAndFontPanelFactory { public NewColorAndFontPanel createPanel(ColorAndFontOptions options) { - return new NewColorAndFontPanel(new SchemesPanel(options), new FontOptions(options), new FontEditorPreview(options), "Font", null, null){ + FontEditorPreview previewPanel = new FontEditorPreview(options, true); + return new NewColorAndFontPanel(new SchemesPanel(options), new FontOptions(options), previewPanel, "Font", null, null){ @Override public boolean containsFontOptions() { return true; @@ -363,7 +364,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract private static class ConsoleFontConfigurableFactory implements ColorAndFontPanelFactory { public NewColorAndFontPanel createPanel(ColorAndFontOptions options) { - FontEditorPreview previewPanel = new FontEditorPreview(options) { + FontEditorPreview previewPanel = new FontEditorPreview(options, false) { @Override protected EditorColorsScheme updateOptionsScheme(EditorColorsScheme selectedScheme) { return ConsoleViewUtil.updateConsoleColorScheme(selectedScheme); diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/FontEditorPreview.java b/platform/lang-impl/src/com/intellij/application/options/colors/FontEditorPreview.java index b936ef1f3242..a890285ac9c1 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/FontEditorPreview.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/FontEditorPreview.java @@ -36,12 +36,12 @@ public class FontEditorPreview implements PreviewPanel{ private final EventDispatcher myDispatcher = EventDispatcher.create(ColorAndFontSettingsListener.class); - public FontEditorPreview(final ColorAndFontOptions options) { + public FontEditorPreview(final ColorAndFontOptions options, boolean editable) { myOptions = options; @Nls String text = getIDEDemoText(); - myEditor = (EditorEx)createPreviewEditor(text, 10, 3, -1, myOptions); + myEditor = (EditorEx)createPreviewEditor(text, 10, 3, -1, myOptions, editable); installTrafficLights(myEditor); } @@ -70,10 +70,10 @@ public class FontEditorPreview implements PreviewPanel{ ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true); } - static Editor createPreviewEditor(String text, int column, int line, int selectedLine, ColorAndFontOptions options) { + static Editor createPreviewEditor(String text, int column, int line, int selectedLine, ColorAndFontOptions options, boolean editable) { EditorFactory editorFactory = EditorFactory.getInstance(); Document editorDocument = editorFactory.createDocument(text); - EditorEx editor = (EditorEx)editorFactory.createViewer(editorDocument); + EditorEx editor = (EditorEx) (editable ? editorFactory.createEditor(editorDocument) : editorFactory.createViewer(editorDocument)); editor.setColorsScheme(options.getSelectedScheme()); EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(true); diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java b/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java index 649bf0d2ee2e..58218b81dc11 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java @@ -66,7 +66,7 @@ public class SimpleEditorPreview implements PreviewPanel{ myHighlightData = extractant2.extractHighlights(text); int selectedLine = -1; - myEditor = (EditorEx)FontEditorPreview.createPreviewEditor(extractant2.cutDefinedTags(text), 10, 3, selectedLine, myOptions); + myEditor = (EditorEx)FontEditorPreview.createPreviewEditor(extractant2.cutDefinedTags(text), 10, 3, selectedLine, myOptions, false); FontEditorPreview.installTrafficLights(myEditor); myBlinkingAlarm = new Alarm().setActivationComponent(myEditor.getComponent());