本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
示例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";
}
};
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
}
示例15: getForegroundColor
protected static Color getForegroundColor(boolean isValid) {
return isValid ? UIUtil.getListForeground() : JBColor.RED;
}