be.ugent.caagt.swirl
Interface GenericSelectionModel<E>
- DefaultGenericSelectionModel<E>
public interface GenericSelectionModel<E>
Model which keeps track of a single element selected from a group. The element
is represented by an object type
E
. Classes that satisfy this interface
can be used to implement a
GenericSelectionGroup
.
Models of this type are used by the
MenuBuilder
to implement radio button groups.
addChangeListener
public void addChangeListener(ChangeListener listener)
Adds a listener which should be notified of all changes in the model.
clearSelection
public void clearSelection()
Clears the selection. Short for
setSelection(null);
getSelection
public E getSelection()
Returns the current selection or null if nothing is currently
selected.
isSelected
public boolean isSelected()
Check whether an element is currently selected. Short for
getSelection() != null
removeChangeListener
public void removeChangeListener(ChangeListener listener)
setSelection
public void setSelection(E element)
Set the current selection and notify any listeners in case of changes.
element
- object which represents the selected
element, or null if the selection should be cleared