public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
Component comp = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
if (value instanceof Hook && comp instanceof JLabel) {
JLabel label = (JLabel) comp;
Hook hook = (Hook) value;
if (hook != null) {
label.setText(hook.getName());
}
} else if (value instanceof Script && comp instanceof JLabel) {
JLabel label = (JLabel) comp;
Script script = (Script) value;
if (script != null) {