com.vaadin.ui.components.grid.selection
Class MultiSelectionModel

java.lang.Object
  extended by com.vaadin.ui.components.grid.selection.AbstractSelectionModel
      extended by com.vaadin.ui.components.grid.selection.MultiSelectionModel
All Implemented Interfaces:
SelectionModel, SelectionModel.Multi, java.io.Serializable

public class MultiSelectionModel
extends AbstractSelectionModel
implements SelectionModel.Multi

A default implementation of a SelectionModel.Multi

Since:
Author:
Vaadin Ltd
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.ui.components.grid.selection.SelectionModel
SelectionModel.Multi, SelectionModel.None, SelectionModel.Single
 
Field Summary
 
Fields inherited from class com.vaadin.ui.components.grid.selection.AbstractSelectionModel
grid, selection
 
Constructor Summary
MultiSelectionModel()
           
 
Method Summary
 boolean deselect(java.util.Collection<?> itemIds)
          Marks items as deselected.
 boolean deselect(java.lang.Object... itemIds)
          Marks items as deselected.
 boolean deselectAll()
          Marks all the items in the current Container as deselected
 java.util.Collection<java.lang.Object> getSelectedRows()
          Returns a collection of all the currently selected itemIds.
 void reset()
          Resets the selection model.
 boolean select(java.util.Collection<?> itemIds)
          Marks items as selected.
 boolean select(java.lang.Object... itemIds)
          Marks items as selected.
 boolean selectAll()
          Marks all the items in the current Container as selected
 
Methods inherited from class com.vaadin.ui.components.grid.selection.AbstractSelectionModel
fireSelectionChangeEvent, isSelected, setGrid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.components.grid.selection.SelectionModel
isSelected, setGrid
 

Constructor Detail

MultiSelectionModel

public MultiSelectionModel()
Method Detail

select

public boolean select(java.lang.Object... itemIds)
               throws java.lang.IllegalArgumentException
Description copied from interface: SelectionModel.Multi
Marks items as selected.

This method does not clear any previous selection state, only adds to it.

Specified by:
select in interface SelectionModel.Multi
Parameters:
itemIds - the itemId(s) to mark as selected
Returns:
true if the selection state changed. false if all the given itemIds already were selected
Throws:
java.lang.IllegalArgumentException - if the itemIds varargs array is null
See Also:
SelectionModel.Multi.deselect(Object...)

select

public boolean select(java.util.Collection<?> itemIds)
               throws java.lang.IllegalArgumentException
Description copied from interface: SelectionModel.Multi
Marks items as selected.

This method does not clear any previous selection state, only adds to it.

Specified by:
select in interface SelectionModel.Multi
Parameters:
itemIds - the itemIds to mark as selected
Returns:
true if the selection state changed. false if all the given itemIds already were selected
Throws:
java.lang.IllegalArgumentException - if itemIds is null
See Also:
SelectionModel.Multi.deselect(Collection)

deselect

public boolean deselect(java.lang.Object... itemIds)
                 throws java.lang.IllegalArgumentException
Description copied from interface: SelectionModel.Multi
Marks items as deselected.

Specified by:
deselect in interface SelectionModel.Multi
Parameters:
itemIds - the itemId(s) to remove from being selected
Returns:
true if the selection state changed. false if none the given itemIds were selected previously
Throws:
java.lang.IllegalArgumentException - if the itemIds varargs array is null
See Also:
SelectionModel.Multi.select(Object...)

deselect

public boolean deselect(java.util.Collection<?> itemIds)
                 throws java.lang.IllegalArgumentException
Description copied from interface: SelectionModel.Multi
Marks items as deselected.

Specified by:
deselect in interface SelectionModel.Multi
Parameters:
itemIds - the itemId(s) to remove from being selected
Returns:
true if the selection state changed. false if none the given itemIds were selected previously
Throws:
java.lang.IllegalArgumentException - if itemIds is null
See Also:
SelectionModel.Multi.select(Collection)

selectAll

public boolean selectAll()
Description copied from interface: SelectionModel.Multi
Marks all the items in the current Container as selected

Specified by:
selectAll in interface SelectionModel.Multi
Returns:
true iff some items were previously not selected
See Also:
SelectionModel.Multi.deselectAll()

deselectAll

public boolean deselectAll()
Description copied from interface: SelectionModel.Multi
Marks all the items in the current Container as deselected

Specified by:
deselectAll in interface SelectionModel.Multi
Returns:
true iff some items were previously selected
See Also:
SelectionModel.Multi.selectAll()

getSelectedRows

public java.util.Collection<java.lang.Object> getSelectedRows()
Returns a collection of all the currently selected itemIds.

The returned Collection is in order of selection – the item that was first selected will be first in the collection, and so on. Should an item have been selected twice without being deselected in between, it will have remained in its original position.

Specified by:
getSelectedRows in interface SelectionModel
Overrides:
getSelectedRows in class AbstractSelectionModel
Returns:
a collection of all the currently selected itemIds

reset

public void reset()
Resets the selection model.

Equivalent to calling deselectAll()

Specified by:
reset in interface SelectionModel


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.