Example usage for com.google.gwt.user.client Element getLastChild

List of usage examples for com.google.gwt.user.client Element getLastChild

Introduction

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

Prototype

@Override
    public Node getLastChild() 

Source Link

Usage

From source file:org.geomajas.gwt.client.gfx.context.DomHelper.java

License:Open Source License

/**
 * Within a certain group, bring an element to the front. This will make sure it's visible (within that group).
 * /*from w  ww. j a  v  a 2 s  . com*/
 * @param object
 *            The group wherein to search for the element.
 * @param name
 *            The name of the element to bring to the front.
 * @since 1.10.0
 */
public void bringToFront(Object parent, String name) {
    Element parentElement = getGroup(parent);
    if (parentElement == null) {
        throw new IllegalArgumentException("bringToFront failed: could not find parent group.");
    }

    Element element = getElement(parent, name);
    if (element == null) {
        throw new IllegalArgumentException("bringToFront failed: could not find element within group.");
    }
    if (parentElement.getLastChild() != element) {
        parentElement.appendChild(element);
    }
}

From source file:org.jboss.demo.widgets.client.local.PickListWidget.java

License:Open Source License

private Element clearChildren(Element element) {
    if (element.hasChildNodes()) {
        while (element.hasChildNodes()) {
            element.removeChild(element.getLastChild());
        }/*from w  w w.j a v a 2  s  .c om*/
    }
    return element;
}