1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.common.ui.client.mvc; |
17 | |
|
18 | |
import java.util.List; |
19 | |
|
20 | |
import org.kuali.student.common.ui.client.security.AuthorizationCallback; |
21 | |
import org.kuali.student.common.ui.client.security.RequiresAuthorization; |
22 | |
import org.kuali.student.core.rice.authorization.PermissionType; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
@Deprecated |
34 | |
public class DelegatingViewComposite extends ViewComposite implements RequiresAuthorization { |
35 | |
Controller childController; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
public DelegatingViewComposite(Controller parentController, Controller childController, Enum<?> viewType) { |
42 | 0 | super(parentController, "DelegatingViewComposite", viewType); |
43 | 0 | initWidget(childController); |
44 | 0 | this.childController = childController; |
45 | 0 | } |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
@Override |
53 | |
public boolean beforeHide() { |
54 | 0 | return childController.getCurrentView().beforeHide(); |
55 | |
} |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
@Override |
61 | |
public void beforeShow(final Callback<Boolean> onReadyCallback) { |
62 | 0 | if (childController.getCurrentView() == null){ |
63 | 0 | childController.showDefaultView(onReadyCallback); |
64 | |
} else { |
65 | 0 | childController.getCurrentView().beforeShow(onReadyCallback); |
66 | |
} |
67 | 0 | } |
68 | |
|
69 | |
public Controller getChildController(){ |
70 | 0 | return childController; |
71 | |
} |
72 | |
|
73 | |
public void setChildController(Controller controller){ |
74 | 0 | this.childController = controller; |
75 | 0 | } |
76 | |
|
77 | |
@Override |
78 | |
public String collectHistory(String historyStack) { |
79 | 0 | return childController.collectHistory(historyStack); |
80 | |
} |
81 | |
|
82 | |
@Override |
83 | |
public void onHistoryEvent(String historyStack) { |
84 | 0 | childController.onHistoryEvent(historyStack); |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public void clear() { |
89 | 0 | childController.resetCurrentView(); |
90 | 0 | } |
91 | |
|
92 | |
@Override |
93 | |
public void checkAuthorization(PermissionType permissionType, AuthorizationCallback callback) { |
94 | 0 | if (childController instanceof RequiresAuthorization){ |
95 | 0 | ((RequiresAuthorization)childController).checkAuthorization(permissionType, callback); |
96 | |
} |
97 | 0 | } |
98 | |
|
99 | |
@Override |
100 | |
public boolean isAuthorizationRequired() { |
101 | 0 | if (childController instanceof RequiresAuthorization){ |
102 | 0 | return ((RequiresAuthorization)childController).isAuthorizationRequired(); |
103 | |
} else { |
104 | 0 | return false; |
105 | |
} |
106 | |
} |
107 | |
|
108 | |
@Override |
109 | |
public void setAuthorizationRequired(boolean required) { |
110 | 0 | if (childController instanceof RequiresAuthorization){ |
111 | 0 | ((RequiresAuthorization)childController).setAuthorizationRequired(required); |
112 | |
} |
113 | 0 | } |
114 | |
|
115 | |
@Override |
116 | |
public void collectBreadcrumbNames(List<String> names) { |
117 | 0 | childController.collectBreadcrumbNames(names); |
118 | |
|
119 | 0 | } |
120 | |
|
121 | |
} |