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.

PopupClosingWithEsc.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.datefield;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.shared.ui.datefield.DateResolution;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.tests.components.TestDateField;
  6. import com.vaadin.ui.AbstractLocalDateField;
  7. import com.vaadin.ui.VerticalLayout;
  8. public class PopupClosingWithEsc extends AbstractReindeerTestUI {
  9. @Override
  10. protected void setup(VaadinRequest request) {
  11. AbstractLocalDateField df1 = new TestDateField("Day");
  12. df1.setId("day");
  13. df1.setResolution(DateResolution.DAY);
  14. AbstractLocalDateField df2 = new TestDateField("Month");
  15. df2.setId("month");
  16. df2.setResolution(DateResolution.MONTH);
  17. AbstractLocalDateField df3 = new TestDateField("Year");
  18. df3.setId("year");
  19. df3.setResolution(DateResolution.YEAR);
  20. VerticalLayout layout = new VerticalLayout();
  21. layout.setMargin(true);
  22. layout.setSpacing(true);
  23. layout.addComponents(df1, df2, df3);
  24. setContent(layout);
  25. }
  26. @Override
  27. protected String getTestDescription() {
  28. return "Testing that the DateField popup can be closed with ESC key.";
  29. }
  30. @Override
  31. protected Integer getTicketNumber() {
  32. return 12317;
  33. }
  34. }