* creates a single EditorField for the given attribute
*/
public static AbstractField<?> createEditorField(String id, IModel<String> model,
final AttributeDefinition attribute, boolean editable) {
if (attribute.isBoolean()) {
return new CheckboxField(id, model, attribute, new BooleanFieldValidator(attribute));
}
StringFieldValidator validator = new StringFieldValidator(attribute);
if (!attribute.getOptions().isEmpty()) {
return new DropdownField(id, model, attribute, validator);
} else if (attribute.isPassword()) {