GWT 2.0 RC1 Released

gwtWell, GWT 2.0 RC1 (yes!) is out. I was going to wait for a while with some of my new projects until switching them over to GWT 2.0, but given the pace of the GWT 2.0 project, I may just switch them over now rather than going through a painful migration.

I'm especially eager to use UiBinder to do declarative UI creation. Just specify how your interface should look in XML:

<!-- UserDashboard.ui.xml -->
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'
    xmlns:my='urn:import:com.my.app.widgets' >
 
  <g:HTMLPanel>
    <my:WeatherReport ui:field='weather'/>
    <my:Stocks ui:field='stocks'/>
    <my:CricketScores ui:field='scores' />
  </g:HTMLPanel>
</ui:UiBinder>
 

and write some Java to instantiate it:

public class UserDashboard extends Composite {
  interface MyUiBinder extends UiBinder<Widget, UserDashboard>;
  private static final MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
 
  private final String[] teamNames;
 
  public UserDashboard(String... teamNames) {
    this.teamNames = teamNames;
    initWidget(uiBinder.createAndBindUi(this));
  }
 
  /** Used by MyUiBinder to instantiate CricketScores */
  @UiFactory CricketScores makeCricketScores() { // method name is insignificant
    return new CricketScores(teamNames);
  }
}
 

Obviously there's a little more to it than this. I'll try to post a little howto over the weekend. There's already a few examples out there, but when it comes to a new feature like this, the more explanations, the better.

Related posts:

  1. GWT, Gadgets and OpenSocial
  2. Released: QxWT-0.8.2-RC1 – GWT Wrapper for qooxdoo
  3. GWT and XUL
  4. MetaWidget – Convention over Configuration UI
  5. GWT 2.0: Cool Beans on In Browser Development Mode

Topics: ,

Comments: 2 so far

  1. I’ve also done a bit of a tutorial on my blog:

    http://eggsylife.co.uk/2009/11/01/gwt-2-0-declarative-interfaces/

    Comment by James Heggs, Thursday, November 19, 2009 @ 3:14 am

  2. [...] GWT 2.0 RC1 Released | Pathfinder Development | Software Developers | Blogs [...]

    Pingback by Ennuyer.net » Blog Archive » Rails Reading - November 24, 2009, Tuesday, November 24, 2009 @ 4:46 pm

Leave a comment

Powered by WP Hashcash

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com