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.

ComboBoxSuggestionPopupWidthPercentage.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.vaadin.tests.components.combobox;
  2. import java.util.Arrays;
  3. import java.util.List;
  4. import com.vaadin.server.VaadinRequest;
  5. import com.vaadin.tests.components.AbstractReindeerTestUI;
  6. import com.vaadin.ui.ComboBox;
  7. public class ComboBoxSuggestionPopupWidthPercentage
  8. extends AbstractReindeerTestUI {
  9. private static List<String> items = Arrays.asList("abc", "cde", "efg",
  10. "ghi", "ijk", "more items 1", "more items 2", "more items 3",
  11. "Ridicilously long item caption so we can see how the ComboBox displays ridicilously long captions in the suggestion pop-up",
  12. "more items 4", "more items 5", "more items 6", "more items 7");
  13. @Override
  14. protected void setup(VaadinRequest request) {
  15. ComboBox<String> percentage = new ComboBox<>(
  16. "200px wide ComboBox with 200% wide suggestion popup", items);
  17. percentage.addStyleName("percentage");
  18. percentage.setWidth("200px");
  19. percentage.setPopupWidth("200%");
  20. addComponent(percentage);
  21. }
  22. @Override
  23. protected String getTestDescription() {
  24. return "Suggestion pop-up's width should be 200% of the ComboBox itself (400px)";
  25. }
  26. @Override
  27. protected Integer getTicketNumber() {
  28. return 19685;
  29. }
  30. }