diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-01-08 13:10:33 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-01-08 13:10:33 +0000 |
commit | 89eb83dc413eb76adda8b36ee32f0c333b367cc8 (patch) | |
tree | 405d4f2b60465c6934912badf6bdf23071aaa96b /src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java | |
parent | dbdc297a3aac51c495ca80db70e6f158d213360d (diff) | |
download | vaadin-framework-89eb83dc413eb76adda8b36ee32f0c333b367cc8.tar.gz vaadin-framework-89eb83dc413eb76adda8b36ee32f0c333b367cc8.zip |
Fix for #2435 - Separate stylenames for VerticalLayout, HorizontalLayout and OrderedLayout
svn changeset:6457/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java index a9282e3bc9..2b0be73c58 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java @@ -20,15 +20,10 @@ public class IOrderedLayout extends CellBasedLayout { public static final String CLASSNAME = "i-orderedlayout";
- static {
- STYLENAME_SPACING = "i-orderedlayout-spacing";
- STYLENAME_MARGIN_TOP = "i-orderedlayout-margin-top";
- STYLENAME_MARGIN_RIGHT = "i-orderedlayout-margin-right";
- STYLENAME_MARGIN_BOTTOM = "i-orderedlayout-margin-bottom";
- STYLENAME_MARGIN_LEFT = "i-orderedlayout-margin-left";
- }
+ private int orientation;
- private int orientation = ORIENTATION_HORIZONTAL;
+ // Can be removed once OrderedLayout is removed
+ private boolean allowOrientationUpdate = false;
/**
* Size of the layout excluding any margins.
@@ -40,7 +35,20 @@ public class IOrderedLayout extends CellBasedLayout { private String width = "";
public IOrderedLayout() {
- setStyleName(CLASSNAME);
+ this(CLASSNAME, ORIENTATION_VERTICAL);
+ allowOrientationUpdate = true;
+ }
+
+ protected IOrderedLayout(String className, int orientation) {
+ setStyleName(className);
+ this.orientation = orientation;
+
+ STYLENAME_SPACING = className + "-spacing";
+ STYLENAME_MARGIN_TOP = className + "-margin-top";
+ STYLENAME_MARGIN_RIGHT = className + "-margin-right";
+ STYLENAME_MARGIN_BOTTOM = className + "-margin-bottom";
+ STYLENAME_MARGIN_LEFT = className + "-margin-left";
+
}
@Override
@@ -55,7 +63,9 @@ public class IOrderedLayout extends CellBasedLayout { return;
}
- handleOrientationUpdate(uidl);
+ if (allowOrientationUpdate) {
+ handleOrientationUpdate(uidl);
+ }
// IStopWatch w = new IStopWatch("OrderedLayout.updateFromUIDL");
|