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.

HorizontalSplitPanel.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright 2000-2018 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.ui;
  17. import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState;
  18. /**
  19. * A horizontal split panel contains two components and lays them horizontally.
  20. * The first component is on the left side.
  21. *
  22. * <pre>
  23. *
  24. * +---------------------++----------------------+
  25. * | || |
  26. * | The first component || The second component |
  27. * | || |
  28. * +---------------------++----------------------+
  29. *
  30. * ^
  31. * |
  32. * the splitter
  33. *
  34. * </pre>
  35. *
  36. * @author Vaadin Ltd.
  37. * @since 6.5
  38. */
  39. public class HorizontalSplitPanel extends AbstractSplitPanel {
  40. /**
  41. * Creates an empty horizontal split panel.
  42. */
  43. public HorizontalSplitPanel() {
  44. super();
  45. setSizeFull();
  46. }
  47. /**
  48. * Creates a horizontal split panel containing the given components.
  49. *
  50. * @param firstComponent
  51. * The component to be placed to the left of the splitter
  52. * @param secondComponent
  53. * The component to be placed to the right of the splitter
  54. */
  55. public HorizontalSplitPanel(Component firstComponent,
  56. Component secondComponent) {
  57. this();
  58. setFirstComponent(firstComponent);
  59. setSecondComponent(secondComponent);
  60. }
  61. @Override
  62. protected HorizontalSplitPanelState getState() {
  63. return (HorizontalSplitPanelState) super.getState();
  64. }
  65. @Override
  66. protected HorizontalSplitPanelState getState(boolean markAsDirty) {
  67. return (HorizontalSplitPanelState) super.getState(markAsDirty);
  68. }
  69. }