Package com.vaadin.ui

Class PopupView

    • Constructor Detail

      • PopupView

        public PopupView​(String small,
                         Component large)
        A simple way to create a PopupPanel. Note that the minimal representation may not be dynamically updated, in order to achieve this create your own Content object and use PopupView(Content).
        Parameters:
        small - the minimal textual representation as HTML
        large - the full, Component-type representation
      • PopupView

        public PopupView​(PopupView.Content content)
        Creates a PopupView through the PopupView.Content interface. This allows the creator to dynamically change the contents of the PopupView.
        Parameters:
        content - the PopupView.Content that contains the information for this
    • Method Detail

      • createContent

        protected static PopupView.Content createContent​(String minimizedValue,
                                                         Component popupContent)
        Creates a Content from given text representation and popup content.
        Parameters:
        minimizedValue - text representation when popup is hidden
        popupContent - popup content
        Returns:
        content with given data
        Since:
        7.5.0
      • setContent

        public void setContent​(PopupView.Content newContent)
                        throws IllegalArgumentException
        This method will replace the current content of the panel with a new one.
        Parameters:
        newContent - PopupView.Content object containing new information for the PopupView
        Throws:
        IllegalArgumentException - if the method is passed a null value, or if one of the content methods returns null
      • getContent

        public PopupView.Content getContent()
        Returns the content-package for this PopupView.
        Returns:
        the PopupView.Content for this object or null
      • setPopupVisible

        public void setPopupVisible​(boolean visible)
        Set the visibility of the popup. Does not hide the minimal representation.
        Parameters:
        visible -
      • 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.
      • isPopupVisible

        public boolean isPopupVisible()
        Return whether the popup is visible.
        Returns:
        true if the popup is showing
      • isHideOnMouseOut

        public boolean isHideOnMouseOut()
        Check if this popup will be hidden when the user takes the mouse cursor out of the popup area.
        Returns:
        true if the popup is hidden on mouse out, false otherwise
      • setHideOnMouseOut

        public void setHideOnMouseOut​(boolean hideOnMouseOut)
        Should the popup automatically hide when the user takes the mouse cursor out of the popup area? If this is false, the user must click outside the popup to close it. The default is true.
        Parameters:
        hideOnMouseOut -
      • getComponentCount

        public int getComponentCount()
        Gets the number of contained components. Consistent with the iterator returned by #getComponentIterator().
        Returns:
        the number of contained components (zero or one)
      • 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
      • getState

        protected PopupViewState 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 AbstractComponent
        Returns:
        updated component shared state