Chapter 6. Interface design with UiBinder

 

This chapter covers

  • Creating templates using markup instead of Java code
  • Binding templates to Java
  • Handling events
  • Adding style to templates

Let’s face facts: programmers aren’t usually good designers. It all comes down to specialization. Whereas some of us specialize in application development, others specialize in making those applications look great.

When you look at traditional web frameworks, there’s always some sort of template tool that bridges the gap between developer and designer. The most common of these for Java frameworks is Java Server Pages (JSP), which allows you to mix the HTML a designer develops with data a developer provides. UiBinder is GWT’s designer-developer bridge, allowing you to design your interface in an HTML-like file instead of in your Java code.

And like many other template tools, it’s more than just a bridge; it also offers functionality to developers to increase productivity and reduce the amount of Java code they need to write. Let’s look at some of what you can expect to see in this chapter:

  • Mix HTML and widget declarations in a single XML template.
  • Bind widget declarations to variables in your code.
  • Bind widget events to methods (no more anonymous classes).
  • Write less Java code.

6.1. Binding the designer’s HTML to Java code

6.2. Handling events with UiBinder

6.3. Introducing the UiBinder expression language

6.4. Applying style with UiBinder

6.5. Using the Eclipse plug-in with UiBinder

6.6. Summary

sitemap