use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerPage method createTimePickerFromRenderer.
private void createTimePickerFromRenderer() {
ComponentRenderer<TimePicker, TimePickerPage> renderer = new ComponentRenderer<>(() -> {
TimePicker timePicker = new TimePicker();
timePicker.setValue(LocalTime.now());
return timePicker;
});
renderer.render(getElement(), null);
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerPage method createDefaultTimePicker.
private void createDefaultTimePicker() {
Div message = createMessageDiv("simple-picker-message");
TimePicker timePicker = new TimePicker();
timePicker.setId("simple-picker");
timePicker.setLabel("Default TimePicker");
timePicker.addValueChangeListener(event -> updateMessage(message, timePicker));
add(timePicker, message);
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerPage method createHelperText.
private void createHelperText() {
TimePicker timePickerHelperText = new TimePicker();
timePickerHelperText.setId("time-picker-helper-text");
timePickerHelperText.setHelperText("Helper text");
NativeButton clearHelper = new NativeButton("Clear helper text", e -> {
timePickerHelperText.setHelperText(null);
});
clearHelper.setId("button-clear-helper-text");
add(timePickerHelperText, clearHelper);
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerPage method createTimePickerWithMinAndMaxSetting.
private void createTimePickerWithMinAndMaxSetting() {
Div message = createMessageDiv("time-picker-min-max-message");
TimePicker timePicker = new TimePicker();
timePicker.setLabel("TimePicker Min & Max");
timePicker.setMin(LocalTime.of(5, 0));
timePicker.setMax(LocalTime.of(18, 0));
timePicker.addValueChangeListener(event -> updateMessage(message, timePicker));
timePicker.setId("time-picker-min-max");
add(timePicker, message);
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerPage method createDisabledTimePicker.
private void createDisabledTimePicker() {
Div message = createMessageDiv("disabled-picker-message");
TimePicker timePicker = new TimePicker();
timePicker.setEnabled(false);
timePicker.setLabel("Disabled TimePicker");
timePicker.addValueChangeListener(event -> message.setText("This event should not have happened"));
timePicker.setId("disabled-picker");
add(timePicker, message);
}
Aggregations