|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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. |
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 addChangeListener(javax.swing.event.ChangeListener) . |
void |
setSelection(E element)
Set the current selection and notify any listeners in case of changes. |
Method Detail |
---|
E getSelection()
void setSelection(E element)
element
- object which represents the selected
element, or null if the selection should be clearedvoid clearSelection()
setSelection(null);
boolean isSelected()
getSelection() != null
void addChangeListener(javax.swing.event.ChangeListener listener)
void removeChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener(javax.swing.event.ChangeListener)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |