com.vaadin.ui.components.grid.

Class AbstractSelectionModel<T>

    • Constructor Detail

      • AbstractSelectionModel

        public AbstractSelectionModel()
    • Method Detail

      • generateData

        public void generateData​(T item,
                                 elemental.json.JsonObject jsonObject)

        Description copied from interface: DataGenerator

        Adds custom data for the given item to its serialized JsonObject representation. This JSON object will be sent to client-side DataProvider.

        Specified by:

        generateData in interface DataGenerator<T>

        Parameters:

        item - the data item being serialized

        jsonObject - the JSON object being sent to the client

      • destroyAllData

        public void destroyAllData()

        Description copied from interface: DataGenerator

        Informs the DataGenerator that all data has been dropped. This method should clean up any unneeded information stored for items.

        Specified by:

        destroyAllData in interface DataGenerator<T>

      • getState

        protected AbstractSelectionModelState getState()

        Description copied from class: AbstractClientConnector

        Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.

        As a side effect, marks the connector dirty so any changes done to the state will be sent to the client. Use getState(false) to avoid marking the connector as dirty.

        Overrides:

        getState in class Grid.AbstractGridExtension<T>

        Returns:

        The shared state for this connector. Never null.

      • init

        protected abstract void init()

        Initializes the selection model after it has been attached to a grid.

      • isUserSelectionAllowed

        public boolean isUserSelectionAllowed()

        Description copied from interface: GridSelectionModel

        Checks if the user is allowed to change the selection.

        The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.

        Specified by:

        isUserSelectionAllowed in interface GridSelectionModel<T>

        Returns:

        true if the user is allowed to change the selection, false otherwise

      • setUserSelectionAllowed

        public void setUserSelectionAllowed​(boolean allowed)

        Description copied from interface: GridSelectionModel

        Sets whether the user is allowed to change the selection.

        The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.

        Specified by:

        setUserSelectionAllowed in interface GridSelectionModel<T>

        Parameters:

        allowed - true if the user is allowed to change the selection, false otherwise