to.etc.domui.component.tbl
Interface ISelectionModel<T>

All Known Implementing Classes:
AbstractSelectionModel, InstanceSelectionModel, KeySelectionModel

public interface ISelectionModel<T>

A model that stores selections for a table.

Author:
Frits Jalvingh Created on Feb 17, 2011

Method Summary
 void addListener(ISelectionListener<T> l)
          Add a listener that will receive notifications when the selections change.
 void clearSelection()
          Clear all selections, then call the listeners to report the change.
 int getSelectionCount()
          Return the #of instances currently selected.
 boolean isMultiSelect()
          T if this model can handle multiple selections.
 boolean isSelected(T rowinstance)
          Return T if this instance is actually selected.
 void removeListener(ISelectionListener<T> l)
           
 void selectAll(ITableModel<T> in)
          This must add all (recoverable) items in the model and add them as selected as efficiently as possible.
 void setInstanceSelected(T rowinstance, boolean on)
          Set or clear an instance's selected state.
 

Method Detail

isMultiSelect

boolean isMultiSelect()
T if this model can handle multiple selections.

Returns:

isSelected

boolean isSelected(@Nonnull
                   T rowinstance)
Return T if this instance is actually selected.

Parameters:
rowinstance -
Returns:

getSelectionCount

int getSelectionCount()
Return the #of instances currently selected.

Returns:

setInstanceSelected

void setInstanceSelected(@Nonnull
                         T rowinstance,
                         boolean on)
                         throws java.lang.Exception
Set or clear an instance's selected state. When changed the model will call the listeners to report the change.

Parameters:
rowinstance -
on -
Throws:
java.lang.Exception

clearSelection

void clearSelection()
                    throws java.lang.Exception
Clear all selections, then call the listeners to report the change.

Throws:
java.lang.Exception

selectAll

void selectAll(ITableModel<T> in)
               throws java.lang.Exception
This must add all (recoverable) items in the model and add them as selected as efficiently as possible. It is NEVER called directly, but always through a ISelectionAllHandler, so that "select all" can be forbidden.

Parameters:
in -
Throws:
java.lang.Exception

addListener

void addListener(@Nonnull
                 ISelectionListener<T> l)
Add a listener that will receive notifications when the selections change.

Parameters:
l -

removeListener

void removeListener(@Nonnull
                    ISelectionListener<T> l)