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.

PopUpWidth.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.combobox;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import com.vaadin.server.ThemeResource;
  5. import com.vaadin.tests.components.TestBase;
  6. import com.vaadin.ui.ComboBox;
  7. public class PopUpWidth extends TestBase {
  8. @Override
  9. protected void setup() {
  10. addComponent(createComboBox("Do not touch this"));
  11. addComponent(createComboBox(
  12. "Browse this (check that width does not change)"));
  13. }
  14. private ComboBox<Integer> createComboBox(String caption) {
  15. ComboBox<Integer> cb = new ComboBox<>(caption);
  16. List<Integer> items = new ArrayList<>();
  17. for (int i = 1; i < 200 + 1; i++) {
  18. items.add(i);
  19. }
  20. cb.setItems(items);
  21. cb.setItemIconGenerator(
  22. item -> new ThemeResource("../runo/icons/16/users.png"));
  23. cb.setItemCaptionGenerator(item -> "Item " + item);
  24. return cb;
  25. }
  26. @Override
  27. protected String getDescription() {
  28. return "Check that width of popup or combobox does not change when paging.";
  29. }
  30. @Override
  31. protected Integer getTicketNumber() {
  32. return 7013;
  33. }
  34. }