Class MultiSelectionEvent<C extends Component,​T>

    • Constructor Detail

      • MultiSelectionEvent

        public MultiSelectionEvent​(C listing,
                                   HasValue<AbstractField.ComponentValueChangeEvent<C,​Set<T>>,​Set<T>> source,
                                   Set<T> oldSelection,
                                   boolean userOriginated)
        Creates a new multi selection change event in a component.
        Parameters:
        listing - the listing component where the event originated
        source - the single select source
        oldSelection - the item that was previously selected
        userOriginated - true if this event originates from the client, false otherwise.
    • Method Detail

      • getAllSelectedItems

        public Set<T> getAllSelectedItems()
        Description copied from interface: SelectionEvent
        Gets all the currently selected items.

        This method applies more to multiselection - for single select it returns either an empty set or a set containing the only selected item.

        Specified by:
        getAllSelectedItems in interface SelectionEvent<C extends Component,​T>
        Returns:
        return all the selected items, if any, never null
      • getNewSelection

        @Deprecated
        public Set<T> getNewSelection()
        Deprecated.
        Use getValue() or getAllSelectedItems() instead which are the exact replacements for this method.
        Gets the new selection.

        The result is the current selection of the source listing. So it's always exactly the same as getValue().

        The method will be removed in a later major version.

        Returns:
        an unmodifiable set of items selected after the selection was changed
        See Also:
        getValue(), getAllSelectedItems()
      • getOldSelection

        public Set<T> getOldSelection()
        Gets the old selection.
        Returns:
        an unmodifiable set of items selected before the selection was changed
      • getRemovedSelection

        public Set<T> getRemovedSelection()
        Gets the items that were removed from selection.

        This is just a convenience method for checking what was previously selected in getOldSelection() but not selected anymore in getNewSelection().

        Returns:
        the items that were removed from selection
      • getAddedSelection

        public Set<T> getAddedSelection()
        Gets the items that were added to selection.

        This is just a convenience method for checking what is new selected in getNewSelection() and wasn't selected in getOldSelection().

        Returns:
        the items that were removed from selection