GWT Exporter now in googlecode repository

11 views
Skip to first unread message

Ray Cromwell

unread,
Jun 15, 2007, 3:28:39 AM6/15/07
to Google-Web-Tool...@googlegroups.com

I just dropped a version in code.google.com/p/gwt-exporter which includes closure support.

Currently missing:
cross-platform 'hassle free' out-of-the-box build scripts (we use maven internally, but that's because we've got our own intranet repository holding all the GWT jars for every platform)
unit tests

As a sample, you can write code like this:

/**
  * @gwt.exportClosure
*/
public interface ClickListener implements Exportable {
  public void onClick(Blah b);
}


/**
  * @gwt.export
 */
public Blah {
  private ClickListener listener;

  public void addListener(ClickListener foo) {
     listener=foo;
  }

  public String getFoo() {
     return "foo";
  }

  public void fireClick() {
      if(listener != null) listener.onClick(this);
  }
}



and then in Javascript, write

var b = new Blah();
b.addListener(function(blah) { alert("Got a "+blah.getFoo()); });
b.fireClick();

-Ray

Scott Blum

unread,
Jun 15, 2007, 11:36:44 AM6/15/07
to Google-Web-Tool...@googlegroups.com
That sounds.... really sweet!

Alex Tkachman

unread,
Jun 15, 2007, 4:01:58 PM6/15/07
to Google-Web-Tool...@googlegroups.com
I agree.
I would love to see it contributed to core GWT because it opens huge
possibilities.

Ray, I am not Google employee so it is easy to ask - what do you think
about contributing this stuff to GWT?

Googlers, what do you think?

Ray Cromwell

unread,
Jun 15, 2007, 5:11:05 PM6/15/07
to Google-Web-Tool...@googlegroups.com

Absolutely zero inhibitions to doing so. :) I wrote the code to solve a need we had internally, as well as a teaching tool on my blog, so I always intended to give it away, and nothing would make me happier than to see people using it, contributing to it, or absorbing it into GWT.  I think the GWT guys will have to code-review it first, because I'm not sure if it conforms to Google conventions. I also have to sign a CLA, I just haven't gotten around to it yet.

-Ray

Ray Cromwell

unread,
Jun 15, 2007, 5:21:20 PM6/15/07
to Google-Web-Tool...@googlegroups.com

BTW, I just put up a new GWT Demystified article explaining some of how it works.

-Ray
Reply all
Reply to author
Forward
0 new messages