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.4KB

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