April 2018
Intermediate to advanced
202 pages
4h 48m
English
Custom reusable UI components should not depend on the mechanism used to handle internationalization. The LoginFormComponent, for instance, should include setters (or alternatively, parameters in the constructor) to configure the captions of the inner UI components. The following implementation shows how to use setters to configure captions in the login form:
public class LoginFormComponent extends Composite {
...
private String usernameCaption = "Username"; private String passwordCaption = "Password"; private String loginButtonCaption = "Log in"; private String rememberMeCaption = "Remember me"; public LoginFormComponent() { LoginForm loginForm = new LoginForm() { @Override protected Component createContent(...) ...Read now
Unlock full access