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.

EmptyCaptions.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.vaadin.tests.components.caption;
  2. import com.vaadin.server.UserError;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.v7.ui.TextField;
  5. public class EmptyCaptions extends TestBase {
  6. @Override
  7. protected void setup() {
  8. TextField tf;
  9. tf = new TextField(null, "Null caption");
  10. addComponent(tf);
  11. tf = new TextField("", "Empty caption");
  12. addComponent(tf);
  13. tf = new TextField(" ", "Space as caption");
  14. addComponent(tf);
  15. tf = new TextField(null, "Null caption, required");
  16. tf.setRequired(true);
  17. addComponent(tf);
  18. tf = new TextField("", "Empty caption, required");
  19. tf.setRequired(true);
  20. addComponent(tf);
  21. tf = new TextField(" ", "Space as caption, required");
  22. tf.setRequired(true);
  23. addComponent(tf);
  24. tf = new TextField(null, "Null caption, error");
  25. tf.setComponentError(new UserError("error"));
  26. addComponent(tf);
  27. tf = new TextField("", "Empty caption, error");
  28. tf.setComponentError(new UserError("error"));
  29. addComponent(tf);
  30. tf = new TextField(" ", "Space as caption, error");
  31. tf.setComponentError(new UserError("error"));
  32. addComponent(tf);
  33. }
  34. @Override
  35. protected String getDescription() {
  36. return "Null caption should never use space while a non-null caption always should use space.";
  37. }
  38. @Override
  39. protected Integer getTicketNumber() {
  40. return 3846;
  41. }
  42. }