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 | 0 | this(viewEnum, name, modelId, true); |
28 | 0 | } |
29 | |
|
30 | |
public VerticalSectionView(Enum<?> viewEnum, String name, String modelId, boolean showTitle) { |
31 | 0 | super(viewEnum, name); |
32 | 0 | this.modelId = modelId; |
33 | 0 | if (name != null && !name.isEmpty()) { |
34 | 0 | SectionTitle sectionTitle = SectionTitle.generateH2Title(getName()); |
35 | 0 | if (showTitle) { |
36 | 0 | layout = new VerticalFieldLayout(sectionTitle); |
37 | |
} else { |
38 | 0 | layout = new VerticalFieldLayout(); |
39 | |
} |
40 | 0 | } else { |
41 | 0 | layout = new VerticalFieldLayout(); |
42 | |
} |
43 | 0 | this.add(layout); |
44 | 0 | } |
45 | |
|
46 | |
public VerticalSectionView(Enum<?> viewEnum, String name, String programModelId, Widget titleWidget) { |
47 | 0 | super(viewEnum, name); |
48 | 0 | this.modelId = programModelId; |
49 | 0 | layout = new VerticalFieldLayout(titleWidget); |
50 | 0 | this.add(layout); |
51 | 0 | } |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
@Override |
59 | |
@SuppressWarnings("unchecked") |
60 | |
public void updateModel() { |
61 | 0 | if (model != null && isValidationEnabled()) { |
62 | 0 | super.updateModel(model); |
63 | |
} |
64 | 0 | } |
65 | |
|
66 | |
@Override |
67 | |
public void clear() { |
68 | |
|
69 | 0 | } |
70 | |
|
71 | |
public void setSectionTitle(String title) { |
72 | 0 | layout.setLayoutTitle(SectionTitle.generateH2Title(title)); |
73 | 0 | } |
74 | |
} |