View Javadoc

1   package org.kuali.student.lum.program.client.major.view;
2   
3   import org.kuali.student.common.ui.client.configurable.mvc.sections.CollapsableSection;
4   import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection;
5   import org.kuali.student.common.ui.client.configurable.mvc.views.SectionView;
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.major.MajorEditableHeader;
12  import org.kuali.student.lum.program.client.properties.ProgramProperties;
13  import org.kuali.student.lum.program.client.widgets.EditableHeader;
14  
15  /**
16   * @author Igor
17   */
18  public class ManagingBodiesViewConfiguration extends AbstractSectionConfiguration {
19  
20      public static ManagingBodiesViewConfiguration create() {
21          return new ManagingBodiesViewConfiguration(new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, ProgramProperties.get().program_menu_sections_managingBodies(), ProgramConstants.PROGRAM_MODEL_ID));
22      }
23  
24      public static ManagingBodiesViewConfiguration createSpecial() {
25          String title = ProgramProperties.get().program_menu_sections_managingBodies();
26          return new ManagingBodiesViewConfiguration(new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, ProgramConstants.PROGRAM_MODEL_ID, new MajorEditableHeader(title, ProgramSections.MANAGE_BODIES_EDIT)));
27      }
28  
29      private ManagingBodiesViewConfiguration(SectionView sectionView) {
30          rootSection = sectionView;
31      }
32  
33      @Override
34      protected void buildLayout() {
35          VerticalSection section = createMainSection();
36          CollapsableSection collapsableSection = createAdditionalSection();
37          rootSection.addSection(section);
38          rootSection.addSection(collapsableSection);
39      }
40  
41      private VerticalSection createMainSection() {
42          VerticalSection section = new VerticalSection();
43          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_curriculumOversightDivision()));
44          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_curriculumOversightUnit()));
45          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_studentOversightDivision()));
46          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_studentOversightUnit()));
47          return section;
48      }
49  
50      private CollapsableSection createAdditionalSection() {
51          CollapsableSection section = new CollapsableSection(ProgramProperties.get().managingBodies_seeAll());
52          configurer.addReadOnlyField(section, ProgramConstants.DEPLOYMENT_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_deploymentDivision()));
53          configurer.addReadOnlyField(section, ProgramConstants.DEPLOYMENT_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_deploymentUnit()));
54          configurer.addReadOnlyField(section, ProgramConstants.FINANCIAL_RESOURCES_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_financialResourcesDivision()));
55          configurer.addReadOnlyField(section, ProgramConstants.FINANCIAL_RESOURCES_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_financialResourcesUnit()));
56          configurer.addReadOnlyField(section, ProgramConstants.FINANCIAL_CONTROL_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_financialControlDivision()));
57          configurer.addReadOnlyField(section, ProgramConstants.FINANCIAL_CONTROL_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_financialControlUnit()));
58          return section;
59      }
60  }