diff --git a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/ANSIColoredConsoleColorsPage.java b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/ANSIColoredConsoleColorsPage.java index 5a4dec3eda31..d551c7a4773d 100644 --- a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/ANSIColoredConsoleColorsPage.java +++ b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/ANSIColoredConsoleColorsPage.java @@ -27,7 +27,9 @@ public class ANSIColoredConsoleColorsPage implements ColorSettingsPage { "- C:>\n" + "- help\n" + "Bad command or file name\n" + - "Log warning\n" + + "\n" + + "Log error\n" + + "Log warning\n" + "\n" + "# Process output highlighted using ANSI colors codes\n" + "ANSI: red\n" + @@ -42,10 +44,13 @@ public class ANSIColoredConsoleColorsPage implements ColorSettingsPage { private static final AttributesDescriptor[] ATTRS = new AttributesDescriptor[]{ new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.stdout"), ConsoleViewContentType.NORMAL_OUTPUT_KEY), - new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.warning"), ConsoleViewContentType.WARNING_OUTPUT_KEY), + new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.stderr"), ConsoleViewContentType.ERROR_OUTPUT_KEY), new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.stdin"), ConsoleViewContentType.USER_INPUT_KEY), new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.system.output"), ConsoleViewContentType.SYSTEM_OUTPUT_KEY), + new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.logError"), ConsoleViewContentType.LOG_ERROR_OUTPUT_KEY), + new AttributesDescriptor(OptionsBundle.message("options.general.color.descriptor.console.warning"), ConsoleViewContentType.LOG_WARNING_OUTPUT_KEY), + new AttributesDescriptor(OptionsBundle.message("color.settings.console.red"), ConsoleHighlighter.RED), new AttributesDescriptor(OptionsBundle.message("color.settings.console.green"), ConsoleHighlighter.GREEN), new AttributesDescriptor(OptionsBundle.message("color.settings.console.yellow"), ConsoleHighlighter.YELLOW), @@ -61,7 +66,8 @@ public class ANSIColoredConsoleColorsPage implements ColorSettingsPage { ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("stdout", ConsoleViewContentType.NORMAL_OUTPUT_KEY); ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("stdin", ConsoleViewContentType.USER_INPUT_KEY); ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("stderr", ConsoleViewContentType.ERROR_OUTPUT_KEY); - ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("warning", ConsoleViewContentType.WARNING_OUTPUT_KEY); + ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("logError", ConsoleViewContentType.LOG_WARNING_OUTPUT_KEY); + ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("logWarning", ConsoleViewContentType.LOG_ERROR_OUTPUT_KEY); ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("red", ConsoleHighlighter.RED); ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("green", ConsoleHighlighter.GREEN); diff --git a/platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java b/platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java index 5243263df902..f80acefc295d 100644 --- a/platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java +++ b/platform/platform-api/src/com/intellij/execution/ui/ConsoleViewContentType.java @@ -39,13 +39,13 @@ public class ConsoleViewContentType { public static final ColorKey CONSOLE_BACKGROUND_KEY = ColorKey.createColorKey("CONSOLE_BACKGROUND_KEY"); public static final TextAttributesKey NORMAL_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("CONSOLE_NORMAL_OUTPUT"); - public static final TextAttributesKey WARNING_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("CONSOLE_WARNING_OUTPUT"); + public static final TextAttributesKey LOG_WARNING_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("LOG_WARNING_OUTPUT"); public static final TextAttributesKey ERROR_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("CONSOLE_ERROR_OUTPUT"); + public static final TextAttributesKey LOG_ERROR_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("LOG_ERROR_OUTPUT"); public static final TextAttributesKey USER_INPUT_KEY = TextAttributesKey.createTextAttributesKey("CONSOLE_USER_INPUT"); public static final TextAttributesKey SYSTEM_OUTPUT_KEY = TextAttributesKey.createTextAttributesKey("CONSOLE_SYSTEM_OUTPUT"); public static final ConsoleViewContentType NORMAL_OUTPUT = new ConsoleViewContentType("NORMAL_OUTPUT", NORMAL_OUTPUT_KEY); - public static final ConsoleViewContentType WARNING_OUTPUT = new ConsoleViewContentType("ERROR_OUTPUT", WARNING_OUTPUT_KEY); public static final ConsoleViewContentType ERROR_OUTPUT = new ConsoleViewContentType("ERROR_OUTPUT", ERROR_OUTPUT_KEY); public static final ConsoleViewContentType USER_INPUT = new ConsoleViewContentType("USER_OUTPUT", USER_INPUT_KEY); public static final ConsoleViewContentType SYSTEM_OUTPUT = new ConsoleViewContentType("SYSTEM_OUTPUT", SYSTEM_OUTPUT_KEY); diff --git a/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java b/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java index 83de47d6647e..cba851865aa2 100644 --- a/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java +++ b/platform/platform-impl/src/com/intellij/notification/EventLogConsole.java @@ -26,6 +26,8 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; import com.intellij.openapi.editor.ScrollType; +import com.intellij.openapi.editor.colors.EditorColorsManager; +import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.event.EditorMouseEvent; import com.intellij.openapi.editor.ex.EditorMarkupModel; import com.intellij.openapi.editor.markup.*; @@ -113,18 +115,19 @@ class EventLogConsole { Pair pair = EventLog.formatForLog(notification); final NotificationType type = notification.getType(); - ConsoleViewContentType contentType = type == NotificationType.ERROR - ? ConsoleViewContentType.ERROR_OUTPUT + TextAttributesKey key = type == NotificationType.ERROR + ? ConsoleViewContentType.LOG_ERROR_OUTPUT_KEY : type == NotificationType.INFORMATION - ? ConsoleViewContentType.NORMAL_OUTPUT - : ConsoleViewContentType.WARNING_OUTPUT; + ? ConsoleViewContentType.NORMAL_OUTPUT_KEY + : ConsoleViewContentType.LOG_WARNING_OUTPUT_KEY; int msgStart = document.getTextLength(); String message = pair.first; append(document, message); - myLogEditor.getMarkupModel() - .addRangeHighlighter(msgStart, document.getTextLength(), HighlighterLayer.CARET_ROW + 1, contentType.getAttributes(), - HighlighterTargetArea.EXACT_RANGE); + + TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key); + int layer = HighlighterLayer.CARET_ROW + 1; + myLogEditor.getMarkupModel().addRangeHighlighter(msgStart, document.getTextLength(), layer, attributes, HighlighterTargetArea.EXACT_RANGE); if (pair.second) { String s = " "; diff --git a/platform/platform-resources-en/src/messages/OptionsBundle.properties b/platform/platform-resources-en/src/messages/OptionsBundle.properties index b3bfef5e37ce..b01256cf2be4 100644 --- a/platform/platform-resources-en/src/messages/OptionsBundle.properties +++ b/platform/platform-resources-en/src/messages/OptionsBundle.properties @@ -127,7 +127,8 @@ options.general.color.descriptor.modified.lines=Modified lines options.general.color.descriptor.console.background=Console background options.general.color.descriptor.console.stdout=Console standard output options.general.color.descriptor.console.stderr=Console error output -options.general.color.descriptor.console.warning=Console warning output +options.general.color.descriptor.console.warning=Log console warning +options.general.color.descriptor.console.logError=Log console error options.general.color.descriptor.console.stdin=Console user input options.general.color.descriptor.console.system.output=Console system output options.general.color.descriptor.hyperlink.new=Hyperlink diff --git a/platform/platform-resources/src/DefaultColorSchemesManager.xml b/platform/platform-resources/src/DefaultColorSchemesManager.xml index 7978c93214d1..a464da48aced 100644 --- a/platform/platform-resources/src/DefaultColorSchemesManager.xml +++ b/platform/platform-resources/src/DefaultColorSchemesManager.xml @@ -1139,11 +1139,16 @@ - +