Coverage Report - org.kuali.student.lum.program.client.variation.view.VariationInformationViewConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
VariationInformationViewConfiguration
0%
0/45
0%
0/2
1.125
 
 1  
 package org.kuali.student.lum.program.client.variation.view;
 2  
 
 3  
 import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
 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.TableSection;
 7  
 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
 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.ProgramMsgConstants;
 11  
 import org.kuali.student.lum.program.client.ProgramSections;
 12  
 import org.kuali.student.lum.program.client.major.MajorEditableHeader;
 13  
 
 14  
 /**
 15  
  * @author Igor
 16  
  */
 17  
 public class VariationInformationViewConfiguration extends AbstractSectionConfiguration {
 18  
 
 19  
     public static VariationInformationViewConfiguration create(Configurer configurer) {
 20  0
         return new VariationInformationViewConfiguration(configurer, false);
 21  
     }
 22  
 
 23  
     public static VariationInformationViewConfiguration createSpecial(Configurer configurer) {
 24  0
         return new VariationInformationViewConfiguration(configurer, true);
 25  
     }
 26  
 
 27  0
     private VariationInformationViewConfiguration(Configurer configurer, boolean isSpecial) {
 28  0
         this.setConfigurer(configurer);
 29  0
         String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_PROGRAMINFORMATION);
 30  0
         if (!isSpecial){
 31  0
             this.rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, 
 32  
                     title, ProgramConstants.PROGRAM_MODEL_ID);
 33  
         } else {
 34  0
             this.rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, 
 35  
                     title, ProgramConstants.PROGRAM_MODEL_ID, new MajorEditableHeader(title, ProgramSections.PROGRAM_DETAILS_EDIT));
 36  
         }
 37  0
         rootSection.addStyleName("programInformationView");
 38  0
     }
 39  
 
 40  
     @Override
 41  
     protected void buildLayout() {
 42  0
         HorizontalSection section = new HorizontalSection();
 43  0
         section.addSection(createIdentifyingDetailsSection());
 44  0
         section.addSection(createProgramTitleSection());
 45  0
         section.nextRow();
 46  0
         section.addSection(createDatesSection());
 47  0
         section.addSection(createOtherInformationSection());
 48  0
         rootSection.addSection(section);
 49  0
     }
 50  
 
 51  
     private TableSection createIdentifyingDetailsSection() {
 52  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_IDENTIFYINGDETAILS)));
 53  0
         configurer.addReadOnlyField(section, ProgramConstants.CODE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CODE));
 54  0
         configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_RUNTIME_PROGRAM_LEVEL, generateMessageInfo(
 55  
                 ProgramMsgConstants.PROGRAMINFORMATION_LEVEL));
 56  0
         configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_TYPE_NAME, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CREDENTIALPROGRAM));
 57  0
         configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_CLASSIFICATION, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CLASSIFICATION));
 58  0
         configurer.addReadOnlyField(section, ProgramConstants.DEGREE_TYPE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_DEGREETYPE));
 59  0
         return section;
 60  
     }
 61  
 
 62  
     private TableSection createProgramTitleSection() {
 63  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_PROGRAMTITLE)));
 64  0
         configurer.addReadOnlyField(section, ProgramConstants.LONG_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLEFULL));
 65  0
         configurer.addReadOnlyField(section, ProgramConstants.SHORT_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLESHORT));
 66  0
         configurer.addReadOnlyField(section, ProgramConstants.TRANSCRIPT, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLETRANSCRIPT));
 67  0
         configurer.addReadOnlyField(section, ProgramConstants.DIPLOMA, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLEDIPLOMA));
 68  0
         return section;
 69  
     }
 70  
 
 71  
     private TableSection createDatesSection() {
 72  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_DATES)));
 73  0
         configurer.addReadOnlyField(section, ProgramConstants.START_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_STARTTERM));
 74  0
         configurer.addReadOnlyField(section, ProgramConstants.END_INSTITUTIONAL_ADMIT_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ADMITTERM));
 75  0
         configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENTRYTERM));
 76  0
         configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENROLLTERM));
 77  0
         configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_APPROVAL_DATE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_APPROVALDATE));
 78  0
         return section;
 79  
     }
 80  
 
 81  
     private TableSection createOtherInformationSection() {
 82  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_OTHERINFORMATION)));
 83  0
         configurer.addReadOnlyField(section, ProgramConstants.LOCATION, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_LOCATION));
 84  0
         configurer.addReadOnlyField(section, ProgramConstants.CIP_2000, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CIP2000));
 85  0
         configurer.addReadOnlyField(section, ProgramConstants.CIP_2010, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CIP2010));
 86  0
         configurer.addReadOnlyField(section, ProgramConstants.HEGIS_CODE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_HEGIS));
 87  0
         configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_INSTITUTION_ID, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_INSTITUTION));
 88  0
         return section;
 89  
     }
 90  
 
 91  
 }