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.

MiddleNotificationPosition.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.vaadin.tests.components.notification;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.shared.Position;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.ui.Button;
  6. import com.vaadin.ui.Notification;
  7. /**
  8. * Test UI class for Notification with middle left and middle right positions.
  9. *
  10. * @since 7.2
  11. * @author Vaadin Ltd
  12. */
  13. public class MiddleNotificationPosition extends AbstractReindeerTestUI {
  14. @Override
  15. protected void setup(VaadinRequest request) {
  16. Button left = new Button("Show Notification in middle left");
  17. left.addStyleName("show-middle-left");
  18. left.addClickListener(event -> {
  19. Notification notification = new Notification("Notification");
  20. notification.setDelayMsec(10000);
  21. notification.setPosition(Position.MIDDLE_LEFT);
  22. notification.show(getUI().getPage());
  23. });
  24. addComponent(left);
  25. Button right = new Button("Show Notification in middle right");
  26. right.addStyleName("show-middle-right");
  27. right.addClickListener(event -> {
  28. Notification notification = new Notification("Notification");
  29. notification.setDelayMsec(10000);
  30. notification.setPosition(Position.MIDDLE_RIGHT);
  31. notification.show(getUI().getPage());
  32. });
  33. addComponent(right);
  34. }
  35. @Override
  36. protected String getTestDescription() {
  37. return "Position.MIDDLE_LEFT and Position.MIDDLE_RIGHT should work for Notification";
  38. }
  39. @Override
  40. protected Integer getTicketNumber() {
  41. return 12931;
  42. }
  43. }