com.intellij.openapi.options.colors.AttributesDescriptor Java Examples

The following examples show how to use com.intellij.openapi.options.colors.AttributesDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DecorationColorsPage.java    From GitToolBox with Apache License 2.0 6 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return new AttributesDescriptor[] {
    new AttributesDescriptor(ResBundle.message("colors.projectView.remote.branch.decoration.label"),
        DecorationColors.REMOTE_BRANCH_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.master.with.remote.decoration.label"),
        DecorationColors.MASTER_WITH_REMOTE_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.master.local.decoration.label"),
        DecorationColors.MASTER_LOCAL_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.status.decoration.label"),
          DecorationColors.STATUS_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.head.tags.decoration.label"),
          DecorationColors.HEAD_TAGS_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.local.branch.decoration.label"),
        DecorationColors.LOCAL_BRANCH_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.projectView.changes.decoration.label"),
        DecorationColors.CHANGED_COUNT_ATTRIBUTES),
    new AttributesDescriptor(ResBundle.message("colors.editor.inline.blame.label"),
        DecorationColors.EDITOR_INLINE_BLAME_ATTRIBUTES)
  };
}
 
Example #2
Source File: ColorSettingsPagesImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
@Nullable
public Pair<ColorSettingsPage,AttributesDescriptor> getAttributeDescriptor(TextAttributesKey key) {
  if (myKeyToDescriptorMap.containsKey(key)) {
    return myKeyToDescriptorMap.get(key);
  }
  else {
    for (ColorSettingsPage page : getRegisteredPages()) {
      for (AttributesDescriptor descriptor : page.getAttributeDescriptors()) {
        if (descriptor.getKey() == key) {
          Pair<ColorSettingsPage,AttributesDescriptor> result = new Pair<ColorSettingsPage, AttributesDescriptor>(page, descriptor);
          myKeyToDescriptorMap.put(key, result);
          return result;
        }
      }
    }
    myKeyToDescriptorMap.put(key, null);
  }
  return null;
}
 
Example #3
Source File: ColorSettingsUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
private static void addInspectionSeverityAttributes(List<AttributesDescriptor> descriptors) {
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unknown.symbol"), CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.deprecated.symbol"), CodeInsightColors.DEPRECATED_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unused.symbol"), CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.error"), CodeInsightColors.ERRORS_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.warning"), CodeInsightColors.WARNINGS_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.weak.warning"), CodeInsightColors.WEAK_WARNING_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.problems"), CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.duplicate"), CodeInsightColors.DUPLICATE_FROM_SERVER));

  for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
    for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
      final TextAttributesKey attributesKey = highlightInfoType.getAttributesKey();
      descriptors.add(new AttributesDescriptor(toDisplayName(attributesKey), attributesKey));
    }
  }
}
 
Example #4
Source File: LocalSarosAnnotationColorsPage.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return Stream.of(COLOR_ATTRIBUTE_DESCRIPTORS, ADDITIONAL_ATTRIBUTE_DESCRIPTORS)
      .flatMap(Collection::stream)
      .toArray(AttributesDescriptor[]::new);
}
 
Example #5
Source File: DebuggerColorsPage.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@Nonnull
public AttributesDescriptor[] getAttributeDescriptors() {
  return new AttributesDescriptor[] {
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.breakpoint.line"), DebuggerColors.BREAKPOINT_ATTRIBUTES),
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.execution.point"), DebuggerColors.EXECUTIONPOINT_ATTRIBUTES),
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.not.top.frame"), DebuggerColors.NOT_TOP_FRAME_ATTRIBUTES),
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.inlined.values"), DebuggerColors.INLINED_VALUES),
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.inlined.values.modified"), DebuggerColors.INLINED_VALUES_MODIFIED),
          new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.inlined.values.execution.line"), DebuggerColors.INLINED_VALUES_EXECUTION_LINE),
  };
}
 
Example #6
Source File: ColorSettingsUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static Map<TextAttributesKey, String> keyToDisplayTextMap(final ColorSettingsPage page) {
  final List<AttributesDescriptor> attributeDescriptors = getAllAttributeDescriptors(page);
  final Map<TextAttributesKey, String> displayText = new HashMap<TextAttributesKey, String>();
  for (AttributesDescriptor attributeDescriptor : attributeDescriptors) {
    final TextAttributesKey key = attributeDescriptor.getKey();
    displayText.put(key, attributeDescriptor.getDisplayName());
  }
  return displayText;
}
 
Example #7
Source File: ColorSettingsUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static List<AttributesDescriptor> getAllAttributeDescriptors(ColorAndFontDescriptorsProvider provider) {
  List<AttributesDescriptor> result = new ArrayList<AttributesDescriptor>();
  Collections.addAll(result, provider.getAttributeDescriptors());
  if (isInspectionColorsPage(provider)) {
    addInspectionSeverityAttributes(result);
  }
  return result;
}
 
Example #8
Source File: ColorAndFontDescriptionPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void setInheritanceInfo(ColorAndFontDescription description) {
  Pair<ColorSettingsPage, AttributesDescriptor> baseDescriptor = description.getBaseAttributeDescriptor();
  if (baseDescriptor != null && baseDescriptor.second.getDisplayName() != null) {
    String attrName = baseDescriptor.second.getDisplayName();
    String attrLabel = attrName.replaceAll(ColorOptionsTree.NAME_SEPARATOR, FontUtil.rightArrow(UIUtil.getLabelFont()));
    ColorSettingsPage settingsPage = baseDescriptor.first;
    String style = "<div style=\"text-align:right\" vertical-align=\"top\">";
    String tooltipText;
    String labelText;
    if (settingsPage != null) {
      String pageName = settingsPage.getDisplayName();
      tooltipText = "'" + attrLabel + "' from<br>'" + pageName + "' section";
      labelText = style + "'" + attrLabel + "'<br>of <a href=\"" + attrName + "\">" + pageName;
    }
    else {
      tooltipText = attrLabel;
      labelText = style + attrLabel + "<br>&nbsp;";
    }

    myInheritanceLabel.setVisible(true);
    myInheritanceLabel.setText(labelText);
    myInheritanceLabel.setToolTipText(tooltipText);
    myInheritanceLabel.setEnabled(true);
    myInheritAttributesBox.setVisible(true);
    myInheritAttributesBox.setEnabled(true);
    myInheritAttributesBox.setSelected(description.isInherited());
    setEditEnabled(!description.isInherited(), description);
  }
  else {
    myInheritanceLabel.setVisible(false);
    myInheritAttributesBox.setSelected(false);
    myInheritAttributesBox.setVisible(false);
    setEditEnabled(true, description);
  }
}
 
Example #9
Source File: HXMLColorSettingsPage.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return DESCRIPTORS;
}
 
Example #10
Source File: XQueryColorSettingsPage.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
    return DESCRIPTORS;
}
 
Example #11
Source File: LombokConfigColorSettingsPage.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return DESCRIPTORS;
}
 
Example #12
Source File: HighlightBracketPairSettingsPage.java    From HighlightBracketPair with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
    return ATTRIBUTESDESC;
}
 
Example #13
Source File: HaxeColorSettingsPage.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATTRS;
}
 
Example #14
Source File: CSharpColorSettingsPage.java    From consulo-csharp with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public AttributesDescriptor[] getAttributeDescriptors()
{
	return ourDescriptors;
}
 
Example #15
Source File: GLSLColorAndFontsPage.java    From glsl4idea with GNU Lesser General Public License v3.0 4 votes vote down vote up
@NotNull
public AttributesDescriptor[] getAttributeDescriptors() {
    return ATTRIBUTES;
}
 
Example #16
Source File: LatteColorSettingsPage.java    From intellij-latte with MIT License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
	return DESCRIPTORS;
}
 
Example #17
Source File: SpecColorSettingsPage.java    From Intellij-Plugin with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
    return DESCRIPTORS;
}
 
Example #18
Source File: ConceptColorSettingsPage.java    From Intellij-Plugin with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
    return DESCRIPTORS;
}
 
Example #19
Source File: ANTLRv4ColorsPage.java    From intellij-plugin-v4 with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
	return ATTRIBUTES;
}
 
Example #20
Source File: DslColorSettingsPage.java    From dsl-compiler-client with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
	return DESCRIPTORS;
}
 
Example #21
Source File: BuckColorSettingsPage.java    From buck with Apache License 2.0 4 votes vote down vote up
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return DESCRIPTORS;
}
 
Example #22
Source File: ColorAndFontDescription.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
public Pair<ColorSettingsPage,AttributesDescriptor> getBaseAttributeDescriptor() {
  return null;
}
 
Example #23
Source File: DefaultLanguageColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return ArrayUtil.append(ATTRIBUTES_DESCRIPTORS, INLINE_PARAMETER_HINT_DESCRIPTOR);
}
 
Example #24
Source File: CustomColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATTRS;
}
 
Example #25
Source File: GeneralColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATT_DESCRIPTORS;
}
 
Example #26
Source File: ANSIColoredConsoleColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATTRS;
}
 
Example #27
Source File: DustColorSettingsPage.java    From Intellij-Dust with MIT License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
  return DESCRIPTORS;
}
 
Example #28
Source File: CppColorsAndFontsPage.java    From CppTools with Apache License 2.0 4 votes vote down vote up
@NotNull
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATTRS;
}
 
Example #29
Source File: MakefileColorsAndFontsPage.java    From CppTools with Apache License 2.0 4 votes vote down vote up
@NotNull
public AttributesDescriptor[] getAttributeDescriptors() {
  return ATTRS;
}
 
Example #30
Source File: HeaderColorSettingsPage.java    From arma-intellij-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
	return DESCRIPTORS;
}