com.vaadin.ui.

Class TwinColSelect<T>

    • Constructor Detail

      • TwinColSelect

        public TwinColSelect()

        Constructs a new TwinColSelect.

      • TwinColSelect

        public TwinColSelect​(String caption)

        Constructs a new TwinColSelect with the given caption.

        Parameters:

        caption - the caption to set, can be null

      • TwinColSelect

        public TwinColSelect​(String caption,
                             DataProvider<T,​?> dataProvider)

        Constructs a new TwinColSelect with caption and data provider for options.

        Parameters:

        caption - the caption to set, can be null

        dataProvider - the data provider, not null

        Since:

        8.0

      • TwinColSelect

        public TwinColSelect​(String caption,
                             Collection<T> options)

        Constructs a new TwinColSelect with caption and the given options.

        Parameters:

        caption - the caption to set, can be null

        options - the options, cannot be null

    • Method Detail

      • getRows

        public int getRows()

        Returns the number of rows in the selects.

        Returns:

        the number of rows visible

      • setRows

        public void setRows​(int rows)

        Sets the number of rows in the selects. If the number of rows is set to 0 or less, the actual number of displayed rows is determined implicitly by the selects.

        If a height if set (using AbstractComponent.setHeight(String) or AbstractComponent.setHeight(float, Unit)) it overrides the number of rows. Leave the height undefined to use this method.

        Parameters:

        rows - the number of rows to set.

      • setRightColumnCaption

        public void setRightColumnCaption​(String rightColumnCaption)

        Sets the text shown above the right column. null clears the caption.

        Parameters:

        rightColumnCaption - The text to show, null to clear

      • getRightColumnCaption

        public String getRightColumnCaption()

        Returns the text shown above the right column.

        Returns:

        The text shown or null if not set.

      • setLeftColumnCaption

        public void setLeftColumnCaption​(String leftColumnCaption)

        Sets the text shown above the left column. null clears the caption.

        Parameters:

        leftColumnCaption - The text to show, null to clear

      • getLeftColumnCaption

        public String getLeftColumnCaption()

        Returns the text shown above the left column.

        Returns:

        The text shown or null if not set.

      • getState

        protected TwinColSelectState 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 AbstractMultiSelect<T>

        Returns:

        updated component shared state

      • getDataProvider

        public DataProvider<T,​?> getDataProvider()

        Description copied from interface: HasItems

        Returns the source of data items used by this listing.

        Specified by:

        getDataProvider in interface HasItems<T>

        Returns:

        the data provider, not null

      • setDataProvider

        public void setDataProvider​(DataProvider<T,​?> dataProvider)

        Description copied from interface: HasDataProvider

        Sets the data provider for this listing. The data provider is queried for displayed items as needed.

        Specified by:

        setDataProvider in interface HasDataProvider<T>

        Parameters:

        dataProvider - the data provider, not null