{
JLabel label = ( JLabel )super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus );
if( value instanceof ModelItem )
{
ModelItem item = ( ModelItem )value;
TreePath treePath = SoapUI.getNavigator().getTreePath( item );
if( treePath == null )
{
if( !( item instanceof EmptyModelItem ) )
{
// listModel.setElementAt( new EmptyModelItem( "<removed>",
// item.getIcon()), index );
}
label.setText( "<removed>" );
label.setToolTipText( null );
}
else
{
String str = item.getName() + " [";
for( int c = 1; c < treePath.getPathCount(); c++ )
{
SoapUITreeNode comp = ( SoapUITreeNode )treePath.getPathComponent( c );
if( comp.getModelItem() instanceof EmptyModelItem )
continue;
if( c > 1 )
str += " - ";
str += comp.toString();
}
str += "]";
label.setText( str );
label.setToolTipText( item.getDescription() );
}
label.setIcon( item.getIcon() );
label.setBorder( BorderFactory.createEmptyBorder( 2, 2, 2, 2 ) );
}
return label;
}