log.debug("No editor for property " + name);
editors[i] = null;
continue;
}
PropertyEditor propertyEditor;
Class<?> editorClass = descriptors[i].getPropertyEditorClass();
if (log.isDebugEnabled()) {
log.debug("Property " + name + " has editor class " + editorClass);
}
if (editorClass != null) {
try {
propertyEditor = (PropertyEditor) editorClass.newInstance();
} catch (InstantiationException e) {
log.error("Can't create property editor.", e);
throw new Error(e.toString());
} catch (IllegalAccessException e) {
log.error("Can't create property editor.", e);
throw new Error(e.toString());
}
} else {
Class<?> c = descriptors[i].getPropertyType();
propertyEditor = PropertyEditorManager.findEditor(c);
}
if (log.isDebugEnabled()) {
log.debug("Property " + name + " has property editor " + propertyEditor);
}
if (propertyEditor == null) {
log.debug("No editor for property " + name);
editors[i] = null;
continue;
}
if (!propertyEditor.supportsCustomEditor()) {
propertyEditor = createWrapperEditor(propertyEditor, descriptors[i]);
if (log.isDebugEnabled()) {
log.debug("Editor for property " + name + " is wrapped in " + propertyEditor);
}
}
if(propertyEditor instanceof TestBeanPropertyEditor)
{
((TestBeanPropertyEditor)propertyEditor).setDescriptor(descriptors[i]);
}
if (propertyEditor.getCustomEditor() instanceof JScrollPane) {
scrollerCount++;
}
editors[i] = propertyEditor;