Package com.intellij.openapi.editor.colors

Examples of com.intellij.openapi.editor.colors.EditorColorsManager


    final Project project = e.getProject();
    final FileEditorManager editorManager =
        FileEditorManager.getInstance(project);
    final HighlightManager highlightManager =
        HighlightManager.getInstance(project);
    final EditorColorsManager editorColorsManager =
        EditorColorsManager.getInstance();
    final Editor editor = editorManager.getSelectedTextEditor();
    final EditorColorsScheme globalScheme =
        editorColorsManager.getGlobalScheme();
    final TextAttributes textattributes =
        globalScheme.getAttributes(
            EditorColors.SEARCH_RESULT_ATTRIBUTES);

    assert editor != null;
View Full Code Here


import java.awt.Color;

public class TextAttributesUtil {
   
    public static SimpleTextAttributes getSimpleTextAttributes(TextAttributesKey textAttributesKey) {
        EditorColorsManager colorManager = EditorColorsManager.getInstance();
        TextAttributes textAttributes = colorManager.getGlobalScheme().getAttributes(textAttributesKey);
        return new SimpleTextAttributes(
                textAttributes.getBackgroundColor(),
                textAttributes.getForegroundColor(),
                textAttributes.getEffectColor(),
                textAttributes.getFontType());
View Full Code Here

                textAttributes.getEffectColor(),
                textAttributes.getFontType());
    }
   
    public static Color getColor(ColorKey colorKey) {
        EditorColorsManager colorManager = EditorColorsManager.getInstance();
        return colorManager.getGlobalScheme().getColor(colorKey);
    }
View Full Code Here

    });
  }

  private static void applyHighlights(Project project, Editor grammarEditor, Set<TextRange> trueRanges, Set<TextRange> falseRanges) {
    if (grammarEditor.isDisposed()) return;
    EditorColorsManager manager = EditorColorsManager.getInstance();
    TextAttributes trueAttrs = manager.getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);
    TextAttributes falseAttrs = manager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES);

    HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
    highlightManager.hideHighlights(grammarEditor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY);
    for (TextRange range : trueRanges) {
      highlightManager.addRangeHighlight(grammarEditor, range.getStartOffset(), range.getEndOffset(), trueAttrs, true, null);
View Full Code Here

      UsageInfo info = infos.get(i);
      PsiElement psiElement = info.getElement();
      if (psiElement == null || !psiElement.isValid()) continue;
      int offsetInFile = psiElement.getTextOffset();

      EditorColorsManager colorManager = EditorColorsManager.getInstance();
      TextAttributes attributes = colorManager.getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);

      TextRange elementRange = psiElement.getTextRange();
      TextRange infoRange = info.getRange();
      TextRange textRange = elementRange.contains(infoRange) ? elementRange.cutOut(infoRange) : elementRange;
      // hack to determine element range to highlight
View Full Code Here

        return returnModel;
    }

    private static Color getHighlighterColor() {
        EditorColorsManager manager = EditorColorsManager.getInstance();
        if (manager != null) {
            EditorColorsScheme globalScheme = manager.getGlobalScheme();

            return globalScheme.getColor(EditorColors.SELECTION_FOREGROUND_COLOR);
        } else {
            return JBColor.getHSBColor(.0f, .37f, .99f);
        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.editor.colors.EditorColorsManager

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.