Package org.opencms.gwt.client.util.impl
Class DocumentStyleImpl
- java.lang.Object
-
- org.opencms.gwt.client.util.impl.DocumentStyleImpl
-
- Direct Known Subclasses:
DocumentStyleImplIE9
public class DocumentStyleImpl extends java.lang.Object
Helper class to retrieve the computed style of an element.This implementation is used for all none MSIE browsers.
- Since:
- 8.0.0
-
-
Constructor Summary
Constructors Constructor Description DocumentStyleImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.lang.String
camelize(java.lang.String s)
Transforms a CSS property name to its javascript property name (font-size >> fontSize).void
clearOpacity(com.google.gwt.dom.client.Element element)
Removes the opacity attribute from the element's inline-style.protected java.lang.String
getComputedStyle(com.google.gwt.dom.client.Element elem, java.lang.String name)
Returns the computed style from the DOM object.java.lang.String
getCurrentStyle(com.google.gwt.dom.client.Element elem, java.lang.String name)
Returns the computed style of the given element.java.lang.String
getPropertyName(java.lang.String name)
Transforms the CSS style name to the name of the javascript style property.protected java.lang.String
hyphenize(java.lang.String name)
Hyphenizes the given string.
-
-
-
Constructor Detail
-
DocumentStyleImpl
public DocumentStyleImpl()
-
-
Method Detail
-
camelize
protected static java.lang.String camelize(java.lang.String s)
Transforms a CSS property name to its javascript property name (font-size >> fontSize).- Parameters:
s
- the property name- Returns:
- the javascript property name
-
clearOpacity
public void clearOpacity(com.google.gwt.dom.client.Element element)
Removes the opacity attribute from the element's inline-style.- Parameters:
element
- the DOM element to manipulate
-
getCurrentStyle
public java.lang.String getCurrentStyle(com.google.gwt.dom.client.Element elem, java.lang.String name)
Returns the computed style of the given element.- Parameters:
elem
- the elementname
- the name of the CSS property- Returns:
- the currently computed style
-
getPropertyName
public java.lang.String getPropertyName(java.lang.String name)
Transforms the CSS style name to the name of the javascript style property.- Parameters:
name
- the name of the CSS property- Returns:
- the javascript property name
-
hyphenize
protected java.lang.String hyphenize(java.lang.String name)
Hyphenizes the given string.- Parameters:
name
- the string to hyphenize- Returns:
- the result
-
getComputedStyle
protected java.lang.String getComputedStyle(com.google.gwt.dom.client.Element elem, java.lang.String name)
Returns the computed style from the DOM object.- Parameters:
elem
- the element objectname
- name of the CSS property- Returns:
- the property value
-
-