if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
Object bean = node.getUserObject();
if (bean != null && !BeanUtils.isSimpleProperty(bean.getClass())) {
if (bean instanceof DescribedElement) {
DescribedElement element = (DescribedElement)bean;
setText(element.getDisplayName());
setToolTipText(element.getCaption());
}
else {
BeanWrapper wrapper = new BeanWrapperImpl(bean);
try {
Object text = propertyName != null ? wrapper.getPropertyValue(propertyName) : wrapper
.getPropertyValue("name");
setText(String.valueOf(text));
}
catch (FatalBeanException e) {
}
}
if (bean instanceof VisualizedElement) {
VisualizedElement element = (VisualizedElement) bean;
setIcon(element.getIcon());
}
else {
if (beanInfo != null) {
Image icon = beanInfo.getIcon(BeanInfo.ICON_COLOR_16x16);
if (icon != null) {