]> source.dussan.org Git - vaadin-framework.git/commitdiff
most component containers now default to 100% width
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 4 Nov 2008 13:53:12 +0000 (13:53 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 4 Nov 2008 13:53:12 +0000 (13:53 +0000)
svn changeset:5809/svn branch:trunk

src/com/itmill/toolkit/ui/CustomComponent.java
src/com/itmill/toolkit/ui/OrderedLayout.java
src/com/itmill/toolkit/ui/Panel.java
src/com/itmill/toolkit/ui/TabSheet.java
src/com/itmill/toolkit/ui/Window.java

index 5d141eca8f1ab28c1aa7a03a6e0f4299ea0012a5..9a6fdc3391990f22cc3f6364481a6f1fca177bc8 100644 (file)
@@ -45,6 +45,8 @@ public class CustomComponent extends AbstractComponentContainer {
      * </p>
      */
     public CustomComponent() {
+        // expand horizontally by default
+        setWidth(100, UNITS_PERCENTAGE);
     }
 
     /**
@@ -60,6 +62,7 @@ public class CustomComponent extends AbstractComponentContainer {
      *            the root of the composition component tree.
      */
     public CustomComponent(Component compositionRoot) {
+        this();
         setCompositionRoot(compositionRoot);
     }
 
index f14ff5756ca1c3f346cdd5c5cbbdf2062a1f0219..7ae96fc623c65d8b6fc59b907fb6cf0f38ddbcae 100644 (file)
@@ -70,7 +70,7 @@ public class OrderedLayout extends AbstractLayout implements
      * <code>ORIENTATION_VERTICAL</code>.
      */
     public OrderedLayout() {
-        orientation = ORIENTATION_VERTICAL;
+        this(ORIENTATION_VERTICAL);
     }
 
     /**
@@ -82,6 +82,9 @@ public class OrderedLayout extends AbstractLayout implements
      */
     public OrderedLayout(int orientation) {
         this.orientation = orientation;
+        if (orientation == ORIENTATION_VERTICAL) {
+            setWidth(100, UNITS_PERCENTAGE);
+        }
     }
 
     /**
index 901e279114627c7d2015120f16a7a57ff5999be7..d775b5dd7c746ecc32dea4d4729556c09f64602d 100644 (file)
@@ -62,7 +62,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
      * Creates a new empty panel. Ordered layout is used.
      */
     public Panel() {
-        setLayout(null);
+        this((Layout) null);
     }
 
     /**
@@ -72,6 +72,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
      *            the layout used in the panel.
      */
     public Panel(Layout layout) {
+        setWidth(100, UNITS_PERCENTAGE);
         setLayout(layout);
     }
 
index e66050a2cfeeaf96ac7b38a4f6991a55fefabf8e..ba1f22e46dbfb5327aa6b6e6774ce2445f08ac7d 100644 (file)
@@ -50,6 +50,8 @@ public class TabSheet extends AbstractComponentContainer implements
      */
     public TabSheet() {
         super();
+        // expand horizontally by default
+        setWidth(100, UNITS_PERCENTAGE);
         setImmediate(true);
     }
 
index b4e204b322b95181d05ed41d0b88da0e1b0e2f55..c3eb95cd7473fe4e57d97d519ba8a6a68bd88fb8 100644 (file)
@@ -174,6 +174,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
     public Window(String caption, Layout layout) {
         super(caption, layout);
         setScrollable(true);
+        setSizeUndefined();
     }
 
     /**