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.
Eg. 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 boolean
equals(Object obj)
static boolean
equals(String cssSize1, String cssSize2)
Check whether the two sizes are equals.static WidgetUtil.CssSize
fromString(String s)
Parse the size from string format toWidgetUtil.CssSize
.static WidgetUtil.CssSize
fromValueUnit(float value, com.google.gwt.dom.client.Style.Unit unit)
Creates aWidgetUtil.CssSize
using a value and its measurement unit.com.google.gwt.dom.client.Style.Unit
getUnit()
Gets the measurement unit for this css size.float
getValue()
Gets the value for this css size.String
toString()
static com.google.gwt.dom.client.Style.Unit
unitByType(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.CssSize
object.
-
fromValueUnit
public static WidgetUtil.CssSize fromValueUnit(float value, com.google.gwt.dom.client.Style.Unit unit)
Creates aWidgetUtil.CssSize
using a value and its measurement unit.- Parameters:
value
- the value.unit
- the unit.- Returns:
- the
WidgetUtil.CssSize
object.
-
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.
-
-