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.

TestDatefieldYear.java 1018B

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests.components.datefield;
  2. import java.time.LocalDate;
  3. import java.util.Locale;
  4. import com.vaadin.shared.ui.datefield.Resolution;
  5. import com.vaadin.tests.components.TestBase;
  6. import com.vaadin.tests.components.TestDateField;
  7. import com.vaadin.ui.AbstractDateField;
  8. public class TestDatefieldYear extends TestBase {
  9. @Override
  10. protected String getDescription() {
  11. return "A popup with resolution year or month should update the textfield when browsing. The value displayed in the textfield should always be the same as the popup shows.";
  12. }
  13. @Override
  14. protected Integer getTicketNumber() {
  15. return 2813;
  16. }
  17. @Override
  18. protected void setup() {
  19. @SuppressWarnings("deprecation")
  20. AbstractDateField df = new TestDateField("Year",
  21. LocalDate.of(2009, 4, 1));
  22. df.setLocale(new Locale("en", "US"));
  23. df.setResolution(Resolution.YEAR);
  24. df.setResolution(Resolution.MONTH);
  25. addComponent(df);
  26. }
  27. }