// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.options.colors;

import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.util.NlsContexts;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

/**
 * Describes a text attribute key the attributes for which can be configured in a custom
 * colors and fonts page.
 *
 * @see ColorSettingsPage#getAttributeDescriptors()
 */
public final class AttributesDescriptor extends AbstractKeyDescriptor<TextAttributesKey> {
  /** Please use {@link #AttributesDescriptor(Supplier, TextAttributesKey)} instead. */
  public AttributesDescriptor(@NotNull @NlsContexts.AttributeDescriptor String displayName, @NotNull TextAttributesKey key) {
    this(new StaticSupplier(displayName), key);
  }

  /**
   * Creates an attribute descriptor with the specified name and text attributes key.
   *
   * @param displayName the name of the attribute shown in the colors list.
   * @param key         the attributes key for which the colors are specified.
   */
  public AttributesDescriptor(@NotNull Supplier<@Nls(capitalization = Nls.Capitalization.Sentence) String> displayName,
                              @NotNull TextAttributesKey key) {
    super(displayName, key);
  }

  @SuppressWarnings("RedundantMethodOverride") // binary compatibility
  @NotNull
  @Override
  public TextAttributesKey getKey() {
    return super.getKey();
  }
}
@@ -291,46 +291,8 @@
 ts;%0A
-import org.jetbrains.annotations.Nls;%0A
 impo
@@ -1217,105 +1217,57 @@
 @Nls
-(capitalization = Nls.Capitalization.Sentence) String%3E displayName,%0A                             
+Contexts.AttributeDescriptor String%3E displayName,
  @No

correct NLS annotation (IDEA-CR-66746)