Search in sources :

Example 1 with PickerPropertyView

use of com.codename1.rad.propertyviews.PickerPropertyView 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

PickerPropertyView (com.codename1.rad.propertyviews.PickerPropertyView)1 Picker (com.codename1.ui.spinner.Picker)1