View Javadoc

1   package org.kuali.student.lum.program.client.credential.view;
2   
3   import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
4   import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection;
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.ProgramMsgConstants;
10  import org.kuali.student.lum.program.client.ProgramSections;
11  import org.kuali.student.lum.program.client.credential.CredentialEditableHeader;
12  
13  /**
14   * @author Igor
15   */
16  public class CredentialManagingBodiesViewConfiguration extends AbstractSectionConfiguration {
17  
18      public static CredentialManagingBodiesViewConfiguration create(Configurer configurer) {
19          return new CredentialManagingBodiesViewConfiguration(configurer, false);
20      }
21  
22      public static CredentialManagingBodiesViewConfiguration createSpecial(Configurer configurer) {
23          return new CredentialManagingBodiesViewConfiguration(configurer, true);
24      }
25  
26      private CredentialManagingBodiesViewConfiguration(Configurer configurer, boolean isSpecial) {
27          this.setConfigurer(configurer);
28          String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_MANAGINGBODIES);
29          if (!isSpecial){
30              this.rootSection = new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, 
31                  ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title, ProgramSections.MANAGE_BODIES_EDIT));
32          } else {
33              this.rootSection = new VerticalSectionView(ProgramSections.MANAGE_BODIES_VIEW, title, 
34                      ProgramConstants.PROGRAM_MODEL_ID);
35          }
36      }
37  
38      @Override
39      protected void buildLayout() {
40          VerticalSection section = createMainSection();
41          rootSection.addSection(section);
42      }
43  
44      private VerticalSection createMainSection() {
45          VerticalSection section = new VerticalSection();
46          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_DIVISION,
47                  new MessageKeyInfo(ProgramMsgConstants.PROGRAM_MSG_GROUP, "course", ProgramMsgConstants.STATUS_ACTIVE, ProgramMsgConstants.MANAGINGBODIES_CURRICULUMOVERSIGHTDIVISION));
48          configurer.addReadOnlyField(section, ProgramConstants.CURRICULUM_OVERSIGHT_UNIT,
49                  new MessageKeyInfo(ProgramMsgConstants.PROGRAM_MSG_GROUP, "course", ProgramMsgConstants.STATUS_ACTIVE, ProgramMsgConstants.MANAGINGBODIES_CURRICULUMOVERSIGHTUNIT));
50          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_DIVISION,
51                  new MessageKeyInfo(ProgramMsgConstants.PROGRAM_MSG_GROUP, "course", ProgramMsgConstants.STATUS_ACTIVE, ProgramMsgConstants.MANAGINGBODIES_STUDENTOVERSIGHTDIVISION));
52          configurer.addReadOnlyField(section, ProgramConstants.STUDENT_OVERSIGHT_UNIT,
53                  new MessageKeyInfo(ProgramMsgConstants.PROGRAM_MSG_GROUP, "course", ProgramMsgConstants.STATUS_ACTIVE, ProgramMsgConstants.MANAGINGBODIES_STUDENTOVERSIGHTUNIT));
54          return section;
55      }
56  }