|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.core.comp.DefaultListSelectionModel
Default data model implementation for list selections.
Field Summary | |
protected java.util.List |
listeners
|
Fields inherited from interface org.enhydra.barracuda.core.comp.ListSelectionModel |
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION |
Constructor Summary | |
DefaultListSelectionModel()
|
Method Summary | |
void |
addModelListener(ModelListener ml)
Add a listener to the template that's notified each time a change to the data model occurs. |
void |
addSelectionInterval(int index0,
int index1)
Change the selection to be the set union of the current selection and the indices between index0 and index1 inclusive. |
void |
clearSelection()
Change the selection to the empty set. |
java.lang.Object |
clone()
Returns a clone of this selection model with the same selection. |
void |
fireModelChanged()
Forwards the given notification event to all TemplateModelListeners that registered
themselves as listeners for this template model. |
int |
getMaxSelectionIndex()
Returns the last selected index or -1 if the selection is empty. |
int |
getMinSelectionIndex()
Returns the first selected index or -1 if the selection is empty. |
int |
getSelectionMode()
Returns the selection mode. |
boolean |
isSelectedIndex(int index)
Returns true if the specified index is selected. |
boolean |
isSelectionEmpty()
Returns true if no indices are selected. |
void |
removeModelListener(ModelListener ml)
Remove a listener |
void |
removeSelectionInterval(int index0,
int index1)
Change the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive. |
void |
setSelectionInterval(int index0,
int index1)
Change the selection to be between index0 and index1 inclusive. |
void |
setSelectionMode(int selectionMode)
Sets the selection mode. |
java.lang.String |
toString()
Returns a string that displays and identifies this object's properties. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.List listeners
Constructor Detail |
public DefaultListSelectionModel()
Method Detail |
public void addModelListener(ModelListener ml)
addModelListener
in interface Model
ml
- the TemplateModelListenerpublic void removeModelListener(ModelListener ml)
removeModelListener
in interface Model
ml
- the TemplateModelListenerpublic void fireModelChanged()
TemplateModelListeners
that registered
themselves as listeners for this template model.
public void setSelectionMode(int selectionMode)
setSelectionMode
in interface ListSelectionModel
selectionMode
- one of three values:
java.lang.IllegalArgumentException
- if selectionMode
is not one of the legal values shown abovesetSelectionMode(int)
public int getSelectionMode()
getSelectionMode
in interface ListSelectionModel
getSelectionMode()
public void setSelectionInterval(int index0, int index1)
setSelectionInterval
in interface ListSelectionModel
index0
- one end of the interval.index1
- other end of the intervalpublic void addSelectionInterval(int index0, int index1)
addSelectionInterval
in interface ListSelectionModel
index0
- one end of the interval.index1
- other end of the intervalpublic void removeSelectionInterval(int index0, int index1)
removeSelectionInterval
in interface ListSelectionModel
index0
- one end of the interval.index1
- other end of the intervalpublic int getMinSelectionIndex()
getMinSelectionIndex
in interface ListSelectionModel
public int getMaxSelectionIndex()
getMaxSelectionIndex
in interface ListSelectionModel
public boolean isSelectedIndex(int index)
isSelectedIndex
in interface ListSelectionModel
public boolean isSelectionEmpty()
isSelectionEmpty
in interface ListSelectionModel
public void clearSelection()
clearSelection
in interface ListSelectionModel
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of this objectpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
listenerLists
are not duplicated.
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the selection model does not
both (a) implement the Cloneable interface and (b) define a
clone
method.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |