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 Enum<?> getViewEnumValue(String enumValue) { |
59 | 0 | return ORGViews.valueOf(enumValue); |
60 | |
} |
61 | |
|
62 | |
@Override |
63 | |
protected void hideView(View view) { |
64 | |
|
65 | 0 | viewPanel.clear(); |
66 | 0 | } |
67 | |
|
68 | |
@Override |
69 | |
protected void renderView(View view) { |
70 | 0 | viewPanel.setWidget((Composite)view); |
71 | |
|
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public void showDefaultView(final Callback<Boolean> onReadyCallback) { |
76 | 0 | initOrgView(); |
77 | 0 | showView(ORGViews.CREATE_ORG, onReadyCallback); |
78 | |
|
79 | 0 | } |
80 | |
|
81 | |
private View initOrgView(){ |
82 | 0 | orgProposalController = new OrgProposalController(); |
83 | 0 | createOrgView = new DelegatingViewComposite(OrgApplicationManager.this,orgProposalController, ORGViews.CREATE_ORG); |
84 | 0 | return createOrgView; |
85 | |
|
86 | |
} |
87 | |
|
88 | |
@Override |
89 | |
public void collectBreadcrumbNames(List<String> names) { |
90 | |
|
91 | 0 | } |
92 | |
|
93 | |
} |