public final class StyleHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <E extends com.google.gwt.dom.client.Style.HasCssName> |
addEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject,
E style)
Adds enum value style name to UIObject unless style is
null. |
static <E extends com.google.gwt.dom.client.Style.HasCssName,F extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> |
addUniqueEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject,
Class<F> enumClass,
E style)
Convenience method for first removing all enum style constants and then adding the single one.
|
static boolean |
containsStyle(String styleNames,
String style)
Returns
true if specified style is contained in space-separated list of styles |
static <F extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> |
fromStyleName(Class<F> enumClass,
com.google.gwt.dom.client.Style.HasCssName styleName) |
static com.google.gwt.dom.client.Style.Unit |
getMeasurementUnit(String value) |
static Double |
getMeasurementValue(String value) |
static <E extends com.google.gwt.dom.client.Style.HasCssName> |
removeEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject,
E style)
Removes enum value style name from UIObject unless style is
null. |
static <E extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> |
removeEnumStyleNames(com.google.gwt.user.client.ui.UIObject uiObject,
Class<E> enumClass)
Removes all CSS style names specified by an enum that implements
Style.HasCssName from an UIObject. |
static void |
toggleStyleName(com.google.gwt.user.client.ui.UIObject uiObject,
boolean toggleStyle,
String styleName)
Toggles a style name on a ui object
|
public static <F extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> F fromStyleName(Class<F> enumClass, com.google.gwt.dom.client.Style.HasCssName styleName)
public static <E extends com.google.gwt.dom.client.Style.HasCssName,F extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> void addUniqueEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject, Class<F> enumClass, E style)
public static <E extends Enum<? extends com.google.gwt.dom.client.Style.HasCssName>> void removeEnumStyleNames(com.google.gwt.user.client.ui.UIObject uiObject, Class<E> enumClass)
Style.HasCssName from an UIObject.E - Enum type implementing Style.HasCssNameuiObject - Object to remove CSS class names fromenumClass - Enum representing CSS class namespublic static <E extends com.google.gwt.dom.client.Style.HasCssName> void addEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject, E style)
null.uiObject - Object to add style tostyle - Style namepublic static <E extends com.google.gwt.dom.client.Style.HasCssName> void removeEnumStyleName(com.google.gwt.user.client.ui.UIObject uiObject, E style)
null.uiObject - Object to remove style fromstyle - Style namepublic static boolean containsStyle(String styleNames, String style)
true if specified style is contained in space-separated list of stylesstyleNames - Space-separated list of stylesstyle - Style to look forpublic static void toggleStyleName(com.google.gwt.user.client.ui.UIObject uiObject, boolean toggleStyle, String styleName)
uiObject - Object to toggle style ontoggleStyle - whether or not to toggle the style name on the objectstyleName - Style namepublic static Double getMeasurementValue(String value)
public static com.google.gwt.dom.client.Style.Unit getMeasurementUnit(String value)
Copyright © 2018. All rights reserved.