Java Code Examples for com.intellij.ui.JBColor#GREEN

The following examples show how to use com.intellij.ui.JBColor#GREEN . 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: LineParser.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static Object toStyle(String str) {
  switch (str) {
    case "1":
      return SimpleTextAttributes.STYLE_BOLD;
    case "3":
      return SimpleTextAttributes.STYLE_ITALIC;
    case "4":
      return SimpleTextAttributes.STYLE_UNDERLINE;
    case "9":
      return SimpleTextAttributes.STYLE_STRIKEOUT;
    case "30":
      return JBColor.BLACK;
    case "31":
      return JBColor.RED;
    case "32":
      return JBColor.GREEN;
    case "33":
      return JBColor.YELLOW;
    case "34":
      return JBColor.BLUE;
    case "35":
      return JBColor.MAGENTA;
    case "36":
      return JBColor.CYAN;
    case "37":
      return JBColor.WHITE;
    case "38":
      return JBColor.GRAY;
    default:
      return null;
  }
}
 
Example 2
Source File: LineParser.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static Object toStyle(String str) {
  switch (str) {
    case "1":
      return SimpleTextAttributes.STYLE_BOLD;
    case "3":
      return SimpleTextAttributes.STYLE_ITALIC;
    case "4":
      return SimpleTextAttributes.STYLE_UNDERLINE;
    case "9":
      return SimpleTextAttributes.STYLE_STRIKEOUT;
    case "30":
      return JBColor.BLACK;
    case "31":
      return JBColor.RED;
    case "32":
      return JBColor.GREEN;
    case "33":
      return JBColor.YELLOW;
    case "34":
      return JBColor.BLUE;
    case "35":
      return JBColor.MAGENTA;
    case "36":
      return JBColor.CYAN;
    case "37":
      return JBColor.WHITE;
    case "38":
      return JBColor.GRAY;
    default:
      return null;
  }
}
 
Example 3
Source File: EditorDocOps.java    From KodeBeagle with Apache License 2.0 5 votes vote down vote up
public final void addHighlighting(final List<Integer> linesForHighlighting,
                                  final Document document) {
    TextAttributes attributes = new TextAttributes();
    JBColor color = JBColor.GREEN;
    attributes.setEffectColor(color);
    attributes.setEffectType(EffectType.SEARCH_MATCH);
    attributes.setBackgroundColor(HIGHLIGHTING_COLOR);
    Editor projectEditor =
            FileEditorManager.getInstance(windowObjects.getProject()).getSelectedTextEditor();
    if (projectEditor != null) {
        PsiFile psiFile =
                PsiDocumentManager.getInstance(windowObjects.getProject()).
                        getPsiFile(projectEditor.getDocument());
        MarkupModel markupModel = projectEditor.getMarkupModel();
        if (markupModel != null) {
            markupModel.removeAllHighlighters();

            for (int line : linesForHighlighting) {
                line = line - 1;
                if (line < document.getLineCount()) {
                    int startOffset = document.getLineStartOffset(line);
                    int endOffset = document.getLineEndOffset(line);
                    String lineText =
                            document.getCharsSequence().
                                    subSequence(startOffset, endOffset).toString();
                    int lineStartOffset =
                            startOffset + lineText.length() - lineText.trim().length();
                    markupModel.addRangeHighlighter(lineStartOffset, endOffset,
                            HighlighterLayer.ERROR, attributes,
                            HighlighterTargetArea.EXACT_RANGE);
                    if (psiFile != null && psiFile.findElementAt(lineStartOffset) != null) {
                        HighlightUsagesHandler.doHighlightElements(projectEditor,
                                new PsiElement[]{psiFile.findElementAt(lineStartOffset)},
                                attributes, false);
                    }
                }
            }
        }
    }
}
 
Example 4
Source File: TestVisualization.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 4 votes vote down vote up
private static LookAndFeelService mockLook() {
    return new LookAndFeelService() {
        @Override
        public Color getBackgroundColor() {
            return JBColor.BLACK;
        }

        @Override
        public Color getBorderColor() {
            return JBColor.RED;
        }

        @Override
        public Color getNodeStrokeColor() {
            return JBColor.GREEN;
        }

        @Override
        public Color getNodeStrokeHoverColor() {
            return JBColor.ORANGE;
        }

        @Override
        public Color getNodeFillColor() {
            return JBColor.CYAN;
        }

        @Override
        public Color getNodeFillHoverColor() {
            return JBColor.DARK_GRAY;
        }

        @Override
        public Color getEdgeStrokeColor() {
            return JBColor.LIGHT_GRAY;
        }

        @Override
        public Color getEdgeFillColor() {
            return JBColor.MAGENTA;
        }

        @Override
        public Color getTextColor() {
            return JBColor.WHITE;
        }

        @Override
        public boolean isGraphViewZoomInverted() {
            return true;
        }
    };
}
 
Example 5
Source File: EventLogConsole.java    From consulo with Apache License 2.0 4 votes vote down vote up
private void highlightNotification(final Notification notification,
                                   String message,
                                   final int startLine,
                                   final int endLine,
                                   int titleOffset,
                                   int titleLength) {

  final MarkupModel markupModel = getConsoleEditor().getMarkupModel();
  TextAttributes bold = new TextAttributes(null, null, null, null, Font.BOLD);
  final RangeHighlighter colorHighlighter =
          markupModel.addRangeHighlighter(titleOffset, titleOffset + titleLength, HighlighterLayer.CARET_ROW + 1, bold, HighlighterTargetArea.EXACT_RANGE);
  Color color = notification.getType() == NotificationType.ERROR
                ? JBColor.RED
                : notification.getType() == NotificationType.WARNING ? JBColor.YELLOW : JBColor.GREEN;
  colorHighlighter.setErrorStripeMarkColor(color);
  colorHighlighter.setErrorStripeTooltip(message);

  final Runnable removeHandler = new Runnable() {
    @Override
    public void run() {
      if (colorHighlighter.isValid()) {
        markupModel.removeHighlighter(colorHighlighter);
      }

      TextAttributes italic = new TextAttributes(null, null, null, null, Font.ITALIC);
      for (int line = startLine; line < endLine; line++) {
        for (RangeHighlighter highlighter : myHyperlinkSupport.getValue().findAllHyperlinksOnLine(line)) {
          markupModel.addRangeHighlighter(highlighter.getStartOffset(), highlighter.getEndOffset(), HighlighterLayer.CARET_ROW + 2, italic,
                                          HighlighterTargetArea.EXACT_RANGE);
          myHyperlinkSupport.getValue().removeHyperlink(highlighter);
        }
      }
    }
  };
  if (!notification.isExpired()) {
    myProjectModel.removeHandlers.put(notification, removeHandler);
  }
  else {
    removeHandler.run();
  }
}