1 | |
package org.kuali.student.lum.program.client.credential.edit; |
2 | |
|
3 | |
import org.kuali.student.common.ui.client.configurable.mvc.Configurer; |
4 | |
import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor; |
5 | |
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
6 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.HorizontalSection; |
7 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection; |
8 | |
import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView; |
9 | |
import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration; |
10 | |
import org.kuali.student.lum.program.client.ProgramConstants; |
11 | |
import org.kuali.student.lum.program.client.ProgramMsgConstants; |
12 | |
import org.kuali.student.lum.program.client.ProgramSections; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
public class CredentialInformationEditConfiguration extends AbstractSectionConfiguration { |
18 | |
|
19 | 0 | public CredentialInformationEditConfiguration(Configurer configurer) { |
20 | 0 | this.setConfigurer(configurer); |
21 | 0 | rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_EDIT, getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_PROGRAMINFORMATION), |
22 | |
ProgramConstants.PROGRAM_MODEL_ID); |
23 | 0 | } |
24 | |
|
25 | |
@Override |
26 | |
protected void buildLayout() { |
27 | 0 | HorizontalSection horizontalSection = new HorizontalSection(); |
28 | 0 | horizontalSection.addSection(createLeftSection()); |
29 | 0 | rootSection.addSection(horizontalSection); |
30 | 0 | } |
31 | |
|
32 | |
private VerticalSection createLeftSection() { |
33 | 0 | VerticalSection section = new VerticalSection(); |
34 | 0 | section.addSection(createKeyProgramInformationSection()); |
35 | 0 | section.addSection(createProgramTitleSection()); |
36 | 0 | section.addSection(createDatesSection()); |
37 | 0 | section.addSection(createOtherInformationSection()); |
38 | 0 | return section; |
39 | |
} |
40 | |
|
41 | |
private VerticalSection createKeyProgramInformationSection() { |
42 | 0 | VerticalSection section = new VerticalSection(); |
43 | 0 | configurer.addField(section, ProgramConstants.CODE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CODE)); |
44 | 0 | configurer.addField(section, ProgramConstants.PROGRAM_LEVEL, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_LEVEL)); |
45 | 0 | configurer.addField(section, ProgramConstants.DEGREE_TYPE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_DEGREETYPE)); |
46 | 0 | return section; |
47 | |
} |
48 | |
|
49 | |
private VerticalSection createProgramTitleSection() { |
50 | 0 | VerticalSection section = new VerticalSection(); |
51 | 0 | configurer.addField(section, ProgramConstants.LONG_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLEFULL)); |
52 | 0 | configurer.addField(section, ProgramConstants.SHORT_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLESHORT)); |
53 | 0 | return section; |
54 | |
} |
55 | |
|
56 | |
private VerticalSection createDatesSection() { |
57 | 0 | VerticalSection section = new VerticalSection(SectionTitle.generateH3Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_DATES))); |
58 | |
|
59 | 0 | FieldDescriptor fd = configurer.addField(section,ProgramConstants.PROPOSAL_PREV_START_TERM_PATH, generateMessageInfo(ProgramMsgConstants.MAJORDISCIPLINE_PREVSTARTTERM)); |
60 | 0 | fd.getFieldWidget().setVisible(false); |
61 | 0 | fd.hideLabel(); |
62 | 0 | configurer.addField(section, ProgramConstants.START_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_STARTTERM)); |
63 | 0 | configurer.addField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENTRYTERM)); |
64 | 0 | configurer.addField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENROLLTERM)); |
65 | 0 | return section; |
66 | |
} |
67 | |
|
68 | |
private VerticalSection createOtherInformationSection() { |
69 | 0 | VerticalSection section = new VerticalSection(SectionTitle.generateH3Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_OTHERINFORMATION))); |
70 | 0 | configurer.addField(section, ProgramConstants.INSTITUTION + "/" + ProgramConstants.ORG_ID, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_INSTITUTION)); |
71 | 0 | return section; |
72 | |
} |
73 | |
} |