We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.terminal.gwt.client.
Class ComputedStyle
java.lang.Object
com.vaadin.terminal.gwt.client.ComputedStyle
- extends Object
public class ComputedStyle
Field Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
computedStyle
|
Constructor Summary | |
---|---|
ComputedStyle(com.google.gwt.user.client.Element elem)
Gets this element's computed style object which can be used to gather information about the current state of the rendered node. |
Method Summary | |
---|---|
int[] |
getBorder()
Get current border values from the DOM. |
int |
getIntProperty(String name)
|
int[] |
getMargin()
Get current margin values from the DOM. |
int[] |
getPadding()
Get current padding values from the DOM. |
String |
getProperty(String name)
|
static Integer |
parseInt(String value)
Takes a String value e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
computedStyle
protected final com.google.gwt.core.client.JavaScriptObject computedStyle
Constructor Detail |
---|
ComputedStyle
public ComputedStyle(com.google.gwt.user.client.Element elem)
- Parameters:
elem
- the element
Gets this element's computed style object which can be used to gather information about the current state of the rendered node.
Note that this method is expensive. Wherever possible, reuse the returned object.
Method Detail |
---|
getProperty
public final String getProperty(String name)
- Parameters:
name
- name of the CSS property in camelCase- Returns:
- the value of the property, normalized for across browsers (each browser returns pixel values whenever possible).
getIntProperty
public final int getIntProperty(String name)
getMargin
public final int[] getMargin()
Get current margin values from the DOM. The array order is the default CSS order: top, right, bottom, left.
getPadding
public final int[] getPadding()
Get current padding values from the DOM. The array order is the default CSS order: top, right, bottom, left.
getBorder
public final int[] getBorder()
Get current border values from the DOM. The array order is the default CSS order: top, right, bottom, left.
parseInt
public static Integer parseInt(String value)
- Parameters:
String
- a value starting with a number- Returns:
- int the value from the string before any non-numeric characters.
If the value cannot be parsed to a number, returns
null
.
Takes a String value e.g. "12px" and parses that to int 12.