Search in sources :

Example 1 with PropertyViewDecoratorNode

use of com.codename1.rad.nodes.PropertyViewDecoratorNode in project CodeRAD by shannah.

the class DefaultPropertyViewFactory method createPropertyView.

@Override
public PropertyView createPropertyView(Entity entity, FieldNode field) {
    PropertyViewFactory typeFactory = registry.get(field.getWidgetType(entity.getEntity().getEntityType()));
    if (typeFactory == null) {
        throw new IllegalArgumentException("Type " + field.getWidgetType() + " not supported");
    }
    PropertyView out = typeFactory.createPropertyView(entity, field);
    PropertyViewDecoratorAttribute decoratorAtt = (PropertyViewDecoratorAttribute) field.findAttribute(PropertyViewDecoratorAttribute.class);
    if (decoratorAtt != null) {
        out = decoratorAtt.getValue().decorate(out);
    }
    NodeList decorators = field.getChildNodes(PropertyViewDecoratorNode.class);
    if (decorators != null) {
        for (Node n : decorators) {
            out = ((PropertyViewDecoratorNode) n).getValue().decorate(out);
        }
    }
    return out;
}
Also used : PropertyViewDecoratorAttribute(com.codename1.rad.attributes.PropertyViewDecoratorAttribute) PropertyViewFactoryNode(com.codename1.rad.nodes.PropertyViewFactoryNode) Node(com.codename1.rad.nodes.Node) PropertyViewDecoratorNode(com.codename1.rad.nodes.PropertyViewDecoratorNode) FieldNode(com.codename1.rad.nodes.FieldNode) OptionsNode(com.codename1.rad.nodes.OptionsNode) PropertyViewDecoratorNode(com.codename1.rad.nodes.PropertyViewDecoratorNode) LabelPropertyView(com.codename1.rad.propertyviews.LabelPropertyView) TextFieldPropertyView(com.codename1.rad.propertyviews.TextFieldPropertyView) TablePropertyView(com.codename1.rad.propertyviews.TablePropertyView) ButtonListPropertyView(com.codename1.rad.propertyviews.ButtonListPropertyView) CheckBoxPropertyView(com.codename1.rad.propertyviews.CheckBoxPropertyView) ComboBoxPropertyView(com.codename1.rad.propertyviews.ComboBoxPropertyView) SwitchPropertyView(com.codename1.rad.propertyviews.SwitchPropertyView) TextAreaPropertyView(com.codename1.rad.propertyviews.TextAreaPropertyView)

Aggregations

PropertyViewDecoratorAttribute (com.codename1.rad.attributes.PropertyViewDecoratorAttribute)1 FieldNode (com.codename1.rad.nodes.FieldNode)1 Node (com.codename1.rad.nodes.Node)1 OptionsNode (com.codename1.rad.nodes.OptionsNode)1 PropertyViewDecoratorNode (com.codename1.rad.nodes.PropertyViewDecoratorNode)1 PropertyViewFactoryNode (com.codename1.rad.nodes.PropertyViewFactoryNode)1 ButtonListPropertyView (com.codename1.rad.propertyviews.ButtonListPropertyView)1 CheckBoxPropertyView (com.codename1.rad.propertyviews.CheckBoxPropertyView)1 ComboBoxPropertyView (com.codename1.rad.propertyviews.ComboBoxPropertyView)1 LabelPropertyView (com.codename1.rad.propertyviews.LabelPropertyView)1 SwitchPropertyView (com.codename1.rad.propertyviews.SwitchPropertyView)1 TablePropertyView (com.codename1.rad.propertyviews.TablePropertyView)1 TextAreaPropertyView (com.codename1.rad.propertyviews.TextAreaPropertyView)1 TextFieldPropertyView (com.codename1.rad.propertyviews.TextFieldPropertyView)1