| 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.core.client.GWT; |
| 24 | |
import com.google.gwt.user.client.ui.Widget; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
public class CollapsableLayout extends FieldLayout{ |
| 32 | |
|
| 33 | 0 | private VerticalFieldLayout verticalLayout = new VerticalFieldLayout(); |
| 34 | |
private CollapsablePanel panel; |
| 35 | |
|
| 36 | 0 | public CollapsableLayout(String title){ |
| 37 | 0 | panel = GWT.create(CollapsablePanel.class); |
| 38 | 0 | panel.initialise(title, verticalLayout, false); |
| 39 | 0 | this.add(panel); |
| 40 | 0 | } |
| 41 | |
|
| 42 | 0 | public CollapsableLayout(String title, boolean isOpen){ |
| 43 | 0 | panel = GWT.create(CollapsablePanel.class); |
| 44 | 0 | panel.initialise(title, verticalLayout, isOpen); |
| 45 | 0 | this.add(panel); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
@Override |
| 49 | |
public void addFieldToLayout(FieldElement field) { |
| 50 | 0 | verticalLayout.addField(field); |
| 51 | |
|
| 52 | 0 | } |
| 53 | |
|
| 54 | |
@Override |
| 55 | |
public void addLayoutToLayout(FieldLayout layout) { |
| 56 | 0 | verticalLayout.addLayoutToLayout(layout); |
| 57 | |
|
| 58 | 0 | } |
| 59 | |
|
| 60 | |
@Override |
| 61 | |
public void addWidgetToLayout(Widget widget) { |
| 62 | 0 | verticalLayout.addWidgetToLayout(widget); |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
@Override |
| 66 | |
public void removeFieldLayoutComponentFromLayout( |
| 67 | |
FieldLayoutComponent component) { |
| 68 | 0 | verticalLayout.removeFieldLayoutComponentFromLayout(component); |
| 69 | |
|
| 70 | 0 | } |
| 71 | |
|
| 72 | |
@Override |
| 73 | |
public void removeWidgetFromLayout(Widget widget) { |
| 74 | 0 | verticalLayout.removeWidgetFromLayout(widget); |
| 75 | 0 | } |
| 76 | |
|
| 77 | |
@Override |
| 78 | |
public void setLayoutTitle(SectionTitle layoutTitle) { |
| 79 | 0 | verticalLayout.setLayoutTitle(layoutTitle); |
| 80 | |
|
| 81 | 0 | } |
| 82 | |
|
| 83 | |
@Override |
| 84 | |
public void addButtonLayoutToLayout(ButtonLayout buttonLayout) { |
| 85 | 0 | verticalLayout.addButtonLayout(buttonLayout); |
| 86 | |
|
| 87 | 0 | } |
| 88 | |
|
| 89 | |
} |