Class AbsoluteLayout
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- All Implemented Interfaces:
LayoutEvents.LayoutClickNotifier,ClientConnector,Sizeable,ComponentContainer,HasComponents,HasComponents.ComponentAttachDetachNotifier,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("./absolute-layout.css") public class AbsoluteLayout extends AbstractLayout implements LayoutEvents.LayoutClickNotifierClassic Component implementation of V8's com.vaadin.ui.AbsoluteLayout.It is a layout implementation that mimics html absolute positioning.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbsoluteLayout.ComponentPositionThe ComponentPosition class represents a component's position within the absolute layout.-
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.StringCLASSNAMEClass name, prefix in styling.-
Fields inherited from interface com.vaadin.classic.v8.server.Sizeable
SIZE_UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description AbsoluteLayout()Creates an AbsoluteLayout with full size.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddComponent(com.vaadin.flow.component.Component c)Adds the component into this container.voidaddComponent(com.vaadin.flow.component.Component c, java.lang.String cssPosition)Adds a component to the layout.com.vaadin.flow.shared.RegistrationaddLayoutClickListener(LayoutEvents.LayoutClickListener listener)Deprecated.intgetComponentCount()Gets the number of children thisComponentContainerhasAbsoluteLayout.ComponentPositiongetPosition(com.vaadin.flow.component.Component component)Gets the position of a component in the layout.java.util.Iterator<com.vaadin.flow.component.Component>iterator()Gets the component container iterator for going through all the components in the container.voidremoveComponent(com.vaadin.flow.component.Component component)Removes the component from this container.voidremoveLayoutClickListener(LayoutEvents.LayoutClickListener listener)Deprecated.voidreplaceComponent(com.vaadin.flow.component.Component oldComponent, com.vaadin.flow.component.Component newComponent)Replaces the component in the container with another one without changing position.voidsetPosition(com.vaadin.flow.component.Component component, AbsoluteLayout.ComponentPosition position)Sets the position of a component in the layout.-
Methods inherited from class com.vaadin.classic.v8.ui.AbstractComponentContainer
add, addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, remove, removeAll, removeAllComponents, setHeight, setWidth
-
Methods inherited from class com.vaadin.classic.v8.ui.AbstractComponent
addInternalStyles, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, doSetHeight, doSetWidth, 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, getChildren, getElement, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, scrollIntoView, set, setElement, setId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
CLASSNAME
public static final java.lang.String CLASSNAME
Class name, prefix in styling.- See Also:
- Constant Field Values
-
-
Method Detail
-
addComponent
public void addComponent(com.vaadin.flow.component.Component c)
Description copied from interface:ComponentContainerAdds the component into this container.- Specified by:
addComponentin interfaceComponentContainer- Overrides:
addComponentin classAbstractComponentContainer- Parameters:
c- the component to be added.
-
addComponent
public void addComponent(com.vaadin.flow.component.Component c, java.lang.String cssPosition)Adds a component to the layout. The component can be positioned by providing a string formatted in CSS-format.For example the string "top:10px;left:10px" will position the component 10 pixels from the left and 10 pixels from the top. The identifiers: "top","left","right" and "bottom" can be used to specify the position.
- Parameters:
c- The component to add to the layoutcssPosition- The css position string
-
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 classAbstractComponentContainer- Parameters:
component- the component to be removed.
-
replaceComponent
public void replaceComponent(com.vaadin.flow.component.Component oldComponent, com.vaadin.flow.component.Component newComponent)Description copied from interface:ComponentContainerReplaces the component in the container with another one without changing position.This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.
- Specified by:
replaceComponentin interfaceComponentContainer- Parameters:
oldComponent- the old component that will be replaced.newComponent- the new component to be replaced.
-
getComponentCount
public int getComponentCount()
Description copied from interface:ComponentContainerGets the number of children thisComponentContainerhas- Specified by:
getComponentCountin interfaceComponentContainer- Returns:
- The number of child components this container has.
-
iterator
public java.util.Iterator<com.vaadin.flow.component.Component> iterator()
Description copied from class:AbstractComponentContainerGets the component container iterator for going through all the components in the container.- Specified by:
iteratorin interfaceHasComponents- Specified by:
iteratorin interfacejava.lang.Iterable<com.vaadin.flow.component.Component>- Overrides:
iteratorin classAbstractComponentContainer- Returns:
- the Iterator of the components inside the container.
-
getPosition
public AbsoluteLayout.ComponentPosition getPosition(com.vaadin.flow.component.Component component)
Gets the position of a component in the layout. Returns null if component is not attached to the layout.Note that you cannot update the position by updating this object. Call
setPosition(Component, ComponentPosition)with the updatedAbsoluteLayout.ComponentPositionobject.- Parameters:
component- The component which position is needed- Returns:
- An instance of ComponentPosition containing the position of the component, or null if the component is not enclosed in the layout.
-
setPosition
public void setPosition(com.vaadin.flow.component.Component component, AbsoluteLayout.ComponentPosition position)Sets the position of a component in the layout.- Parameters:
component- the component to modifyposition- the new position of the component
-
addLayoutClickListener
public com.vaadin.flow.shared.Registration addLayoutClickListener(LayoutEvents.LayoutClickListener listener)
Deprecated.Not supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/classic-component-pack for mitigation options.- Specified by:
addLayoutClickListenerin interfaceLayoutEvents.LayoutClickNotifier- Parameters:
listener- The listener to add- Returns:
- a registration object for removing the listener
- See Also:
Registration
-
removeLayoutClickListener
@Deprecated public void removeLayoutClickListener(LayoutEvents.LayoutClickListener listener)
Deprecated.
-
-