Set a disabledIcon if available.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@325460 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: b60ba520fe
This commit is contained in:
Sebastian Bazley 2005-06-15 00:08:10 +00:00
parent 793767e6b2
commit 715a0e2ccd
1 changed files with 20 additions and 3 deletions

View File

@ -50,12 +50,29 @@ public class JMeterCellRenderer extends DefaultTreeCellRenderer
leaf, leaf,
row, row,
p_hasFocus); p_hasFocus);
this.setEnabled(((JMeterTreeNode)value).isEnabled()); boolean enabled=((JMeterTreeNode)value).isEnabled();
ImageIcon ic = ((JMeterTreeNode)value).getIcon(); ImageIcon ic = ((JMeterTreeNode)value).getIcon(enabled);
if (ic != null) if (ic != null)
{
if (enabled)
{ {
setIcon(ic); setIcon(ic);
} }
else
{
setDisabledIcon(ic);
}
}
else
{
if (!enabled)// i.e. no disabled icon found
{
// Must therefore set the enabled icon so there is at least some icon
ic = ((JMeterTreeNode)value).getIcon();
if (ic != null) setIcon(ic);
}
}
this.setEnabled(enabled);
return this; return this;
} }
} }