Package com.vaadin.client
Class WidgetUtil.CssSize
- java.lang.Object
-
- com.vaadin.client.WidgetUtil.CssSize
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- WidgetUtil
public static class WidgetUtil.CssSize extends Object implements Serializable
Wrap a css size value and its unit and translate back and forth to the string representation.
E.g. 50%, 123px, ...- Since:
- 7.2.6
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static booleanequals(String cssSize1, String cssSize2)Check whether the two sizes are equals.static WidgetUtil.CssSizefromString(String s)Parse the size from string format toWidgetUtil.CssSize.static WidgetUtil.CssSizefromValueUnit(float value, com.google.gwt.dom.client.Style.Unit unit)Creates aWidgetUtil.CssSizeusing a value and its measurement unit.com.google.gwt.dom.client.Style.UnitgetUnit()Gets the measurement unit for this css size.floatgetValue()Gets the value for this css size.inthashCode()StringtoString()static com.google.gwt.dom.client.Style.UnitunitByType(String type)Gets the unit value by its type.
-
-
-
Method Detail
-
unitByType
public static com.google.gwt.dom.client.Style.Unit unitByType(String type)
Gets the unit value by its type.- Parameters:
type- the type of the unit as found in the style.- Returns:
- the unit value.
-
fromString
public static WidgetUtil.CssSize fromString(String s)
Parse the size from string format toWidgetUtil.CssSize.- Parameters:
s- the size as string.- Returns:
- a
WidgetUtil.CssSizeobject.
-
fromValueUnit
public static WidgetUtil.CssSize fromValueUnit(float value, com.google.gwt.dom.client.Style.Unit unit)
Creates aWidgetUtil.CssSizeusing a value and its measurement unit.- Parameters:
value- the value.unit- the unit.- Returns:
- the
WidgetUtil.CssSizeobject.
-
getValue
public float getValue()
Gets the value for this css size.- Returns:
- the value.
-
getUnit
public com.google.gwt.dom.client.Style.Unit getUnit()
Gets the measurement unit for this css size.- Returns:
- the unit.
-
-