Coverage Report - org.kuali.student.common.ui.client.event.SaveActionEvent
 
Classes in this File Line Coverage Branch Coverage Complexity
SaveActionEvent
0%
0/30
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.common.ui.client.event;
 17  
 
 18  
 import org.kuali.student.common.ui.client.mvc.HasActionState;
 19  
 
 20  
 /**
 21  
  * A save event with user defined save types. This allows a single widget to handle
 22  
  * different types of save events without having to create new events and handlers. 
 23  
  * 
 24  
  * @author Kuali Student Team
 25  
  *
 26  
  */
 27  0
 public class SaveActionEvent extends ActionEvent<SaveActionHandler> implements HasActionState{
 28  0
     public static final Type<SaveActionHandler> TYPE = new Type<SaveActionHandler>();
 29  
     
 30  
     private ActionState actionState;
 31  0
     private String message = "Saving";
 32  0
     private boolean acknowledgeRequired = true;
 33  0
     private boolean gotoNextView = false;
 34  0
     private boolean saveSuccessful = false;
 35  
     
 36  0
     public SaveActionEvent(){
 37  0
     }
 38  
     
 39  0
     public SaveActionEvent(boolean gotoNextView){
 40  0
             this.gotoNextView = gotoNextView;
 41  0
     }
 42  
     
 43  0
     public SaveActionEvent(String message){
 44  0
         this.message = message;
 45  0
     }    
 46  
    
 47  
     @Override
 48  
     protected void dispatch(SaveActionHandler handler) {
 49  0
         handler.doSave(this);
 50  0
     }
 51  
 
 52  
     @Override
 53  
     public Type<SaveActionHandler> getAssociatedType() {
 54  0
         return TYPE;
 55  
     }
 56  
         
 57  
 
 58  
     public void setActionState(ActionState state){
 59  0
         this.actionState = state;
 60  0
     }
 61  
     
 62  
     /**
 63  
      * @see org.kuali.student.common.ui.client.mvc.HasActionState#getActionState()
 64  
      */
 65  
     @Override
 66  
     public ActionState getActionState() {
 67  0
         return this.actionState;
 68  
     }
 69  
     
 70  
     public String getMessage(){
 71  0
         return message;
 72  
     }
 73  
 
 74  
     public boolean isAcknowledgeRequired() {
 75  0
         return acknowledgeRequired;
 76  
     }
 77  
 
 78  
     public void setAcknowledgeRequired(boolean acknowledgeRequired) {
 79  0
         this.acknowledgeRequired = acknowledgeRequired;
 80  0
     }
 81  
     
 82  
     public boolean gotoNextView(){
 83  0
             return gotoNextView;
 84  
     }
 85  
 
 86  
         public void setGotoNextView(boolean gotoNextView) {
 87  0
                 this.gotoNextView = gotoNextView;
 88  0
         }
 89  
 
 90  
         public void setSaveSuccessful(boolean saveSuccessful) {
 91  0
                 this.saveSuccessful = saveSuccessful;
 92  0
         }
 93  
 
 94  
         public boolean isSaveSuccessful() {
 95  0
                 return saveSuccessful;
 96  
         }
 97  
     
 98  
 }