Example usage for com.google.gwt.user.client.ui Widget setParent

List of usage examples for com.google.gwt.user.client.ui Widget setParent

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Widget setParent.

Prototype

void setParent(Widget parent) 

Source Link

Document

Sets this widget's parent.

Usage

From source file:org.zkoss.gwt.client.zk.Container.java

License:Open Source License

@Override
public void add(com.google.gwt.user.client.ui.Widget child) {
    /** Validate */
    if (!(child instanceof Widget)) {
        throw new RuntimeException("must be ZK Widget!");
    }//from   ww  w.  j a va  2 s  .  c  o  m
    Widget zChild = (Widget) child;

    /** adjust for Re Insertion */

    /** Detach Child */
    if (zChild.isAttached()) {
        zChild.removeFromParent();
    }
    /** Logical Attach */

    /** Physical Attach */
    appendChild((zChild).getZkWidget());
    /** Adopt */
    zChild.setParent(this);
}