From: Matti Tahvonen Date: Tue, 4 Nov 2008 13:56:12 +0000 (+0000) Subject: refactored obsolete iLayout from Panel X-Git-Tag: 6.7.0.beta1~3874 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9dfd1b60851144296af334cec75cfae98ec5d0c2;p=vaadin-framework.git refactored obsolete iLayout from Panel svn changeset:5811/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java index edc9a0fb12..260d6f7d9d 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java @@ -14,7 +14,6 @@ import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; import com.itmill.toolkit.terminal.gwt.client.Container; -import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; import com.itmill.toolkit.terminal.gwt.client.IErrorMessage; import com.itmill.toolkit.terminal.gwt.client.Paintable; import com.itmill.toolkit.terminal.gwt.client.RenderInformation; @@ -22,8 +21,7 @@ import com.itmill.toolkit.terminal.gwt.client.RenderSpace; import com.itmill.toolkit.terminal.gwt.client.UIDL; import com.itmill.toolkit.terminal.gwt.client.Util; -public class IPanel extends SimplePanel implements Container, - ContainerResizedListener { +public class IPanel extends SimplePanel implements Container { public static final String CLASSNAME = "i-panel"; @@ -69,6 +67,8 @@ public class IPanel extends SimplePanel implements Container, private int captionMarginLeft = -1; + private boolean rendering; + private int contentMarginLeft = -1; public IPanel() { @@ -102,8 +102,10 @@ public class IPanel extends SimplePanel implements Container, } public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { + rendering = true; // Ensure correct implementation if (client.updateComponent(this, uidl, false)) { + rendering = false; return; } @@ -178,7 +180,7 @@ public class IPanel extends SimplePanel implements Container, // IE/FF2 is not able to make the offsetWidth for contentNode // correct // for some reason... - iLayout(false); + runHacks(false); } // We may have actions attached to this panel if (uidl.getChildCount() > 1) { @@ -206,6 +208,8 @@ public class IPanel extends SimplePanel implements Container, DOM.setElementPropertyInt(contentNode, "scrollLeft", scrollLeft); } + rendering = false; + } private void handleError(UIDL uidl) { @@ -253,11 +257,7 @@ public class IPanel extends SimplePanel implements Container, } } - public void iLayout() { - iLayout(true); - } - - public void iLayout(boolean runGeckoFix) { + public void runHacks(boolean runGeckoFix) { if (BrowserInfo.get().isIE6() && width != null && !width.equals("")) { /* * IE6 requires overflow-hidden elements to have a width specified @@ -399,6 +399,9 @@ public class IPanel extends SimplePanel implements Container, } else { DOM.setStyleAttribute(contentNode, "height", ""); } + if (!rendering) { + runHacks(true); + } } private int getCaptionMarginLeft() { @@ -432,9 +435,10 @@ public class IPanel extends SimplePanel implements Container, @Override public void setWidth(String width) { this.width = width; - super.setWidth(width); - + if (!rendering) { + runHacks(true); + } } private int getContainerBorderWidth() { @@ -501,7 +505,7 @@ public class IPanel extends SimplePanel implements Container, */ return true; } - iLayout(false); + runHacks(false); return !renderInformation.updateSize(getElement()); }