]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added Component constructors (#10246) 42/342/3
authorArtur Signell <artur@vaadin.com>
Thu, 22 Nov 2012 12:31:53 +0000 (14:31 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 22 Nov 2012 14:09:30 +0000 (14:09 +0000)
Change-Id: I86845693004fcdf65d5307c47a27e7d3a3274c52

server/src/com/vaadin/ui/Accordion.java
server/src/com/vaadin/ui/HorizontalSplitPanel.java
server/src/com/vaadin/ui/TabSheet.java
server/src/com/vaadin/ui/VerticalSplitPanel.java

index c31bfe8840095b4500558386ad9a6836379e35fc..c6683faa15c78e0ddcd373e12fa9c4db9586c801 100644 (file)
@@ -27,5 +27,23 @@ package com.vaadin.ui;
  * @see TabSheet
  */
 public class Accordion extends TabSheet {
+    /**
+     * Creates an empty accordion.
+     */
+    public Accordion() {
+        super();
+    }
+
+    /**
+     * Constructs a new accordion containing the given components.
+     * 
+     * @param components
+     *            The components to add to the accordion. Each component will be
+     *            added to a separate tab.
+     */
+    public Accordion(Component... components) {
+        this();
+        addComponents(components);
+    }
 
 }
index 017234d62da7791ae3f9ccb15e1a6bd7f56e7b6e..1e5ae83d725bab19fffd7c94b49b36fa46f13c19 100644 (file)
@@ -37,8 +37,26 @@ package com.vaadin.ui;
  * @since 6.5
  */
 public class HorizontalSplitPanel extends AbstractSplitPanel {
+    /**
+     * Creates an empty horizontal split panel
+     */
     public HorizontalSplitPanel() {
         super();
         setSizeFull();
     }
+
+    /**
+     * Creates a horizontal split panel containing the given components
+     * 
+     * @param firstComponent
+     *            The component to be placed to the left of the splitter
+     * @param secondComponent
+     *            The component to be placed to the right of the splitter
+     */
+    public HorizontalSplitPanel(Component firstComponent,
+            Component secondComponent) {
+        this();
+        setFirstComponent(firstComponent);
+        setSecondComponent(secondComponent);
+    }
 }
index 995db5092ebe377f4cbd8cab4c9ca2b9a787f059..5553bf64f8e1fedd65082bedf217b2057ef8db84 100644 (file)
@@ -108,7 +108,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
     private int tabIndex;
 
     /**
-     * Constructs a new Tabsheet. Tabsheet is immediate by default, and the
+     * Constructs a new TabSheet. A TabSheet is immediate by default, and the
      * default close handler removes the tab being closed.
      */
     public TabSheet() {
@@ -125,6 +125,18 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
         });
     }
 
+    /**
+     * Constructs a new TabSheet containing the given components.
+     * 
+     * @param components
+     *            The components to add to the tab sheet. Each component will be
+     *            added to a separate tab.
+     */
+    public TabSheet(Component... components) {
+        this();
+        addComponents(components);
+    }
+
     /**
      * Gets the component container iterator for going through all the
      * components (tab contents).
index 813401c4a0b21a4a15d48f1268d501ff634c3f32..1378e466d8cd1d0c3e47bd2bcb2bb46bf810ebca 100644 (file)
@@ -39,4 +39,18 @@ public class VerticalSplitPanel extends AbstractSplitPanel {
         setSizeFull();
     }
 
+    /**
+     * Creates a horizontal split panel containing the given components
+     * 
+     * @param firstComponent
+     *            The component to be placed above the splitter
+     * @param secondComponent
+     *            The component to be placed below of the splitter
+     */
+    public VerticalSplitPanel(Component firstComponent,
+            Component secondComponent) {
+        this();
+        setFirstComponent(firstComponent);
+        setSecondComponent(secondComponent);
+    }
 }