From 3172f0b49070204445a93382adec111b510b96c1 Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Thu, 3 Jul 2008 22:27:23 +0000 Subject: [PATCH] Cleaning and documenting IOrderedLayout svn changeset:5048/svn branch:trunk --- .../gwt/client/ui/IOrderedLayout.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 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 c38014d346..99e83e27b9 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java @@ -115,6 +115,10 @@ public class IOrderedLayout extends Panel implements Container, setStyleName(CLASSNAME); } + /** + * Constuct base DOM-scrtucture and clean any already attached + * widgetwrappers from DOM. + */ private void createAndEmptyWrappedChildContainer() { if (orientationMode == ORIENTATION_HORIZONTAL) { final String structure = "
"; @@ -256,6 +260,10 @@ public class IOrderedLayout extends Panel implements Container, updateFixedSizes(); } + /** + * While setting width, ensure that margin div is also resized properly. + * Furthermore, enable/disable fixed mode + */ public void setWidth(String width) { super.setWidth(width); @@ -272,6 +280,10 @@ public class IOrderedLayout extends Panel implements Container, } } + /** + * While setting height, ensure that margin div is also resized properly. + * Furthermore, enable/disable fixed mode + */ public void setHeight(String height) { super.setHeight(height); @@ -301,9 +313,6 @@ public class IOrderedLayout extends Panel implements Container, // Remove unneeded attributes from each wrapper String wh = (orientationMode == ORIENTATION_HORIZONTAL) ? "width" : "height"; - String overflow = (orientationMode == ORIENTATION_HORIZONTAL) ? (BrowserInfo - .get().isFF2() ? "overflow" : "overflowX") - : "overflowY"; for (Iterator i = childWidgetWrappers.iterator(); i.hasNext();) { Element we = ((WidgetWrapper) i.next()).getElement(); DOM.setStyleAttribute(we, wh, ""); @@ -368,9 +377,6 @@ public class IOrderedLayout extends Panel implements Container, // Set the sizes for each child String wh = (orientationMode == ORIENTATION_HORIZONTAL) ? "width" : "height"; - String overflow = (orientationMode == ORIENTATION_HORIZONTAL) ? (BrowserInfo - .get().isFF2() ? "overflow" : "overflowX") - : "overflowY"; for (Iterator i = childWidgetWrappers.iterator(); i.hasNext();) { Element we = ((WidgetWrapper) i.next()).getElement(); final int ws = Math.round(((float) size) / (numChild--)); @@ -386,6 +392,7 @@ public class IOrderedLayout extends Panel implements Container, Util.runDescendentsLayout(this); } + /** Enable/disable margic classes for the margin div when needed */ protected void handleMargins(UIDL uidl) { margins = new MarginInfo(uidl.getIntAttribute("margins")); setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP, @@ -398,6 +405,7 @@ public class IOrderedLayout extends Panel implements Container, margins.hasLeft()); } + /** Parse alignments from UIDL and pass whem to correct widgetwrappers */ private void handleAlignments(UIDL uidl) { // Component alignments as a comma separated list. // See com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo.java for -- 2.39.5