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.

SplitPanelWidthOnResize.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.splitpanel;
  2. import com.vaadin.server.Sizeable;
  3. import com.vaadin.tests.components.AbstractTestCase;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.HorizontalSplitPanel;
  6. import com.vaadin.ui.LegacyWindow;
  7. import com.vaadin.ui.NativeButton;
  8. import com.vaadin.ui.TextField;
  9. import com.vaadin.ui.VerticalLayout;
  10. public class SplitPanelWidthOnResize extends AbstractTestCase {
  11. @Override
  12. public void init() {
  13. VerticalLayout layout = new VerticalLayout();
  14. layout.setSizeFull();
  15. LegacyWindow w = new LegacyWindow("", layout);
  16. setMainWindow(w);
  17. HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
  18. Button button = new NativeButton("A huge button");
  19. button.setSizeFull();
  20. TextField textField = new TextField("A small textfield");
  21. splitPanel.setFirstComponent(button);
  22. splitPanel.setSecondComponent(textField);
  23. splitPanel.setSizeFull();
  24. splitPanel.setSplitPosition(100, Sizeable.UNITS_PERCENTAGE);
  25. layout.addComponent(splitPanel);
  26. }
  27. @Override
  28. protected String getDescription() {
  29. return "Make the browser window smaller and then larger again. The huge button should always stay visible and the TextField should never be shown.";
  30. }
  31. @Override
  32. protected Integer getTicketNumber() {
  33. return 3322;
  34. }
  35. }