1 | |
package org.kuali.student.lum.program.client.credential.view; |
2 | |
|
3 | |
import org.kuali.student.common.ui.client.configurable.mvc.Configurer; |
4 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection; |
5 | |
import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView; |
6 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo; |
7 | |
import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration; |
8 | |
import org.kuali.student.lum.program.client.ProgramConstants; |
9 | |
import org.kuali.student.lum.program.client.ProgramMsgConstants; |
10 | |
import org.kuali.student.lum.program.client.ProgramSections; |
11 | |
import org.kuali.student.lum.program.client.credential.CredentialEditableHeader; |
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
public class CredentialManagingBodiesViewConfiguration extends AbstractSectionConfiguration { |
17 | |
|
18 | |
public static CredentialManagingBodiesViewConfiguration create(Configurer configurer) { |
19 | 0 | return new CredentialManagingBodiesViewConfiguration(configurer, false); |
20 | |
} |
21 | |
|
22 | |
public static CredentialManagingBodiesViewConfiguration createSpecial(Configurer configurer) { |
23 | 0 | return new CredentialManagingBodiesViewConfiguration(configurer, true); |
24 | |
} |
25 | |
|
26 | 0 | private CredentialManagingBodiesViewConfiguration(Configurer configurer, boolean isSpecial) { |
27 | 0 | this.setConfigurer(configurer); |
28 | 0 | String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_MANAGINGBODIES); |
29 | 0 | if (!isSpecial){ |
30 | 0 | this.rootSection = new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, |
31 | |
ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title, ProgramSections.MANAGE_BODIES_EDIT)); |
32 | |
} else { |
33 | 0 | this.rootSection = new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, |
34 | |
ProgramConstants.PROGRAM_MODEL_ID); |
35 | |
} |
36 | 0 | } |
37 | |
|
38 | |
@Override |
39 | |
protected void buildLayout() { |
40 | 0 | VerticalSection section = createMainSection(); |
41 | 0 | rootSection.addSection(section); |
42 | 0 | } |
43 | |
|
44 | |
private VerticalSection createMainSection() { |
45 | 0 | VerticalSection section = new VerticalSection(); |
46 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramMsgConstants.MANAGINGBODIES_CURRICULUMOVERSIGHTDIVISION)); |
47 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramMsgConstants.MANAGINGBODIES_CURRICULUMOVERSIGHTUNIT)); |
48 | 0 | configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramMsgConstants.MANAGINGBODIES_STUDENTOVERSIGHTDIVISION)); |
49 | 0 | configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramMsgConstants.MANAGINGBODIES_STUDENTOVERSIGHTUNIT)); |
50 | 0 | return section; |
51 | |
} |
52 | |
} |