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.

RichTextAreaEmptyString.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.richtextarea;
  2. import com.vaadin.shared.ui.label.ContentMode;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.Button.ClickEvent;
  6. import com.vaadin.ui.Button.ClickListener;
  7. import com.vaadin.ui.Label;
  8. import com.vaadin.ui.RichTextArea;
  9. public class RichTextAreaEmptyString extends TestBase {
  10. @Override
  11. protected String getDescription() {
  12. return "Test the value of a rich text area. Visually empty area should return \"\"";
  13. }
  14. @Override
  15. protected Integer getTicketNumber() {
  16. return 8004;
  17. }
  18. @Override
  19. protected void setup() {
  20. final RichTextArea area = new RichTextArea();
  21. final Label l = new Label(area.getValue(), ContentMode.PREFORMATTED);
  22. l.setCaption("Value recieved from RichTextArea:");
  23. final Button b = new Button("get area value", new ClickListener() {
  24. @Override
  25. public void buttonClick(ClickEvent event) {
  26. l.setValue(area.getValue());
  27. }
  28. });
  29. addComponent(area);
  30. addComponent(b);
  31. addComponent(l);
  32. }
  33. }