1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.organization.ui.client.mvc.controller; |
17 | |
|
18 | |
import java.util.List; |
19 | |
|
20 | |
import org.kuali.student.common.ui.client.mvc.Callback; |
21 | |
import org.kuali.student.common.ui.client.mvc.Controller; |
22 | |
import org.kuali.student.common.ui.client.mvc.DelegatingViewComposite; |
23 | |
import org.kuali.student.common.ui.client.mvc.View; |
24 | |
|
25 | |
import com.google.gwt.user.client.ui.Composite; |
26 | |
import com.google.gwt.user.client.ui.SimplePanel; |
27 | |
|
28 | |
|
29 | |
public class OrgApplicationManager extends Controller{ |
30 | 0 | private final SimplePanel viewPanel = new SimplePanel(); |
31 | 0 | private Controller orgProposalController = null; |
32 | 0 | private DelegatingViewComposite createOrgView = null; |
33 | |
|
34 | |
|
35 | |
public OrgApplicationManager(){ |
36 | 0 | super(OrgApplicationManager.class.getName()); |
37 | 0 | super.initWidget(viewPanel); |
38 | 0 | } |
39 | |
|
40 | 0 | public enum ORGViews { |
41 | 0 | CREATE_ORG |
42 | |
} |
43 | |
@Override |
44 | |
protected <V extends Enum<?>> void getView(V viewType, Callback<View> callback) { |
45 | |
|
46 | 0 | switch ((ORGViews) viewType) { |
47 | |
case CREATE_ORG: |
48 | 0 | initOrgView(); |
49 | 0 | callback.exec(createOrgView); |
50 | 0 | break; |
51 | |
default: |
52 | 0 | callback.exec(null); |
53 | |
} |
54 | |
|
55 | 0 | } |
56 | |
|
57 | |
@Override |
58 | |
public Class<? extends Enum<?>> getViewsEnum() { |
59 | 0 | return ORGViews.class; |
60 | |
} |
61 | |
|
62 | |
@Override |
63 | |
public Enum<?> getViewEnumValue(String enumValue) { |
64 | 0 | return ORGViews.valueOf(enumValue); |
65 | |
} |
66 | |
|
67 | |
@Override |
68 | |
protected void hideView(View view) { |
69 | |
|
70 | 0 | viewPanel.clear(); |
71 | 0 | } |
72 | |
|
73 | |
@Override |
74 | |
protected void renderView(View view) { |
75 | 0 | viewPanel.setWidget((Composite)view); |
76 | |
|
77 | 0 | } |
78 | |
|
79 | |
@Override |
80 | |
public void showDefaultView(final Callback<Boolean> onReadyCallback) { |
81 | 0 | initOrgView(); |
82 | 0 | showView(ORGViews.CREATE_ORG, onReadyCallback); |
83 | |
|
84 | 0 | } |
85 | |
|
86 | |
private View initOrgView(){ |
87 | 0 | orgProposalController = new OrgProposalController(); |
88 | 0 | createOrgView = new DelegatingViewComposite(OrgApplicationManager.this,orgProposalController, ORGViews.CREATE_ORG); |
89 | 0 | return createOrgView; |
90 | |
|
91 | |
} |
92 | |
|
93 | |
@Override |
94 | |
public void collectBreadcrumbNames(List<String> names) { |
95 | |
|
96 | 0 | } |
97 | |
|
98 | |
} |