org.zkoss.zul.ext
Interface Selectable<E>

All Known Implementing Classes:
AbstractGroupsModel, AbstractListModel, AbstractTreeModel, BindingGroupsListModel, BindingListModelArray, BindingListModelList, BindingListModelListModel, BindingListModelMap, BindingListModelSet, DefaultTreeModel, GroupsListModel, GroupsModelArray, ListModelArray, ListModelList, ListModelMap, ListModelSet, SimpleGroupsModel, SimpleListModel

public interface Selectable<E>

Indicate a selectable collection or component. Generally used with ListModel and Listbox.

Author:
henrichen, tomyeh
See Also:
ListModel, Listbox

Method Summary
 boolean addToSelection(E obj)
          Add the specified object into selection.
 void clearSelection()
          Change the selection to the empty set.
 java.util.Set<E> getSelection()
          Returns the current selection.
 boolean isMultiple()
          Returns whether the current selection mode is multiple.
 boolean isSelected(java.lang.Object obj)
          Returns whether an object is selected.
 boolean isSelectionEmpty()
          Returns true if the selection is currently empty.
 boolean removeFromSelection(java.lang.Object obj)
          Remove the specified object from selection.
 void setMultiple(boolean multiple)
          Sets the selection mode to be multiple.
 void setSelection(java.util.Collection<? extends E> selection)
          Replace the current selection with the given set.
 

Method Detail

getSelection

java.util.Set<E> getSelection()
Returns the current selection. It is readonly. Don't modify it directly

Returns:
the current selection.

setSelection

void setSelection(java.util.Collection<? extends E> selection)
Replace the current selection with the given set.

If this represents a change to the current selection then notify each ListDataListener, including UI.

Since:
6.0.0

isSelected

boolean isSelected(java.lang.Object obj)
Returns whether an object is selected.

Since:
6.0.0

isSelectionEmpty

boolean isSelectionEmpty()
Returns true if the selection is currently empty.

Since:
6.0.0

addToSelection

boolean addToSelection(E obj)
Add the specified object into selection.

If this represents a change to the current selection then notify each ListDataListener, including UI.

Parameters:
obj - the object to be as selection.
Returns:
true if it is added successfully; false if obj is not part of the data, or was already selected.
Since:
6.0.0

removeFromSelection

boolean removeFromSelection(java.lang.Object obj)
Remove the specified object from selection.

If this represents a change to the current selection then notify each ListDataListener, including UI.

Parameters:
obj - the object to be remove from selection.
Returns:
whether it is removed successfully
Since:
6.0.0

clearSelection

void clearSelection()
Change the selection to the empty set.

If this represents a change to the current selection then notify each ListDataListener, including UI.


setMultiple

void setMultiple(boolean multiple)
Sets the selection mode to be multiple.

Since:
6.0.0

isMultiple

boolean isMultiple()
Returns whether the current selection mode is multiple.

Since:
6.0.0
See Also:
setMultiple(boolean)


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo