|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface is implemented by widget models that support the selection of entries in a keyed set (lists, tables, trees). Each entry in the underlying value domain has a key of type String which uniquely identifies the entry within the value domain. There may exist at most one entry with a particular key. This interface allows either to query the selection or to modify it.
This interface supports two variants. The first behaviour is called strict. With strict behaviour, the currently selected entries are always drawn from the underlying value domain. With !isStrict() (which is only allowed in models having !isMultiSelect()), the selected value needs not to be contained in the domain.
| Method Summary | |
void |
deselect(java.lang.String key)
Deselects a particular entry. |
void |
deselectAll()
All selected entries get deselected. |
java.lang.String |
getSelected()
Returns the id of the selected element. |
java.lang.String[] |
getSelection()
Returns a newly created array containing the ids of the selected entries or an empty array, if nothing is selected. |
int |
getSelectionCount()
Returns the number of selected elements. |
boolean |
isMultiSelect()
Returns true if more than one entry may be selected. |
boolean |
isSelected(java.lang.String key)
Returns true if the entry with the provided key is selected, false otherwise. |
boolean |
isStrict()
Returns if this Selectable has strict behaviour, that is, the selected keys must always be in the underlying domain of this. |
void |
select(java.lang.String key)
Sets the entry with a provided key as selected. |
| Method Detail |
public void select(java.lang.String key)
If isStrict() and the provided key is not contained in the underlying domain, this method does nothing.
key - the entry to select
java.lang.IllegalArgumentException - if key is null.public void deselect(java.lang.String key)
key - identifies the entry to deselect. If the entry with the provided key is not
selected, this method does nothing.
java.lang.IllegalArgumentException - if key is null.public void deselectAll()
public boolean isMultiSelect()
public java.lang.String getSelected()
Usually, this method is the preferred way of querying the selection state if !isMultiSelect().
public java.lang.String[] getSelection()
public int getSelectionCount()
public boolean isSelected(java.lang.String key)
public boolean isStrict()
Strict behaviour is only supported if !isMultiSelect(). That means, isMultiSelect() always implies isStrict().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||