aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2008-11-04 13:56:12 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2008-11-04 13:56:12 +0000
commit9dfd1b60851144296af334cec75cfae98ec5d0c2 (patch)
treeb72e13a90a636d0f93f87f6699963ae75d9091fb
parentbaaa2aa0a515c600aac78bb200ed547395fbb71f (diff)
downloadvaadin-framework-9dfd1b60851144296af334cec75cfae98ec5d0c2.tar.gz
vaadin-framework-9dfd1b60851144296af334cec75cfae98ec5d0c2.zip
refactored obsolete iLayout from Panel
svn changeset:5811/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java28
1 files changed, 16 insertions, 12 deletions
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());
}