Class AbsoluteLayout

    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        Class name, prefix in styling.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbsoluteLayout

        public AbsoluteLayout()
        Creates an AbsoluteLayout with full size.
    • Method Detail

      • 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 layout
        cssPosition - The css position string
      • replaceComponent

        public void replaceComponent​(com.vaadin.flow.component.Component oldComponent,
                                     com.vaadin.flow.component.Component newComponent)
        Description copied from interface: ComponentContainer
        Replaces 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:
        replaceComponent in interface ComponentContainer
        Parameters:
        oldComponent - the old component that will be replaced.
        newComponent - the new component to be replaced.
      • iterator

        public java.util.Iterator<com.vaadin.flow.component.Component> iterator()
        Description copied from class: AbstractComponentContainer
        Gets the component container iterator for going through all the components in the container.
        Specified by:
        iterator in interface HasComponents
        Specified by:
        iterator in interface java.lang.Iterable<com.vaadin.flow.component.Component>
        Overrides:
        iterator in class AbstractComponentContainer
        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 updated AbsoluteLayout.ComponentPosition object.

        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 modify
        position - 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:
        addLayoutClickListener in interface LayoutEvents.LayoutClickNotifier
        Parameters:
        listener - The listener to add
        Returns:
        a registration object for removing the listener
        See Also:
        Registration