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

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

Introduction

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

Prototype

@Override
    public Widget asWidget() 

Source Link

Usage

From source file:com.agnie.gwt.common.client.widget.DecoratedPanel.java

License:Open Source License

/**
 * add widget to panel/*from w  w  w  .  j a v a  2s . co m*/
 * 
 * @param content
 *            widget to add
 */
@UiChild
public void addContent(Widget content) {
    if (content != null) {
        this.contentPan.add(content.asWidget());
    }
}

From source file:com.sencha.gxt.widget.core.client.container.CardLayoutContainer.java

License:sencha.com license

@Override
public void setActiveWidget(Widget widget) {
    if (activeWidget == widget) {
        return;/* w  w  w. j a  v  a  2 s.  com*/
    }
    if (activeWidget != null) {
        activeWidget.setVisible(false);
    }
    if (widget != null) {
        if (widget.asWidget().getParent() == this) {
            activeWidget = widget;
            activeWidget.setVisible(true);
            // forcing causes layout to execute every time this method called
            // when used with TabPanel this causes layouts to execute every time tab
            // selected which is not optimal

            // EXTGWT-1550, in example, a panel is collapsed then another tab is
            // selected. when returning to tab with collapsed panel
            // the layout executes as it was forced

            if (isAttached()) {
                doLayout();

                if (this.activeWidget instanceof HasLayout) {
                    ((HasLayout) this.activeWidget).forceLayout();
                }
            }

        } else {
            activeWidget = widget;
            activeWidget.setVisible(true);
            add(widget);
            if (widget.asWidget().getParent() == this) {
                if (isAttached()) {
                    doLayout();

                    if (this.activeWidget instanceof HasLayout) {
                        ((HasLayout) this.activeWidget).forceLayout();
                    }
                }
            } else {
                activeWidget = null;
            }
        }
    } else {
        activeWidget = null;
    }
}

From source file:org.eclipse.che.ide.ui.multisplitpanel.panel.SubPanelViewImpl.java

License:Open Source License

private void removeChildSubPanel(Widget widget) {
    removeWidgetFromSplitPanel(widget.asWidget());

    IsWidget lastWidget = null;//from   w ww  . j  a va2  s. co m
    if (!southSubPanels.isEmpty()) {
        lastWidget = southSubPanels.get(0);
    } else if (!eastSubPanels.isEmpty()) {
        lastWidget = eastSubPanels.get(0);
    }

    if (lastWidget != null) {
        removeWidgetFromSplitPanel(lastWidget.asWidget());
        splitLayoutPanel.add(lastWidget);
    } else {
        ((SubPanelViewImpl) parentPanel).removeWidgetFromSplitPanel(this);
    }
}

From source file:org.nsesa.editor.gwt.core.client.ui.document.sourcefile.content.ContentController.java

License:EUPL

/**
 * Check if the given <tt>widget</tt> is fully visible in the scroll panel or not.
 *
 * @param widget the widget to check//from   w  ww  . jav a 2  s  . com
 * @return <tt>true</tt> if the widget is fully visible in the scroll panel
 */
public boolean isFullyVisible(Widget widget) {
    if (widget != null) {
        final int widgetTop = widget.asWidget().getAbsoluteTop();
        final int scrollTop = view.getScrollPanel().getAbsoluteTop();
        final int scrollBarHeight = view.getScrollPanel().getOffsetHeight();
        return widgetTop > scrollTop && widgetTop < scrollTop + scrollBarHeight;
    }
    return false;
}

From source file:org.overlord.commons.gwt.client.local.widgets.AnchorPanel.java

License:Apache License

/**
 * Inserts a widget before the specified index.
 * //from  w  ww  .j  a  va2  s  .c o  m
 * @param w
 *            the widget to be inserted
 * @param beforeIndex
 *            the index before which it will be inserted
 * @throws IndexOutOfBoundsException
 *             if <code>beforeIndex</code> is out of range
 */
public void insert(Widget w, int beforeIndex) {
    insert(w, getElement(), beforeIndex, true);
    children.add(beforeIndex, w.asWidget());
}

From source file:org.pepstock.jem.gwt.client.Sizes.java

License:Open Source License

public static final String getWidthStringHtml(Widget w) {
    return w.asWidget().getElement().getStyle().getWidth();
}

From source file:org.pepstock.jem.gwt.client.Sizes.java

License:Open Source License

public static final String getHeightStringHtml(Widget w) {
    return w.asWidget().getElement().getStyle().getHeight();
}

From source file:org.pepstock.jem.gwt.client.Sizes.java

License:Open Source License

public static final int getWidthHtml(Widget w) {
    String s = w.asWidget().getElement().getStyle().getWidth();
    return getPixelValue(s);
}

From source file:org.pepstock.jem.gwt.client.Sizes.java

License:Open Source License

public static final int getHeightHtml(Widget w) {
    String s = w.asWidget().getElement().getStyle().getHeight();
    return getPixelValue(s);
}

From source file:org.uberfire.client.workbench.PanelManagerImpl.java

License:Apache License

void appendWidgetToElement(final HTMLElement container, final Widget panelViewWidget) {
    DOMUtil.appendWidgetToElement(container, panelViewWidget.asWidget());
}