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.

1234567891011121314151617181920212223242526272829303132
  1. package com.vaadin.tests.components.abstractcomponent;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.shared.ui.ContentMode;
  4. import com.vaadin.tests.components.AbstractTestUI;
  5. import com.vaadin.ui.Button;
  6. /**
  7. * @author Vaadin Ltd
  8. *
  9. */
  10. public class TooltipModes extends AbstractTestUI {
  11. @Override
  12. protected void setup(VaadinRequest request) {
  13. Button label = new Button("Label. Hover to see tooltip");
  14. label.setDescription("Several\n lines\n tooltip");
  15. addComponent(label);
  16. Button useHtml = new Button("Use Html in the tooltip",
  17. event -> label.setDescription(
  18. "<div>Html <b><span>tooltip</span></b></div>",
  19. ContentMode.HTML));
  20. addComponent(useHtml);
  21. Button usePreformatted = new Button("Use plain text in the tooltip",
  22. event -> label.setDescription("<b>tooltip</b>",
  23. ContentMode.TEXT));
  24. addComponent(usePreformatted);
  25. }
  26. }