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.

UseTooltipsToClarifyFunctions.asciidoc 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. title: Use Tooltips To Clarify Functions
  3. order: 58
  4. layout: page
  5. ---
  6. [[use-tooltips-to-clarify-functions]]
  7. = Use tooltips to clarify functions
  8. Even when clearly labelled, the action performed by a button might not
  9. be clear enough to the user. This is especially common when space or
  10. design constraints force you to keep the label very short, or use an
  11. icon instead of a label. This is where tooltips come in handy.
  12. image:img/tooltip.png[A tooltip]
  13. Tooltips are very easy to add to Vaadin components, although the method
  14. used to set them is the somewhat misleadingly named *setDescription()*:
  15. [source,java]
  16. ....
  17. Button btnAttach = new Button();
  18. btnAttach.setIcon(new ThemeResource("icons/attach.png"));
  19. btnAttach.setDescription("Attach a file");
  20. ....
  21. Of course, tooltips can be used for all kinds of UI components, not just
  22. buttons. An input field or even a read-only indicator can benefit from a
  23. tooltip. While the entire point of tooltips is to convey more
  24. information that would fit in the component’s caption or label, it’s
  25. still a good idea of try to keep the tooltip’s text as short as
  26. possible. Big tooltip balloons get in the way of using the UI and become
  27. annoying distractions instead of helpful aids.
  28. Keep in mind, however, that tooltips cannot be seen on a touch screen,
  29. since there is no mouse pointer to hover over the component. For input
  30. fields, consider using an *input prompt* instead.