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.views.VerticalSectionView; |
5 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo; |
6 | |
import org.kuali.student.common.ui.client.widgets.menus.KSListPanel; |
7 | |
import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration; |
8 | |
import org.kuali.student.lum.common.client.lo.TreeStringBinding; |
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.credential.CredentialEditableHeader; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
public class CredentialLearningObjectivesViewConfiguration extends AbstractSectionConfiguration { |
18 | |
|
19 | |
public static CredentialLearningObjectivesViewConfiguration create(Configurer configurer) { |
20 | 0 | return new CredentialLearningObjectivesViewConfiguration(configurer, false); |
21 | |
} |
22 | |
|
23 | |
public static CredentialLearningObjectivesViewConfiguration createSpecial(Configurer configurer) { |
24 | 0 | return new CredentialLearningObjectivesViewConfiguration(configurer, true); |
25 | |
} |
26 | |
|
27 | 0 | private CredentialLearningObjectivesViewConfiguration(Configurer configurer, boolean isSpecial) { |
28 | 0 | this.setConfigurer(configurer); |
29 | 0 | String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_LEARNINGOBJECTIVES); |
30 | 0 | if (!isSpecial){ |
31 | 0 | rootSection = new VerticalSectionView(ProgramSections.LEARNING_OBJECTIVES_VIEW, title, |
32 | |
ProgramConstants.PROGRAM_MODEL_ID); |
33 | |
} else { |
34 | 0 | rootSection = new VerticalSectionView(ProgramSections.LEARNING_OBJECTIVES_VIEW, title, |
35 | |
ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title, ProgramSections.LEARNING_OBJECTIVES_EDIT)); |
36 | |
} |
37 | 0 | } |
38 | |
protected void buildLayout() { |
39 | 0 | configurer.addReadOnlyField(rootSection, ProgramConstants.LEARNING_OBJECTIVES, new MessageKeyInfo(""), new KSListPanel()).setWidgetBinding(new TreeStringBinding()); |
40 | 0 | } |
41 | |
} |