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.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.datefield;
  17. import com.vaadin.server.VaadinRequest;
  18. import com.vaadin.shared.ui.datefield.Resolution;
  19. import com.vaadin.tests.components.AbstractTestUI;
  20. import com.vaadin.tests.components.TestDateField;
  21. import com.vaadin.ui.AbstractDateField;
  22. import com.vaadin.ui.VerticalLayout;
  23. public class PopupClosingWithEsc extends AbstractTestUI {
  24. @Override
  25. protected void setup(VaadinRequest request) {
  26. AbstractDateField df1 = new TestDateField("Day");
  27. df1.setId("day");
  28. df1.setResolution(Resolution.DAY);
  29. AbstractDateField df2 = new TestDateField("Month");
  30. df2.setId("month");
  31. df2.setResolution(Resolution.MONTH);
  32. AbstractDateField df3 = new TestDateField("Year");
  33. df3.setId("year");
  34. df3.setResolution(Resolution.YEAR);
  35. VerticalLayout layout = new VerticalLayout();
  36. layout.setMargin(true);
  37. layout.setSpacing(true);
  38. layout.addComponents(df1, df2, df3);
  39. setContent(layout);
  40. }
  41. @Override
  42. protected String getTestDescription() {
  43. return "Testing that the DateField popup can be closed with ESC key.";
  44. }
  45. @Override
  46. protected Integer getTicketNumber() {
  47. return 12317;
  48. }
  49. }