Search in sources :

Example 1 with ColorDescriptor

use of com.intellij.openapi.options.colors.ColorDescriptor in project intellij-community by JetBrains.

the class VcsColorsPageFactory method getColorDescriptors.

@Override
@NotNull
public ColorDescriptor[] getColorDescriptors() {
    List<ColorDescriptor> descriptors = new ArrayList<>();
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.added.lines"), EditorColors.ADDED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.modified.lines"), EditorColors.MODIFIED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.deleted.lines"), EditorColors.DELETED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.whitespaces.modified.lines"), EditorColors.WHITESPACES_MODIFIED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.border.lines"), EditorColors.BORDER_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
    descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations"), EditorColors.ANNOTATIONS_COLOR, ColorDescriptor.Kind.FOREGROUND));
    List<ColorKey> colorKeys = AnnotationsSettings.ANCHOR_COLOR_KEYS;
    for (int i = 0; i < colorKeys.size(); i++) {
        descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations.color.n", i + 1), colorKeys.get(i), ColorDescriptor.Kind.BACKGROUND));
    }
    return ArrayUtil.toObjectArray(descriptors, ColorDescriptor.class);
}
Also used : ColorDescriptor(com.intellij.openapi.options.colors.ColorDescriptor) ColorKey(com.intellij.openapi.editor.colors.ColorKey) ArrayList(java.util.ArrayList) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ColorDescriptor

use of com.intellij.openapi.options.colors.ColorDescriptor in project intellij-community by JetBrains.

the class HTMLColorsPage method getColorDescriptors.

@Override
@NotNull
public ColorDescriptor[] getColorDescriptors() {
    // todo: make preview for it
    final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
    final ColorDescriptor[] colorDescriptors = new ColorDescriptor[colorKeys.length];
    for (int i = 0; i < colorDescriptors.length; i++) {
        colorDescriptors[i] = new ColorDescriptor(OptionsBundle.message("options.html.attribute.descriptor.tag.tree", i + 1), colorKeys[i], ColorDescriptor.Kind.BACKGROUND);
    }
    return colorDescriptors;
}
Also used : ColorDescriptor(com.intellij.openapi.options.colors.ColorDescriptor) ColorKey(com.intellij.openapi.editor.colors.ColorKey) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ColorKey (com.intellij.openapi.editor.colors.ColorKey)2 ColorDescriptor (com.intellij.openapi.options.colors.ColorDescriptor)2 NotNull (org.jetbrains.annotations.NotNull)2 ArrayList (java.util.ArrayList)1