Implementation of
TokenFormatter with support for route like place names.
Instead of wiring a hierarchy of several places bound to multiple presenters this implements a flat structure where
every history token is bound to a single presenter.
Usage:
Replace the default binding to
ParameterTokenFormatter with
RouteTokenFormatter. In case you use
GWTPs
com.gwtplatform.mvp.client.gin.DefaultModule:
install(new DefaultModule(DefaultPlaceManager.class, RouteTokenFormatter.class));
Now all @NameToken's are treated as routes. Routes are expected to start with an '/' and can contain path parameters
as well as query parameters.
@NameToken("/user/{userId}/privacy") // Token for PrivacyPresenter}
@NameToken("/user/{userId}/privacy/profile") // Token for PrivacyProfilePresenter}
@NameToken("/user/{userId}/privacy/photos") // Token for PrivacyPhotosPresenter}
Static-parts of an route tie stronger than parameter-parts. This way following works:
@NameToken("/{vanityId}") // Token for VanityUrlPresenter}
@NameToken("/privacy") // Token for PrivacyPresenter
Note: For the moment this is implemented on top of the hierarchical-place API to not an big structural changes prior
1.0 release.