com.extjs.gxt.ui.client.widget.layout
Class FormLayout

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.Layout
          extended by com.extjs.gxt.ui.client.widget.layout.AnchorLayout
              extended by com.extjs.gxt.ui.client.widget.layout.FormLayout
All Implemented Interfaces:
Observable

public class FormLayout
extends AnchorLayout

Layout for form fields and their labels. FormLayout will only render Field subclasses. All other components will be ignored.

To add a component that is not a Field subclass, see AdapterField. To add plain text see LabelField.


Constructor Summary
FormLayout()
          Creates a new form layout.
FormLayout(FormPanel.LabelAlign labelAlign)
          Creates a new form layout.
 
Method Summary
 int getDefaultWidth()
          Returns the default field width.
 boolean getHideLabels()
          Returns true if labels are being hidden.
 FormPanel.LabelAlign getLabelAlign()
          Returns the label alignment.
 int getLabelPad()
          Returns the label pad.
 java.lang.String getLabelSeparator()
          Returns the label separator.
 int getLabelWidth()
          Returns the label width.
 void setContainer(Container ct)
          Sets the layout's container.
 void setDefaultWidth(int defaultWidth)
          Sets the default width for fields (defaults to 200).
 void setHideLabels(boolean hideLabels)
          True to hide field labels by default (defaults to false).
 void setLabelAlign(FormPanel.LabelAlign labelAlign)
          Sets the label alignment.
 void setLabelPad(int labelPad)
          The default padding in pixels for field labels (defaults to 0).
 void setLabelSeparator(java.lang.String labelSeparator)
          Sets the label separator (defaults to ':').
 void setLabelWidth(int labelWidth)
          Sets the default width in pixels of field labels (defaults to 100).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.layout.AnchorLayout
getAnchorSize, setAnchorSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Layout
getExtraStyle, getResizeDelay, isRenderHidden, layout, setExtraStyle, setRenderHidden, setResizeDelay
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormLayout

public FormLayout()
Creates a new form layout.


FormLayout

public FormLayout(FormPanel.LabelAlign labelAlign)
Creates a new form layout.

Parameters:
labelAlign - the label alignment
Method Detail

getDefaultWidth

public int getDefaultWidth()
Returns the default field width.

Returns:
the default field width

getHideLabels

public boolean getHideLabels()
Returns true if labels are being hidden.

Returns:
the hide label state

getLabelAlign

public FormPanel.LabelAlign getLabelAlign()
Returns the label alignment.

Returns:
the label alignment

getLabelPad

public int getLabelPad()
Returns the label pad.

Returns:
the label pad

getLabelSeparator

public java.lang.String getLabelSeparator()
Returns the label separator.

Returns:
the label separator

getLabelWidth

public int getLabelWidth()
Returns the label width.

Returns:
the label width

setContainer

public void setContainer(Container ct)
Description copied from class: Layout
Sets the layout's container.

Overrides:
setContainer in class Layout
Parameters:
ct - the container

setDefaultWidth

public void setDefaultWidth(int defaultWidth)
Sets the default width for fields (defaults to 200).

Parameters:
defaultWidth - the default width

setHideLabels

public void setHideLabels(boolean hideLabels)
True to hide field labels by default (defaults to false).

Parameters:
hideLabels - true to hide labels

setLabelAlign

public void setLabelAlign(FormPanel.LabelAlign labelAlign)
Sets the label alignment.

Parameters:
labelAlign - the label align

setLabelPad

public void setLabelPad(int labelPad)
The default padding in pixels for field labels (defaults to 0). labelPad only applies if labelWidth is also specified, otherwise it will be ignored.

Parameters:
labelPad - the label pad

setLabelSeparator

public void setLabelSeparator(java.lang.String labelSeparator)
Sets the label separator (defaults to ':').

Parameters:
labelSeparator - the label separator

setLabelWidth

public void setLabelWidth(int labelWidth)
Sets the default width in pixels of field labels (defaults to 100).

Parameters:
labelWidth - the label width