My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Debug  
Debug annotation overview
Updated Aug 18, 2010 by gal.dol...@gmail.com

Overview

Another extension of the EventBinding system is the @Debug annotation.

If you ever need to inspect the parameters of a handler and you don't want to stop the execution and re-run as debug, you can annotate the handler with @Debug. That will print a log with the parameters when the handler gets called.

Example:

    @ViewHandler
    @HasAttribute({"action", "index"})
    @Debug
    protected void contactsTable$click(@Attribute Actions action, @Attribute Integer index) {
        ContactDetails contactDetail = contactDetails.get(index);
        if (action.equals(Actions.CLICK)) {
            placeManager.go(EditContactPresenter.class, contactDetail.getId());
        } else {
            if (selectionModel.isSelected(contactDetail)) {
                selectionModel.removeSelection(contactDetail);
            } else {
                selectionModel.addSelection(contactDetail);
            }
        }
    }

Log:

@Debug com.google.gwt.sample.contacts.client.contacts.ContactsPresenter.contactsTable$click
@Debug----> action: SELECT
@Debug----> index: 14
Powered by Google Project Hosting