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

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

Introduction

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

Prototype

public static Widget asWidgetOrNull(IsWidget w) 

Source Link

Document

This convenience method makes a null-safe call to IsWidget#asWidget() .

Usage

From source file:com.seanchenxi.gwt.serenity.client.view.impl.DiscussionListViewImpl.java

License:Apache License

@Override
public void updateResponseViewPosition(int discussionId) {
    Widget respondWidget = Widget.asWidgetOrNull(respond);
    if (respondWidget == null)
        return;/*from  w  w  w .j ava  2s.  com*/
    DiscussionViewImpl discussion = discussions.get(discussionId);
    if (discussion != null) {
        respond.setDiscussionId(discussion.getId());
        respondWidget.addStyleName(getLevelStyle(discussion.getLevel()));
        main.insert(respond, main.getWidgetIndex(discussion) + 1);
    } else {
        respond.setDiscussionId(0);
        respondWidget.setStyleName(StringPool.BLANK);
        main.add(respond);
    }
}

From source file:fr.putnami.pwt.core.widget.client.base.AbstractPanel.java

License:Open Source License

public void append(IsWidget child) {
    this.add(Widget.asWidgetOrNull(child), this.element);
}

From source file:fr.putnami.pwt.core.widget.client.FormGroup.java

License:Open Source License

@Override
public void redraw() {
    this.clear();

    StyleUtils.toggleStyle(Widget.asWidgetOrNull(this.label), FormGroup.STYLE_SCREAN_READER,
            this.type == Layout.INLINE);
    this.addIfNotNull(this.label, 3, 0, false);
    boolean ro = isReadOnly();
    this.editor = this.editorProvider.getEditor(ro);
    initFocusableEditor();// w ww  . j a v a2  s. c o m
    if (!Boolean.FALSE.equals(this.readonly)) {
        this.addIfNotNull(editor, 9, 0, true);
    } else {
        this.addIfNotNull(editor, 9, 0, true);
        this.addIfNotNull(this.error, 9, 3, true);
        this.addIfNotNull(this.help, 9, 3, true);
    }
}

From source file:fr.putnami.pwt.core.widget.client.FormGroup.java

License:Open Source License

private void addIfNotNull(Editor e, int size, int offset, boolean wrap) {
    if (e instanceof IsWidget) {
        boolean wrapInCol = wrap;
        wrapInCol &= this.type == Layout.HORIZONTAL;

        Widget toAdd = Widget.asWidgetOrNull((IsWidget) e);
        if (wrapInCol) {
            GridColumn column = new GridColumn();
            column.add(toAdd);/*  w w w  .  j av  a2s .c om*/
            column.setSize(size);
            column.setOffset(offset);
            toAdd = column;
        }
        if (this.type == Layout.HORIZONTAL) {
            if (size > 0) {
                StyleUtils.addStyle(toAdd, new GridColumn.SizeStyle(GridColumn.PREFIX_SIZE_MD, size));
            }
            if (offset > 0) {
                StyleUtils.addStyle(toAdd, new GridColumn.OffsetStyle(GridColumn.PREFIX_OFFSET_MD, offset));
            }
        }
        this.append(toAdd);
    }
}

From source file:fr.putnami.pwt.core.widget.client.Navbar.java

License:Open Source License

@UiChild(tagname = "Brand")
public void addBrand(Widget w) {
    StyleUtils.addStyle(Widget.asWidgetOrNull(w), Navbar.STYLE_BRAND);
    this.headerContainer.add(w);
}

From source file:fr.putnami.pwt.core.widget.client.Navbar.java

License:Open Source License

@UiChild(tagname = "left")
public void addLeft(IsWidget w) {
    StyleUtils.addStyle(Widget.asWidgetOrNull(w), Navbar.STYLE_NAVBAR_LEFT);
    this.add(w);
}

From source file:fr.putnami.pwt.core.widget.client.Navbar.java

License:Open Source License

@UiChild(tagname = "right")
public void addRight(IsWidget w) {
    StyleUtils.addStyle(Widget.asWidgetOrNull(w), Navbar.STYLE_NAVBAR_RIGHT);
    this.add(w);
}

From source file:org.apache.hupa.client.ui.HupaLayout.java

License:Apache License

@Override
public AcceptsOneWidget getTopBarView() {
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x2_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x0");
    InstrumentationLoggerProvider.get()// w  ww.  ja  v a2s. c o  m
            .instrument("org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a1");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x0");
    return new AcceptsOneWidget() {
        @Override
        public void setWidget(IsWidget w) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf8845");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x2_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x20x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x3_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x1");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x30x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x30x00x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddb77be6a10x20x00x00x199bf88450x30x0");
            topBarContainer.setWidget(Widget.asWidgetOrNull(w));
        }
    };
}

From source file:org.apache.hupa.client.ui.HupaLayout.java

License:Apache License

@Override
public AcceptsOneWidget getLogoView() {
    InstrumentationLoggerProvider.get()//from   w w w. j  a  v  a2  s.c  om
            .instrument("org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x2_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x0");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x1");
    return new AcceptsOneWidget() {
        @Override
        public void setWidget(IsWidget w) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x3_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x20x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x2");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf8845");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x30x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x30x00x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185ddf2869bfb0x20x00x00x199bf88450x30x0");
            logoContainer.setWidget(Widget.asWidgetOrNull(w));
        }
    };
}

From source file:org.apache.hupa.client.ui.HupaLayout.java

License:Apache License

@Override
public AcceptsOneWidget getNotificationView() {
    InstrumentationLoggerProvider.get()/*from   w w  w . j  ava  2 s. com*/
            .instrument("org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c182221");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x2");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x0");
    return new AcceptsOneWidget() {
        @Override
        public void setWidget(IsWidget w) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x1_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x3_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x2_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x20x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x0");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf8845");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x30x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x30x00x0_____org_apache_hupa_client_ui_HupaLayout_java0x0f4c185dd3c1822210x20x00x00x199bf88450x30x00x00x0");
            notificationContainer.setWidget(Widget.asWidgetOrNull(w));
        }
    };
}