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 | 0 | private CredentialDocsViewConfiguration(Configurer configurer, boolean isSpecial) { |
21 | 0 | this.setConfigurer(configurer); |
22 | 0 | String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_SUPPORTINGDOCUMENTS); |
23 | 0 | if (isSpecial){ |
24 | 0 | this.rootSection = new VerticalSectionView(ProgramSections.SUPPORTING_DOCUMENTS_VIEW, title, |
25 | |
ProgramConstants.PROGRAM_MODEL_ID, new CredentialEditableHeader(title,ProgramSections.SUPPORTING_DOCUMENTS_EDIT)); |
26 | |
} else { |
27 | 0 | this.rootSection = new VerticalSectionView(ProgramSections.SUPPORTING_DOCUMENTS_VIEW, title, |
28 | |
ProgramConstants.PROGRAM_MODEL_ID); |
29 | |
} |
30 | 0 | } |
31 | |
|
32 | |
@Override |
33 | |
protected void buildLayout() { |
34 | 0 | configurer.addReadOnlyField(rootSection, "id", new MessageKeyInfo(""), new DocumentList(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE,false, false)).setWidgetBinding(new DocumentListBinding("id")); |
35 | 0 | } |
36 | |
|
37 | |
public static CredentialDocsViewConfiguration createSpecial(Configurer configurer) { |
38 | 0 | return new CredentialDocsViewConfiguration(configurer, true); |
39 | |
} |
40 | |
|
41 | |
public static CredentialDocsViewConfiguration create(Configurer configurer){ |
42 | 0 | return new CredentialDocsViewConfiguration(configurer, false); |
43 | |
} |
44 | |
} |