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.

HiddenHorizontalLayout.java 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.vaadin.tests.layouts;
  2. import com.vaadin.shared.ui.ContentMode;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.Button.ClickEvent;
  6. import com.vaadin.ui.HorizontalLayout;
  7. import com.vaadin.ui.Label;
  8. import com.vaadin.ui.VerticalLayout;
  9. public class HiddenHorizontalLayout extends TestBase {
  10. @Override
  11. protected String getDescription() {
  12. return "Test to verify that toggling layout visibility works properly.";
  13. }
  14. @Override
  15. protected Integer getTicketNumber() {
  16. return 3183;
  17. }
  18. @Override
  19. public void setup() {
  20. VerticalLayout vl = new VerticalLayout();
  21. vl.setSizeFull();
  22. getLayout().addComponent(vl);
  23. final HorizontalLayout hl = new HorizontalLayout();
  24. hl.setWidth("100%");
  25. hl.setHeight("30px");
  26. hl.addComponent(new Label("label1"));
  27. hl.addComponent(new Label("label2"));
  28. hl.addComponent(new Label("label3"));
  29. hl.addComponent(new Label("label4"));
  30. vl.addComponent(hl);
  31. Label l = new Label(
  32. "Steps to reproduce with Vaadin 6.0.1:<br/>"
  33. + "1. set browser size smaller than fullscreen<br/>"
  34. + "2. Refresh page with browser<br/>"
  35. + "3. Click \"toggle layout visibility\"<br>"
  36. + "4. Resize browser window to full <br/>"
  37. + "5. Click \"toggle layout visibility\"<br/>",
  38. ContentMode.HTML);
  39. vl.addComponent(l);
  40. Button b = new Button("toggle layout visibility",
  41. new Button.ClickListener() {
  42. @Override
  43. public void buttonClick(ClickEvent event) {
  44. hl.setVisible(!hl.isVisible());
  45. }
  46. });
  47. vl.addComponent(b);
  48. }
  49. }