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.

ComboBoxSuggestionPopupWidth.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 ComboBoxSuggestionPopupWidth extends AbstractReindeerTestUI {
  8. private static List<String> items = Arrays.asList("abc", "cde", "efg",
  9. "ghi", "ijk", "more items 1", "more items 2", "more items 3",
  10. "Ridicilously long item caption so we can see how the ComboBox displays ridicilously long captions in the suggestion pop-up",
  11. "more items 4", "more items 5", "more items 6", "more items 7");
  12. @Override
  13. protected void setup(VaadinRequest request) {
  14. ComboBox<String> cb = new ComboBox<>(
  15. "200px wide ComboBox with 100% wide suggestion popup", items);
  16. cb.setPopupWidth("100%");
  17. cb.setWidth("200px");
  18. cb.addStyleName("width-as-percentage");
  19. addComponent(cb);
  20. }
  21. @Override
  22. protected String getTestDescription() {
  23. return "Suggestion pop-up's width should be the same width as the ComboBox itself";
  24. }
  25. @Override
  26. protected Integer getTicketNumber() {
  27. return 19685;
  28. }
  29. }