Monday, April 28, 2014

Re: menus with UIBinder

What about reflection? I noticed that java.lang.reflect is not available in GWT.

I would have done it like this:

@UiField MenuItem itm_Login;

private void init ()
 setCommand (itm_Login,"cmd_Login"); // one line per item

private void setCommand (MenuItem itm,String cmd)
 final Method m = this.class.getMethod (cmd,null);

   new ScheduledCommand ()
    public void execute ()
     m.invoke ...

Aren't there similar methods to do this?

I will try everything before going on with so much boilerplate code...


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment