diff options
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/server/DebugUtilities.java | 20 |
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)) { |