1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.common.ui.client.widgets.field.layout.layouts; |
17 | |
|
18 | |
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
19 | |
import org.kuali.student.common.ui.client.widgets.field.layout.button.ButtonLayout; |
20 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.FieldElement; |
21 | |
import org.kuali.student.common.ui.client.widgets.search.CollapsablePanel; |
22 | |
|
23 | |
import com.google.gwt.user.client.ui.Widget; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class CollapsableLayout extends FieldLayout{ |
31 | |
|
32 | 0 | private VerticalFieldLayout verticalLayout = new VerticalFieldLayout(); |
33 | |
private CollapsablePanel panel; |
34 | |
|
35 | 0 | public CollapsableLayout(String title){ |
36 | 0 | panel = new CollapsablePanel(title, verticalLayout, false); |
37 | 0 | this.add(panel); |
38 | 0 | } |
39 | |
|
40 | 0 | public CollapsableLayout(String title, boolean isOpen){ |
41 | 0 | panel = new CollapsablePanel(title, verticalLayout, isOpen); |
42 | 0 | this.add(panel); |
43 | 0 | } |
44 | |
|
45 | |
@Override |
46 | |
public void addFieldToLayout(FieldElement field) { |
47 | 0 | verticalLayout.addField(field); |
48 | |
|
49 | 0 | } |
50 | |
|
51 | |
@Override |
52 | |
public void addLayoutToLayout(FieldLayout layout) { |
53 | 0 | verticalLayout.addLayoutToLayout(layout); |
54 | |
|
55 | 0 | } |
56 | |
|
57 | |
@Override |
58 | |
public void addWidgetToLayout(Widget widget) { |
59 | 0 | verticalLayout.addWidgetToLayout(widget); |
60 | 0 | } |
61 | |
|
62 | |
@Override |
63 | |
public void removeFieldLayoutComponentFromLayout( |
64 | |
FieldLayoutComponent component) { |
65 | 0 | verticalLayout.removeFieldLayoutComponentFromLayout(component); |
66 | |
|
67 | 0 | } |
68 | |
|
69 | |
@Override |
70 | |
public void removeWidgetFromLayout(Widget widget) { |
71 | 0 | verticalLayout.removeWidgetFromLayout(widget); |
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public void setLayoutTitle(SectionTitle layoutTitle) { |
76 | 0 | verticalLayout.setLayoutTitle(layoutTitle); |
77 | |
|
78 | 0 | } |
79 | |
|
80 | |
@Override |
81 | |
public void addButtonLayoutToLayout(ButtonLayout buttonLayout) { |
82 | 0 | verticalLayout.addButtonLayout(buttonLayout); |
83 | |
|
84 | 0 | } |
85 | |
|
86 | |
} |