Package org.zkoss.zul.ext
Interface Selectable<E>
- All Known Subinterfaces:
GroupsSelectableModel<E>
- All Known Implementing Classes:
AbstractGroupsModel,AbstractListModel,AbstractTreeModel,DefaultTreeModel,GroupsListModel,GroupsModelArray,ListModelArray,ListModelList,ListModelMap,ListModelSet,SimpleGroupsModel,SimpleListModel
public interface Selectable<E>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddToSelection(E obj) Add the specified object into selection.voidChange the selection to the empty set.Returns the current selection.Returns the selection control for the selection model, if any.booleanReturns whether the current selection mode is multiple.booleanisSelected(Object obj) Returns whether an object is selected.booleanReturns true if the selection is currently empty.booleanRemove the specified object from selection.voidsetMultiple(boolean multiple) Sets the selection mode to be multiple.voidsetSelection(Collection<? extends E> selection) Replace the current selection with the given set.voidSets the selection control for the selection model
-
Method Details
-
getSelection
Returns the current selection. It is readonly. Don't modify it directly- Returns:
- the current selection.
-
setSelection
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
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
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
objis not part of the data, or was already selected. - Since:
- 6.0.0
-
removeFromSelection
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:
-
setSelectionControl
Sets the selection control for the selection model- Parameters:
ctrl-- Since:
- 8.0.0
-
getSelectionControl
SelectionControl getSelectionControl()Returns the selection control for the selection model, if any.- Since:
- 8.0.0
-