Search in sources :

Example 6 with Attribute

use of com.codename1.rad.models.Attribute in project CodeRAD by shannah.

the class UI method textField.

public static FieldNode textField(Attribute... atts) {
    FieldNode fieldNode = new FieldNode(atts);
    fieldNode.setAttributes(TEXT);
    return fieldNode;
}
Also used : FieldNode(com.codename1.rad.nodes.FieldNode)

Example 7 with Attribute

use of com.codename1.rad.models.Attribute in project CodeRAD by shannah.

the class UI method checkboxList.

public static FieldNode checkboxList(Attribute... atts) {
    FieldNode fieldNode = new FieldNode(atts);
    fieldNode.setAttributes(CHECKBOX_LIST);
    return fieldNode;
}
Also used : FieldNode(com.codename1.rad.nodes.FieldNode)

Example 8 with Attribute

use of com.codename1.rad.models.Attribute in project CodeRAD by shannah.

the class TablePropertyView method update.

@Override
public void update() {
    super.update();
    EntityListTableModel model = (EntityListTableModel) getComponent().getModel();
    EntityList list = model.getEntityList();
    EntityList ePropertyVal = getPropertyAsEntityList();
    if (ePropertyVal == list) {
        return;
    }
    TableColumns columns = (TableColumns) getField().findAttribute(TableColumns.class);
    if (columns == null) {
        throw new IllegalStateException("Cannot create TablePropertyView for field " + getField() + " because the field does not define any columns.  Add a ColumnsNode attribute to the field.");
    }
    EntityListTableModel newModel = new EntityListTableModel(list.getRowType(), ePropertyVal, columns);
    getComponent().setModel(newModel);
}
Also used : TableColumns(com.codename1.rad.nodes.TableColumns) EntityList(com.codename1.rad.models.EntityList) EntityListTableModel(com.codename1.rad.ui.table.EntityListTableModel)

Example 9 with Attribute

use of com.codename1.rad.models.Attribute in project CodeRAD by shannah.

the class SectionNode method setAttributes.

public void setAttributes(Attribute... atts) {
    if (fields == null) {
        fields = new Fields();
    }
    for (Attribute att : atts) {
        if (att.getClass() == FieldNode.class) {
            att = ((FieldNode) att).createProxy(this);
            fields.add((FieldNode) att);
        // ((FieldNode)att).setParent(this);
        } else {
            super.setAttributes(att);
        }
    }
}
Also used : Attribute(com.codename1.rad.models.Attribute)

Example 10 with Attribute

use of com.codename1.rad.models.Attribute in project CodeRAD by shannah.

the class Controller method extendAction.

/**
 * Extends an action from a parent controller, and registers it as an action on this controller.
 * @param category The category to register the action to.
 * @param callback Callback which is executed immediately on the action, which is used to configure
 *                 the action.
 * @return The action node that was added/extended.
 * @see #extendAction(ActionNode.Category, boolean, Attribute[])
 */
public ActionNode extendAction(ActionNode.Category category, SuccessCallback<ActionNode> callback) {
    ActionNode extendedAction = extendAction(category, false);
    callback.onSucess(extendedAction);
    return extendedAction;
}
Also used : ActionNode(com.codename1.rad.nodes.ActionNode)

Aggregations

FieldNode (com.codename1.rad.nodes.FieldNode)14 PropertySelectorAttribute (com.codename1.rad.attributes.PropertySelectorAttribute)6 Attribute (com.codename1.rad.models.Attribute)6 NodeDecoratorAttribute (com.codename1.rad.attributes.NodeDecoratorAttribute)4 ViewPropertyParameterAttribute (com.codename1.rad.attributes.ViewPropertyParameterAttribute)4 Label (com.codename1.ui.Label)3 BorderLayout (com.codename1.ui.layouts.BorderLayout)3 ActionNode (com.codename1.rad.nodes.ActionNode)2 Container (com.codename1.ui.Container)2 Hashtable (java.util.Hashtable)2 Switch (com.codename1.components.Switch)1 CharArrayReader (com.codename1.io.CharArrayReader)1 Log (com.codename1.io.Log)1 NetworkEvent (com.codename1.io.NetworkEvent)1 DateFormat (com.codename1.l10n.DateFormat)1 RAD (com.codename1.rad.annotations.RAD)1 RADDoc (com.codename1.rad.annotations.RADDoc)1 ActionStyleAttribute (com.codename1.rad.attributes.ActionStyleAttribute)1 PropertyImageRendererAttribute (com.codename1.rad.attributes.PropertyImageRendererAttribute)1 Entity (com.codename1.rad.models.Entity)1