Package com.intellij.openapi.editor.markup

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


      final int textStartOffset = textEndOffset - line.length();
      final int highlightStartOffset = textStartOffset + lparenthIndex + 1;
      final int highlightEndOffset = textStartOffset + rparenthIndex;
      VirtualFile virtualFile = file.getVirtualFile();
      final OpenFileHyperlinkInfo info = new OpenFileHyperlinkInfo(myProject, virtualFile, lineNumber - 1);
      TextAttributes attributes = HYPERLINK_ATTRIBUTES.clone();
      if (!ProjectRootManager.getInstance(myProject).getFileIndex().isInContent(virtualFile)) {
        Color color = UIUtil.getTextInactiveTextColor();
        attributes.setForegroundColor(color);
        attributes.setEffectColor(color);
      }
      return new Result(highlightStartOffset, highlightEndOffset, info, attributes);
    }
    catch(NumberFormatException e){
      return null;
View Full Code Here


        content = "";
        endOffset = m.start(pos-1);
      }

      document.replaceString(startOffset, endOffset, content);
      TextAttributes forcedAttributes = null;
      if (foregroundColor != null) {
        forcedAttributes = new TextAttributes(Color.decode(foregroundColor), Color.decode(backgroundColor),
                                                              Color.decode(effectColor), EffectType.valueOf(effectType),
                                                              Integer.parseInt(fontType));
      }

      TextRange textRange = new TextRange(startOffset, startOffset + content.length());
View Full Code Here

    }
    else{
      effectColor = null;
      effectType = null;
    }
    return new TextAttributes(myFgColor, null,effectColor, effectType, myStyle & FONT_MASK);
  }
View Full Code Here

  private void processIntersectingRange(CharSequence chars,
                                        int hiStart,
                                        int hiEnd,
                                        TextAttributesKey[] tokenHighlights,
                                        List<TextChunk> result) {
    TextAttributes originalAttrs = convertAttributes(tokenHighlights);
    int lastOffset = hiStart;
    for(RangeMarker rangeMarker: myRangeMarkers) {
      int usageStart = rangeMarker.getStartOffset();
      int usageEnd = rangeMarker.getEndOffset();
      if (rangeMarker.isValid() && rangeIntersect(lastOffset, hiEnd, usageStart, usageEnd)) {
View Full Code Here

  }

  private static void addChunk(CharSequence chars, int start, int end, TextAttributes originalAttrs, boolean bold, List<TextChunk> result) {
    if (start >= end) return;
    String rText = chars.subSequence(start, end).toString();
    TextAttributes attrs = bold
                           ? TextAttributes.merge(originalAttrs, new TextAttributes(null, null, null, null, Font.BOLD))
                           : originalAttrs;
    result.add(new TextChunk(attrs, rText));
  }
View Full Code Here

           || s1 < s2 && s2 < e1 || s1 < e2 && e2 < e1
           || s1 == s2 && e1 == e2;
  }

  private TextAttributes convertAttributes(TextAttributesKey[] keys) {
    TextAttributes attrs = myColorsScheme.getAttributes(HighlighterColors.TEXT);

    for (TextAttributesKey key : keys) {
      TextAttributes attrs2 = myColorsScheme.getAttributes(key);
      if (attrs2 != null) {
        attrs = TextAttributes.merge(attrs, attrs2);
      }
    }
View Full Code Here

    }
    UsageInfo2UsageAdapter usageInfo = (UsageInfo2UsageAdapter)usage;

    Editor editor = usageInfo.openTextEditor(true);
    if (editor == null) return;
    TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES);

    RangeBlinker rangeBlinker = new RangeBlinker(editor, attributes, 6);
    rangeBlinker.resetMarkers(usageInfo.getRangeMarkers());
    rangeBlinker.startBlinking();
  }
View Full Code Here

  private int myInsertionIndex = 0;

  public synchronized void customize(SimpleColoredComponent component) {
    for (Iterator iterator = getSectionsIterator(); iterator.hasNext();) {
      TextSection section = (TextSection) iterator.next();
      TextAttributes attributes = section.ATTRIBUTES;
      component.append(section.TEXT, SimpleTextAttributes.fromTextAttributes(attributes));
    }
    component.setIcon(myIcon);
  }
View Full Code Here

                fontStyle = fontStyle | Font.BOLD;
            }
            if (spockConfig.labelItalics) {
                fontStyle = fontStyle | Font.ITALIC;
            }
            textAttributes = new TextAttributes(spockConfig.labelColor, null, null, EffectType.BOXED, fontStyle);
        }
        return textAttributes;
    }
View Full Code Here

    public static void printToConsole(@NotNull final JavaREPLLanguageConsole console,
                                      @NotNull final String string,
                                      @NotNull final ConsoleViewContentType mainType,
                                      @Nullable ConsoleViewContentType additionalType) {
        final TextAttributes mainAttributes = mainType.getAttributes();
        final TextAttributes attributes;
        if (additionalType == null) {
            attributes = mainAttributes;
        } else {
            attributes = additionalType.getAttributes().clone();
            attributes.setBackgroundColor(mainAttributes.getBackgroundColor());
        }

        Application application = ApplicationManager.getApplication();
        if (application.isDispatchThread()) {
            console.printToHistory(string, attributes);
View Full Code Here

TOP

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

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.