public class Tree extends Control
| Modifier | Constructor and Description |
|---|---|
protected |
Tree(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 Tree。
|
| Modifier and Type | Method and Description |
|---|---|
void |
check(ItemPath itemPath)
选中复选框。
|
void |
check(String itemPath)
选中复选框。
|
void |
collapse(ItemPath itemPath)
折叠 treeview 控件中的项目。
|
void |
collapse(String itemPath)
折叠 treeview 控件中的项目。
|
void |
doubleSelect(ItemPath itemPath)
双击项目。
|
void |
doubleSelect(ItemPath itemPath,
ModifierKey modifiers)
双击项目。
|
void |
doubleSelect(String itemPath)
双击项目。
|
void |
doubleSelect(String itemPath,
ModifierKey modifiers)
双击项目。
|
void |
expand(ItemPath itemPath)
展开 treeview 控件中的对象。
|
void |
expand(String itemPath)
展开 treeview 控件中的对象。
|
int |
getItemCount()
获取 树中项目的数量(包括所有子级)。
|
List<ItemPath> |
getItemPaths()
返回树的所有项目为 itempath 的列表。
|
Rect |
getItemRect(ItemPath itemPath)
返回相对于 treeview 控件的项目的大小和位置。
|
Rect |
getItemRect(ItemPath itemPath,
boolean getIconRect)
返回相对于 treeview 控件的项目的大小和位置。
|
Rect |
getItemRect(String itemPath)
返回相对于 treeview 控件的项目的大小和位置。
|
Rect |
getItemRect(String itemPath,
boolean getIconRect)
返回相对于 treeview 控件的项目的大小和位置。
|
Tree |
getItems()
Deprecated.
自 Silk Test 2011 开始使用
ItemPaths 属性,不再检索树的所有项目。 |
ItemPath |
getSelectedIndex()
获取 第一个所选项目的索引。
|
List<ItemPath> |
getSelectedIndices()
获取 所选项目的索引。
|
ItemPath |
getSelectedItem()
获取 第一个所选项目的名称。
|
List<ItemPath> |
getSelectedItems()
获取 所选项目的名称。
|
List<ItemPath> |
getVisibleItemPaths()
获取 树中可见项目的列表(包括所有子级)。
|
Tree |
getVisibleItems()
Deprecated.
自 Silk Test 2011 开始使用
VisibleItemPaths 属性,不再检索树的所有可见项目。 |
boolean |
isAllowsCheck()
获取 控件是否可以显示选中标记。
|
boolean |
isAllowsMultiSelect()
获取 控件是否支持选择多个项目。
|
boolean |
isExpandable(ItemPath itemPath)
确认是否可以展开指定项目。
|
boolean |
isExpandable(String itemPath)
确认是否可以展开指定项目。
|
boolean |
isExpanded(ItemPath itemPath)
确认是否展开指定项目。
|
boolean |
isExpanded(String itemPath)
确认是否展开指定项目。
|
void |
select(ItemPath itemPath)
选择树中的项目。
|
void |
select(String itemPath)
选择树中的项目。
|
void |
setSelectedIndex(ItemPath selectedIndex)
设置 第一个所选项目的索引。
|
void |
setSelectedIndex(String selectedIndex)
设置 第一个所选项目的索引。
|
void |
setSelectedIndices(List<ItemPath> selectedIndices)
设置 所选项目的索引。
|
void |
setSelectedItem(ItemPath selectedItem)
设置 第一个所选项目的名称。
|
void |
setSelectedItem(String selectedItem)
设置 第一个所选项目的名称。
|
void |
setSelectedItems(List<ItemPath> selectedItems)
设置 所选项目的名称。
|
void |
uncheck(ItemPath itemPath)
取消选中复选框。
|
void |
uncheck(String itemPath)
取消选中复选框。
|
getHorizontalBar, getVerticalBar, openContextMenu, openContextMenuclick, 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, typePasswordKeyscaptureBitmap, 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, waitForPropertyequals, 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, toStringprotected Tree(JtfObjectHandle handle, Desktop desktop)
handle - 可确定 Tree 的句柄desktop - 此对象所在的桌面public void check(ItemPath itemPath)
itemPath - 可选中的项目路径public void check(String itemPath)
itemPath - 可选中的项目路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void collapse(ItemPath itemPath)
itemPath - 可折叠的项目路径public void collapse(String itemPath)
itemPath - 可折叠的项目路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void doubleSelect(ItemPath itemPath)
itemPath - 可选择的项目public void doubleSelect(ItemPath itemPath, ModifierKey modifiers)
itemPath - 可选择的项目modifiers - 可双击的修饰符public void doubleSelect(String itemPath)
itemPath - 可选择的项目. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void doubleSelect(String itemPath, ModifierKey modifiers)
itemPath - 可选择的项目. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
modifiers - 可双击的修饰符public void expand(ItemPath itemPath)
itemPath - 可展开的项目的路径public void expand(String itemPath)
itemPath - 可展开的项目的路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public Rect getItemRect(ItemPath itemPath)
默认情况下,返回项目文本的矩形。返回的矩形包括项目的 X 和 Y 位置(与 treeview 控件相对应)、其宽度及高度。
使用可选的 getIconRect 参数通过返回值指定项目图标的位置和大小。如果项目当前已滚动至视图外,则返回的坐标将反映此点。例如,如果指定项目 1,则当前可见的顶端项目是项目 10,然后返回的 Y 坐标为负数。
示例使用情况例如,要单击某个树项目的图标,请键入:
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 - 可检索其矩形的项目public Rect getItemRect(ItemPath itemPath, boolean getIconRect)
默认情况下,返回项目文本的矩形。返回的矩形包括项目的 X 和 Y 位置(与 treeview 控件相对应)、其宽度及高度。
使用可选的 getIconRect 参数通过返回值指定项目图标的位置和大小。如果项目当前已滚动至视图外,则返回的坐标将反映此点。例如,如果指定项目 1,则当前可见的顶端项目是项目 10,然后返回的 Y 坐标为负数。
示例使用情况例如,要单击某个树项目的图标,请键入:
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 - 可检索其矩形的项目getIconRect - 如果为 true,则返回图标的大小和位置,否则返回文本的矩形public Rect getItemRect(String itemPath)
默认情况下,返回项目文本的矩形。返回的矩形包括项目的 X 和 Y 位置(与 treeview 控件相对应)、其宽度及高度。
使用可选的 getIconRect 参数通过返回值指定项目图标的位置和大小。如果项目当前已滚动至视图外,则返回的坐标将反映此点。例如,如果指定项目 1,则当前可见的顶端项目是项目 10,然后返回的 Y 坐标为负数。
示例使用情况例如,要单击某个树项目的图标,请键入:
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 - 可检索其矩形的项目. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public Rect getItemRect(String itemPath, boolean getIconRect)
默认情况下,返回项目文本的矩形。返回的矩形包括项目的 X 和 Y 位置(与 treeview 控件相对应)、其宽度及高度。
使用可选的 getIconRect 参数通过返回值指定项目图标的位置和大小。如果项目当前已滚动至视图外,则返回的坐标将反映此点。例如,如果指定项目 1,则当前可见的顶端项目是项目 10,然后返回的 Y 坐标为负数。
示例使用情况例如,要单击某个树项目的图标,请键入:
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 - 可检索其矩形的项目. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
getIconRect - 如果为 true,则返回图标的大小和位置,否则返回文本的矩形public boolean isExpandable(ItemPath itemPath)
itemPath - 可确认项目是否可展开的项目的路径public boolean isExpandable(String itemPath)
itemPath - 可确认项目是否可展开的项目的路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public boolean isExpanded(ItemPath itemPath)
itemPath - 可确认项目是否可展开的项目的路径public boolean isExpanded(String itemPath)
itemPath - 可确认项目是否可展开的项目的路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void select(ItemPath itemPath)
itemPath - 可选择的项目路径public void select(String itemPath)
itemPath - 可选择的项目路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void uncheck(ItemPath itemPath)
itemPath - 可取消选中的项目的路径public void uncheck(String itemPath)
itemPath - 可取消选中的项目的路径. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public boolean isAllowsCheck()
public boolean isAllowsMultiSelect()
public int getItemCount()
public Tree getItems()
ItemPaths 属性,不再检索树的所有项目。public ItemPath getSelectedIndex()
public void setSelectedIndex(ItemPath selectedIndex)
selectedIndex - 第一个所选项目的索引public void setSelectedIndex(String selectedIndex)
selectedIndex - 第一个所选项目的索引. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void setSelectedIndices(List<ItemPath> selectedIndices)
selectedIndices - 所选项目的索引public ItemPath getSelectedItem()
public void setSelectedItem(ItemPath selectedItem)
selectedItem - 第一个所选项目的名称public void setSelectedItem(String selectedItem)
selectedItem - 第一个所选项目的名称. E.g: /Games/Applications[2]/[0]有关详细信息,请参见 ItemPath.ItemPath(String)。
public void setSelectedItems(List<ItemPath> selectedItems)
selectedItems - 所选项目的名称public Tree getVisibleItems()
VisibleItemPaths 属性,不再检索树的所有可见项目。Copyright 2009-2012 Micro Focus. All Rights Reserved.