final Object sender = event.getSource();
// pop the view
if(sender == toolbar.btnPop) {
final boolean popped = isPopped();
ViewManager.get().dispatch(new PinPopViewRequest(key, !popped));
}
// close the view
else if(sender == toolbar.btnClose) {
ViewManager.get().dispatch(new UnloadViewRequest(key, true, false));