Package com.intellij.openapi.editor.markup

Examples of com.intellij.openapi.editor.markup.TextAttributes


      IElementType type = ((LeafPsiElement) psiElement).getElementType();
      if (type == ClojureElementTypes.LEFT_PAREN || type == ClojureElementTypes.RIGHT_PAREN) {
        int level = getLevel(psiElement);
        if (level >= 0) {
          final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
          TextAttributes attrs = ClojureBraceAttributes.getBraceAttributes(level, scheme.getDefaultBackground());
          annotationHolder.createInfoAnnotation(psiElement, null).setEnforcedTextAttributes(attrs);
        }
      }
    }
  }
View Full Code Here


      };

  public static TextAttributes getBraceAttributes(int level, Color background) {
    Color braceColor = CLOJURE_BRACE_COLORS[level % CLOJURE_BRACE_COLORS.length];
    Color adjustedBraceColor = new Color(braceColor.getRGB() ^ background.getRGB() ^ 0xFFFFFF);
    return new TextAttributes(adjustedBraceColor, null, null, null, 1);
  }
View Full Code Here

    public static RangeHighlighter highlightRangeComment(Comment.Range range, Editor editor, Project project) {
        CharSequence charsSequence = editor.getMarkupModel().getDocument().getCharsSequence();

        RangeUtils.Offset offset = RangeUtils.rangeToTextOffset(charsSequence, range);

        TextAttributes attributes = new TextAttributes();
        attributes.setBackgroundColor(JBColor.YELLOW);
        ArrayList<RangeHighlighter> highlighters = Lists.newArrayList();
        HighlightManager highlightManager = HighlightManager.getInstance(project);
        highlightManager.addRangeHighlight(editor, offset.start, offset.end, attributes, false, highlighters);
        return highlighters.get(0);
    }
View Full Code Here

      if (userObject instanceof AbstractTreeNode) {
        simpleTextAttributes = getSimpleTextAttributes(((AbstractTreeNode)userObject).getPresentation());
      }
    }
    if (color != null) {
      final TextAttributes textAttributes = simpleTextAttributes.toTextAttributes();
      textAttributes.setForegroundColor(color);
      simpleTextAttributes = SimpleTextAttributes.fromTextAttributes(textAttributes);
    }
    return simpleTextAttributes;
  }
View Full Code Here

  }

  public static SimpleTextAttributes getSimpleTextAttributes(final ItemPresentation presentation) {
    final TextAttributesKey textAttributesKey = presentation.getTextAttributesKey();
    if (textAttributesKey == null) return SimpleTextAttributes.REGULAR_ATTRIBUTES;
    final TextAttributes textAttributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(textAttributesKey);
    return textAttributes == null ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.fromTextAttributes(textAttributes);
  }
View Full Code Here

  }

  private void prepareText(String text, final Color textForegroundColor, final Color textBackgroundColor, final Color textEffectColor) {
    setFont(UIUtil.getLabelFont());
    myHighlightedText = new HighlightedText();
    myHighlightedText.appendText(text, new TextAttributes(
      textForegroundColor, textBackgroundColor, textEffectColor, EffectType.LINE_UNDERSCORE, Font.PLAIN
    ));
    myHighlightedText.applyToComponent(this);
    adjustSize();
  }
View Full Code Here

  public void setIcon(Icon icon) {
    myIcon = icon;
  }

  public static TodoAttributes createDefault() {
    TextAttributes textAttributes = createDefaultTextAttributes();
    return new TodoAttributes(DEFAULT_ICON, textAttributes);
  }
View Full Code Here

    TextAttributes textAttributes = createDefaultTextAttributes();
    return new TodoAttributes(DEFAULT_ICON, textAttributes);
  }

  private static TextAttributes createDefaultTextAttributes() {
    TextAttributes textAttributes = new TextAttributes(Color.blue, null,null,null,Font.BOLD | Font.ITALIC);
    textAttributes.setErrorStripeColor(Color.blue);
    return textAttributes;
  }
View Full Code Here

    return result;
  }

  public TodoAttributes clone() {
    try {
      TextAttributes textAttributes = myTextAttributes.clone();
      TodoAttributes attributes = (TodoAttributes)super.clone();
      attributes.myTextAttributes = textAttributes;
      return attributes;
    }
    catch (CloneNotSupportedException e) {
View Full Code Here

        }
    }

    private static void addRenderers(@Nonnull VulnerabilityMarker marker, @Nonnull MarkupModel documentMarkupModel) {

        TextAttributes attributes = new TextAttributes();

        Color color = getHighlighterColor();

        attributes.setBackgroundColor(color);

        int markerLineNumber = getLineNumber(marker);

        RangeHighlighter newHighlighter = documentMarkupModel.addLineHighlighter(markerLineNumber, 500, attributes);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.editor.markup.TextAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.