com.vaadin.ui.

Class AbsoluteLayout

    • Constructor Detail

      • AbsoluteLayout

        public AbsoluteLayout()

        Creates an AbsoluteLayout with full size.

    • Method Detail

      • getState

        protected AbsoluteLayoutState getState()

        Description copied from class: AbstractComponent

        Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().

        Overrides:

        getState in class AbstractLayout

        Returns:

        updated component shared state

      • replaceComponent

        public void replaceComponent​(Component oldComponent,
                                     Component newComponent)

        Replaces one component with another one. The new component inherits the old components position.

        Specified by:

        replaceComponent in interface ComponentContainer

        Parameters:

        oldComponent - the old component that will be replaced.

        newComponent - the new component to be replaced.

      • addComponent

        public void addComponent​(Component c,
                                 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

      • beforeClientResponse

        public void beforeClientResponse​(boolean initial)

        Description copied from interface: ClientConnector

        Called before the shared state and RPC invocations are sent to the client. Gives the connector an opportunity to set computed/dynamic state values or to invoke last minute RPC methods depending on other component features.

        Specified by:

        beforeClientResponse in interface ClientConnector

        Overrides:

        beforeClientResponse in class AbstractComponent

        Parameters:

        initial - true if the client-side connector will be created and initialized after this method has been invoked. false if there is already an initialized client-side connector.

      • getPosition

        public AbsoluteLayout.ComponentPosition getPosition​(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.

      • readDesign

        public void readDesign​(org.jsoup.nodes.Element design,
                               DesignContext designContext)

        Description copied from interface: Component

        Reads the component state from the given design.

        The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.

        It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.

        This method must not modify the design.

        Specified by:

        readDesign in interface Component

        Overrides:

        readDesign in class AbstractComponent

        Parameters:

        design - The element to obtain the state from

        designContext - The DesignContext instance used for parsing the design

      • writeDesign

        public void writeDesign​(org.jsoup.nodes.Element design,
                                DesignContext designContext)

        Description copied from interface: Component

        Writes the component state to the given design.

        The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.

        This method must not modify the component state.

        Specified by:

        writeDesign in interface Component

        Overrides:

        writeDesign in class AbstractComponent

        Parameters:

        design - The element to write the component state to. Any previous attributes or child nodes are not cleared.

        designContext - The DesignContext instance used for writing the design