|
UserActions
User actions overview
IntroductionAs you already know if you have seen the Google IO session, the idea behind user actions is to track what users are doing in your application. As easy as adding an annotationIn Guit you can track UserActions adding the @UserAction("Some text") annotation to any MethodHandler (see HandlersParametersBinding). Example (from contacts demo) @ViewHandler
protected void addButton$click() {
placeManager.go(EditContactPresenter.class);
}To track a user action on that method: @ViewHandler
@UserAction("Add contact")
protected void addButton$click() {
placeManager.go(EditContactPresenter.class);
}That's it! Tacking the UserActionsGuit do not provide any UserAction tracker, that's up to you. Every user action fires an UserActionEvent to the EventBus. So you can subscribe to it at any place in your application. The event has the annotation String and the Component class (the class that owns the method that caused the user action). public class UserActionEvent extends GwtEvent<UserActionHandler> {
private final String userAction;
private final Class<?> component;
...
| |