Package org.zkoss.zul.ext
Interface TreeSelectableModel
-
- All Known Implementing Classes:
AbstractTreeModel,DefaultTreeModel
public interface TreeSelectableModel- Since:
- 6.0.0
- Author:
- jumperchen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddSelectionPath(int[] path)Adds path to the current selection.booleanaddSelectionPaths(int[][] paths)Adds paths to the current selection.voidclearSelection()Empties the current selection.intgetSelectionCount()Returns the number of paths that are selected.int[]getSelectionPath()Returns the first path in the selection.int[][]getSelectionPaths()Returns the paths in the selection.booleanisMultiple()Returns whether the current selection mode is multiple.booleanisPathSelected(int[] path)Returns true if the path,path, is in the current selection.booleanisSelectionEmpty()Returns 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 Detail
-
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:
setMultiple(boolean)
-
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.
-
-