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.

ButtonsWaiAria.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.vaadin.tests.components.button;
  2. import com.vaadin.tests.components.ComponentTestCase;
  3. import com.vaadin.ui.Button;
  4. import com.vaadin.ui.NativeButton;
  5. public class ButtonsWaiAria extends ComponentTestCase<Button> {
  6. @Override
  7. protected Class<Button> getTestClass() {
  8. return Button.class;
  9. }
  10. @Override
  11. protected void initializeComponents() {
  12. Button l;
  13. boolean nat = false;
  14. l = createButton("Default Button", nat);
  15. addTestComponent(l);
  16. l = createButton("Icon Button, empty alt", nat);
  17. l.setIcon(ICON_16_USER_PNG_CACHEABLE);
  18. l.setDescription("Empty alt text");
  19. addTestComponent(l);
  20. l = createButton("Icon Button with alt", nat);
  21. l.setIcon(ICON_16_USER_PNG_CACHEABLE, "user icon");
  22. addTestComponent(l);
  23. l = createButton("Tooltip Button", nat);
  24. l.setDescription("Tooltip");
  25. addTestComponent(l);
  26. }
  27. private Button createButton(String text, boolean nativeButton) {
  28. Button b;
  29. if (nativeButton) {
  30. b = new NativeButton(text);
  31. } else {
  32. b = new Button(text);
  33. }
  34. return b;
  35. }
  36. @Override
  37. protected String getDescription() {
  38. return "A generic test for Buttons in different configurations";
  39. }
  40. }