new JLabel("<html><body><b>" + value + "</b></body></html>", SwingConstants.CENTER));
}
return panel;
}
SimpleColoredComponent textChunks = new SimpleColoredComponent();
textChunks.setIpad(new Insets(0, 0, 0, 0));
textChunks.setBorder(null);
if (column == 0) {
GroupNode parent = (GroupNode) usageNode.getParent();
appendGroupText(parent, panel, fileBgColor);
if (usage == ShowUsagesAction.MORE_USAGES_SEPARATOR) {
textChunks.append("...<");
textChunks.append("more usages", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
textChunks.append(">...");
}
} else if (usage != ShowUsagesAction.MORE_USAGES_SEPARATOR) {
UsagePresentation presentation = usage.getPresentation();
TextChunk[] text = presentation.getText();
if (column == 1) {
final Icon icon = presentation.getIcon();
textChunks.setIcon(icon == null ? EmptyIcon.ICON_16 : icon);
if (text.length != 0) {
SimpleTextAttributes attributes =
isSelected ? new SimpleTextAttributes(bg, fg, fg, SimpleTextAttributes.STYLE_ITALIC)
: deriveAttributesWithColor(text[0].getSimpleAttributesIgnoreBackground(),
fileBgColor);
textChunks.append(text[0].getText(), attributes);
}
} else if (column == 2) {
for (int i = 1; i < text.length; i++) {
TextChunk textChunk = text[i];
final SimpleTextAttributes attrs = textChunk.getSimpleAttributesIgnoreBackground();
SimpleTextAttributes attributes =
isSelected ? new SimpleTextAttributes(bg, fg, fg, attrs.getStyle())
: deriveAttributesWithColor(attrs, fileBgColor);
textChunks.append(textChunk.getText(), attributes);
}
} else {
assert false : column;
}
}