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.

TestForApplicationLayoutThatUsesWholeBrosersSpace.java 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests;
  17. import com.vaadin.server.LegacyApplication;
  18. import com.vaadin.ui.HorizontalSplitPanel;
  19. import com.vaadin.ui.Label;
  20. import com.vaadin.ui.LegacyWindow;
  21. import com.vaadin.ui.Table;
  22. import com.vaadin.ui.VerticalLayout;
  23. import com.vaadin.ui.VerticalSplitPanel;
  24. public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends
  25. LegacyApplication {
  26. LegacyWindow main = new LegacyWindow("Windowing test");
  27. VerticalLayout rootLayout;
  28. VerticalSplitPanel firstLevelSplit;
  29. @Override
  30. public void init() {
  31. setMainWindow(main);
  32. rootLayout = new VerticalLayout();
  33. main.setContent(rootLayout);
  34. rootLayout.addComponent(new Label("header"));
  35. firstLevelSplit = new VerticalSplitPanel();
  36. final HorizontalSplitPanel secondSplitPanel = new HorizontalSplitPanel();
  37. secondSplitPanel.setFirstComponent(new Label("left"));
  38. final VerticalLayout topRight = new VerticalLayout();
  39. topRight.addComponent(new Label("topright header"));
  40. final Table t = TestForTablesInitialColumnWidthLogicRendering
  41. .getTestTable(4, 100);
  42. t.setSizeFull();
  43. topRight.addComponent(t);
  44. topRight.setExpandRatio(t, 1);
  45. topRight.addComponent(new Label("topright footer"));
  46. secondSplitPanel.setSecondComponent(topRight);
  47. final VerticalLayout el = new VerticalLayout();
  48. el.addComponent(new Label("B��"));
  49. firstLevelSplit.setFirstComponent(secondSplitPanel);
  50. firstLevelSplit.setSecondComponent(el);
  51. rootLayout.addComponent(firstLevelSplit);
  52. rootLayout.setExpandRatio(firstLevelSplit, 1);
  53. rootLayout.addComponent(new Label("footer"));
  54. }
  55. }