aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2008-12-11 11:44:30 +0000
committerArtur Signell <artur.signell@itmill.com>2008-12-11 11:44:30 +0000
commit76eecfda71c9a2f522a4475fa6786cb58b2048b2 (patch)
treebc24a070f0cff87c6e1931b0aeb96b71f34009ec
parentae89a160b9978cadea06de96859db7f8118b57de (diff)
downloadvaadin-framework-76eecfda71c9a2f522a4475fa6786cb58b2048b2.tar.gz
vaadin-framework-76eecfda71c9a2f522a4475fa6786cb58b2048b2.zip
Updated layout validity checker to support VerticalLayout+HorizontalLayout
svn changeset:6167/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java b/src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java
index 978899be1d..d32ceae436 100644
--- a/src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java
+++ b/src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java
@@ -94,15 +94,17 @@ public class DebugUtilities {
if (hasRelativeHeight(component) && hasUndefinedHeight(parent)) {
if (parent instanceof AbstractOrderedLayout) {
AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
- int orientation = OrderedLayout.ORIENTATION_HORIZONTAL;
+ boolean vertical = false;
if (ol instanceof OrderedLayout) {
- orientation = ((OrderedLayout) ol).getOrientation();
+ if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
+ vertical = true;
+ }
} else if (ol instanceof VerticalLayout) {
- orientation = OrderedLayout.ORIENTATION_VERTICAL;
+ vertical = true;
}
- if (orientation == OrderedLayout.ORIENTATION_VERTICAL) {
+ if (vertical) {
msg = "Relative height for component inside non sized vertical ordered layout.";
attributes = getHeightAttributes(component);
} else if (!hasNonRelativeHeightComponent(ol)) {
@@ -152,15 +154,17 @@ public class DebugUtilities {
if (hasRelativeWidth(component) && hasUndefinedWidth(parent)) {
if (parent instanceof AbstractOrderedLayout) {
AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
- int orientation = OrderedLayout.ORIENTATION_HORIZONTAL;
+ boolean horizontal = true;
if (ol instanceof OrderedLayout) {
- orientation = ((OrderedLayout) ol).getOrientation();
+ if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
+ horizontal = false;
+ }
} else if (ol instanceof VerticalLayout) {
- orientation = OrderedLayout.ORIENTATION_VERTICAL;
+ horizontal = false;
}
- if (orientation == OrderedLayout.ORIENTATION_HORIZONTAL) {
+ if (horizontal) {
msg = "Relative width for component inside non sized horizontal ordered layout.";
attributes = getWidthAttributes(component);
} else if (!hasNonRelativeWidthComponent(ol)) {