Example usage for com.google.gwt.uibinder.client UiBinder createAndBindUi

List of usage examples for com.google.gwt.uibinder.client UiBinder createAndBindUi

Introduction

In this page you can find the example usage for com.google.gwt.uibinder.client UiBinder createAndBindUi.

Prototype

U createAndBindUi(O owner);

Source Link

Document

Creates and returns the root object of the UI, and fills any fields of owner tagged with UiField .

Usage

From source file:com.google.api.explorer.client.parameter.schema.SchemaForm.java

License:Apache License

public SchemaForm(UiBinder<Widget, SchemaForm> uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
}

From source file:com.google.gwt.sample.hellorebinding.client.util.UiBinders.java

License:Apache License

/**
 * Creates and returns the root object of the UI, and fills any fields of owner
 * tagged with {@link UiField}.//from ww w . j a  v  a  2 s .c o  m
 *
 * @param rootTypeLiteral  literal of the type of the root object of the generated UI, typically 
 *                         a subclass of {@link com.google.gwt.dom.client.Element Element} or
 *                         {@link com.google.gwt.user.client.ui.UIObject UiObject}
 * @param ownerTypeLiteral literal of the type of the object that will own the generated UI
 * @param owner            the object whose 
 *                         {@link com.google.gwt.uibinder.client.UiField UiField} needs will be
 *                         filled
 */
@Rebind(type = UiBinderCreator.class)
public static <U, O> U createAndBindUi(@Rebind.Param final Class<U> rootTypeLiteral,
        @Rebind.Param final Class<O> ownerTypeLiteral, O owner) {
    UiBinderCreator<U, O> creator = GWT.create(UiBinderCreator.class, rootTypeLiteral, ownerTypeLiteral);
    UiBinder<U, O> uiBinder = creator.createUiBinder();
    return uiBinder.createAndBindUi(owner);
}

From source file:com.google.gwt.sample.hellorebinding.client.util.UiBinders.java

License:Apache License

/**
 * Creates and returns the root object of the UI, and fills any fields of owner
 * tagged with {@link UiField}.// w  ww . j  a va 2  s  . c o  m
 *
 * @param rootTypeLiteral  literal of the type of the root object of the generated UI, typically
 *                         a subclass of {@link com.google.gwt.dom.client.Element Element} or
 *                         {@link com.google.gwt.user.client.ui.UIObject UiObject}
 * @param ownerTypeLiteral literal of the type of the object that will own the generated UI
 * @param templateLiteral  literal of the template file
 * @param owner            the object whose {@literal @}UiField needs will be filled
 */
@Rebind(type = UiBinderCreator.class)
public static <U, O> U createAndBindUi(@Rebind.Param final Class<U> rootTypeLiteral,
        @Rebind.Param final Class<O> ownerTypeLiteral, @Rebind.Param final String templateLiteral, O owner) {
    UiBinderCreator<U, O> creator = GWT.create(UiBinderCreator.class, rootTypeLiteral, ownerTypeLiteral,
            templateLiteral);
    UiBinder<U, O> uiBinder = creator.createUiBinder();
    return uiBinder.createAndBindUi(owner);
}

From source file:com.google.gwt.site.demo.gsss.grid.examples.Examples.java

License:Apache License

protected Examples(UiBinder<Widget, Examples> binder) {
    widget = binder.createAndBindUi(this);

    resources.style().ensureInjected();/*from www  .java2 s  . co  m*/
    resources.grid().ensureInjected();
    resources.gridSettings().ensureInjected();
}

From source file:com.mozido.channels.nextweb.components.shell.Shell.java

License:Apache License

/**
 * Construct the {@link Shell}./*from   w ww.  ja  v a 2 s  .c  om*/
 */
public Shell() {
    // Initialize the ui binder.
    UiBinder uiBinder;
    if (App.isMobileVersion()) {
        uiBinder = GWT.create(MobileBinder.class);
    } else {
        uiBinder = GWT.create(WebBinder.class);
    }
    initWidget((Widget) uiBinder.createAndBindUi(this));

    // Default to no content.
    contentPanel.ensureDebugId("contentPanel");
    scrollPanel.getElement().setId("contentScroll");
    setContent(null);
}

From source file:com.nabla.wapp.client.mvp.binder.BindedDisplay.java

License:Apache License

protected <D> void create(final UiBinder<U, D> uiBinder, final D instance) {
    impl = uiBinder.createAndBindUi(instance);
    impl.onCreate();/*from w ww.ja v a  2 s.  c  o m*/
}

From source file:org.openremote.app.client.widget.AbstractAppPanel.java

License:Open Source License

public AbstractAppPanel(UiBinder<PopupPanel, AbstractAppPanel> binder) {
    this.popupPanel = binder.createAndBindUi(this);

    popupPanel.getElement().getStyle().setOverflow(Style.Overflow.AUTO);

    popupPanel.setGlassStyleName("or-PopupPanelGlass");

    popupPanel.addAttachHandler(event -> {
        if (event.isAttached()) {
            windowHandlerRegistration = Window.addResizeHandler(e -> {
                if (isOpen()) {
                    open();//from   w w w .  ja va  2  s.com
                }
            });
            if (openCloseConsumer != null) {
                openCloseConsumer.accept(true);
            }
        } else if (windowHandlerRegistration != null) {
            windowHandlerRegistration.removeHandler();
            windowHandlerRegistration = null;
        }
    });

    popupPanel.addCloseHandler(event -> {
        if (openCloseConsumer != null) {
            openCloseConsumer.accept(false);
        }
        if (target != null) {
            popupPanel.removeAutoHidePartner(target.getElement());
        }
    });

}

From source file:org.openremote.manager.client.widget.AbstractAppPanel.java

License:Open Source License

public AbstractAppPanel(UiBinder<PopupPanel, AbstractAppPanel> binder) {
    this.popupPanel = binder.createAndBindUi(this);
    popupPanel.setAutoHideOnHistoryEventsEnabled(true);

    popupPanel.setGlassStyleName("or-PopupPanelGlass");

    popupPanel.addCloseHandler(event -> {
        if (target != null) {
            popupPanel.removeAutoHidePartner(target.getElement());
            target = null;// w w  w .j  ava 2s. co m
        }
    });

    Window.addResizeHandler(event -> {
        if (isShowing()) {
            if (target != null) {
                popupPanel.showRelativeTo(target);
            } else if (bottomRightTarget != null) {
                showBottomRightOf(bottomRightTarget, marginRight, marginBottom);
            } else if (topLeftTarget != null) {
                showTopLeftOf(topLeftTarget, marginTop, marginLeft);
            }
        }
    });
}