Coverage Report - org.kuali.student.lum.program.client.credential.view.CredentialInformationViewConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
CredentialInformationViewConfiguration
0%
0/38
N/A
1
 
 1  
 package org.kuali.student.lum.program.client.credential.view;
 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.TableSection;
 6  
 import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection;
 7  
 import org.kuali.student.common.ui.client.configurable.mvc.views.SectionView;
 8  
 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
 9  
 import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo;
 10  
 import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration;
 11  
 import org.kuali.student.lum.program.client.ProgramConstants;
 12  
 import org.kuali.student.lum.program.client.ProgramSections;
 13  
 import org.kuali.student.lum.program.client.credential.CredentialEditableHeader;
 14  
 import org.kuali.student.lum.program.client.properties.ProgramProperties;
 15  
 
 16  
 /**
 17  
  * @author Igor
 18  
  */
 19  
 public class CredentialInformationViewConfiguration extends AbstractSectionConfiguration {
 20  
 
 21  
     public static CredentialInformationViewConfiguration create() {
 22  0
         CredentialInformationViewConfiguration instance = new CredentialInformationViewConfiguration(new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, ProgramProperties.get().program_menu_sections_programInformation(), ProgramConstants.PROGRAM_MODEL_ID));
 23  0
         return instance;
 24  
     }
 25  
 
 26  
     public static CredentialInformationViewConfiguration createSpecial() {
 27  0
         CredentialInformationViewConfiguration instance = new CredentialInformationViewConfiguration(new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, ProgramProperties.get().program_menu_sections_programInformation(), ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(ProgramProperties.get().program_menu_sections_programInformation(), ProgramSections.PROGRAM_DETAILS_EDIT)));
 28  0
         return instance;
 29  
     }
 30  
 
 31  0
     private CredentialInformationViewConfiguration(SectionView sectionView) {
 32  0
         rootSection = sectionView;
 33  0
         rootSection.addStyleName("programInformationView");
 34  0
     }
 35  
 
 36  
     @Override
 37  
     protected void buildLayout() {
 38  0
         HorizontalSection section = new HorizontalSection();
 39  0
         section.addSection(createIdentifyingDetailsSection());
 40  0
         section.addSection(createProgramTitleSection());
 41  0
         section.nextRow();
 42  0
         section.addSection(createDatesSection());
 43  0
         section.addSection(createOtherInformationSection());
 44  0
         rootSection.addSection(section);
 45  0
     }
 46  
 
 47  
     private TableSection createIdentifyingDetailsSection() {
 48  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_identifyingDetails()));
 49  0
         configurer.addReadOnlyField(section, ProgramConstants.CODE, new MessageKeyInfo(ProgramProperties.get().programInformation_code()));
 50  0
         configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM + "/" + ProgramConstants.PROGRAM_LEVEL, new MessageKeyInfo(ProgramProperties.get().programInformation_level()));
 51  0
         configurer.addReadOnlyField(section, ProgramConstants.DEGREE_TYPE, new MessageKeyInfo(ProgramProperties.get().programInformation_degreeType()));
 52  0
         return section;
 53  
     }
 54  
 
 55  
     private TableSection createProgramTitleSection() {
 56  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_programTitle()));
 57  0
         configurer.addReadOnlyField(section, ProgramConstants.LONG_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleFull()));
 58  0
         configurer.addReadOnlyField(section, ProgramConstants.SHORT_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleShort()));
 59  0
         return section;
 60  
     }
 61  
 
 62  
     private TableSection createDatesSection() {
 63  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_dates()));
 64  0
         configurer.addReadOnlyField(section, ProgramConstants.START_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_startTerm()));
 65  0
         configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_entryTerm()));
 66  0
         configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_enrollTerm()));
 67  0
         return section;
 68  
     }
 69  
 
 70  
     private TableSection createOtherInformationSection() {
 71  0
         TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_otherInformation()));
 72  0
         configurer.addReadOnlyField(section, ProgramConstants.INSTITUTION + "/" + ProgramConstants.ORG_ID, new MessageKeyInfo(ProgramProperties.get().programInformation_institution()));
 73  0
         return section;
 74  
     }
 75  
 
 76  
     public VerticalSection createActivateProgramSection(){
 77  0
         VerticalSection section = new VerticalSection(SectionTitle.generateH2Title(ProgramProperties.get().programInformation_activateProgram()));
 78  0
         section.setInstructions("<br>" + ProgramProperties.get().programInformation_activateInstructions() + "<br><br>");
 79  0
         configurer.addField(section, ProgramConstants.PREV_END_PROGRAM_ENTRY_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_entryTerm()));
 80  0
         configurer.addField(section, ProgramConstants.PREV_END_PROGRAM_ENROLL_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_enrollTerm()));
 81  0
         return section;
 82  
     }    
 83  
 }