From aaae6972f974a5e00801027996b64ed5b3e34bab Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 19 Dec 2024 14:19:51 +0100 Subject: [PATCH] Java: use .messagePointer() to avoid storing UI strings in static field in color settings GitOrigin-RevId: b2e71849660cfed94c202dec6e0e3ace60ca38e0 --- .../AbstractBasicJavaColorSettingsPage.java | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/java/java-frontback-impl/src/com/intellij/openapi/options/colors/pages/AbstractBasicJavaColorSettingsPage.java b/java/java-frontback-impl/src/com/intellij/openapi/options/colors/pages/AbstractBasicJavaColorSettingsPage.java index a0b9a542676e..31d58a11026f 100644 --- a/java/java-frontback-impl/src/com/intellij/openapi/options/colors/pages/AbstractBasicJavaColorSettingsPage.java +++ b/java/java-frontback-impl/src/com/intellij/openapi/options/colors/pages/AbstractBasicJavaColorSettingsPage.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.options.colors.pages; import com.intellij.application.options.colors.InspectionColorSettingsPage; @@ -22,61 +22,61 @@ import java.util.Map; public abstract class AbstractBasicJavaColorSettingsPage implements ColorSettingsPage, InspectionColorSettingsPage, DisplayPrioritySortable { private static final AttributesDescriptor[] ourDescriptors = { - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.keyword"), JavaHighlightingColors.KEYWORD), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.number"), JavaHighlightingColors.NUMBER), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.keyword"), JavaHighlightingColors.KEYWORD), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.number"), JavaHighlightingColors.NUMBER), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.string"), JavaHighlightingColors.STRING), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.valid.escape.in.string"), JavaHighlightingColors.VALID_STRING_ESCAPE), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.invalid.escape.in.string"), JavaHighlightingColors.INVALID_STRING_ESCAPE), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.string"), JavaHighlightingColors.STRING), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.valid.escape.in.string"), JavaHighlightingColors.VALID_STRING_ESCAPE), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.invalid.escape.in.string"), JavaHighlightingColors.INVALID_STRING_ESCAPE), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.operator.sign"), JavaHighlightingColors.OPERATION_SIGN), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.parentheses"), JavaHighlightingColors.PARENTHESES), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.braces"), JavaHighlightingColors.BRACES), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.brackets"), JavaHighlightingColors.BRACKETS), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.comma"), JavaHighlightingColors.COMMA), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.semicolon"), JavaHighlightingColors.JAVA_SEMICOLON), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.dot"), JavaHighlightingColors.DOT), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.operator.sign"), JavaHighlightingColors.OPERATION_SIGN), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.parentheses"), JavaHighlightingColors.PARENTHESES), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.braces"), JavaHighlightingColors.BRACES), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.brackets"), JavaHighlightingColors.BRACKETS), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.comma"), JavaHighlightingColors.COMMA), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.semicolon"), JavaHighlightingColors.JAVA_SEMICOLON), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.dot"), JavaHighlightingColors.DOT), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.line.comment"), JavaHighlightingColors.LINE_COMMENT), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.block.comment"), JavaHighlightingColors.JAVA_BLOCK_COMMENT), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.javadoc.comment"), JavaHighlightingColors.DOC_COMMENT), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.javadoc.tag"), JavaHighlightingColors.DOC_COMMENT_TAG), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.javadoc.tag.value"), JavaHighlightingColors.DOC_COMMENT_TAG_VALUE), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.javadoc.markup"), JavaHighlightingColors.DOC_COMMENT_MARKUP), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.line.comment"), JavaHighlightingColors.LINE_COMMENT), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.block.comment"), JavaHighlightingColors.JAVA_BLOCK_COMMENT), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.javadoc.comment"), JavaHighlightingColors.DOC_COMMENT), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.javadoc.tag"), JavaHighlightingColors.DOC_COMMENT_TAG), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.javadoc.tag.value"), JavaHighlightingColors.DOC_COMMENT_TAG_VALUE), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.javadoc.markup"), JavaHighlightingColors.DOC_COMMENT_MARKUP), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.class"), JavaHighlightingColors.CLASS_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.anonymous.class"), JavaHighlightingColors.ANONYMOUS_CLASS_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.type.parameter"), JavaHighlightingColors.TYPE_PARAMETER_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.abstract.class"), JavaHighlightingColors.ABSTRACT_CLASS_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.interface"), JavaHighlightingColors.INTERFACE_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.enum"), JavaHighlightingColors.ENUM_NAME_ATTRIBUTES), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.local.variable"), JavaHighlightingColors.LOCAL_VARIABLE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.reassigned.local.variable"), JavaHighlightingColors.REASSIGNED_LOCAL_VARIABLE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.reassigned.parameter"), JavaHighlightingColors.REASSIGNED_PARAMETER_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.implicit.anonymous.parameter"), JavaHighlightingColors.IMPLICIT_ANONYMOUS_CLASS_PARAMETER_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.instance.field"), JavaHighlightingColors.INSTANCE_FIELD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.instance.final.field"), JavaHighlightingColors.INSTANCE_FINAL_FIELD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.static.field"), JavaHighlightingColors.STATIC_FIELD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.static.imported.field"), JavaHighlightingColors.STATIC_FIELD_IMPORTED_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.static.final.field"), JavaHighlightingColors.STATIC_FINAL_FIELD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.static.final.imported.field"), JavaHighlightingColors.STATIC_FINAL_FIELD_IMPORTED_ATTRIBUTES), - new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.parameter"), JavaHighlightingColors.PARAMETER_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.lambda.parameter"), JavaHighlightingColors.LAMBDA_PARAMETER_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.method.call"), JavaHighlightingColors.METHOD_CALL_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.method.imported.call"), JavaHighlightingColors.STATIC_METHOD_CALL_IMPORTED_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.method.declaration"), JavaHighlightingColors.METHOD_DECLARATION_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.constructor.call"), JavaHighlightingColors.CONSTRUCTOR_CALL_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.constructor.declaration"), JavaHighlightingColors.CONSTRUCTOR_DECLARATION_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.static.method"), JavaHighlightingColors.STATIC_METHOD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.abstract.method"), JavaHighlightingColors.ABSTRACT_METHOD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.inherited.method"), JavaHighlightingColors.INHERITED_METHOD_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.public"), JavaHighlightingColors.PUBLIC_REFERENCE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.protected"), JavaHighlightingColors.PROTECTED_REFERENCE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.package.private"), JavaHighlightingColors.PACKAGE_PRIVATE_REFERENCE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.private"), JavaHighlightingColors.PRIVATE_REFERENCE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.class"), JavaHighlightingColors.CLASS_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.anonymous.class"), JavaHighlightingColors.ANONYMOUS_CLASS_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.type.parameter"), JavaHighlightingColors.TYPE_PARAMETER_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.abstract.class"), JavaHighlightingColors.ABSTRACT_CLASS_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.interface"), JavaHighlightingColors.INTERFACE_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.enum"), JavaHighlightingColors.ENUM_NAME_ATTRIBUTES), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.local.variable"), JavaHighlightingColors.LOCAL_VARIABLE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.reassigned.local.variable"), JavaHighlightingColors.REASSIGNED_LOCAL_VARIABLE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.reassigned.parameter"), JavaHighlightingColors.REASSIGNED_PARAMETER_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.implicit.anonymous.parameter"), JavaHighlightingColors.IMPLICIT_ANONYMOUS_CLASS_PARAMETER_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.instance.field"), JavaHighlightingColors.INSTANCE_FIELD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.instance.final.field"), JavaHighlightingColors.INSTANCE_FINAL_FIELD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.static.field"), JavaHighlightingColors.STATIC_FIELD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.static.imported.field"), JavaHighlightingColors.STATIC_FIELD_IMPORTED_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.static.final.field"), JavaHighlightingColors.STATIC_FINAL_FIELD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.static.final.imported.field"), JavaHighlightingColors.STATIC_FINAL_FIELD_IMPORTED_ATTRIBUTES), + new AttributesDescriptor(OptionsBundle.messagePointer("options.java.attribute.descriptor.parameter"), JavaHighlightingColors.PARAMETER_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.lambda.parameter"), JavaHighlightingColors.LAMBDA_PARAMETER_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.method.call"), JavaHighlightingColors.METHOD_CALL_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.method.imported.call"), JavaHighlightingColors.STATIC_METHOD_CALL_IMPORTED_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.method.declaration"), JavaHighlightingColors.METHOD_DECLARATION_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.constructor.call"), JavaHighlightingColors.CONSTRUCTOR_CALL_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.constructor.declaration"), JavaHighlightingColors.CONSTRUCTOR_DECLARATION_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.static.method"), JavaHighlightingColors.STATIC_METHOD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.abstract.method"), JavaHighlightingColors.ABSTRACT_METHOD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.inherited.method"), JavaHighlightingColors.INHERITED_METHOD_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.public"), JavaHighlightingColors.PUBLIC_REFERENCE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.protected"), JavaHighlightingColors.PROTECTED_REFERENCE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.package.private"), JavaHighlightingColors.PACKAGE_PRIVATE_REFERENCE_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.private"), JavaHighlightingColors.PRIVATE_REFERENCE_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.annotation.name"), JavaHighlightingColors.ANNOTATION_NAME_ATTRIBUTES), - new AttributesDescriptor(JavaOptionBundle.message("options.java.attribute.descriptor.annotation.attribute.name"), JavaHighlightingColors.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES) + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.annotation.name"), JavaHighlightingColors.ANNOTATION_NAME_ATTRIBUTES), + new AttributesDescriptor(JavaOptionBundle.messagePointer("options.java.attribute.descriptor.annotation.attribute.name"), JavaHighlightingColors.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES) }; @NonNls private static final Map ourTags = RainbowHighlighter.createRainbowHLM();