jhickman / gxt-uibinder

Automatically exported from code.google.com/p/gxt-uibinder
0 stars 0 forks source link

DEPRECATED

Please note that with the newer releases of GWT, this project is now deprecated as many of the techniques used to add custom element parsers to UiBinder are now not possible.

It should also be noted that this open source project has no relation to Sencha Inc and their product GXT.


Much of the components in ExtGWT (GXT) were written before GWT 2.0, thus not having support for UiBinder.

This project utilizes the ability to add custom ElementParsers from the gwt-customuibinder project add a number of parsers that can handle GXT layouts and widgets.

This project also adds support for using GXT events from UiBinder.

To get started, check out the User's Guide.

News

2011-05-11 Announcement: gxt-uibinder is now in Maven Central

New Release: 1.0.0

2011-04-03 New Release: 0.11

2011-03-27 New Release: 0.10

<form:item value="{msg.foo}" />

  * added a type attribute so that SimpleComboBox items can be values other than String type.

2011-03-20 New Release: 0.9

2011-03-15 New Release: 0.8

<gxt:layoutdata>

elements cause incorrect "add" ordering

2011-03-06 Released version 0.7

2011-01-18 New Demo Site available! All gxt-uibinder examples can now be found at http://gxt-uibinder.appspot.com/

2011-01-18 Released version 0.6.

<gxt:buttons>

* Adding LayoutData abilities with nested 

<xx:layoutdata>

child elements of LayoutContainers

2011-01-12

2011-01-03

2010-12-21 Released version 0.5.

2010-12-20 Released version 0.4.

<ns:tooltipconfig />

element

2010-12-12 Released version 0.3.

2010-12-06 New Download available 0.2. Added support for basic Grids. See Grid for usage.

Example Usage

Here's a quick example usage:

UiBinder File:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui"
    xmlns:gxt="urn:import:com.extjs.gxt.ui.client.widget"
    xmlns:menu="urn:import:com.extjs.gxt.ui.client.widget.menu">

  <gxt:ContentPanel headerVisible="false" layout="FitLayout">
    <gxt:topcomponent>
      <menu:MenuBar borders="true">
        <menu:MenuBarItem text="File">
          <menu:Menu>
            <menu:MenuItem text="New" ui:field="newMenuItem" />
            <menu:MenuItem text="Open" ui:field="openMenuItem" />
            <menu:MenuItem text="Save"  ui:field="saveMenuItem" />
            <menu:MenuItem text="Save As" ui:field="saveAsMenuItem" />
          </menu:Menu>
        </menu:MenuBarItem>
      </menu:MenuBar>
    </gxt:topcomponent>
    <gxt:LayoutContainer layout="BorderLayout">
      <gxt:center>
        <gxt:LayoutContainer layout="FitLayout" ui:field="content" />
      </gxt:center>
      <gxt:south size="30">
        <gxt:Label ui:field="status" />
      </gxt:south>
    </gxt:LayoutContainer>
  </gxt:ContentPanel>
</ui:UiBinder>

Owner Class:

public class ApplicationShell extends Composite {

  static interface Binder extends UiBinder<Widget, ApplicationShell> {}
  private Binder BINDER = GWT.create(Binder.class);

  @UiField LayoutContainer content;
  @UiField Label status;

  public ApplicationShell() {
    initWidget(BINDER.createAndBindUi(this));
  }

  @GxtUiHandler(uiField="newMenuItem", eventType=GxtEvent.Select)
  public void newMenuItemClicked(MenuEvent event) {
     status.setText("new clicked");
  }

  @GxtUiHandler(uiField="openMenuItem", eventType=GxtEvent.Select)
  public void openMenuItemClicked(MenuEvent event) {
     status.setText("open clicked");
  }

  @GxtUiHandler(uiField={"saveMenuItem", "saveAsMenuItem"}, eventType=GxtEvent.Select)
  public void saveOrSaveAsClicked(MenuEvent event) {
     status.setText("save or save as clicked");
  }
}