View Javadoc

1   package org.kuali.student.lum.program.client.credential.view;
2   
3   import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection;
4   import org.kuali.student.common.ui.client.configurable.mvc.views.SectionView;
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.ProgramSections;
10  import org.kuali.student.lum.program.client.credential.CredentialEditableHeader;
11  import org.kuali.student.lum.program.client.properties.ProgramProperties;
12  
13  /**
14   * @author Igor
15   */
16  public class CredentialManagingBodiesViewConfiguration extends AbstractSectionConfiguration {
17  
18      public static CredentialManagingBodiesViewConfiguration create() {
19          return new CredentialManagingBodiesViewConfiguration(new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, ProgramProperties.get().program_menu_sections_managingBodies(), ProgramConstants.PROGRAM_MODEL_ID));
20      }
21  
22      public static CredentialManagingBodiesViewConfiguration createSpecial() {
23          String title = ProgramProperties.get().program_menu_sections_managingBodies();
24          return new CredentialManagingBodiesViewConfiguration(new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title, ProgramSections.MANAGE_BODIES_EDIT)));
25      }
26  
27      private CredentialManagingBodiesViewConfiguration(SectionView sectionView) {
28          rootSection = sectionView;
29      }
30  
31      @Override
32      protected void buildLayout() {
33          VerticalSection section = createMainSection();
34          rootSection.addSection(section);
35      }
36  
37      private VerticalSection createMainSection() {
38          VerticalSection section = new VerticalSection();
39          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_curriculumOversightDivision()));
40          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_curriculumOversightUnit()));
41          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_DIVISION, new MessageKeyInfo(ProgramProperties.get().managingBodies_studentOversightDivision()));
42          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_UNIT, new MessageKeyInfo(ProgramProperties.get().managingBodies_studentOversightUnit()));
43          return section;
44      }
45  }