1 | |
package org.kuali.student.lum.program.client.credential.edit; |
2 | |
|
3 | |
import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor; |
4 | |
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
5 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.HorizontalSection; |
6 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection; |
7 | |
import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView; |
8 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo; |
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.ProgramSections; |
12 | |
import org.kuali.student.lum.program.client.properties.ProgramProperties; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
public class CredentialInformationEditConfiguration extends AbstractSectionConfiguration { |
18 | |
|
19 | 0 | public CredentialInformationEditConfiguration() { |
20 | 0 | rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_EDIT, ProgramProperties.get().program_menu_sections_programInformation(), ProgramConstants.PROGRAM_MODEL_ID); |
21 | 0 | } |
22 | |
|
23 | |
@Override |
24 | |
protected void buildLayout() { |
25 | 0 | HorizontalSection horizontalSection = new HorizontalSection(); |
26 | 0 | horizontalSection.addSection(createLeftSection()); |
27 | 0 | rootSection.addSection(horizontalSection); |
28 | 0 | } |
29 | |
|
30 | |
private VerticalSection createLeftSection() { |
31 | 0 | VerticalSection section = new VerticalSection(); |
32 | 0 | section.addSection(createKeyProgramInformationSection()); |
33 | 0 | section.addSection(createProgramTitleSection()); |
34 | 0 | section.addSection(createDatesSection()); |
35 | 0 | section.addSection(createOtherInformationSection()); |
36 | 0 | return section; |
37 | |
} |
38 | |
|
39 | |
private VerticalSection createKeyProgramInformationSection() { |
40 | 0 | VerticalSection section = new VerticalSection(); |
41 | 0 | configurer.addField(section, ProgramConstants.CODE, new MessageKeyInfo(ProgramProperties.get().programInformation_code())); |
42 | 0 | configurer.addField(section, ProgramConstants.PROGRAM_LEVEL, new MessageKeyInfo(ProgramProperties.get().programInformation_level())); |
43 | 0 | configurer.addField(section, ProgramConstants.DEGREE_TYPE, new MessageKeyInfo(ProgramProperties.get().programInformation_degreeType())); |
44 | 0 | return section; |
45 | |
} |
46 | |
|
47 | |
private VerticalSection createProgramTitleSection() { |
48 | 0 | VerticalSection section = new VerticalSection(); |
49 | 0 | configurer.addField(section, ProgramConstants.LONG_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleFull())); |
50 | 0 | configurer.addField(section, ProgramConstants.SHORT_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleShort())); |
51 | 0 | return section; |
52 | |
} |
53 | |
|
54 | |
private VerticalSection createDatesSection() { |
55 | 0 | VerticalSection section = new VerticalSection(SectionTitle.generateH3Title(ProgramProperties.get().programInformation_dates())); |
56 | |
|
57 | 0 | FieldDescriptor fd = configurer.addField(section,ProgramConstants.PROPOSAL_PREV_START_TERM_PATH, new MessageKeyInfo(ProgramProperties.get().majorDiscipline_prevStartTerm())); |
58 | 0 | fd.getFieldWidget().setVisible(false); |
59 | 0 | fd.hideLabel(); |
60 | 0 | configurer.addField(section, ProgramConstants.START_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_startTerm())); |
61 | 0 | configurer.addField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_entryTerm())); |
62 | 0 | configurer.addField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_enrollTerm())); |
63 | 0 | return section; |
64 | |
} |
65 | |
|
66 | |
private VerticalSection createOtherInformationSection() { |
67 | 0 | VerticalSection section = new VerticalSection(SectionTitle.generateH3Title(ProgramProperties.get().programInformation_otherInformation())); |
68 | 0 | configurer.addField(section, ProgramConstants.INSTITUTION + "/" + ProgramConstants.ORG_ID, new MessageKeyInfo(ProgramProperties.get().programInformation_institution())); |
69 | 0 | return section; |
70 | |
} |
71 | |
} |