Version 0.7 released!

517 views
Skip to first unread message

Philippe Beaudoin

unread,
Feb 1, 2012, 1:59:35 PM2/1/12
to gwt-pl...@googlegroups.com
We just released version 0.7 of GWTP. You can get it from the download section: 
  http://code.google.com/p/gwt-platform/downloads/list 
Or from Maven Central, see:
  http://code.google.com/p/gwt-platform/wiki/UsingGwtpWithMaven 

See the release notes for details: 
  http://code.google.com/p/gwt-platform/wiki/ReleaseNotes 

This version has very little breaking changes, but they should all be easy to fix. Details on migrating to 0.7 are available here: 
  http://code.google.com/p/gwt-platform/wiki/PortingV1#V0.7

You can get the samples from the downloads section. Information on how to run them from a command line or in Eclipse are given here: 
  http://code.google.com/p/gwt-platform/wiki/RunningGwtpSamples

If you're interested to see GWTP in production apps, check out:
(If you want to see your application in this list, just send me an email saying why you like GWTP! ;))

Have fun with GWTP!

Lucas Mansbridge

unread,
Feb 1, 2012, 2:55:10 PM2/1/12
to gwt-pl...@googlegroups.com
Thank you!  Migrated already.

Konstantin Zolotarev

unread,
Feb 2, 2012, 1:28:19 AM2/2/12
to gwt-pl...@googlegroups.com
Great news ! thank you very much for your hard work!

Also could you change meta title value here :

Konstantin Zolotarev

unread,
Feb 2, 2012, 1:41:30 AM2/2/12
to gwt-pl...@googlegroups.com
The last version of GWTP eclipse plugin is 0.6.1.201109181204 ?

Matija Jerković

unread,
Feb 2, 2012, 5:13:14 AM2/2/12
to gwt-pl...@googlegroups.com
Hm... Am I missing something or you didn't change annotation and boilerplate generation code for events ? 

Web.bindery EventBus doesn't implement HasHandlers and if I inject somewhere EventBus I can't use generated fire method because it doesn't implement HasHandlers. I can't inject SimpleEventBus (that extends shared EventBus that implements HasHandler) because I would get different eventbus object and not gwtp one.

I have noticed in your processor source that you included indeed web.bindery HandlerRegistration.

I agree that there is easy workaround:

//                CurrentUserChangedEvent.fire(eventBus, null);
                eventBus.fireEvent(new CurrentUserChangedEvent(null));

jon

unread,
Feb 2, 2012, 5:42:00 AM2/2/12
to gwt-pl...@googlegroups.com
I am also having this problem. Is this something that will be fixed or shall we switch to using eventBus.fireEvent?

The method fire(HasHandlers, ...) in the type MyEvent is not applicable for the arguments (EventBus, ...)

I have another problem with my generated actions with @Optional annotations. It seems there is no constructor being generated for them:

The constructor MyTestAction(long, long, boolean) is undefined

My action:

@GenDispatch(isSecure = true, serviceName = ActionImpl.DEFAULT_SERVICE_NAME)
public class MyTest
{
    @In(1)
    long test;
       
    @In(2)
    long test2;
   
    @Optional
    @In(3)
    Boolean confirm;
}

Philippe Beaudoin

unread,
Feb 2, 2012, 8:56:02 AM2/2/12
to gwt-pl...@googlegroups.com
Strange... This must mean we have not test/sample for these. I'll double check, add them, and try to quickly release a new version.

Cheers,

   Philippe

Philippe Beaudoin

unread,
Feb 2, 2012, 10:19:17 AM2/2/12
to gwt-pl...@googlegroups.com, Michael Renaud
Yes. I'm no longer maintaining the Eclipse Plugin, for lack of time. :(
Michael Renaud is the man behind this awesome tool, if you love it, or if you encounter any problem with it, just let him know!

Philippe Beaudoin

unread,
Feb 2, 2012, 11:04:55 AM2/2/12
to gwt-pl...@googlegroups.com
Jon & Matija:
After further investigation, it appears that this is exactly the desired behavior. The reason the static method expects an "HasHandlers" instead of an "EventBus" is to make it possible to track the origin of the event. Your workaround works, but the real way to solve the problem is to make your origin (the object firing the event) an HasHandlers. This works out of the box if presenters (or presenter widgets) fire the event (as they already implement HasHandlers) otherwise just implement the HasHandlers interface together with its unique method "fireEvent". See CurrentUser in gwt-sample-tab for an example, copied here:

public class CurrentUser implements HasHandlers {

  private boolean isAdmin = true;

  private final EventBus eventBus;

  @Inject
  public CurrentUser(EventBus eventBus) {
    this.eventBus = eventBus;
  }

  public void setAdmin(boolean isAdmin) {
    this.isAdmin = isAdmin;
    CurrentUserChangedEvent.fire(this);
  }

  public boolean isAdmin() {
    return isAdmin;
  }

  @Override
  public void fireEvent(GwtEvent<?> event) {
    eventBus.fireEvent(event);
  }
}

I'm looking into the @Optional issue.

   Philippe

On Thu, Feb 2, 2012 at 5:42 AM, jon <sar...@gmail.com> wrote:

Philippe Beaudoin

unread,
Feb 2, 2012, 11:18:39 AM2/2/12
to gwt-pl...@googlegroups.com, Brendan Doherty
+Brendan Doherty (who worked on this)

Ok, here are how optional input parameters are handled (from AnnotationProcessingTest in gwtp-dispatch-shared):

Given:

@GenDispatch
public class RetrieveFoo {
  @In(1)
  int fooId;

  @In(2)
  @Optional
  String additionalQuestion;

  @Out(1)
  Foo foo;

  @Out(2)
  int meaningOfLife;

  @Out(3)
  @Optional
  boolean answer42;
}

You would build it with:
RetrieveFooAction action = new RetrieveFooAction.Builder(42).additionalQuestion("meaning of life").build();

This makes it possible to have many optional parameters without having a combinatorial explosion of constructors and while allowing the omission of any of the missing parameter. Granted, it's a bit verbose... I wouldn't be against allowing the specification of some static builders using annotations (say, if you have a frequent use case for an optional parameter).

Cheers,

   Philippe 

jon

unread,
Feb 2, 2012, 11:52:21 AM2/2/12
to gwt-pl...@googlegroups.com
That explains it, thanks Philippe for looking into it.

It's very nice to be able to use many different optional parameters and I see the Builder approach is
used for events as well. Maybe you should mention something about this in the porting notes.

Now I just have to change some 600+ occurances of events and actions before my code compiles ;)

Philippe Beaudoin

unread,
Feb 2, 2012, 11:55:15 AM2/2/12
to gwt-pl...@googlegroups.com
Ouch. Yeah... it's a drawback of our "mercilessly refactor" approach. :) Sorry...

I'll add that to the release notes, although as I'm not responsible for that change I don't remember when it was done. I'll track it down. :)

Konstantin Zolotarev

unread,
Feb 5, 2012, 4:02:23 AM2/5/12
to gwt-pl...@googlegroups.com, Michael Renaud
After Updating to new GWTP version into my project. GWTP plugin still crete new presenters using old Path ot EventBus and HandlerRegistration.

And attached patch to fix it. 

Christian Goudreau

unread,
Feb 5, 2012, 11:09:16 AM2/5/12
to gwt-pl...@googlegroups.com, Michael Renaud
Thanks a lot for the fix! CR Done.
--
Christian Goudreau
Reply all
Reply to author
Forward
0 new messages