setText(params.getName());
}
else if (value instanceof DataFactory)
{
final DataFactory dfac = (DataFactory) value;
final DataFactoryMetaData data = dfac.getMetaData();
final Image image = data.getIcon(Locale.getDefault(), BeanInfo.ICON_COLOR_32x32);
if (image != null)
{
setIcon(new ImageIcon(image));
}
final String connectionName = data.getDisplayConnectionName(dfac);
if (connectionName != null)
{
setText(Messages.getString("StructureTreeCellRenderer.NamedDataFactoryMessage",
data.getDisplayName(Locale.getDefault()), connectionName));
}
else
{
setText(data.getDisplayName(Locale.getDefault()));
}
}
else if (value instanceof ParentDataFactoryNode)
{
setText(Messages.getString("StructureTreeCellRenderer.InheritedDataFactories"));
}
else if (value instanceof InheritedDataFactoryWrapper)
{
final InheritedDataFactoryWrapper wrapper = (InheritedDataFactoryWrapper) value;
final DataFactory dfac = wrapper.getDataFactory();
if (DataFactoryRegistry.getInstance().isRegistered(dfac.getClass().getName()) == false)
{
setText(dfac.getClass().getSimpleName());
}
else
{
final DataFactoryMetaData data = dfac.getMetaData();
final Image image = data.getIcon(Locale.getDefault(), BeanInfo.ICON_COLOR_32x32);
if (image != null)
{
setIcon(new ImageIcon(image));
}
final String connectionName = data.getDisplayConnectionName(dfac);
if (connectionName != null)
{
setText(Messages.getString("StructureTreeCellRenderer.NamedDataFactoryMessage",
data.getDisplayName(Locale.getDefault()), connectionName));
}
else
{
setText(data.getDisplayName(Locale.getDefault()));
}
}
}
return this;
}