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.

ComboboxStyleChangeWidth.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.combobox;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractTestUIWithLog;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.ComboBox;
  6. /**
  7. * Test UI for adding a stylename to a combobox with an undefined width.
  8. *
  9. * @author Vaadin Ltd
  10. */
  11. public class ComboboxStyleChangeWidth extends AbstractTestUIWithLog {
  12. @Override
  13. protected void setup(VaadinRequest request) {
  14. final ComboBox<String> cbFoo = new ComboBox<>();
  15. cbFoo.setItems(
  16. "A really long string that causes an inline width to be set");
  17. cbFoo.setSizeUndefined();
  18. Button btn = new Button("Click to break CB",
  19. event -> cbFoo.addStyleName("foofoo"));
  20. addComponent(cbFoo);
  21. addComponent(btn);
  22. }
  23. @Override
  24. protected String getTestDescription() {
  25. return "The computed inline width of an undefined-width ComboBox "
  26. + "(with a sufficiently long option string) breaks when "
  27. + "the component's stylename is changed after initial "
  28. + "rendering.";
  29. }
  30. @Override
  31. protected Integer getTicketNumber() {
  32. return Integer.valueOf(13444);
  33. }
  34. }