1 18 19 package org.apache.jmeter.gui.tree; 20 21 import java.awt.Component ; 22 23 import javax.swing.ImageIcon ; 24 import javax.swing.JTree ; 25 import javax.swing.tree.DefaultTreeCellRenderer ; 26 27 31 public class JMeterCellRenderer extends DefaultTreeCellRenderer 32 { 33 public JMeterCellRenderer() 34 { 35 } 36 37 public Component getTreeCellRendererComponent(JTree tree, 38 Object value, 39 boolean sel, 40 boolean expanded, 41 boolean leaf, 42 int row, 43 boolean hasFocus) 44 { 45 super.getTreeCellRendererComponent( 46 tree, 47 ((JMeterTreeNode) value).getName(), 48 sel, 49 expanded, 50 leaf, 51 row, 52 hasFocus); 53 this.setEnabled(((JMeterTreeNode)value).isEnabled()); 54 ImageIcon ic = ((JMeterTreeNode)value).getIcon(); 55 if (ic != null) 56 { 57 setIcon(ic); 58 } 59 return this; 60 } 61 } 62 | Popular Tags |