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,java.io.Serializable,java.lang.Iterable<com.vaadin.flow.component.Component>
@Tag("div") @CssImport("./ordered-layout.css") @CssImport("./margin.css") @JsModule("./form-layout-styles.js") public class FormLayout extends AbstractOrderedLayoutLegacy 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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.server.Sizeable
Sizeable.Unit
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIN_FORM_LAYOUT_THEME-
Fields inherited from interface com.vaadin.classic.v8.server.Sizeable
SIZE_UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description FormLayout()Creates a new a FormLayout.FormLayout(com.vaadin.flow.component.Component... children)Constructs a FormLayout and adds the given components to it.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddComponent(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.java.util.stream.Stream<com.vaadin.flow.component.Component>getChildren()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 voidsetSlotClasses()This 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, setSpacing
-
Methods inherited from class com.vaadin.classic.v8.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, iterator, moveComponentsFrom, removeAll, removeAllComponents, setHeight, setWidth
-
Methods 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, setWidthUndefined
-
Methods 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, updateDiffstate
-
Methods 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, scrollIntoView, set, setElement, setId
-
-
-
-
Field Detail
-
IN_FORM_LAYOUT_THEME
public static final java.lang.String IN_FORM_LAYOUT_THEME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpandRatio
@Deprecated public float getExpandRatio(com.vaadin.flow.component.Component component)
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
public com.vaadin.flow.component.Component getComponent(int index) throws java.lang.IndexOutOfBoundsExceptionDescription 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:
java.lang.IndexOutOfBoundsException- If the index is out of range.
-
addComponent
public void addComponent(com.vaadin.flow.component.Component component, int index) throws java.lang.IndexOutOfBoundsExceptionDescription 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:
java.lang.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
public java.util.stream.Stream<com.vaadin.flow.component.Component> getChildren()
- Overrides:
getChildrenin classAbstractOrderedLayout
-
-