public class FormLayout extends AbstractOrderedLayout
Form
to layout fields. It may also be used
separately without Form
.
FormLayout is a close relative of 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.Layout.AlignmentHandler, Layout.MarginHandler, Layout.SpacingHandler
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
ALIGNMENT_DEFAULT, components
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
FormLayout() |
FormLayout(Component... children)
Constructs a FormLayout and adds the given components to it.
|
Modifier and Type | Method and Description |
---|---|
float |
getExpandRatio(Component component)
Deprecated.
This method currently has no effect as expand ratios are not
implemented in FormLayout
|
protected FormLayoutState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
void |
setExpandRatio(Component component,
float ratio)
Deprecated.
This method currently has no effect as expand ratios are not
implemented in FormLayout
|
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, addListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getMargin, getState, isSpacing, iterator, readDesign, removeComponent, removeLayoutClickListener, removeListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setMargin, setMargin, setSpacing, writeDesign
readMargin, writeMargin
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addComponents, addListener, addListener, getComponentIterator, moveComponentsFrom, removeAllComponents, removeListener, removeListener
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListener
public FormLayout()
public FormLayout(Component... children)
children
- Components to add to the FormLayoutAbstractComponentContainer.addComponents(Component...)
@Deprecated public void setExpandRatio(Component component, float ratio)
AbstractOrderedLayout
This method is used to control how excess space in layout is distributed among components. Excess space may exist if layout is sized and contained non relatively sized components don't consume all available space.
Example how to distribute 1:3 (33%) for component1 and 2:3 (67%) for
component2 :
layout.setExpandRatio(component1, 1);
layout.setExpandRatio(component2, 2);
If no ratios have been set, the excess space is distributed evenly among all components.
Note, that width or height (depending on orientation) needs to be defined for this method to have any effect.
setExpandRatio
in class AbstractOrderedLayout
component
- the component in this layout which expand ratio is to be setratio
- new expand ratio (greater or equal to 0)Sizeable
@Deprecated public float getExpandRatio(Component component)
AbstractOrderedLayout
getExpandRatio
in class AbstractOrderedLayout
component
- which expand ratios is requestedprotected FormLayoutState getState()
AbstractComponent
getState
in class AbstractOrderedLayout
Copyright © 2019 Vaadin Ltd. All rights reserved.