Search in sources :

Example 1 with DateTimePicker

use of org.gwtbootstrap3.extras.datetimepicker.client.ui.DateTimePicker in project kie-wb-common by kiegroup.

the class DatePickerFieldRenderer method getDateWidget.

private Widget getDateWidget(String inputId) {
    if (field.getShowTime()) {
        DateTimePicker box = new DateTimePicker();
        box.setId(inputId);
        box.setPlaceholder(field.getPlaceHolder());
        box.setEnabled(!field.getReadOnly());
        box.setAutoClose(true);
        box.setHighlightToday(true);
        box.setShowTodayButton(true);
        handler = readOnly -> box.setEnabled(!readOnly);
        return box;
    }
    DatePicker box = new DatePicker();
    box.setId(inputId);
    box.setPlaceholder(field.getPlaceHolder());
    box.setEnabled(!field.getReadOnly());
    box.setAutoClose(true);
    box.setHighlightToday(true);
    box.setShowTodayButton(true);
    box.setContainer(RootPanel.get());
    handler = readOnly -> box.setEnabled(!readOnly);
    return box;
}
Also used : DateTimePicker(org.gwtbootstrap3.extras.datetimepicker.client.ui.DateTimePicker) DatePicker(org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker)

Example 2 with DateTimePicker

use of org.gwtbootstrap3.extras.datetimepicker.client.ui.DateTimePicker in project kie-wb-common by kiegroup.

the class DateTimePickerPresenterViewImpl method initDatePicker.

public void initDatePicker() {
    DOMUtil.removeAllChildren(container);
    dateTimePicker = new DateTimePicker();
    dateTimePicker.setGWTFormat(DateEditableColumnGenerator.DEFAULT_DATE_AND_TIME_FORMAT_MASK);
    dateTimePicker.setHighlightToday(true);
    dateTimePicker.setShowTodayButton(true);
    dateTimePicker.setAutoClose(true);
    dateTimePicker.addChangeDateHandler(event -> {
        presenter.notifyDateChange(dateTimePicker.getValue());
    });
    dateTimePicker.addHideHandler(hideEvent -> {
        hideEvent.stopPropagation();
        presenter.notifyHide();
    });
    dateTimePicker.getElement().setClassName(DATE_PICKER_CELL_STYLE);
    DOMUtil.appendWidgetToElement(container, dateTimePicker);
}
Also used : DateTimePicker(org.gwtbootstrap3.extras.datetimepicker.client.ui.DateTimePicker)

Aggregations

DateTimePicker (org.gwtbootstrap3.extras.datetimepicker.client.ui.DateTimePicker)2 DatePicker (org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker)1