From: Matti Tahvonen Date: Fri, 24 Aug 2007 07:02:42 +0000 (+0000) Subject: using Sizeables UNIT_SYMBOLS, theoretically all units now supported X-Git-Tag: 6.7.0.beta1~6075 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f345e97cbc688d4a845f37c2bfd579e0d3ea10e7;p=vaadin-framework.git using Sizeables UNIT_SYMBOLS, theoretically all units now supported svn changeset:2117/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/SplitPanel.java b/src/com/itmill/toolkit/ui/SplitPanel.java index 66158757e1..2468d4fcef 100644 --- a/src/com/itmill/toolkit/ui/SplitPanel.java +++ b/src/com/itmill/toolkit/ui/SplitPanel.java @@ -81,7 +81,7 @@ public class SplitPanel extends AbstractComponentContainer implements Layout, Si private int pos = 50; - private int posUnit = Sizeable.UNITS_PERCENTAGE; + private int posUnit = UNITS_PERCENTAGE; /** * Creates a new split panel. The orientation of the panels is @@ -212,26 +212,17 @@ public class SplitPanel extends AbstractComponentContainer implements Layout, Si // TODO refine size attributes if(width > 0) { - target.addAttribute("width", width + (widthUnit == Sizeable.UNITS_PIXELS ? "px" : "%")); + target.addAttribute("width", width + UNIT_SYMBOLS[widthUnit]); } else { target.addAttribute("width", "100%"); } if(height > 0) { - target.addAttribute("height", height + (heightUnit == Sizeable.UNITS_PIXELS ? "px" : "%")); + target.addAttribute("height", height + UNIT_SYMBOLS[widthUnit]); } else { target.addAttribute("height", "100%"); } - String position = pos + ""; - switch (posUnit) { - case Sizeable.UNITS_PIXELS: - position += "px"; - break; - case Sizeable.UNITS_PERCENTAGE: - default: - position += "%"; - break; - } + String position = pos + UNIT_SYMBOLS[posUnit]; target.addAttribute("position", position); @@ -287,7 +278,7 @@ public class SplitPanel extends AbstractComponentContainer implements Layout, Si * @param pos the new size of the first region in persentage */ public void setSplitPosition(int pos) { - setSplitPosition(pos, Sizeable.UNITS_PERCENTAGE); + setSplitPosition(pos, UNITS_PERCENTAGE); } /**