You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DateFieldKeyboardInput.java 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. package com.vaadin.tests.components.datefield;
  2. import java.time.LocalDate;
  3. import com.vaadin.server.VaadinRequest;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.ui.DateField;
  6. import com.vaadin.ui.Label;
  7. public class DateFieldKeyboardInput extends AbstractReindeerTestUI {
  8. @Override
  9. protected void setup(VaadinRequest request) {
  10. final DateField dateField = new DateField("Select date",
  11. LocalDate.of(2014, 1, 15));
  12. dateField.setDateFormat("dd.MM.yyyy");
  13. addComponent(dateField);
  14. dateField.addValueChangeListener(
  15. event -> addComponent(new Label("Date has been changed.")));
  16. }
  17. @Override
  18. public Integer getTicketNumber() {
  19. return 16677;
  20. }
  21. @Override
  22. public String getTestDescription() {
  23. return "When a new date is entered in the text field using the keyboard, pressing the return key after typing the date, "
  24. + "a label with the text 'Date has been changed' should appear.";
  25. }
  26. }