Java 类com.intellij.openapi.editor.colors.ColorKey 实例源码

项目:tools-idea    文件:ColorAndFontOptions.java   
private static void addEditorSettingDescription(ArrayList<EditorSchemeAttributeDescriptor> array,
                                                                   String name,
                                                                   String group,
                                                                   ColorKey backgroundKey,
                                                                   ColorKey foregroundKey,
                                                                   EditorColorsScheme scheme) {
  String type = null;
  if (foregroundKey != null) {
    type = foregroundKey.getExternalName();
  }
  else {
    if (backgroundKey != null) {
      type = backgroundKey.getExternalName();
    }
  }
  ColorAndFontDescription descr = new EditorSettingColorDescription(name, group, backgroundKey, foregroundKey, type, scheme);
  array.add(descr);
}
项目:consulo    文件:AnnotationsSettings.java   
@Nonnull
List<Integer> getAnchorIndexes(@Nullable EditorColorsScheme scheme) {
  if (scheme == null) scheme = EditorColorsManager.getInstance().getGlobalScheme();

  List<Integer> result = new ArrayList<>(ANCHORS_COUNT);

  int count = 0;
  for (ColorKey key : ANCHOR_COLOR_KEYS) {
    if (scheme.getColor(key) != null) {
      result.add(count);
      count += COLORS_BETWEEN_ANCHORS + 1;
    }
    else {
      result.add(null);
    }
  }

  return result;
}
项目:consulo-xml    文件:XmlTagTreeHighlightingColors.java   
@NotNull
public static ColorKey[] getColorKeys()
{
    final int levelCount = XmlEditorOptions.getInstance().getTagTreeHighlightingLevelCount();

    if(ourColorKeys == null || ourColorKeys.length != levelCount)
    {
        ourColorKeys = new ColorKey[levelCount];

        for(int i = 0; i < ourColorKeys.length; i++)
        {
            ourColorKeys[i] = ColorKey.createColorKey("HTML_TAG_TREE_LEVEL" + i, DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
        }
    }

    return ourColorKeys;
}
项目:intellij-ce-playground    文件:DefaultColorsScheme.java   
@Nullable
@Override
public Color getColor(ColorKey key) {
  if (key == null) return null;
  Color color = myColorsMap.get(key);
  return color != null ? color : key.getDefaultColor();
}
项目:intellij-ce-playground    文件:EditorColorsSchemeImpl.java   
@Nullable
@Override
public Color getColor(ColorKey key) {
  if (myColorsMap.containsKey(key)) {
    return myColorsMap.get(key);
  }
  else {
    return myParentScheme.getColor(key);
  }
}
项目:intellij-ce-playground    文件:ColorProvider.java   
@Override
public Color getColor() {
  while (!myKeys.isEmpty()) {
    ColorKey key = myKeys.get(myKeys.size() - 1);
    Color result = myScheme.getColor(key);
    if (result == null || result.equals(myScheme.getDefaultForeground())) {
      myKeys.remove(myKeys.size() - 1);
    }
    else {
      return result;
    }
  }
  return myScheme.getDefaultForeground();
}
项目:intellij-ce-playground    文件:ColorAndFontOptions.java   
@Nullable
private static String calcType(@Nullable ColorKey backgroundKey, @Nullable ColorKey foregroundKey) {
  if (foregroundKey != null) {
    return foregroundKey.getExternalName();
  }
  else if (backgroundKey != null) {
    return backgroundKey.getExternalName();
  }
  return null;
}
项目:intellij-ce-playground    文件:ColorAndFontOptions.java   
private static void addEditorSettingDescription(@NotNull List<EditorSchemeAttributeDescriptor> list,
                                                String name,
                                                String group,
                                                @Nullable ColorKey backgroundKey,
                                                @Nullable ColorKey foregroundKey,
                                                @NotNull EditorColorsScheme scheme) {
  list.add(new EditorSettingColorDescription(name, group, backgroundKey, foregroundKey, calcType(backgroundKey, foregroundKey), scheme));
}
项目:intellij-ce-playground    文件:ColorAndFontOptions.java   
private EditorSettingColorDescription(String name,
                                     String group,
                                     ColorKey backgroundKey,
                                     ColorKey foregroundKey,
                                     String type,
                                     EditorColorsScheme scheme) {
  super(name, group, type, scheme, null, null);
  if (backgroundKey != null) {
    myGetSetBackground = new GetSetColor(backgroundKey, scheme);
  }
  if (foregroundKey != null) {
    myGetSetForeground = new GetSetColor(foregroundKey, scheme);
  }
  initCheckedStatus();
}
项目:intellij-ce-playground    文件:XmlTagTreeHighlightingColors.java   
@NotNull
public static ColorKey[] getColorKeys() {
  final int levelCount = WebEditorOptions.getInstance().getTagTreeHighlightingLevelCount();

  if (ourColorKeys == null || ourColorKeys.length != levelCount) {
    ourColorKeys = new ColorKey[levelCount];

    for (int i = 0; i < ourColorKeys.length; i++) {
      ourColorKeys[i] = ColorKey.createColorKey("HTML_TAG_TREE_LEVEL" + i, DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
    }
  }

  return ourColorKeys;
}
项目:intellij-ce-playground    文件:XmlTagTreeHighlightingUtil.java   
static Color[] getBaseColors() {
  final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
  final Color[] colors = new Color[colorKeys.length];

  final EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();

  for (int i = 0; i < colors.length; i++) {
    colors[i] = colorsScheme.getColor(colorKeys[i]);
  }

  return colors;
}
项目:intellij-ce-playground    文件:HTMLColorsPage.java   
@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;
}
项目:material-theme-jetbrains    文件:MTFileColors.java   
public static Color get(final FileStatus status) {
  final EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();

  final ColorKey colorKey = MTFileColors.fileStatusColorKeyHashMap.get(status);
  if (colorKey != null) {
    return globalScheme.getColor(colorKey);
  }

  return globalScheme.getDefaultForeground();
}
项目:tools-idea    文件:ColorProvider.java   
@Override
public Color getColor() {
  while (!myKeys.isEmpty()) {
    ColorKey key = myKeys.get(myKeys.size() - 1);
    Color result = myScheme.getColor(key);
    if (result == null || result.equals(myScheme.getDefaultForeground())) {
      myKeys.remove(myKeys.size() - 1);
    }
    else {
      return result;
    }
  }
  return myScheme.getDefaultForeground();
}
项目:tools-idea    文件:EditorColorsSchemeImpl.java   
@Override
public Color getColor(ColorKey key) {
  if (myColorsMap.containsKey(key)) {
    return myColorsMap.get(key);
  }
  else {
    return myParentScheme.getColor(key);
  }
}
项目:tools-idea    文件:ColorAndFontOptions.java   
private EditorSettingColorDescription(String name,
                                     String group,
                                     ColorKey backgroundKey,
                                     ColorKey foregroundKey,
                                     String type,
                                     EditorColorsScheme scheme) {
  super(name, group, type, scheme, null, null);
  if (backgroundKey != null) {
    myGetSetBackground = new GetSetColor(backgroundKey, scheme);
  }
  if (foregroundKey != null) {
    myGetSetForeground = new GetSetColor(foregroundKey, scheme);
  }
  initCheckedStatus();
}
项目:tools-idea    文件:XmlTagTreeHighlightingColors.java   
@NotNull
public static ColorKey[] getColorKeys() {
  final int levelCount = WebEditorOptions.getInstance().getTagTreeHighlightingLevelCount();

  if (ourColorKeys == null || ourColorKeys.length != levelCount) {
    ourColorKeys = new ColorKey[levelCount];

    for (int i = 0; i < ourColorKeys.length; i++) {
      ourColorKeys[i] = ColorKey.createColorKey("HTML_TAG_TREE_LEVEL" + i, DEFAULT_COLORS[i % DEFAULT_COLORS.length]);
    }
  }

  return ourColorKeys;
}
项目:tools-idea    文件:XmlTagTreeHighlightingUtil.java   
static Color[] getBaseColors() {
  final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
  final Color[] colors = new Color[colorKeys.length];

  final EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();

  for (int i = 0; i < colors.length; i++) {
    colors[i] = colorsScheme.getColor(colorKeys[i]);
  }

  return colors;
}
项目:tools-idea    文件:HTMLColorsPage.java   
@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;
}
项目:consulo    文件:EditorColorsSchemeImpl.java   
@Nullable
@Override
public Color getColor(ColorKey key) {
  if (myColorsMap.containsKey(key)) {
    return myColorsMap.get(key);
  }
  else {
    return myParentScheme.getColor(key);
  }
}
项目:consulo    文件:ColorProvider.java   
@Override
public Color getColor() {
  while (!myKeys.isEmpty()) {
    ColorKey key = myKeys.get(myKeys.size() - 1);
    Color result = myScheme.getColor(key);
    if (result == null || result.equals(myScheme.getDefaultForeground())) {
      myKeys.remove(myKeys.size() - 1);
    }
    else {
      return result;
    }
  }
  return myScheme.getDefaultForeground();
}
项目:consulo    文件:AnnotationsSettings.java   
@Nonnull
private static List<ColorKey> createColorKeys(int count) {
  List<ColorKey> keys = new ArrayList<>();
  for (int i = 0; i < count; i++) {
    keys.add(ColorKey.createColorKey("VCS_ANNOTATIONS_COLOR_" + (i + 1)));
  }
  return keys;
}
项目:consulo    文件:AnnotationsSettings.java   
@Nonnull
public List<Color> getOrderedColors(@Nullable EditorColorsScheme scheme) {
  if (scheme == null) scheme = EditorColorsManager.getInstance().getGlobalScheme();

  List<Color> anchorColors = new ArrayList<>();
  for (ColorKey key : ANCHOR_COLOR_KEYS) {
    ContainerUtil.addIfNotNull(anchorColors, scheme.getColor(key));
  }

  return ColorGenerator.generateLinearColorSequence(anchorColors, COLORS_BETWEEN_ANCHORS);
}
项目:consulo    文件:ColorAndFontOptions.java   
@Nullable
private static String calcType(@Nullable ColorKey backgroundKey, @Nullable ColorKey foregroundKey) {
  if (foregroundKey != null) {
    return foregroundKey.getExternalName();
  }
  else if (backgroundKey != null) {
    return backgroundKey.getExternalName();
  }
  return null;
}
项目:consulo    文件:ColorAndFontOptions.java   
private static void addEditorSettingDescription(@Nonnull List<EditorSchemeAttributeDescriptor> list,
                                                String name,
                                                String group,
                                                @Nullable ColorKey backgroundKey,
                                                @Nullable ColorKey foregroundKey,
                                                @Nonnull EditorColorsScheme scheme) {
  list.add(new EditorSettingColorDescription(name, group, backgroundKey, foregroundKey, calcType(backgroundKey, foregroundKey), scheme));
}
项目:consulo    文件:ColorAndFontOptions.java   
private EditorSettingColorDescription(String name, String group, ColorKey backgroundKey, ColorKey foregroundKey, String type, EditorColorsScheme scheme) {
  super(name, group, type, scheme, null, null);
  if (backgroundKey != null) {
    myGetSetBackground = new GetSetColor(backgroundKey, scheme);
  }
  if (foregroundKey != null) {
    myGetSetForeground = new GetSetColor(foregroundKey, scheme);
  }
  initCheckedStatus();
}
项目:consulo-xml    文件:XmlTagTreeHighlightingUtil.java   
static Color[] getBaseColors() {
  final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
  final Color[] colors = new Color[colorKeys.length];

  final EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();

  for (int i = 0; i < colors.length; i++) {
    colors[i] = colorsScheme.getColor(colorKeys[i]);
  }

  return colors;
}
项目:consulo-xml    文件:HTMLColorsPage.java   
@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;
}
项目:intellij-ce-playground    文件:DefaultColorsScheme.java   
@Override
public void setColor(ColorKey key, Color color) {
}
项目:intellij-ce-playground    文件:EditorColorsSchemeImpl.java   
@Override
public void setColor(ColorKey key, Color color) {
  if (!Comparing.equal(color, getColor(key))) {
    myColorsMap.put(key, color);
  }
}
项目:intellij-ce-playground    文件:FileStatus.java   
@NotNull
ColorKey getColorKey();
项目:intellij-ce-playground    文件:FileStatusFactory.java   
public synchronized FileStatus createFileStatus(@NonNls @NotNull String id, @NotNull String description, Color color) {
  FileStatusImpl result = new FileStatusImpl(id, ColorKey.createColorKey("FILESTATUS_" + id, color), description);
  myStatuses.add(result);
  return result;
}
项目:intellij-ce-playground    文件:FileStatusFactory.java   
public synchronized FileStatus createOnlyColorForFileStatus(@NonNls @NotNull String id, final Color color) {
  FileStatus result = new FileStatusImpl.OnlyColorFileStatus(id, ColorKey.createColorKey("FILESTATUS_" + id, color), null);
  myStatuses.add(result);
  return result;
}
项目:intellij-ce-playground    文件:FileStatusFactory.java   
public FileStatusImpl(@NotNull String status, @NotNull ColorKey key, String text) {
  myStatus = status;
  myColorKey = key;
  myText = text;
}
项目:intellij-ce-playground    文件:FileStatusFactory.java   
@NotNull
@Override
public ColorKey getColorKey() {
  return myColorKey;
}
项目:intellij-ce-playground    文件:FileStatusFactory.java   
public OnlyColorFileStatus(@NotNull String status, @NotNull ColorKey key, String text) {
  super(status, key, text);
}
项目:intellij-ce-playground    文件:TextAnnotationGutterProvider.java   
@Nullable
ColorKey getColor(int line, Editor editor);
项目:intellij-ce-playground    文件:FileStatusManagerImpl.java   
@NotNull
@Override
public ColorKey getColorKey() {
  throw new AssertionError("Should not be called");
}
项目:intellij-ce-playground    文件:ColorProvider.java   
ColorSchemeBasedHolder(EditorColorsScheme scheme, ColorKey ... keys) {
  myScheme = scheme;
  myKeys.addAll(Arrays.asList(keys));
  Collections.reverse(myKeys); // Reverse collection in order to reduce removal cost
}
项目:intellij-ce-playground    文件:EditorGutterComponentImpl.java   
@Override
public Color getOutlineColor(boolean isActive) {
  ColorKey key = isActive ? EditorColors.SELECTED_TEARLINE_COLOR : EditorColors.TEARLINE_COLOR;
  Color color = myEditor.getColorsScheme().getColor(key);
  return color != null ? color : JBColor.black;
}