]> source.dussan.org Git - vaadin-framework.git/commitdiff
Size update optimization for OrderedLayout and SplitPanel
authorArtur Signell <artur.signell@itmill.com>
Thu, 18 Dec 2008 12:28:42 +0000 (12:28 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 18 Dec 2008 12:28:42 +0000 (12:28 +0000)
svn changeset:6271/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java

index 12295239f5ed9a1a163a7621b161b62d120ee037..7256727cb3adab75e667a00a994965d281189244 100644 (file)
@@ -37,6 +37,8 @@ public class IOrderedLayout extends CellBasedLayout {
 \r
     private boolean isRendering = false;\r
 \r
+    private String width = "";\r
+\r
     public IOrderedLayout() {\r
         setStyleName(CLASSNAME);\r
     }\r
@@ -758,11 +760,14 @@ public class IOrderedLayout extends CellBasedLayout {
 \r
     @Override\r
     public void setWidth(String width) {\r
+        if (this.width.equals(width)) {\r
+            return;\r
+        }\r
         Size sizeBefore = new Size(activeLayoutSize.getWidth(),\r
                 activeLayoutSize.getHeight());\r
 \r
         super.setWidth(width);\r
-\r
+        this.width = width;\r
         if (width != null && !width.equals("")) {\r
             setActiveLayoutWidth(getOffsetWidth()\r
                     - activeMargins.getHorizontal());\r
index 3f83dc6229ec6e07d65abc4a15428be5eeda995d..c267035e1ac754b5f0ae2d34a2881c1e92211fb2 100644 (file)
@@ -66,9 +66,9 @@ public class ISplitPanel extends ComplexPanel implements Container,
 
     private ApplicationConnection client;
 
-    private String width = null;
+    private String width = "";
 
-    private String height = null;
+    private String height = "";
 
     private RenderSpace firstRenderSpace = new RenderSpace(0, 0, true);
     private RenderSpace secondRenderSpace = new RenderSpace(0, 0, true);
@@ -462,6 +462,10 @@ public class ISplitPanel extends ComplexPanel implements Container,
 
     @Override
     public void setHeight(String height) {
+        if (this.height.equals(height)) {
+            return;
+        }
+
         this.height = height;
         super.setHeight(height);
         if (!rendering && client != null) {
@@ -472,6 +476,10 @@ public class ISplitPanel extends ComplexPanel implements Container,
 
     @Override
     public void setWidth(String width) {
+        if (this.width.equals(width)) {
+            return;
+        }
+
         this.width = width;
         super.setWidth(width);
         if (!rendering && client != null) {