public class SLListBox extends SLBase
Modifier | Constructor and Description |
---|---|
protected |
SLListBox(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 SLListBox。
|
Modifier and Type | Method and Description |
---|---|
boolean |
canSelectMultiple()
获取 列表框是否允许同时选择多个子级元素。
|
void |
deselectAll()
取消选择所有列表项目。
|
double |
getHorizontalScrollPercent()
获取 当前水平滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
List<SLListItem> |
getItems()
获取 列表框项目的列表。
|
List<String> |
getItemTexts()
获取 所有项目文本的列表。
|
int |
getSelectedIndex()
获取 当前选定内容中第一个项目的索引,如果选定内容为空,则返回负值 (-1)。.
|
List<Integer> |
getSelectedIndices()
获取 当前所选项目的索引。
|
SLListItem |
getSelectedItem()
获取 当前选定内容中的第一个项目,如果选定内容为空,则返回 null。
|
List<SLListItem> |
getSelectedItems()
获取 当前所选项目。
|
String |
getSelectedItemText()
获取 第一个所选项目的文本。
|
List<String> |
getSelectedItemTexts()
获取 当前所选项目的文本。
|
double |
getVerticalScrollPercent()
获取 当前垂直滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
boolean |
isHorizontallyScrollable()
获取 表示列表框是否可水平滚动的值。
|
boolean |
isVerticallyScrollable()
获取 表示列表框是否可垂直滚动的值。
|
void |
scrollHorizontal(ScrollAmount scrollAmount)
将内容区域的当前可见区域水平滚动指定 ScrollAmount。
|
void |
scrollVertical(ScrollAmount scrollAmount)
将内容区域的当前可见区域垂直滚动指定 ScrollAmount。
|
void |
select(int itemIndex)
选择指定列表框项目。
|
void |
select(int itemIndex,
ModifierKey modifiers)
选择指定列表框项目。
|
void |
select(ItemIdentifier item)
选择指定列表框项目。
|
void |
select(ItemIdentifier item,
ModifierKey modifiers)
选择指定列表框项目。
|
void |
select(String itemText)
选择指定列表框项目。
|
void |
select(String itemText,
ModifierKey modifiers)
选择指定列表框项目。
|
void |
selectAll()
选择列表中的所有项目。
|
void |
setHorizontalScrollPercent(double percent)
设置水平滚动位置占列表框中全部内容区域的百分比。
|
void |
setVerticalScrollPercent(double percent)
设置垂直滚动位置占列表框内全部内容区域的百分比。
|
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, getAutomationId, getClassName, getName, getRawChildren, getRawChildren, isEnabled, isFocused, mouseMove, mouseMove, pressKeys, pressKeys, pressMouse, pressMouse, pressMouse, pressMouse, releaseKeys, releaseKeys, releaseMouse, releaseMouse, releaseMouse, releaseMouse, setFocus, typeKeys, typeKeys, typeKeys, typePasswordKeys, typePasswordKeys, typePasswordKeys
captureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getText, 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 SLListBox(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 SLListBox 的句柄desktop
- 此对象所在的桌面public void deselectAll()
public void scrollHorizontal(ScrollAmount scrollAmount)
scrollAmount
- 可滚动的方向和距离public void scrollVertical(ScrollAmount scrollAmount)
scrollAmount
- =可滚动的方向和距离public void select(ItemIdentifier item)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
item
- 可选择的项目的名称或索引public void select(ItemIdentifier item, ModifierKey modifiers)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
item
- 可选择的项目的名称或索引modifiers
- 选择项目时可按的修饰键(Alt、Shift、Ctrl)。默认:不使用修饰键。public void select(String itemText)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemText
- 可选择的项目的名称或索引public void select(String itemText, ModifierKey modifiers)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemText
- 可选择的项目的名称或索引modifiers
- 选择项目时可按的修饰键(Alt、Shift、Ctrl)。默认:不使用修饰键。public void select(int itemIndex)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemIndex
- 可选择的项目的名称或索引public void select(int itemIndex, ModifierKey modifiers)
示例使用情况要选择列表框类型中带文本“项目 1”的项目:
listBox.select("item 1");要选择列表框类型中的第三个项目:
listBox.select(3);要选择列表框中的多个项目,请使用修饰键(例如 Ctrl 或 Shift)。 要选择多选列表框(已扩展选择类型)中分别带文本“项目 1”和“项目 3”的两个项目,请键入以下内容:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);在具有多种选择样式的多选列表框中,用户通过单击项目可取消选择所选项目。 以下代码选择此类列表框中的两个项目,然后取消选择第一个项目:
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemIndex
- 可选择的项目的名称或索引modifiers
- 选择项目时可按的修饰键(Alt、Shift、Ctrl)。默认:不使用修饰键。public void selectAll()
public void setHorizontalScrollPercent(double percent)
percent
- 全部水平内容区域的百分比public void setVerticalScrollPercent(double percent)
percent
- 全部垂直内容区域的百分比public boolean canSelectMultiple()
public boolean isHorizontallyScrollable()
public double getHorizontalScrollPercent()
public List<SLListItem> getItems()
public int getSelectedIndex()
public SLListItem getSelectedItem()
public List<SLListItem> getSelectedItems()
public String getSelectedItemText()
public boolean isVerticallyScrollable()
public double getVerticalScrollPercent()
Copyright 2009-2012 Micro Focus. All Rights Reserved.