Search in sources :

Example 26 with FieldNode

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

the class UI method comboBox.

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

Example 27 with FieldNode

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

the class UI method radioList.

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

Example 28 with FieldNode

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

the class EntityListTableModel method rebuildColMap.

private void rebuildColMap() {
    colMap.clear();
    int len = columns.getColumnCount();
    for (int i = 0; i < len; i++) {
        FieldNode def = columns.getColumn(i);
        Property p = def.getProperty(entityType);
        if (p != null) {
            colMap.put(p, i);
        }
    }
}
Also used : FieldNode(com.codename1.rad.nodes.FieldNode) Property(com.codename1.rad.models.Property)

Example 29 with FieldNode

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

the class EntityListTableCellRenderer method getTableCellRendererComponent.

@Override
public Component getTableCellRendererComponent(Table table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    EntityListTableModel model = (EntityListTableModel) table.getModel();
    FieldNode field = model.getColumnField(column);
    FieldNode fieldCopy = field.copy();
    fieldCopy.setAttributes(new Editable(false));
    Entity entity = model.getEntity(row);
    if (entity == null) {
        if (parent != null) {
            return parent.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        } else {
            return new com.codename1.ui.Label();
        }
    }
    return viewFactory.createPropertyView(entity, fieldCopy);
}
Also used : Entity(com.codename1.rad.models.Entity) FieldNode(com.codename1.rad.nodes.FieldNode) Editable(com.codename1.rad.models.Property.Editable)

Example 30 with FieldNode

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

the class PickerPropertyViewBuilder method build.

@Override
public PickerPropertyView build() {
    if (fieldNode == null) {
        throw new IllegalStateException("PickerPropertyView requires tag to be set");
    }
    Picker picker = this.picker == null ? new Picker() : this.picker;
    String t = getTagName();
    if ("raddatePicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_DATE);
    } else if ("raddateTimePicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_DATE_AND_TIME);
    } else if ("radtimePicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_TIME);
    } else if ("radcalendarPicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_CALENDAR);
    } else if ("raddurationPicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_DURATION);
    } else if ("raddurationHoursPicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_DURATION_HOURS);
    } else if ("raddurationMinutesPicker".equalsIgnoreCase(t)) {
        picker.setType(Display.PICKER_TYPE_DURATION_MINUTES);
    }
    return new PickerPropertyView(picker, getEntity(), fieldNode);
}
Also used : Picker(com.codename1.ui.spinner.Picker) PickerPropertyView(com.codename1.rad.propertyviews.PickerPropertyView)

Aggregations

FieldNode (com.codename1.rad.nodes.FieldNode)25 Attribute (com.codename1.rad.models.Attribute)3 Entity (com.codename1.rad.models.Entity)3 LabelPropertyView (com.codename1.rad.propertyviews.LabelPropertyView)2 SpanLabelPropertyView (com.codename1.rad.propertyviews.SpanLabelPropertyView)2 TextAreaPropertyView (com.codename1.rad.propertyviews.TextAreaPropertyView)2 TextFieldPropertyView (com.codename1.rad.propertyviews.TextFieldPropertyView)2 SpanLabel (com.codename1.components.SpanLabel)1 Columns (com.codename1.rad.attributes.Columns)1 PropertyImageRendererAttribute (com.codename1.rad.attributes.PropertyImageRendererAttribute)1 PropertySelectorAttribute (com.codename1.rad.attributes.PropertySelectorAttribute)1 PropertyViewDecoratorAttribute (com.codename1.rad.attributes.PropertyViewDecoratorAttribute)1 Property (com.codename1.rad.models.Property)1 Editable (com.codename1.rad.models.Property.Editable)1 Node (com.codename1.rad.nodes.Node)1 OptionsNode (com.codename1.rad.nodes.OptionsNode)1 PropertyNode (com.codename1.rad.nodes.PropertyNode)1 PropertyViewDecoratorNode (com.codename1.rad.nodes.PropertyViewDecoratorNode)1 PropertyViewFactoryNode (com.codename1.rad.nodes.PropertyViewFactoryNode)1 ButtonListPropertyView (com.codename1.rad.propertyviews.ButtonListPropertyView)1