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.

DisabledDateFieldWidth.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.tests.components.datefield;
  2. import com.vaadin.shared.ui.datefield.Resolution;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.tests.components.TestDateField;
  5. import com.vaadin.ui.AbstractDateField;
  6. import com.vaadin.ui.Button;
  7. import com.vaadin.ui.Button.ClickEvent;
  8. import com.vaadin.ui.GridLayout;
  9. public class DisabledDateFieldWidth extends TestBase {
  10. @Override
  11. public void setup() {
  12. final AbstractDateField dateField1 = new TestDateField("DateField");
  13. dateField1.setResolution(Resolution.YEAR);
  14. dateField1.setEnabled(false);
  15. Button button = new Button("Repaint datefield",
  16. new Button.ClickListener() {
  17. @Override
  18. public void buttonClick(ClickEvent event) {
  19. dateField1.markAsDirty();
  20. }
  21. });
  22. GridLayout gl = new GridLayout(3, 1);
  23. gl.addComponent(dateField1);
  24. gl.addComponent(button);
  25. addComponent(gl);
  26. }
  27. @Override
  28. protected String getDescription() {
  29. // TODO Auto-generated method stub
  30. return null;
  31. }
  32. @Override
  33. protected Integer getTicketNumber() {
  34. // TODO Auto-generated method stub
  35. return null;
  36. }
  37. }