? property.getSchema().getName()
: property.getSchema().getDisplayName());
item.add(label);
final FieldPanel field;
boolean required = false;
boolean isArray = false;
if (GUARDED_STRING.equalsIgnoreCase(property.getSchema().getType())
|| GUARDED_BYTE_ARRAY.equalsIgnoreCase(property.getSchema().getType())) {
field = new AjaxPasswordFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());
((PasswordTextField) field.getField()).setResetPassword(false);
required = property.getSchema().isRequired();
} else {
Class propertySchemaClass;
try {
propertySchemaClass = ClassUtils.forName(property.getSchema().getType(), ClassUtils
.getDefaultClassLoader());
} catch (Exception e) {
LOG.error("Error parsing attribute type", e);
propertySchemaClass = String.class;
}
if (NUMBER.contains(propertySchemaClass)) {
field = new AjaxNumberFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model(),
ClassUtils.resolvePrimitiveIfNecessary(propertySchemaClass));
required = property.getSchema().isRequired();
} else if (Boolean.class.equals(propertySchemaClass) || boolean.class.equals(propertySchemaClass)) {
field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(), new Model());
} else {
field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());
required = property.getSchema().isRequired();
}
if (String[].class.equals(propertySchemaClass)) {
isArray = true;
}
}
field.setTitle(property.getSchema().getHelpMessage());
if (isArray) {
field.removeRequiredLabel();
if (property.getValues().isEmpty()) {
property.getValues().add(null);
}
item.add(new MultiValueSelectorPanel<String>("panel", new PropertyModel<List<String>>(property,
"values"), field));
} else {
if (required) {
field.addRequiredLabel();
}
field.setNewModel(property.getValues());
item.add(field);
}
final AjaxCheckBoxPanel overridable = new AjaxCheckBoxPanel("connPropAttrOverridable",
"connPropAttrOverridable", new PropertyModel(property, "overridable"));