Class SelectionModel.AbstractSelectionModel<T>

    • Constructor Detail

      • AbstractSelectionModel

        protected AbstractSelectionModel​(ProvidesKey<T> keyProvider)
        Construct an AbstractSelectionModel with a given key provider.
        Parameters:
        keyProvider - an instance of ProvidesKey, or null if the record object should act as its own key
    • Method Detail

      • fireEvent

        public void fireEvent​(GwtEvent<?> event)
        Description copied from interface: HasHandlers
        Fires the given event to the handlers listening to the event's type.

        Any exceptions thrown by handlers will be bundled into a UmbrellaException and then re-thrown after all handlers have completed. An exception thrown by a handler will not prevent other handlers from executing.

        Specified by:
        fireEvent in interface HasHandlers
        Parameters:
        event - the event
      • getKey

        public java.lang.Object getKey​(T item)
        Description copied from interface: ProvidesKey
        Get the key for a list item.
        Specified by:
        getKey in interface ProvidesKey<T>
        Parameters:
        item - the list item
        Returns:
        the key that represents the item
      • getKeyProvider

        public ProvidesKey<T> getKeyProvider()
        Returns a ProvidesKey instance that simply returns the input data item.
        Returns:
        the key provider, which may be null
      • fireSelectionChangeEvent

        protected void fireSelectionChangeEvent()
        Fire a SelectionChangeEvent. Multiple firings may be coalesced.
      • isEventCancelled

        protected boolean isEventCancelled()
        Return true if the next scheduled event should be canceled.
        Returns:
        true if the event is canceled
      • isEventScheduled

        protected boolean isEventScheduled()
        Return true if an event is scheduled to be fired.
        Returns:
        true if the event is scheduled
      • scheduleSelectionChangeEvent

        protected void scheduleSelectionChangeEvent()
        Schedules a SelectionChangeEvent to fire at the end of the current event loop.
      • setEventCancelled

        protected void setEventCancelled​(boolean isEventCancelled)
        Set whether the next scheduled event should be canceled.
        Parameters:
        isEventCancelled - if true, cancel the event
      • setEventScheduled

        protected void setEventScheduled​(boolean isEventScheduled)
        Set whether an event is scheduled to be fired.
        Parameters:
        isEventScheduled - if true, schedule the event