當前位置: 首頁>>代碼示例>>Java>>正文


Java JBColor.RED屬性代碼示例

本文整理匯總了Java中com.intellij.ui.JBColor.RED屬性的典型用法代碼示例。如果您正苦於以下問題:Java JBColor.RED屬性的具體用法?Java JBColor.RED怎麽用?Java JBColor.RED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.ui.JBColor的用法示例。


在下文中一共展示了JBColor.RED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSeparatorPanel

@NotNull
private static JComponent createSeparatorPanel(@NotNull LineSeparator separator) {
  JLabel label = new JLabel(separator.name());
  Color color;
  if (separator == LineSeparator.CRLF) {
    color = JBColor.RED;
  }
  else if (separator == LineSeparator.LF) {
    color = JBColor.BLUE;
  }
  else if (separator == LineSeparator.CR) {
    color = JBColor.MAGENTA;
  }
  else {
    color = JBColor.BLACK;
  }
  label.setForeground(color);
  return label;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:DiffUtil.java

示例2: updateImpl

@Override
protected void updateImpl(PresentationData data) {
  StudyStatus status = myTask.getStatus();
  String subtaskInfo = myTask instanceof TaskWithSubtasks ? getSubtaskInfo((TaskWithSubtasks)myTask) : null;
  if (status == StudyStatus.Unchecked) {
    updatePresentation(data, myTask.getName(), JBColor.BLACK, EducationalCoreIcons.Task, subtaskInfo);
    return;
  }
  boolean isSolved = status == StudyStatus.Solved;
  JBColor color = isSolved ? LIGHT_GREEN : JBColor.RED;
  Icon icon = isSolved ? EducationalCoreIcons.TaskCompl : EducationalCoreIcons.TaskProbl;
  updatePresentation(data, myTask.getName(), color, icon, subtaskInfo);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:13,代碼來源:TaskDirectoryNode.java

示例3: getColor

public JBColor getColor(@NotNull final AnswerPlaceholder placeholder) {
  if (!placeholder.getUseLength() && placeholder.isActive() && placeholder.getActiveSubtaskInfo().isNeedInsertText()) {
    return JBColor.LIGHT_GRAY;
  }
  final StudyStatus status = placeholder.getStatus();
  if (status == StudyStatus.Solved) {
    return JBColor.GREEN;
  }
  if (status == StudyStatus.Failed) {
    return JBColor.RED;
  }
  return JBColor.BLUE;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:13,代碼來源:StudyTaskManager.java

示例4: prepareAttributes

private SimpleTextAttributes prepareAttributes(SimpleTextAttributes from) {
    ErrorLevel level = getTotalErrorLevel();
    Color waveColor = level == ErrorLevel.NONE ? null : JBColor.RED;
    int style = from.getStyle();
    if (waveColor != null) style |= SimpleTextAttributes.STYLE_WAVED;
    return new SimpleTextAttributes(from.getBgColor(), from.getFgColor(), waveColor, style);
}
 
開發者ID:seedstack,項目名稱:intellij-plugin,代碼行數:7,代碼來源:SeedStackSimpleNode.java

示例5: errorColor

public static Color errorColor() {
    TextAttributes attribute = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.ERRORS_ATTRIBUTES);
    Color color = JBColor.RED;
    if (attribute != null) {
        if (attribute.getForegroundColor() != null) {
            color = attribute.getForegroundColor();
        } else if (attribute.getEffectColor() != null) {
            color = attribute.getEffectColor();
        } else if (attribute.getErrorStripeColor() != null) {
            color = attribute.getErrorStripeColor();
        }
    }
    return color;
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:14,代碼來源:Utils.java

示例6: prepareAttributes

private SimpleTextAttributes prepareAttributes(SimpleTextAttributes from) {
  ExternalProjectsStructure.ErrorLevel level = getTotalErrorLevel();
  Color waveColor = level == ExternalProjectsStructure.ErrorLevel.NONE ? null : JBColor.RED;
  int style = from.getStyle();
  if (waveColor != null) style |= SimpleTextAttributes.STYLE_WAVED;
  return new SimpleTextAttributes(from.getBgColor(), from.getFgColor(), waveColor, style);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:ExternalSystemNode.java

示例7: appendFileName

@Override
public void appendFileName(final ChangesBrowserNodeRenderer renderer, final VirtualFile vFile, final String fileName, final Color color, final boolean highlightProblems) {
  int style = SimpleTextAttributes.STYLE_PLAIN;
  Color underlineColor = null;
  if (highlightProblems && vFile != null && !vFile.isDirectory() && myProblemSolver.isProblemFile(vFile)) {
    underlineColor = JBColor.RED;
    style = SimpleTextAttributes.STYLE_WAVED;
  }
  renderer.append(fileName, new SimpleTextAttributes(style, color, underlineColor));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:WolfChangesFileNameDecorator.java

示例8: InspectionListCellRenderer

public InspectionListCellRenderer() {
  mySelected = new SimpleTextAttributes(UIUtil.getListSelectionBackground(),
                                        UIUtil.getListSelectionForeground(),
                                        JBColor.RED,
                                        SimpleTextAttributes.STYLE_PLAIN);
  myPlain = new SimpleTextAttributes(UIUtil.getListBackground(),
                                     UIUtil.getListForeground(),
                                     JBColor.RED,
                                     SimpleTextAttributes.STYLE_PLAIN);
  myHighlighted = new SimpleTextAttributes(UIUtil.getListBackground(),
                                           UIUtil.getListForeground(),
                                           null,
                                           SimpleTextAttributes.STYLE_SEARCH_MATCH);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:InspectionListCellRenderer.java

示例9: getPresentation

@NotNull
@Override
public UsagePresentation getPresentation() {
  final UsagePresentation presentation = super.getPresentation();
  return new UsagePresentation() {
    @Override
    @NotNull
    public TextChunk[] getText() {
      return new TextChunk[]{
        new TextChunk(new TextAttributes(JBColor.RED, null, null, EffectType.WAVE_UNDERSCORE, Font.PLAIN), getTooltipText())
      };
    }

    @Override
    @NotNull
    public String getPlainText() {
      return presentation.getPlainText();
    }

    @Override
    public Icon getIcon() {
      return presentation.getIcon();
    }

    @Override
    public String getTooltipText() {
      return "Too complex to analyze, analysis stopped here";
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:SliceTooComplexDFAUsage.java

示例10: getColor

public JBColor getColor(@NotNull final AnswerPlaceholder placeholder) {
  final StudyStatus status = getStatus(placeholder);
  if (status == StudyStatus.Solved) {
    return JBColor.GREEN;
  }
  if (status == StudyStatus.Failed) {
    return JBColor.RED;
  }
  return JBColor.BLUE;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:StudyTaskManager.java

示例11: prepareAttributes

private SimpleTextAttributes prepareAttributes(SimpleTextAttributes from) {
  ErrorLevel level = getTotalErrorLevel();
  Color waveColor = level == ErrorLevel.NONE ? null : JBColor.RED;
  int style = from.getStyle();
  if (waveColor != null) style |= SimpleTextAttributes.STYLE_WAVED;
  return new SimpleTextAttributes(from.getBgColor(), from.getFgColor(), waveColor, style);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:MavenProjectsStructure.java

示例12: customizeCellRenderer

@Override
public void customizeCellRenderer(JTable table, final Object value,
                                  boolean isSelected, boolean hasFocus, final int row, final int column) {

    final int modelColumn = myTable.convertColumnIndexToModel(column);
    final M memberInfo = myTable.myTypesInfos.get(row);
    setToolTipText(myTable.myTypeInfoModel.getTooltipText(memberInfo));
    switch (modelColumn) {
        case DISPLAY_NAME_COLUMN: {
            Icon memberIcon = myTable.getMemberIcon(memberInfo, 0);
            RowIcon icon = new RowIcon(3);
            icon.setIcon(memberIcon, MEMBER_ICON_POSITION);
            setIcon(icon);
            break;
        }
        default: {
            setIcon(null);
        }
    }
    setIconOpaque(false);
    setOpaque(false);
    final boolean cellEditable = myTable.myTypeInfoModel.isTypeEnabled(memberInfo);
    setEnabled(cellEditable);

    if (value == null) return;
    final int problem = myTable.myTypeInfoModel.checkForProblems(memberInfo);
    Color c = null;
    if (problem == MemberInfoModel.ERROR) {
        c = JBColor.RED;
    } else if (problem == MemberInfoModel.WARNING && !isSelected) {
        c = JBColor.BLUE;
    }
    append((String) value, new SimpleTextAttributes(Font.PLAIN, c));
}
 
開發者ID:phajduk,項目名稱:dagger2-intellij-plugin,代碼行數:34,代碼來源:AbstractTypeSelectionTable.java

示例13: normalOrRedWaved

@NotNull
private static CellAppearanceEx normalOrRedWaved(@NotNull final String text, @Nullable final Icon icon, final boolean waved) {
  return waved ? new SimpleTextCellAppearance(text, icon, new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, null, JBColor.RED))
               : SimpleTextCellAppearance.regular(text, icon);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:OrderEntryAppearanceServiceImpl.java

示例14: customizeCellRenderer

@Override
public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  if (value instanceof MasterDetailsComponent.MyNode) {
    final MasterDetailsComponent.MyNode node = (MasterDetailsComponent.MyNode)value;

    final NamedConfigurable namedConfigurable = node.getConfigurable();
    if (namedConfigurable == null) {
      return;
    }

    final String displayName = node.getDisplayName();
    final Icon icon = namedConfigurable.getIcon(expanded);
    setIcon(icon);
    setToolTipText(null);
    setFont(UIUtil.getTreeFont());

    SimpleTextAttributes textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
    if (node.isDisplayInBold()) {
      textAttributes = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
    }
    else if (namedConfigurable instanceof ProjectStructureElementConfigurable) {
      final ProjectStructureElement projectStructureElement =
        ((ProjectStructureElementConfigurable)namedConfigurable).getProjectStructureElement();
      if (projectStructureElement != null) {
        final ProjectStructureDaemonAnalyzer daemonAnalyzer = myContext.getDaemonAnalyzer();
        final ProjectStructureProblemsHolderImpl problemsHolder = daemonAnalyzer.getProblemsHolder(projectStructureElement);
        if (problemsHolder != null && problemsHolder.containsProblems()) {
          final boolean isUnused = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.UNUSED);
          final boolean haveWarnings = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.WARNING);
          final boolean haveErrors = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.ERROR);
          Color foreground = isUnused ? UIUtil.getInactiveTextColor() : null;
          final int style = haveWarnings || haveErrors ? SimpleTextAttributes.STYLE_WAVED : -1;
          final Color waveColor = haveErrors ? JBColor.RED : haveWarnings ? JBColor.GRAY : null;
          textAttributes = textAttributes.derive(style, foreground, null, waveColor);
          setToolTipText(problemsHolder.composeTooltipMessage());
        }

        append(displayName, textAttributes);
        String description = projectStructureElement.getDescription();
        if (description != null) {
          append(" (" + description + ")", SimpleTextAttributes.GRAY_ATTRIBUTES, false);
        }
        return;
      }
    }
    append(displayName, textAttributes);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:48,代碼來源:ProjectStructureElementRenderer.java

示例15: getForegroundColor

protected static Color getForegroundColor(boolean isValid) {
  return isValid ? UIUtil.getListForeground() : JBColor.RED;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:LibraryTableTreeContentElement.java


注:本文中的com.intellij.ui.JBColor.RED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。