}
@Override
public Component getTableCellRendererComponent(JTable list, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
UsageNode usageNode = value instanceof UsageNode ? (UsageNode) value : null;
Usage usage = usageNode == null ? null : usageNode.getUsage();
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
Color fileBgColor = getBackgroundColor(isSelected, usage);
final Color bg = UIUtil.getListSelectionBackground();
final Color fg = UIUtil.getListSelectionForeground();
panel.setBackground(isSelected ? bg : fileBgColor == null ? list.getBackground() : fileBgColor);
panel.setForeground(isSelected ? fg : list.getForeground());
if (usage == null || usageNode instanceof ShowUsagesAction.StringNode) {
panel.setLayout(new BorderLayout());
if (column == 0) {
panel.add(
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(">...");