01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.common;
05:
06: import org.dijon.DefaultTreeCellRenderer;
07:
08: import java.awt.Component;
09:
10: import javax.swing.JTree;
11:
12: public class XTreeCellRenderer extends DefaultTreeCellRenderer {
13: public Component getTreeCellRendererComponent(JTree tree,
14: Object value, boolean sel, boolean expanded, boolean leaf,
15: int row, boolean focused) {
16: Component comp = super .getTreeCellRendererComponent(tree,
17: value, sel, expanded, leaf, row, focused);
18:
19: if (value instanceof XTreeNode) {
20: setIcon(((XTreeNode) value).getIcon());
21: }
22:
23: return comp;
24: }
25: }
|