|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AdvancedListSelectionModel<E>
AdvancedListSelectionModel
is an interface defining additional methods
for selection management beyond the standard ListSelectionModel
.
Field Summary |
---|
Fields inherited from interface javax.swing.ListSelectionModel |
---|
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION |
Method Summary | |
---|---|
void |
addValidSelectionMatcher(Matcher<E> validSelectionMatcher)
Add a matcher which decides when source elements are valid for selection. |
void |
dispose()
Releases the resources consumed by this AdvancedListSelectionModel so that it
may eventually be garbage collected. |
EventList<E> |
getDeselected()
Gets an EventList that contains only deselected values and
modifies the source list on mutation. |
boolean |
getEnabled()
Returns whether the EventSelectionModel is editable or not. |
EventList<E> |
getSelected()
Gets an EventList that contains only selected
values and modifies the source list on mutation. |
EventList<E> |
getTogglingDeselected()
Gets an EventList that contains only deselected values and
modifies the selection state on mutation. |
EventList<E> |
getTogglingSelected()
Gets an EventList that contains only selected
values and modifies the selection state on mutation. |
void |
invertSelection()
Inverts the current selection. |
void |
removeValidSelectionMatcher(Matcher<E> validSelectionMatcher)
Remove a matcher which decides when source elements are valid for selection. |
void |
setEnabled(boolean enabled)
Set the EventSelectionModel as editable or not. |
Method Detail |
---|
EventList<E> getSelected()
EventList
that contains only selected
values and modifies the source list on mutation.
Adding and removing items from this list performs the same operation on
the source list.
EventList<E> getTogglingSelected()
EventList
that contains only selected
values and modifies the selection state on mutation.
Adding an item to this list selects it and removing an item deselects it.
If an item not in the source list is added an
IllegalArgumentException
is thrown.
EventList<E> getDeselected()
EventList
that contains only deselected values and
modifies the source list on mutation.
Adding and removing items from this list performs the same operation on
the source list.
EventList<E> getTogglingDeselected()
EventList
that contains only deselected values and
modifies the selection state on mutation.
Adding an item to this list deselects it and removing an item selects it.
If an item not in the source list is added an
IllegalArgumentException
is thrown
void setEnabled(boolean enabled)
Note that this will also disable the selection from being modified programatically. Therefore you must use setEnabled(true) to modify the selection in code.
boolean getEnabled()
void addValidSelectionMatcher(Matcher<E> validSelectionMatcher)
validSelectionMatcher
- returns true if a source element
can be selected; false otherwisevoid removeValidSelectionMatcher(Matcher<E> validSelectionMatcher)
validSelectionMatcher
- returns true if a source element
can be selected; false otherwisevoid invertSelection()
void dispose()
AdvancedListSelectionModel
so that it
may eventually be garbage collected.
An AdvancedListSelectionModel
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the AdvancedListSelectionModel
to be garbage collected before its source EventList
. This is
necessary for situations where an AdvancedListSelectionModel
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on a AdvancedListSelectionModel
after it has been disposed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |