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.core.document.ui.client.widgets.documenttool.DocumentList;
7 import org.kuali.student.core.document.ui.client.widgets.documenttool.DocumentListBinding;
8 import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration;
9 import org.kuali.student.lum.common.client.lu.LUUIConstants;
10 import org.kuali.student.lum.program.client.ProgramConstants;
11 import org.kuali.student.lum.program.client.ProgramMsgConstants;
12 import org.kuali.student.lum.program.client.ProgramSections;
13 import org.kuali.student.lum.program.client.credential.CredentialEditableHeader;
14
15
16
17
18 public class CredentialDocsViewConfiguration extends AbstractSectionConfiguration {
19
20 private CredentialDocsViewConfiguration(Configurer configurer, boolean isSpecial) {
21 this.setConfigurer(configurer);
22 String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_SUPPORTINGDOCUMENTS);
23 if (isSpecial){
24 this.rootSection = new VerticalSectionView(ProgramSections.SUPPORTING_DOCUMENTS_VIEW, title,
25 ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title,ProgramSections.SUPPORTING_DOCUMENTS_EDIT));
26 } else {
27 this.rootSection = new VerticalSectionView(ProgramSections.SUPPORTING_DOCUMENTS_VIEW, title,
28 ProgramConstants.PROGRAM_MODEL_ID);
29 }
30 }
31
32 @Override
33 protected void buildLayout() {
34 configurer.addReadOnlyField(rootSection, "id", new MessageKeyInfo(""), new DocumentList(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE,false, false)).setWidgetBinding(new DocumentListBinding("id"));
35 }
36
37 public static CredentialDocsViewConfiguration createSpecial(Configurer configurer) {
38 return new CredentialDocsViewConfiguration(configurer, true);
39 }
40
41 public static CredentialDocsViewConfiguration create(Configurer configurer){
42 return new CredentialDocsViewConfiguration(configurer, false);
43 }
44 }