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.

UploadHtmlCaption.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.vaadin.tests.components.upload;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractTestUI;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.Upload;
  6. public class UploadHtmlCaption extends AbstractTestUI {
  7. @Override
  8. protected void setup(VaadinRequest request) {
  9. Upload upload = new Upload();
  10. upload.setImmediateMode(false);
  11. upload.setButtonCaption("<b>Submit button</b>");
  12. upload.setCaption("This is the caption of the <b>entire</b> component");
  13. addComponent(upload);
  14. Button toggleButtonCaption = new Button("Toggle button caption",
  15. e -> upload.setButtonCaptionAsHtml(
  16. !upload.isButtonCaptionAsHtml()));
  17. toggleButtonCaption.setId("toggleButtonCaption");
  18. addComponent(toggleButtonCaption);
  19. Button toggleComponentCaption = new Button("Toggle component caption",
  20. e -> upload.setCaptionAsHtml(!upload.isCaptionAsHtml()));
  21. toggleComponentCaption.setId("toggleComponentCaption");
  22. addComponent(toggleComponentCaption);
  23. }
  24. @Override
  25. protected Integer getTicketNumber() {
  26. return 11810;
  27. }
  28. @Override
  29. protected String getTestDescription() {
  30. return "It should be possible to set component caption and submit button caption "
  31. + "to allow HTML display mode independently of each other.";
  32. }
  33. }