use of com.vaadin.flow.component.timepicker.TimePicker in project karnak by OsiriX-Foundation.
the class TransferStatusGrid method createTransferDateFilter.
/**
* Creation of the filter for transfer date
*
* @param transferDateColumn Column
* @param filterRow Row filter
*/
private void createTransferDateFilter(Column<TransferStatusEntity> transferDateColumn, HeaderRow filterRow) {
// Date
DatePicker datePicker = new DatePicker();
datePicker.setLocale(Locale.FRANCE);
UIS.setTooltip(datePicker, TOOLTIP_FORMAT_DD_MM_YYYY);
datePicker.setPlaceholder("Date");
datePicker.setMinWidth(30, Unit.PERCENTAGE);
datePicker.setMaxWidth(40, Unit.PERCENTAGE);
datePicker.setClearButtonVisible(true);
// Time Start
TimePicker startTimePicker = new TimePicker();
startTimePicker.setPlaceholder("Start");
UIS.setTooltip(startTimePicker, TOOLTIP_FORMAT_HH_MM);
startTimePicker.setMinWidth(25, Unit.PERCENTAGE);
startTimePicker.setMaxWidth(30, Unit.PERCENTAGE);
startTimePicker.setClearButtonVisible(true);
// Time End
TimePicker endTimePicker = new TimePicker();
endTimePicker.setPlaceholder("End");
UIS.setTooltip(endTimePicker, TOOLTIP_FORMAT_HH_MM);
endTimePicker.setMinWidth(25, Unit.PERCENTAGE);
endTimePicker.setMaxWidth(30, Unit.PERCENTAGE);
endTimePicker.setClearButtonVisible(true);
// Listeners
buildListenerDate(datePicker, startTimePicker, endTimePicker);
buildListenerStartTime(datePicker, startTimePicker, endTimePicker);
buildListenerEndTime(datePicker, startTimePicker, endTimePicker);
// Add components
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.add(datePicker, startTimePicker, endTimePicker);
horizontalLayout.setSizeFull();
filterRow.getCell(transferDateColumn).setComponent(horizontalLayout);
}
use of com.vaadin.flow.component.timepicker.TimePicker in project WebComponentKit by itsoulltd.
the class AbstractBeanEditor method getValueField.
protected HasValue getValueField(Property prop) {
HasValue hasValue = null;
if (prop.getType() == DataType.BOOL) {
Checkbox box = new Checkbox();
box.setLabel(prop.getKey());
if (prop.getValue() != null)
box.setValue((Boolean) prop.getValue());
else
box.setIndeterminate(true);
hasValue = box;
} else if (prop.getType() == DataType.SQLDATE) {
DatePicker datePicker = new DatePicker();
datePicker.setValue(LocalDate.now());
datePicker.setClearButtonVisible(true);
hasValue = datePicker;
} else if (prop.getType() == DataType.SQLTIMESTAMP) {
TimePicker timePicker = new TimePicker();
timePicker.setValue(LocalTime.now());
timePicker.setClearButtonVisible(true);
hasValue = timePicker;
} else {
TextField field = new TextField();
field.setLabel(prop.getKey());
hasValue = field;
}
return hasValue;
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerLocaleTest method newTimePicker_returnsUiLocale.
@Test
public void newTimePicker_returnsUiLocale() {
Locale finnishLocale = new Locale("fi-FI");
ui.setLocale(finnishLocale);
TimePicker timePicker = new TimePicker();
Assert.assertEquals(finnishLocale, timePicker.getLocale());
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerTest method testSetStep_minutesNotDivideEvenly_throwsException.
@Test(expected = IllegalArgumentException.class)
public void testSetStep_minutesNotDivideEvenly_throwsException() {
TimePicker timePicker = new TimePicker();
timePicker.setStep(Duration.ofMinutes(35));
}
use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.
the class TimePickerTest method setInitialValue.
@Test
public void setInitialValue() {
TimePicker picker = new TimePicker(LocalTime.of(9, 32));
assertEquals(LocalTime.of(9, 32), picker.getValue());
assertEquals("09:32", picker.getElement().getProperty("value"));
}
Aggregations