aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/Form.java
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2008-05-23 11:56:35 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2008-05-23 11:56:35 +0000
commit378751200eda29f75f00fb0d2b4cdaa57232446a (patch)
tree99471ad945493b5b148a064aaa60a95b6ff37c63 /src/com/itmill/toolkit/ui/Form.java
parent310f8d8858c28ddc382db391911bedbc74d103d5 (diff)
downloadvaadin-framework-378751200eda29f75f00fb0d2b4cdaa57232446a.tar.gz
vaadin-framework-378751200eda29f75f00fb0d2b4cdaa57232446a.zip
fixes #1712
svn changeset:4627/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/Form.java')
-rw-r--r--src/com/itmill/toolkit/ui/Form.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/Form.java b/src/com/itmill/toolkit/ui/Form.java
index 805b1a88d8..fa24590a26 100644
--- a/src/com/itmill/toolkit/ui/Form.java
+++ b/src/com/itmill/toolkit/ui/Form.java
@@ -112,6 +112,8 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
}
};
+ private Layout formFooter;
+
/**
* Contructs a new form with default layout.
*
@@ -163,6 +165,9 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
layout.paint(target);
+ if (formFooter != null) {
+ formFooter.paint(target);
+ }
}
/*
@@ -957,4 +962,32 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
throw new UnsupportedOperationException();
}
+ /**
+ * Returns a layout that is rendered below normal form contents. This area
+ * can be used for example to include buttons related to form contents.
+ *
+ * @return layout rendered below normal form contents.
+ */
+ public Layout getFooter() {
+ if (formFooter == null) {
+ formFooter = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL);
+ setParent(formFooter);
+ }
+ return formFooter;
+ }
+
+ /**
+ * Sets the layout that is rendered below normal form contens.
+ *
+ * @param newFormFooter
+ * the new Layout
+ */
+ public void setFooter(Layout newFormFooter) {
+ if (formFooter != null) {
+ formFooter.setParent(null);
+ }
+ formFooter = newFormFooter;
+ formFooter.setParent(this);
+ }
+
}