]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #4460: SplitPanel: add getters for the position (and unit) of the splitter...
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 31 Mar 2010 08:22:25 +0000 (08:22 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 31 Mar 2010 08:22:25 +0000 (08:22 +0000)
svn changeset:12248/svn branch:6.3

src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java
src/com/vaadin/ui/SplitPanel.java

index 101c1e9848baf00c1b86f4a62f8a6b80ee415307..6dc8c655093f69d8ff7bf6372d08056185148b24 100644 (file)
@@ -476,6 +476,8 @@ public class VSplitPanel extends ComplexPanel implements Container,
                 pos = getOffsetWidth();
             }
             position = pos / getOffsetWidth() * 100 + "%";
+        } else {
+            position = newX + "px";
         }
 
         setSplitPosition(newX + "px");
@@ -502,6 +504,8 @@ public class VSplitPanel extends ComplexPanel implements Container,
                 pos = getOffsetHeight();
             }
             position = pos / getOffsetHeight() * 100 + "%";
+        } else {
+            position = newY + "px";
         }
 
         setSplitPosition(newY + "px");
index 4319bf7d9c96a7a28f2ec62b8049f00c76ae1c49..fe2da5d370acfa7fca46cdb5939364d100dab505 100644 (file)
@@ -310,6 +310,25 @@ public class SplitPanel extends AbstractLayout {
         setSplitPosition(pos, unit, true);
     }
 
+    /**
+     * Returns the current position of the splitter, in
+     * {@link #getSplitPositionUnit()} units.
+     * 
+     * @return position of the splitter
+     */
+    public int getSplitPosition() {
+        return pos;
+    }
+
+    /**
+     * Returns the unit of position of the splitter
+     * 
+     * @return unit of position of the splitter
+     */
+    public int getSplitPositionUnit() {
+        return posUnit;
+    }
+
     /**
      * Moves the position of the splitter.
      *