Thank you for those points you mentioned.
Actually in my case we are developers and so would have a preferences in
java code rather than in xml instructions.

What I also wonder is if there are some optimisations in using one or the
other method.
Do you have any idea?

Le 26 janv. 2010, 7:57 PM, "Mirco" <mirco.li...@gmail.com> a écrit :

Hi Gerald,

declarative UI have some good advantages. The ones that first pop up in my
mind are:

- Your Web designers (which are usually not very used to Java fanciness) can
be more confident while
   retouching the layout of your application. Which also decrease the
chances that several people (devs
   and designers) touch the same file, with the risk of nasty conflicts to
resolve.


- A second advantage goes back to the verbosity of Java, which has not been
designed to be a GUI language
  (rather it is a general-purpose language). Cf this example from the GWT
Tutorial.
   http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

public class MyFoo extends Composite {

  Button button = new Button();

  public MyFoo() {

    button.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {

        handleClick();
      }
    });
    initWidget(button);
  }

  void handleClick() {
    Window.alert("Hello, AJAX");

  }
}

In a UiBinder owner class, you can use the @UiHandler annotation to have all
of that anonymous class nonsense written for you.

public class MyFoo extends Composite {
  @UiField Button button;

  public MyFoo() {
    initWidget(button);
  }

  @UiHandler("button")
  void handleClick(ClickEvent e) {

    Window.alert("Hello, AJAX");
  }
}

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Hope this helps.


Cheers,
  Mirco


On Jan 26, 2010, at 7:04 PM, Djay wrote:

> Hello, > > I've started using gwt for a couple of weeks and still face a
question > on which I cou...
-- 
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to