public class Tree extends Control
Modifier | Constructor and Description |
---|---|
protected |
Tree(JtfObjectHandle handle,
Desktop desktop)
Creates a new Tree with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
void |
check(ItemPath itemPath)
Checks the check box.
|
void |
check(String itemPath)
Checks the check box.
|
void |
collapse(ItemPath itemPath)
Collapses an item in a treeview control.
|
void |
collapse(String itemPath)
Collapses an item in a treeview control.
|
void |
doubleSelect(ItemPath itemPath)
Double-clicks an item.
|
void |
doubleSelect(ItemPath itemPath,
ModifierKey modifiers)
Double-clicks an item.
|
void |
doubleSelect(String itemPath)
Double-clicks an item.
|
void |
doubleSelect(String itemPath,
ModifierKey modifiers)
Double-clicks an item.
|
void |
expand(ItemPath itemPath)
Expands an object in a treeview control.
|
void |
expand(String itemPath)
Expands an object in a treeview control.
|
int |
getItemCount()
Gets the number of items in the tree (including all children).
|
List<ItemPath> |
getItemPaths()
Returns all items of the tree as a list of itempaths.
|
Rect |
getItemRect(ItemPath itemPath)
Returns the size and position of an item relative to the treeview control.
|
Rect |
getItemRect(ItemPath itemPath,
boolean getIconRect)
Returns the size and position of an item relative to the treeview control.
|
Rect |
getItemRect(String itemPath)
Returns the size and position of an item relative to the treeview control.
|
Rect |
getItemRect(String itemPath,
boolean getIconRect)
Returns the size and position of an item relative to the treeview control.
|
Tree |
getItems()
Deprecated.
Since Silk Test 2011 use the
ItemPaths property instead for retrieving all items of a tree. |
ItemPath |
getSelectedIndex()
Gets the index of the first selected item.
|
List<ItemPath> |
getSelectedIndices()
Gets the indices of the selected item(s).
|
ItemPath |
getSelectedItem()
Gets the name of the first selected item.
|
List<ItemPath> |
getSelectedItems()
Gets the names of the selected item(s).
|
List<ItemPath> |
getVisibleItemPaths()
Gets a list of visible items in the tree (including all children).
|
Tree |
getVisibleItems()
Deprecated.
Since Silk Test 2011 use the
VisibleItemPaths property instead for retrieving all visible items of a tree. |
boolean |
isAllowsCheck()
Gets whether the control can display a checkmark.
|
boolean |
isAllowsMultiSelect()
Gets whether the control supports selecting multiple items.
|
boolean |
isExpandable(ItemPath itemPath)
Checks if the given item can be expanded.
|
boolean |
isExpandable(String itemPath)
Checks if the given item can be expanded.
|
boolean |
isExpanded(ItemPath itemPath)
Checks if the given item is expanded.
|
boolean |
isExpanded(String itemPath)
Checks if the given item is expanded.
|
void |
select(ItemPath itemPath)
Selects an item from the tree.
|
void |
select(String itemPath)
Selects an item from the tree.
|
void |
setSelectedIndex(ItemPath selectedIndex)
Sets the index of the first selected item.
|
void |
setSelectedIndex(String selectedIndex)
Sets the index of the first selected item.
|
void |
setSelectedIndices(List<ItemPath> selectedIndices)
Sets the indices of the selected item(s).
|
void |
setSelectedItem(ItemPath selectedItem)
Sets the name of the first selected item.
|
void |
setSelectedItem(String selectedItem)
Sets the name of the first selected item.
|
void |
setSelectedItems(List<ItemPath> selectedItems)
Sets the names of the selected item(s).
|
void |
uncheck(ItemPath itemPath)
Unchecks the check box.
|
void |
uncheck(String itemPath)
Unchecks the check box.
|
getHorizontalBar, getVerticalBar, openContextMenu, openContextMenu
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, getBackground, getFont, getForeground, getNativeHandle, isEnabled, isFocused, isVisible, mouseMove, mouseMove, pressKeys, pressKeys, pressMouse, pressMouse, pressMouse, pressMouse, releaseKeys, releaseKeys, releaseMouse, releaseMouse, releaseMouse, releaseMouse, setBackground, setEnabled, setFocus, setFont, setForeground, setVisible, typeKeys, typeKeys, typeKeys, typePasswordKeys, typePasswordKeys, typePasswordKeys
captureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getValue, highlightObject, highlightObject, highlightObject, invokeMethods, textCapture, textCapture, textClick, textClick, textClick, textClick, textClick, textClick, textExists, textExists, textExists, textExists, textExists, textRectangle, textRectangle, textRectangle, textRectangle, textRectangle, waitForChildDisappearance, waitForChildDisappearance, waitForDisappearance, waitForDisappearance, waitForObject, waitForObject, waitForProperty, waitForProperty
equals, exists, find, find, findAll, findAll, getCustomTypeName, getDesktop, getHandle, getLocator, getProperty, getTypeName, hashCode, imageClick, imageClick, imageClick, imageClick, imageClick, imageClick, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageExists, imageExists, imageExists, imageExistsFile, imageExistsFile, imageExistsFile, imageRectangle, imageRectangle, imageRectangle, imageRectangleFile, imageRectangleFile, imageRectangleFile, invoke, preventFinalLocator, setProperty, toString
protected Tree(JtfObjectHandle handle, Desktop desktop)
handle
- the handle that identifies the Treedesktop
- the desktop on which this object livespublic void check(ItemPath itemPath)
itemPath
- the path of the item to checkpublic void check(String itemPath)
itemPath
- the path of the item to check. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void collapse(ItemPath itemPath)
itemPath
- the path of the item to collapsepublic void collapse(String itemPath)
itemPath
- the path of the item to collapse. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void doubleSelect(ItemPath itemPath)
itemPath
- the item to selectpublic void doubleSelect(ItemPath itemPath, ModifierKey modifiers)
itemPath
- the item to selectmodifiers
- the modifier to double-clickpublic void doubleSelect(String itemPath)
itemPath
- the item to select. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void doubleSelect(String itemPath, ModifierKey modifiers)
itemPath
- the item to select. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
modifiers
- the modifier to double-clickpublic void expand(ItemPath itemPath)
itemPath
- the path of the item to expandpublic void expand(String itemPath)
itemPath
- the path of the item to expand. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public List<ItemPath> getItemPaths()
public Rect getItemRect(ItemPath itemPath)
By default the rectangle for the text of the item is returned. The rectangle returned includes the item's X and Y position, relative to the treeview control, its width, and its height.
Use the optional getIconRect
parameter to have the return value specify the location and size of the item's icon instead. If the item is currently scrolled out of view, the returned coordinates reflects this. For example, if item 1 is specified, and the top item currently visible is item 10, then the Y coordinate returned is a negative number.
Sample Usage For example, to click on the icon of certain tree item, type:
myTreeView.expand("/root/child/grandchild"); Rectangle rect = myTreeView.getItemRect("/root/child/grandchild", true); myTree.click(MouseButton.Left, New Point(rect.X + 5, rect.Y + 5));
itemPath
- the item to retrieve the rectangle ofpublic Rect getItemRect(ItemPath itemPath, boolean getIconRect)
By default the rectangle for the text of the item is returned. The rectangle returned includes the item's X and Y position, relative to the treeview control, its width, and its height.
Use the optional getIconRect
parameter to have the return value specify the location and size of the item's icon instead. If the item is currently scrolled out of view, the returned coordinates reflects this. For example, if item 1 is specified, and the top item currently visible is item 10, then the Y coordinate returned is a negative number.
Sample Usage For example, to click on the icon of certain tree item, type:
myTreeView.expand("/root/child/grandchild"); Rectangle rect = myTreeView.getItemRect("/root/child/grandchild", true); myTree.click(MouseButton.Left, New Point(rect.X + 5, rect.Y + 5));
itemPath
- the item to retrieve the rectangle ofgetIconRect
- if true
the size and position of the icon is returned. Otherwise the rectangle of the text is returned.public Rect getItemRect(String itemPath)
By default the rectangle for the text of the item is returned. The rectangle returned includes the item's X and Y position, relative to the treeview control, its width, and its height.
Use the optional getIconRect
parameter to have the return value specify the location and size of the item's icon instead. If the item is currently scrolled out of view, the returned coordinates reflects this. For example, if item 1 is specified, and the top item currently visible is item 10, then the Y coordinate returned is a negative number.
Sample Usage For example, to click on the icon of certain tree item, type:
myTreeView.expand("/root/child/grandchild"); Rectangle rect = myTreeView.getItemRect("/root/child/grandchild", true); myTree.click(MouseButton.Left, New Point(rect.X + 5, rect.Y + 5));
itemPath
- the item to retrieve the rectangle of. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public Rect getItemRect(String itemPath, boolean getIconRect)
By default the rectangle for the text of the item is returned. The rectangle returned includes the item's X and Y position, relative to the treeview control, its width, and its height.
Use the optional getIconRect
parameter to have the return value specify the location and size of the item's icon instead. If the item is currently scrolled out of view, the returned coordinates reflects this. For example, if item 1 is specified, and the top item currently visible is item 10, then the Y coordinate returned is a negative number.
Sample Usage For example, to click on the icon of certain tree item, type:
myTreeView.expand("/root/child/grandchild"); Rectangle rect = myTreeView.getItemRect("/root/child/grandchild", true); myTree.click(MouseButton.Left, New Point(rect.X + 5, rect.Y + 5));
itemPath
- the item to retrieve the rectangle of. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
getIconRect
- if true
the size and position of the icon is returned. Otherwise the rectangle of the text is returned.public boolean isExpandable(ItemPath itemPath)
itemPath
- the path of the item to check if it can be expandedpublic boolean isExpandable(String itemPath)
itemPath
- the path of the item to check if it can be expanded. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public boolean isExpanded(ItemPath itemPath)
itemPath
- the path of the item to check if it is expandedpublic boolean isExpanded(String itemPath)
itemPath
- the path of the item to check if it is expanded. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void select(ItemPath itemPath)
itemPath
- the path of the item to selectpublic void select(String itemPath)
itemPath
- the path of the item to select. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void uncheck(ItemPath itemPath)
itemPath
- the path of the item to uncheckpublic void uncheck(String itemPath)
itemPath
- the path of the item to uncheck. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public boolean isAllowsCheck()
public boolean isAllowsMultiSelect()
public int getItemCount()
public Tree getItems()
ItemPaths
property instead for retrieving all items of a tree.public ItemPath getSelectedIndex()
public void setSelectedIndex(ItemPath selectedIndex)
selectedIndex
- the index of the first selected itempublic void setSelectedIndex(String selectedIndex)
selectedIndex
- the index of the first selected item. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public List<ItemPath> getSelectedIndices()
public void setSelectedIndices(List<ItemPath> selectedIndices)
selectedIndices
- the indices of the selected item(s)public ItemPath getSelectedItem()
public void setSelectedItem(ItemPath selectedItem)
selectedItem
- the name of the first selected itempublic void setSelectedItem(String selectedItem)
selectedItem
- the name of the first selected item. E.g: /Games/Applications[2]/[0]For details see ItemPath.ItemPath(String)
.
public void setSelectedItems(List<ItemPath> selectedItems)
selectedItems
- the names of the selected item(s)public List<ItemPath> getVisibleItemPaths()
public Tree getVisibleItems()
VisibleItemPaths
property instead for retrieving all visible items of a tree.Copyright 2009-2012 Micro Focus. All Rights Reserved.