GWT UiBinder support

The first IntelliJ IDEA 9.0.2 EAP build will add support for UiBinder, new functionality introduced in GWT 2.0. IntelliJ IDEA will understand tags and attributes in ui.xml files:

Inconsistencies between ui.xml file and associated Java class will be highlighted:

You can jump from field to the corresponding tag by using icon on the gutter:

Also IDE provides actions to quickly create new ui.xml file with associated Java class (in Edit | New | Google Web Toolkit menu) and to generate @UiHandler method (in Code | Generate menu).

Expect new version EAP to be published shortly.

This entry was posted in New Features and tagged , . Bookmark the permalink.

5 Responses to GWT UiBinder support

  1. David says:

    I have 9.0.2 but this integration doesn’t seem to be working for me. How do I activate it?

    thanks

  2. Nikolay Chashnikov says:

    Do you have GWT facet in your module?

  3. While the UiBinder support you describe here works perfectly, there is still one important issue that IntelliJ has yet to support:

    It seems that methods invoked via UiBinders are marked as unused.
    For instance, you have a field declared (in java file):

    @UiBinder
    JespersHyperLink aboutlink;

    And imagine that the JespersHyperLink class has a `setTextAndTitle(String s)` metod. UiBinder syntax allows you to call setters directly from the .ui.xml file on instantiation, which is a good way for me to keep java class size down.

    Unfortunately, the code inspection grays out the metod and postulates it’s unused.

    This is very wrong. Do you have focus on correcting this behaviour?

  4. Alexander Vasiljev says:

    Hello Jesper.

    If aboutlink is not invoked from Java code, it may still exists in ui.xml (with or without ui:field binding) with setters called there. So aboutlink field is really unused and could be deleted.

  5. @Alexander:
    > So aboutlink field is really unused and could be deleted.

    You are right, i could delete @UiField aboutLink in my Java class

    But i think you are missing the point: IntelliJ incrorrectly marks `JespersHyperLink.setTextAndTitle()` as being unused.

    I think that is incorrect: JespersHyperLink.setTextAndTitle() is used in the UiBinder files. So IntelliJ should mark it as used. AND “find usages” should show the usage in uibinder file.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>