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