diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-07 16:31:16 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-07 17:12:24 +0300 |
commit | 1fb7d999a09bea25256eef0e9837523c7c81841f (patch) | |
tree | 62e239d911bdc064a07621a4b4203c54c7c11349 /server/src/com/vaadin/ui/FormLayout.java | |
parent | 544152d1adc3a098445f7b11b4651fcc3c2f13bc (diff) | |
download | vaadin-framework-1fb7d999a09bea25256eef0e9837523c7c81841f.tar.gz vaadin-framework-1fb7d999a09bea25256eef0e9837523c7c81841f.zip |
Commit Pekka's patch for #8030 ((Component...) constructor for layouts) and #5422 (addComponents(Component...) for layouts) with minor formatting/javadoc changes
Diffstat (limited to 'server/src/com/vaadin/ui/FormLayout.java')
-rw-r--r-- | server/src/com/vaadin/ui/FormLayout.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/server/src/com/vaadin/ui/FormLayout.java b/server/src/com/vaadin/ui/FormLayout.java index 15ea478597..4df9e8f3c0 100644 --- a/server/src/com/vaadin/ui/FormLayout.java +++ b/server/src/com/vaadin/ui/FormLayout.java @@ -22,12 +22,9 @@ import com.vaadin.shared.ui.MarginInfo; * FormLayout is used by {@link Form} to layout fields. It may also be used * separately without {@link Form}. * - * FormLayout is a close relative to vertical {@link OrderedLayout}, but in - * FormLayout caption is rendered on left side of component. Required and - * validation indicators are between captions and fields. - * - * FormLayout does not currently support some advanced methods from - * OrderedLayout like setExpandRatio and setComponentAlignment. + * FormLayout is a close relative of {@link VerticalLayout}, but in FormLayout + * captions are rendered to the left of their respective components. Required + * and validation indicators are shown between the captions and the fields. * * FormLayout by default has component spacing on. Also margin top and margin * bottom are by default on. @@ -42,4 +39,17 @@ public class FormLayout extends AbstractOrderedLayout { setWidth(100, UNITS_PERCENTAGE); } + /** + * Constructs a FormLayout and adds the given components to it. + * + * @see AbstractOrderedLayout#addComponents(Component...) + * + * @param children + * Components to add to the FormLayout + */ + public FormLayout(Component... children) { + this(); + addComponents(children); + } + } |