|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.ugent.caagt.swirl.DefaultGenericSelectionModel<E>
public class DefaultGenericSelectionModel<E>
A default implementation of GenericSelectionModel. Uses equals
to check whether the model has been changed whenever a new selection is set.
| Field Summary | |
|---|---|
protected javax.swing.event.EventListenerList |
listenerList
The list of listeners currently registered |
| Constructor Summary | |
|---|---|
DefaultGenericSelectionModel()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a listener which should be notified of all changes in the model. |
void |
clearSelection()
Clears the selection. |
protected void |
fireStateChanged()
Notifies all listeners of a state change. |
E |
getSelection()
Returns the current selection or null if nothing is currently selected. |
boolean |
isSelected()
Check whether an element is currently selected. |
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a listener previously registered with GenericSelectionModel.addChangeListener(javax.swing.event.ChangeListener). |
void |
setSelection(E element)
Set the current selection and notify any listeners in case of changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.event.EventListenerList listenerList
| Constructor Detail |
|---|
public DefaultGenericSelectionModel()
| Method Detail |
|---|
public E getSelection()
GenericSelectionModel
getSelection in interface GenericSelectionModel<E>public void setSelection(E element)
GenericSelectionModel
setSelection in interface GenericSelectionModel<E>element - object which represents the selected
element, or null if the selection should be clearedpublic void clearSelection()
GenericSelectionModel
setSelection(null);
clearSelection in interface GenericSelectionModel<E>public boolean isSelected()
GenericSelectionModel
getSelection() != null
isSelected in interface GenericSelectionModel<E>public void addChangeListener(javax.swing.event.ChangeListener listener)
GenericSelectionModel
addChangeListener in interface GenericSelectionModel<E>public void removeChangeListener(javax.swing.event.ChangeListener listener)
GenericSelectionModelGenericSelectionModel.addChangeListener(javax.swing.event.ChangeListener).
removeChangeListener in interface GenericSelectionModel<E>protected void fireStateChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||