001package org.kuali.student.lum.program.client.credential.view; 002 003import org.kuali.student.common.ui.client.configurable.mvc.Configurer; 004import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView; 005import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo; 006import org.kuali.student.common.ui.client.widgets.menus.KSListPanel; 007import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration; 008import org.kuali.student.lum.common.client.lo.TreeStringBinding; 009import org.kuali.student.lum.program.client.ProgramConstants; 010import org.kuali.student.lum.program.client.ProgramMsgConstants; 011import org.kuali.student.lum.program.client.ProgramSections; 012import org.kuali.student.lum.program.client.credential.CredentialEditableHeader; 013 014/** 015 * @author Igor 016 */ 017public class CredentialLearningObjectivesViewConfiguration extends AbstractSectionConfiguration { 018 019 public static CredentialLearningObjectivesViewConfiguration create(Configurer configurer) { 020 return new CredentialLearningObjectivesViewConfiguration(configurer, false); 021 } 022 023 public static CredentialLearningObjectivesViewConfiguration createSpecial(Configurer configurer) { 024 return new CredentialLearningObjectivesViewConfiguration(configurer, true); 025 } 026 027 private CredentialLearningObjectivesViewConfiguration(Configurer configurer, boolean isSpecial) { 028 this.setConfigurer(configurer); 029 String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_LEARNINGOBJECTIVES); 030 if (!isSpecial){ 031 rootSection = new VerticalSectionView(ProgramSections.LEARNING_OBJECTIVES_VIEW, title, 032 ProgramConstants.PROGRAM_MODEL_ID); 033 } else { 034 rootSection = new VerticalSectionView(ProgramSections.LEARNING_OBJECTIVES_VIEW, title, 035 ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title, ProgramSections.LEARNING_OBJECTIVES_EDIT)); 036 } 037 } 038 protected void buildLayout() { 039 configurer.addReadOnlyField(rootSection, ProgramConstants.LEARNING_OBJECTIVES, new MessageKeyInfo(""), new KSListPanel()).setWidgetBinding(new TreeStringBinding()); 040 } 041}