Example usage for com.google.gwt.user.client DOM getElementProperty

List of usage examples for com.google.gwt.user.client DOM getElementProperty

Introduction

In this page you can find the example usage for com.google.gwt.user.client DOM getElementProperty.

Prototype

@Deprecated
public static String getElementProperty(Element elem, String prop) 

Source Link

Document

Gets any named property from an element, as a string.

Usage

From source file:asquare.gwt.sb.client.fw.CellRendererDefault.java

License:Apache License

public void prepareElement(Element viewElement, Object modelElement, CellProperties properties) {
    // set cell class name(s)
    StringBuilder styleName = new StringBuilder();
    buildStyleName(styleName, modelElement, properties);

    if (!styleName.equals(DOM.getElementProperty(viewElement, "className"))) {
        DOM.setElementProperty(viewElement, "className", styleName.toString());
    }/*ww  w .ja  va 2  s  .c  o  m*/

    // set cell CSS properties
    if (m_styleRules != null) {
        for (int i = 0, size = m_styleRules.getSize(); i < size; i++) {
            String property = m_styleRules.getRendererProperty(i);
            if (property == null || properties.getBoolean(property)) {
                Object value = m_styleRules.getValue(i);
                if (value instanceof String) {
                    DOM.setStyleAttribute(viewElement, m_styleRules.getName(i), (String) value);
                } else if (value instanceof Integer) {
                    DOM.setIntStyleAttribute(viewElement, m_styleRules.getName(i),
                            ((Integer) value).intValue());
                } else {
                    assert false;
                }
            } else {
                DOM.setStyleAttribute(viewElement, m_styleRules.getName(i), "");
            }
        }
    }
}

From source file:asquare.gwt.tk.client.ui.CWindow.java

License:Apache License

@Override
public String getTitle() {
    return DOM.getElementProperty(getContainerElement(), "title");
}

From source file:asquare.gwt.tk.client.ui.ExposedCellPanel.java

License:Apache License

/**
 * Gets the style name(s) for the cell specified by
 * <code>cellIndex</code>./*  w  w  w .  jav a  2  s  . co  m*/
 * 
 * @return the CSS class name(s) (space delimited)
 * @param cellIndex the index of the cell
 * @throws IndexOutOfBoundsException if the cell specified by
 *             <code>cellIndex</code> does not exist
 */
public String getCellStyleName(int cellIndex) {
    GwtUtil.rangeCheck(m_cellMap, cellIndex, false);

    // TODO: remove null check in 1.5, http://code.google.com/p/google-web-toolkit/issues/detail?id=1770
    String result = DOM.getElementProperty(getCellElement(cellIndex), "className");
    return result != null ? result : "";
}

From source file:asquare.gwt.tk.client.util.DomUtil.java

License:Apache License

/**
 * @see #getId(UIObject)/*from   ww w  .j  av a2  s .  com*/
 * @param e a native DOM element
 * @return the id or <code>null</code> if the id attribute is not set
 */
public static String getId(Element e) {
    return DOM.getElementProperty(e, "id");
}

From source file:asquare.gwt.tk.client.util.DomUtil.java

License:Apache License

/**
 * Gets an attribute on the specified UIObject's element.
 * /*from ww w  .  jav a  2 s.c om*/
 * @param uio a UIObject
 * @param name an attribute name, in "camelCase"
 * @return value the attribute value, or <code>null</code> if the
 *         attribute is not defined
 */
public static String getAttribute(UIObject uio, String name) {
    return DOM.getElementProperty(uio.getElement(), name);
}

From source file:asquare.gwt.tk.client.util.DomUtil.java

License:Apache License

/**
 * Creates a list of all elements contained by the specified element
 * (inclusive) which have the specified CSS class (in GWT terms
 * <em>stylename</em>).// w  w w.j  av  a  2  s. c o m
 * 
 * @param element the element which is at the root of the hierarchy that you wish to search
 * @param className the name of the CSS class to search for
 * @param result a writable list which will be returned as the result (for recursion).
 *            Typically, you pass <code>null</code> and the list will
 *            be created on the fly.
 * @return <b>result</b> a list containing 0 or more HTML elements
 */
public static List<Element> findElementsWithClass(Element element, String className, List<Element> result) {
    if (result == null) {
        result = new ArrayList<Element>();
    }

    String cls = DOM.getElementProperty(element, "className");
    if (cls != null && cls.indexOf(className) >= 0) {
        result.add(element);
    }

    int childCount = DOM.getChildCount(element);
    for (int i = 0; i < childCount; i++) {
        findElementsWithClass(DOM.getChild(element, i), className, result);
    }

    return result;
}

From source file:cc.alcina.framework.gwt.client.gwittir.widget.BoundHyperlink.java

License:Apache License

public String getTarget() {
    return DOM.getElementProperty(anchorElem, "target");
}

From source file:cc.alcina.framework.gwt.client.gwittir.widget.BoundLink.java

License:Apache License

public String getHref() {
    return DOM.getElementProperty(base.getElement(), "href");
}

From source file:cc.alcina.framework.gwt.client.gwittir.widget.BoundLink.java

License:Apache License

public String getTarget() {
    return DOM.getElementProperty(base.getElement(), "target");
}

From source file:client.template.panel.LoggingPanel.java

License:Open Source License

/**
 * @param message//  w w  w .jav a2s.  c  o  m
 */
public void logMessage(final String message) {
    if (!LoggingPanel.isOpen) {
        LoggingPanel.unread++;
    }

    final String textAdd = (0 == LoggingPanel.unread) ? "" : " (" + LoggingPanel.unread + " New)";

    this.panel.getHeaderTextAccessor().setText(this.title + textAdd);

    this.textArea.setText(this.textArea.getText() + message + "\n");

    final String value = DOM.getElementProperty(this.textArea.getElement(), "scrollHeight");
    DOM.setElementProperty(this.textArea.getElement(), "scrollTop", value);
}