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.

TooltipStyling.java 1.4KB

12345678910111213141516171819202122232425262728293031323334
  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.Label;
  6. public class TooltipStyling extends AbstractTestUI {
  7. @Override
  8. protected void setup(VaadinRequest request) {
  9. Label defaultLabel = new Label(
  10. "I have a tooltip with default settings");
  11. defaultLabel.setDescription(
  12. "This long description should be shown with the application's default font and wrap to several lines as needed."
  13. + "\n\nThis part should be on a separate line");
  14. defaultLabel.setId("default");
  15. addComponent(defaultLabel);
  16. Label htmlLabel = new Label("I have a tooltip with HTML contents");
  17. htmlLabel.setDescription("This is regular text in a tooltip."
  18. + "<pre>This is a pre tag inside a HTML tooltip. It should use a monospace font and by default not break to multiple lines.</pre>",
  19. ContentMode.HTML);
  20. htmlLabel.setId("html");
  21. addComponent(htmlLabel);
  22. }
  23. @Override
  24. protected String getTestDescription() {
  25. return "Tooltips should be shown with the regular application font and automatically wrap to multiple lines for long contents.<br />"
  26. + "&lt;pre> tag contents in a HTML tooltip should still behave according to browser defaults.";
  27. }
  28. }