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.

PopupViewShouldCloseOnTabOut.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.vaadin.tests.components.popupview;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Component;
  4. import com.vaadin.ui.PopupView;
  5. import com.vaadin.ui.PopupView.Content;
  6. import com.vaadin.ui.TextField;
  7. import com.vaadin.ui.VerticalLayout;
  8. @SuppressWarnings("serial")
  9. public class PopupViewShouldCloseOnTabOut extends TestBase {
  10. @Override
  11. protected String getDescription() {
  12. return "The PopupView should close when the user moves focus away from it using the TAB key.";
  13. }
  14. @Override
  15. protected Integer getTicketNumber() {
  16. return 5059;
  17. }
  18. @Override
  19. protected void setup() {
  20. PopupView pv = new PopupView(new Content() {
  21. @Override
  22. public String getMinimizedValueAsHTML() {
  23. return "<b>click me</b>";
  24. }
  25. @Override
  26. public Component getPopupComponent() {
  27. VerticalLayout vl = new VerticalLayout();
  28. TextField field1 = new TextField();
  29. field1.setValue("one");
  30. field1.focus();
  31. vl.addComponent(field1);
  32. TextField field2 = new TextField();
  33. field2.setValue("two");
  34. vl.addComponent(field2);
  35. vl.setWidth("600px");
  36. return vl;
  37. }
  38. });
  39. addComponent(pv);
  40. TextField main = new TextField();
  41. main.setValue("main");
  42. addComponent(main);
  43. TextField main2 = new TextField();
  44. main2.setValue("main2");
  45. addComponent(main2);
  46. }
  47. }