com.tonbeller.wcf.selection
Class SelectionModelDecorator

java.lang.Object
  extended bycom.tonbeller.wcf.selection.SelectionModelDecorator
All Implemented Interfaces:
SelectionModel, SingleSelectionModel

public abstract class SelectionModelDecorator
extends java.lang.Object
implements SelectionModel

decorates a selection model

Author:
av

Field Summary
 
Fields inherited from interface com.tonbeller.wcf.selection.SelectionModel
MULTIPLE_SELECTION, MULTIPLE_SELECTION_BUTTON, MULTIPLE_SELECTION_HREF, NO_SELECTION, SINGLE_SELECTION, SINGLE_SELECTION_BUTTON, SINGLE_SELECTION_HREF
 
Constructor Summary
SelectionModelDecorator(SelectionModel delegate)
           
 
Method Summary
 void add(java.lang.Object obj)
           
 void addAll(java.util.Collection c)
           
 void addSelectionListener(SelectionChangeListener l)
           
 void clear()
          clears the selection
 boolean contains(java.lang.Object obj)
           
 boolean equals(java.lang.Object arg0)
           
 void fireSelectionChanged(RequestContext context)
          fires a SelectionChangeEvent.
 int getMode()
           
 java.util.Set getSelection()
           
 java.lang.Object getSingleSelection()
          return the only selected object or null if the selection is empty.
 int hashCode()
           
 boolean isEmpty()
           
 boolean isSelectable(java.lang.Object item)
          true, if item is selectable.
 void remove(java.lang.Object obj)
           
 void removeSelectionListener(SelectionChangeListener l)
           
 void setSingleSelection(java.lang.Object selectedObject)
          sets the only selected element
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.tonbeller.wcf.selection.SelectionModel
setMode
 

Constructor Detail

SelectionModelDecorator

public SelectionModelDecorator(SelectionModel delegate)
Method Detail

add

public void add(java.lang.Object obj)
Specified by:
add in interface SelectionModel
Parameters:
obj -

addAll

public void addAll(java.util.Collection c)
Specified by:
addAll in interface SelectionModel
Parameters:
c -

addSelectionListener

public void addSelectionListener(SelectionChangeListener l)
Specified by:
addSelectionListener in interface SingleSelectionModel
Parameters:
l -

clear

public void clear()
Description copied from interface: SingleSelectionModel
clears the selection

Specified by:
clear in interface SingleSelectionModel

contains

public boolean contains(java.lang.Object obj)
Specified by:
contains in interface SelectionModel
Parameters:
obj -
Returns:

equals

public boolean equals(java.lang.Object arg0)

fireSelectionChanged

public void fireSelectionChanged(RequestContext context)
Description copied from interface: SingleSelectionModel
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).

Specified by:
fireSelectionChanged in interface SingleSelectionModel
Parameters:
context -

getMode

public int getMode()
Specified by:
getMode in interface SelectionModel
Returns:

getSelection

public java.util.Set getSelection()
Specified by:
getSelection in interface SelectionModel
Returns:

getSingleSelection

public java.lang.Object getSingleSelection()
Description copied from interface: SingleSelectionModel
return the only selected object or null if the selection is empty.

Specified by:
getSingleSelection in interface SingleSelectionModel
Returns:

hashCode

public int hashCode()

isSelectable

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

Specified by:
isSelectable in interface SingleSelectionModel
Parameters:
item -
Returns:

remove

public void remove(java.lang.Object obj)
Specified by:
remove in interface SelectionModel
Parameters:
obj -

removeSelectionListener

public void removeSelectionListener(SelectionChangeListener l)
Specified by:
removeSelectionListener in interface SingleSelectionModel
Parameters:
l -

setSingleSelection

public void setSingleSelection(java.lang.Object selectedObject)
Description copied from interface: SingleSelectionModel
sets the only selected element

Specified by:
setSingleSelection in interface SingleSelectionModel
Parameters:
selectedObject -

toString

public java.lang.String toString()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface SingleSelectionModel