com.tonbeller.wcf.selection
Interface SingleSelectionModel

All Known Subinterfaces:
SelectionModel
All Known Implementing Classes:
AbstractSelectionModel, DefaultSelectionModel, SelectionModelDecorator

public interface SingleSelectionModel

SelectionModel for Tree and Table components.

Author:
av

Method Summary
 void addSelectionListener(SelectionChangeListener l)
           
 void clear()
          clears the selection
 void fireSelectionChanged(RequestContext context)
          fires a SelectionChangeEvent.
 java.lang.Object getSingleSelection()
          return the only selected object or null if the selection is empty.
 boolean isEmpty()
           
 boolean isSelectable(java.lang.Object item)
          true, if item is selectable.
 void removeSelectionListener(SelectionChangeListener l)
           
 void setSingleSelection(java.lang.Object selectedObject)
          sets the only selected element
 

Method Detail

getSingleSelection

public java.lang.Object getSingleSelection()
return the only selected object or null if the selection is empty.

Throws:
java.lang.IllegalStateException - if the selection contains more than one element

setSingleSelection

public void setSingleSelection(java.lang.Object selectedObject)
sets the only selected element


clear

public void clear()
clears the selection


isEmpty

public boolean isEmpty()

isSelectable

public boolean isSelectable(java.lang.Object item)
true, if item is selectable. If not, no checkbox / radio button / hyperlink will be generated


fireSelectionChanged

public void fireSelectionChanged(RequestContext context)
fires a SelectionChangeEvent. This is not fired automatically so clients may choose when to notify the listeners (e.g. after a couple of changes have been made).

Parameters:
context -

addSelectionListener

public void addSelectionListener(SelectionChangeListener l)

removeSelectionListener

public void removeSelectionListener(SelectionChangeListener l)