当前位置: 首页>>代码示例>>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;未经允许,请勿转载。