Google Web Toolkit

GWT UiBinder Composite Wizard

Subclasses of the GWT Composite class can be created using the GWT UiBinder Composite wizard. The wizard can be selected from the drop down wizard menu or from the Eclipse New wizard.

To use the wizard, select the project source folder and package to contain the class. Then enter the class name and hit the Finish button.

The com.google.gwt.user.client.ui.Composite class is the default superclass.


 

 
The wizard generates the following Java code.

import com.google.gwt.core.client.GWT;
import
com.google.gwt.uibinder.client.UiBinder;
import
com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public
class UiBinderComposite extends Composite {
    private static final Binder binder = GWT.create(Binder.class);
    interface Binder extends UiBinder<Widget, UiBinderComposite> {
    }
    public UiBinderComposite() {
        initWidget(binder.createAndBindUi(this));
    }
}

The wizard generates the following XML code.

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>
    <ui:style>
        .panel {
            background-color: ivory;
        }
    </ui:style>
    <g:FlowPanel styleName="{style.panel}"/>
</ui:UiBinder>

When editing GWT Composites, all of the standard GWT panels, widgets and menus are available. Custom or third party controls may be added via the Choose Component command. GWT Composites hold one and only one top-level child. If you wish to include multiple children, drop one of the GWT panel types first.

Note that code that is inappropriate for design time may be hidden with isDesignTime() checks.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.