Package org.zkoss.zul.ext
Interface TreeSelectableModel
- All Known Implementing Classes:
AbstractTreeModel,DefaultTreeModel
public interface TreeSelectableModel
- Since:
- 6.0.0
- Author:
- jumperchen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSelectionPath(int[] path) Adds path to the current selection.booleanaddSelectionPaths(int[][] paths) Adds paths to the current selection.voidEmpties the current selection.intReturns the number of paths that are selected.int[]Returns the first path in the selection.int[][]Returns the paths in the selection.booleanReturns whether the current selection mode is multiple.booleanisPathSelected(int[] path) Returns true if the path,path, is in the current selection.booleanReturns true if the selection is currently empty.booleanremoveSelectionPath(int[] path) Removes path from the selection.booleanremoveSelectionPaths(int[][] paths) Removes paths from the selection.voidsetMultiple(boolean multiple) Sets the selection mode to be multiple.
-
Method Details
-
setMultiple
void setMultiple(boolean multiple) Sets the selection mode to be multiple. -
isMultiple
boolean isMultiple()Returns whether the current selection mode is multiple.- See Also:
-
addSelectionPath
boolean addSelectionPath(int[] path) Adds path to the current selection. If path is not currently in the selection the TreeDataListeners are notified. This has no effect ifpathis null.- Parameters:
path- the new path to add to the current selection- Returns:
- whether it is added successfully
-
addSelectionPaths
boolean addSelectionPaths(int[][] paths) Adds paths to the current selection. If any of the paths in paths are not currently in the selection the TreeDataListeners are notified. This has no effect ifpathsis null.- Parameters:
paths- the new paths to add to the current selection- Returns:
- whether it is added successfully
-
removeSelectionPath
boolean removeSelectionPath(int[] path) Removes path from the selection. If path is in the selection The TreeDataListeners are notified. This has no effect ifpathis null.- Parameters:
path- the path to remove from the selection- Returns:
- true if it was unselected successfully
-
removeSelectionPaths
boolean removeSelectionPaths(int[][] paths) Removes paths from the selection. If any of the paths inpathsare in the selection, the TreeDataListeners are notified. This method has no effect ifpathsis null.- Parameters:
paths- the path to remove from the selection- Returns:
- true if one of the paths was unselected successfully
-
isPathSelected
boolean isPathSelected(int[] path) Returns true if the path,path, is in the current selection. -
isSelectionEmpty
boolean isSelectionEmpty()Returns true if the selection is currently empty. -
clearSelection
void clearSelection()Empties the current selection. If this represents a change in the current selection, the selection listeners are notified. -
getSelectionPath
int[] getSelectionPath()Returns the first path in the selection. How first is defined is up to implementors. -
getSelectionPaths
int[][] getSelectionPaths()Returns the paths in the selection. This will return null (or an empty array) if nothing is currently selected. -
getSelectionCount
int getSelectionCount()Returns the number of paths that are selected.
-