1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
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 | |
|
22 | |
|
23 | |
|
24 | |
|
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 | |
|
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 | |
} |