Java 类com.intellij.ui.JBDefaultTreeCellRenderer 实例源码

项目:jfrog-idea-plugin    文件:IssuesTreeCellRenderer.java   
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    DefaultTreeCellRenderer cellRenderer = (JBDefaultTreeCellRenderer) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
    tree.putClientProperty(TREE_TABLE_TREE_KEY, new JBTable()); // Avoid setting TreeUnfocusedSelectionBackground

    // Set icon
    Issue topIssue = ((ScanTreeNode) value).getTopIssue();
    cellRenderer.setIcon(IconUtils.load(StringUtils.lowerCase(topIssue.getSeverity().toString())));

    return cellRenderer;
}