01: package com.gwtext.client.widgets.layout;
02:
03: import com.google.gwt.core.client.JavaScriptObject;
04: import com.gwtext.client.core.Position;
05: import com.gwtext.client.util.JavaScriptObjectHelper;
06:
07: /**
08: * @author <a href="mailto:m.bogaert@memenco.com">Mathias Bogaert</a>
09: */
10: public class FormLayout extends AnchorLayout {
11:
12: /**
13: * True to hide field labels by default (defaults to false).
14: *
15: * @param hideLabels true to hide field labels by default (defaults to false)
16: */
17: public void setHideLabels(boolean hideLabels) {
18: JavaScriptObjectHelper.setAttribute(configJS, "hideLabels",
19: hideLabels);
20: }
21:
22: /**
23: * A CSS class to add to the div wrapper that contains each field label and field element (the default class is 'x-form-item' and itemCls will be added to that).
24: *
25: * @param itemCls a CSS class to add to the div wrapper that contains each field label and field element (the default class is 'x-form-item' and itemCls will be added to that)
26: */
27: public void setItemCls(String itemCls) {
28: JavaScriptObjectHelper.setAttribute(configJS, "itemCls",
29: itemCls);
30: }
31:
32: /**
33: * Valid values are "left," "top" and "right" (defaults to "left"). This property cascades to child containers if not set.
34: *
35: * @param labelAlign label alignment
36: */
37: public void setLabelAlign(Position labelAlign) {
38: JavaScriptObjectHelper.setAttribute(configJS, "labelAlign",
39: labelAlign.getPosition());
40: }
41:
42: /**
43: * The default padding in pixels for field labels (defaults to 5). labelPad only applies if labelWidth is also specified, otherwise it will be ignored.
44: *
45: * @param labelPad the default padding in pixels for field labels (defaults to 5). labelPad only applies if labelWidth is also specified, otherwise it will be ignored.
46: */
47: public void setLabelPad(int labelPad) {
48: JavaScriptObjectHelper.setAttribute(configJS, "labelPad",
49: labelPad);
50: }
51:
52: public void setLabelWidth(int labelWidth) {
53: JavaScriptObjectHelper.setAttribute(configJS, "labelWidth",
54: labelWidth);
55: }
56:
57: protected native JavaScriptObject create(JavaScriptObject config) /*-{
58: return new $wnd.Ext.layout.FormLayout(config);
59: }-*/;
60:
61: }
|