com.guiseframework.model
Class SingleListSelectionPolicy<V>
java.lang.Object
com.guiseframework.model.AbstractListSelectionPolicy<V>
com.guiseframework.model.SingleListSelectionPolicy<V>
- Type Parameters:
V - The type of values contained in the select model.
- All Implemented Interfaces:
- ListSelectionPolicy<V>
public final class SingleListSelectionPolicy<V>
- extends AbstractListSelectionPolicy<V>
An implementation of a selection strategy for a select model allowing only a single selection at a time.
This class is marked final because it demarcates certain selection semantics that, if they can be assumed, may be offloaded to a component's view in certain circumstances.
This class is thread-safe, and assumes that the corresponding select model is thread-safe, synchronized on itself.
- Author:
- Garret Wilson
- See Also:
ListSelectModel
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleListSelectionPolicy
public SingleListSelectionPolicy()
getSetSelectedIndices
public int[] getSetSelectedIndices(ListSelectModel<V> selectModel,
int[] indices)
- Determines which requested indices may be set as the selection.
This implementation only allows the first index to be set.
- Specified by:
getSetSelectedIndices in interface ListSelectionPolicy<V>- Overrides:
getSetSelectedIndices in class AbstractListSelectionPolicy<V>
- Parameters:
selectModel - The model containing the values to be selected.indices - The requested indices to set as the selection.
- Returns:
- The indices that can be set as the selection.
getAddSelectedIndices
public int[] getAddSelectedIndices(ListSelectModel<V> selectModel,
int[] indices)
- Determines which requested indices may be added to the selection.
This implementation allows the addition of all requested indices.
- Specified by:
getAddSelectedIndices in interface ListSelectionPolicy<V>- Overrides:
getAddSelectedIndices in class AbstractListSelectionPolicy<V>
- Parameters:
selectModel - The model containing the values to be selected.indices - The requested indices to add to the selection.
- Returns:
- The indices that can be added to the selection.
Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.