Search in sources :

Example 26 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method setAutoOpenDisabled.

@Test
public void setAutoOpenDisabled() {
    TimePicker timePicker = new TimePicker();
    assertTrue(timePicker.isAutoOpen());
    timePicker.setAutoOpen(false);
    assertTrue(timePicker.getElement().getProperty(PROP_AUTO_OPEN_DISABLED, false));
    assertFalse(timePicker.isAutoOpen());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 27 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method testSetStep_millisecondsNotDivideEvenly_throwsException.

@Test(expected = IllegalArgumentException.class)
public void testSetStep_millisecondsNotDivideEvenly_throwsException() {
    TimePicker timePicker = new TimePicker();
    timePicker.setStep(Duration.ofMillis(333));
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 28 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method setMinTime_getMin_null.

@Test
public void setMinTime_getMin_null() {
    TimePicker timePicker = new TimePicker();
    assertEquals(null, timePicker.getMinTime());
    timePicker.setMinTime(null);
    assertEquals(null, timePicker.getMin());
    assertEquals(null, timePicker.getMinTime());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 29 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method setMaxTime_getMax_null.

@Test
public void setMaxTime_getMax_null() {
    TimePicker timePicker = new TimePicker();
    assertEquals(null, timePicker.getMaxTime());
    timePicker.setMaxTime(null);
    assertEquals(null, timePicker.getMax());
    assertEquals(null, timePicker.getMaxTime());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 30 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerPage method createHelperComponent.

private void createHelperComponent() {
    TimePicker timePickerHelperComponent = new TimePicker();
    timePickerHelperComponent.setId("time-picker-helper-component");
    Span span = new Span("Helper component");
    span.setId("helper-component");
    timePickerHelperComponent.setHelperComponent(span);
    NativeButton clearComponent = new NativeButton("Clear component helper", e -> {
        timePickerHelperComponent.setHelperComponent(null);
    });
    clearComponent.setId("button-clear-helper-component");
    add(timePickerHelperComponent, clearComponent);
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) NativeButton(com.vaadin.flow.component.html.NativeButton) Span(com.vaadin.flow.component.html.Span)

Aggregations

TimePicker (com.vaadin.flow.component.timepicker.TimePicker)35 Test (org.junit.Test)23 GeneratedVaadinTimePicker (com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker)20 Div (com.vaadin.flow.component.html.Div)5 NativeButton (com.vaadin.flow.component.html.NativeButton)3 LocalTime (java.time.LocalTime)3 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)2 DatePicker (com.vaadin.flow.component.datepicker.DatePicker)2 Span (com.vaadin.flow.component.html.Span)2 TextField (com.vaadin.flow.component.textfield.TextField)2 Duration (java.time.Duration)2 Locale (java.util.Locale)2 HasLabel (com.vaadin.flow.component.HasLabel)1 ComboBox (com.vaadin.flow.component.combobox.ComboBox)1 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 RichTextEditor (com.vaadin.flow.component.richtexteditor.RichTextEditor)1 Select (com.vaadin.flow.component.select.Select)1 IntegerField (com.vaadin.flow.component.textfield.IntegerField)1 Binder (com.vaadin.flow.data.binder.Binder)1