From b255d55b966c905002b78e97ae0e1f0f206b3b17 Mon Sep 17 00:00:00 2001 From: Jouni Koivuviita Date: Wed, 31 Mar 2010 08:21:36 +0000 Subject: [PATCH] Fixes #4460: SplitPanel: add getters for the position (and unit) of the splitter on the server side component svn changeset:12247/svn branch:6.2 --- .../terminal/gwt/client/ui/VSplitPanel.java | 4 ++++ src/com/vaadin/ui/SplitPanel.java | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java index 101c1e9848..6dc8c65509 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java @@ -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"); diff --git a/src/com/vaadin/ui/SplitPanel.java b/src/com/vaadin/ui/SplitPanel.java index 1a149d7394..07a2a49934 100644 --- a/src/com/vaadin/ui/SplitPanel.java +++ b/src/com/vaadin/ui/SplitPanel.java @@ -300,6 +300,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. * -- 2.39.5