1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.ui.client.configurable.mvc.views;
17
18 import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
19 import org.kuali.student.common.ui.client.widgets.field.layout.layouts.VerticalFieldLayout;
20
21 import com.google.gwt.user.client.ui.Widget;
22
23 public class VerticalSectionView extends SectionView {
24
25
26 public VerticalSectionView(Enum<?> viewEnum, String name, String modelId) {
27 this(viewEnum, name, modelId, true);
28 }
29
30 public VerticalSectionView(Enum<?> viewEnum, String name, String modelId, boolean showTitle) {
31 super(viewEnum, name);
32 this.modelId = modelId;
33 if (name != null && !name.isEmpty()) {
34 SectionTitle sectionTitle = SectionTitle.generateH2Title(getName());
35 if (showTitle) {
36 layout = new VerticalFieldLayout(sectionTitle);
37 } else {
38 layout = new VerticalFieldLayout();
39 }
40 } else {
41 layout = new VerticalFieldLayout();
42 }
43 this.add(layout);
44 }
45
46 public VerticalSectionView(Enum<?> viewEnum, String name, String programModelId, Widget titleWidget) {
47 super(viewEnum, name);
48 this.modelId = programModelId;
49 layout = new VerticalFieldLayout(titleWidget);
50 this.add(layout);
51 }
52
53
54
55
56
57
58 @Override
59 @SuppressWarnings("unchecked")
60 public void updateModel() {
61 if (model != null && isValidationEnabled()) {
62 super.updateModel(model);
63 }
64 }
65
66 @Override
67 public void clear() {
68
69 }
70
71 public void setSectionTitle(String title) {
72 layout.setLayoutTitle(SectionTitle.generateH2Title(title));
73 }
74 }