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

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

Introduction

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

Prototype

public Widget getParent() 

Source Link

Document

Gets this widget's parent panel.

Usage

From source file:org.xwiki.gwt.wysiwyg.client.WysiwygEditorApi.java

License:Open Source License

/**
 * Releases the editor so that it can be garbage collected before the page is unloaded. Call this method before the
 * editor is physically detached from the DOM document.
 *///from w w w.j a  v a2 s  . co  m
public void release() {
    if (editor != null) {
        // Logical detach.
        Widget container = editor.getUI();
        while (container.getParent() != null) {
            container = container.getParent();
        }
        RootPanel.detachNow(container);
        editor = null;
    }
}

From source file:org.zanata.webtrans.client.ui.ValidationMessagePanelView.java

License:Apache License

@Inject
public ValidationMessagePanelView(TableEditorMessages messages) {
    this.messages = messages;
    initWidget(uiBinder.createAndBindUi(this));
    Widget header = disclosurePanel.getHeader();
    header.getParent().getElement().removeClassName("header");
    clear();//from  w w  w.j  a va 2 s . com
}

From source file:rocket.widget.client.Panel.java

License:Apache License

/**
 * Sub-classes need to insert the given widget into the DOM
 * /*from   w  w  w . j a v a 2s .  co m*/
 * @param widget
 * @param indexBefore
 */
public void insert(final Widget widget, int indexBefore) {
    if (widget.getParent() != null) {
        throw new IllegalArgumentException(
                "The parameter:widget already has a parent, remove from that first and then add/insert again to this "
                        + this.getClass().getName());
    }

    this.insert0(widget, indexBefore);
    this.adopt(widget);
    this.getWidgetCollection().insert(widget, indexBefore);
}

From source file:ru.codeinside.gses.vaadin.client.VScrollableForm.java

License:Mozilla Public License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    super.updateFromUIDL(uidl, client);
    if (uidl.hasAttribute(SCROLL_TO)) {
        final Paintable paintable = uidl.getPaintableAttribute(SCROLL_TO, client);
        if (paintable != null) {
            final Widget widget = (Widget) paintable;
            final Widget parent = widget.getParent();
            parent.getElement().scrollIntoView();
            if (widget instanceof Focusable) {
                ((Focusable) widget).setFocus(true);
            }/*from ww w.j av a2 s  .  c o  m*/
            parent.addStyleName(HIGHLIGHTED);
            new Timer() {
                public void run() {
                    parent.removeStyleName(HIGHLIGHTED);
                }
            }.schedule(1333);
        }
    }
}