Package com.vaadin.classic.v8.ui
Class FormLayout
java.lang.Object
com.vaadin.flow.component.Component
- All Implemented Interfaces:
LayoutEvents.LayoutClickNotifier,ClientConnector,Sizeable,ComponentContainer,HasComponents,HasComponents.ComponentAttachDetachNotifier,Layout.AlignmentHandler,Layout.MarginHandler,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasStyle,Serializable,Iterable<com.vaadin.flow.component.Component>
@Tag("div")
@CssImport("./ordered-layout.css") @CssImport("./margin.css")
@JsModule("./form-layout-styles.js")
public class FormLayout
extends AbstractOrderedLayout
Legacy version of FormLayout that resembles Vaadin 7/8's FormLayout API as closely as possible in order to facilitate migration to newer versions of Vaadin.
FormLayout is used to layout fields. FormLayout is a close relative of
VerticalLayout, but in FormLayout captions are rendered to the left of
their respective components.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.classic.v8.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListenerNested classes/interfaces inherited from interface com.vaadin.classic.v8.server.Sizeable
Sizeable.Unit -
Field Summary
FieldsFields inherited from interface com.vaadin.classic.v8.server.Sizeable
SIZE_UNDEFINED -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new a FormLayout.FormLayout(com.vaadin.flow.component.Component... children) Constructs a FormLayout and adds the given components to it. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(com.vaadin.flow.component.Component component) Adds the component into this container.voidaddComponent(com.vaadin.flow.component.Component component, int index) Adds a component into indexed position in this container.Stream<com.vaadin.flow.component.Component>com.vaadin.flow.component.ComponentgetComponent(int index) Returns the component at the given position.intgetComponentIndex(com.vaadin.flow.component.Component component) Returns the index of the given component.floatgetExpandRatio(com.vaadin.flow.component.Component component) Deprecated.voidremoveComponent(com.vaadin.flow.component.Component component) Removes the component from this container.voidsetExpandRatio(com.vaadin.flow.component.Component component, float ratio) This method currently has no effect as expand ratios are not implemented in FormLayout.protected voidThis method currently has no effect since the FormLayout has the table as its only child.Methods inherited from class com.vaadin.classic.v8.ui.AbstractOrderedLayout
add, addComponentAsFirst, addComponentAtIndex, addComponentsAndExpand, addLayoutClickListener, beforeClientResponse, doSetHeight, doSetWidth, getComponentAlignment, getComponentCount, getDefaultComponentAlignment, getMargin, isSpacing, remove, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setMargin, setMargin, setSpacingMethods inherited from class com.vaadin.classic.v8.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, iterator, moveComponentsFrom, removeAll, removeAllComponents, setHeight, setWidthMethods inherited from class com.vaadin.classic.v8.ui.AbstractComponent
addInternalStyles, addListener, addShortcutListener, addStyleName, addStyleNames, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getCustomStyles, getData, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getInternalStyles, getLocale, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, notifyParentAboutStyleChanges, onEnabledStateChanged, removeInternalStyles, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefinedMethods inherited from class com.vaadin.classic.v8.server.AbstractClientConnector
addExtension, addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, addMethodInvocationToQueue, attach, createState, detach, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getResource, getSession, handleConnectorRequest, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, onAttach, onDetach, registerRpc, registerRpc, removeExtension, setErrorHandler, setResource, updateDiffstateMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
IN_FORM_LAYOUT_THEME
- See Also:
-
-
Constructor Details
-
FormLayout
public FormLayout()Creates a new a FormLayout. -
FormLayout
public FormLayout(com.vaadin.flow.component.Component... children) Constructs a FormLayout and adds the given components to it.- Parameters:
children- Components to add to the FormLayout
-
-
Method Details
-
getExpandRatio
Deprecated.This method currently has no effect as expand ratios are not implemented in FormLayout.- Overrides:
getExpandRatioin classAbstractOrderedLayout- Parameters:
component- which expand ratios is requested- Returns:
- expand ratio of given component, 0.0f by default.
-
setExpandRatio
public void setExpandRatio(com.vaadin.flow.component.Component component, float ratio) This method currently has no effect as expand ratios are not implemented in FormLayout.- Overrides:
setExpandRatioin classAbstractOrderedLayout- Parameters:
component- the component in this layout which expand ratio is to be setratio- new expand ratio (greater or equal to 0)
-
addComponent
public void addComponent(com.vaadin.flow.component.Component component) Description copied from interface:ComponentContainerAdds the component into this container.- Specified by:
addComponentin interfaceComponentContainer- Overrides:
addComponentin classAbstractOrderedLayout- Parameters:
component- the component to be added.
-
removeComponent
public void removeComponent(com.vaadin.flow.component.Component component) Description copied from interface:ComponentContainerRemoves the component from this container.- Specified by:
removeComponentin interfaceComponentContainer- Overrides:
removeComponentin classAbstractOrderedLayout- Parameters:
component- the component to be removed.
-
getComponentIndex
public int getComponentIndex(com.vaadin.flow.component.Component component) Description copied from class:AbstractOrderedLayoutReturns the index of the given component.- Overrides:
getComponentIndexin classAbstractOrderedLayout- Parameters:
component- The component to look up.- Returns:
- The index of the component or -1 if the component is not a child.
-
getComponent
Description copied from class:AbstractOrderedLayoutReturns the component at the given position.- Overrides:
getComponentin classAbstractOrderedLayout- Parameters:
index- The position of the component.- Returns:
- The component at the given index.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
addComponent
public void addComponent(com.vaadin.flow.component.Component component, int index) throws IndexOutOfBoundsException Description copied from class:AbstractOrderedLayoutAdds a component into indexed position in this container.- Overrides:
addComponentin classAbstractOrderedLayout- Parameters:
component- the component to be added.index- the index of the component position. The components currently in and after the position are shifted forwards.- Throws:
IndexOutOfBoundsException
-
setSlotClasses
protected void setSlotClasses()This method currently has no effect since the FormLayout has the table as its only child.- Overrides:
setSlotClassesin classAbstractOrderedLayout
-
getChildren
- Overrides:
getChildrenin classAbstractOrderedLayout
-