View Javadoc

1   package org.kuali.student.lum.program.client.events;
2   
3   import com.google.gwt.event.shared.EventHandler;
4   import com.google.gwt.event.shared.GwtEvent;
5   import org.kuali.student.common.ui.client.mvc.Callback;
6   import org.kuali.student.common.ui.client.mvc.Controller;
7   
8   /**
9    * @author Igor
10   */
11  public class UpdateEvent extends GwtEvent<UpdateEvent.Handler> {
12  
13      public static Type<Handler> TYPE = new Type<Handler>();
14  
15      private Callback<Boolean> okCallback;
16  
17      private Enum<?> currentView;
18  
19      public UpdateEvent() {
20          this(Controller.NO_OP_CALLBACK);
21      }
22  
23      public UpdateEvent(Enum<?> currentView) {
24          this();
25          this.currentView = currentView;
26      }
27  
28      public UpdateEvent(Callback<Boolean> okCallback) {
29          this.okCallback = okCallback;
30      }
31  
32      @Override
33      public Type<Handler> getAssociatedType() {
34          return TYPE;
35      }
36  
37      @Override
38      protected void dispatch(Handler handler) {
39          handler.onEvent(this);
40      }
41  
42      public Callback<Boolean> getOkCallback() {
43          return okCallback;
44      }
45  
46      public Enum<?> getCurrentView() {
47          return currentView;
48      }
49  
50      public static interface Handler extends EventHandler {
51          void onEvent(UpdateEvent event);
52      }
53  }