]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #2510
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 2 Feb 2009 11:21:45 +0000 (11:21 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 2 Feb 2009 11:21:45 +0000 (11:21 +0000)
svn changeset:6700/svn branch:trunk

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

index c267035e1ac754b5f0ae2d34a2881c1e92211fb2..7a0cc981cb033f4131fa6ef1f0a9eb4872d67976 100644 (file)
@@ -58,7 +58,7 @@ public class ISplitPanel extends ComplexPanel implements Container,
 
     private int origMouseY;
 
-    private boolean locked;
+    private boolean locked = false;
 
     private String splitterStyleName;
 
@@ -155,13 +155,7 @@ public class ISplitPanel extends ComplexPanel implements Container,
             return;
         }
 
-        locked = uidl.hasAttribute("locked");
-        if (locked) {
-            DOM.setElementProperty(splitter, "className", splitterStyleName
-                    + "-locked");
-        } else {
-            DOM.setElementProperty(splitter, "className", splitterStyleName);
-        }
+        setLocked(uidl.getBooleanAttribute("locked"));
 
         setSplitPosition(uidl.getStringAttribute("position"));
 
@@ -198,6 +192,21 @@ public class ISplitPanel extends ComplexPanel implements Container,
 
     }
 
+    private void setLocked(boolean newValue) {
+        if (locked != newValue) {
+            locked = newValue;
+            if (locked) {
+                DOM.setElementProperty(splitter, "className", splitterStyleName
+                        + "-locked");
+            } else {
+                DOM
+                        .setElementProperty(splitter, "className",
+                                splitterStyleName);
+            }
+            splitterSize = -1;
+        }
+    }
+
     private void setSplitPosition(String pos) {
         if (orientation == ORIENTATION_HORIZONTAL) {
             DOM.setStyleAttribute(splitter, "left", pos);
@@ -439,7 +448,7 @@ public class ISplitPanel extends ComplexPanel implements Container,
         }
     }
 
-    private static int splitterSize = -1;
+    private int splitterSize = -1;
 
     private int getSplitterSize() {
         if (splitterSize < 0) {