public class SLComboBox extends SLBase
Silverlight 中的组合框需先打开一次,然后才能检索有关其项目的信息。
Modifier | Constructor and Description |
---|---|
protected |
SLComboBox(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 SLComboBox。
|
Modifier and Type | Method and Description |
---|---|
void |
close()
关闭组合框。
|
double |
getHorizontalScrollPercent()
获取 当前水平滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
List<SLComboBoxItem> |
getItems()
获取 项目的完整列表。
|
List<String> |
getItemTexts()
获取 项目文本的完整列表。
|
int |
getSelectedIndex()
获取 所选项目的索引,如果选定内容为空,则为负值 (-1)。.
|
SLComboBoxItem |
getSelectedItem()
获取 所选项目,如果选定内容为空,则为 null。
|
String |
getSelectedItemText()
获取 所选项目的文本,如果选定内容为空,则为空字符串。
|
double |
getVerticalScrollPercent()
获取 当前垂直滚动位置,如果无有效的滚动位置,则为负值 (-1)。
|
boolean |
isHorizontallyScrollable()
获取 表示组合框是否可水平滚动的值。
|
boolean |
isOpen()
获取 表示组合框是否已打开的值。
|
boolean |
isVerticallyScrollable()
获取 表示组合框是否可垂直滚动的值。
|
void |
open()
打开组合框。
|
void |
scrollHorizontal(ScrollAmount scrollAmount)
将内容区域的当前可见区域水平滚动指定 ScrollAmount。
|
void |
scrollVertical(ScrollAmount scrollAmount)
将内容区域的当前可见区域垂直滚动指定 ScrollAmount。
|
void |
select(int itemIndex)
选择组合框中的项目。
|
void |
select(ItemIdentifier item)
选择组合框中的项目。
|
void |
select(String itemText)
选择组合框中的项目。
|
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 SLComboBox(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 SLComboBox 的句柄desktop
- 此对象所在的桌面public void close()
public void open()
public void scrollHorizontal(ScrollAmount scrollAmount)
scrollAmount
- 可滚动的方向和距离public void scrollVertical(ScrollAmount scrollAmount)
scrollAmount
- 可滚动的方向和距离public void select(ItemIdentifier item)
示例使用情况要选择组合框类型中带文本“项目 1”的项目:
comboBox.select("item 1");要选择组合框类型中的第三个项目:
comboBox.select(3);
item
- 可选择的项目public void select(String itemText)
示例使用情况要选择组合框类型中带文本“项目 1”的项目:
comboBox.select("item 1");要选择组合框类型中的第三个项目:
comboBox.select(3);
itemText
- 可选择的项目public void select(int itemIndex)
示例使用情况要选择组合框类型中带文本“项目 1”的项目:
comboBox.select("item 1");要选择组合框类型中的第三个项目:
comboBox.select(3);
itemIndex
- 可选择的项目public void setHorizontalScrollPercent(double percent)
percent
- 全部水平内容区域的百分比public void setVerticalScrollPercent(double percent)
percent
- 全部垂直内容区域的百分比public boolean isHorizontallyScrollable()
public double getHorizontalScrollPercent()
public boolean isOpen()
public List<SLComboBoxItem> getItems()
public List<String> getItemTexts()
示例使用情况
comboBox.open(); Listitems = comboBox.getItemTexts(); comboBox.close();
public int getSelectedIndex()
public SLComboBoxItem getSelectedItem()
public String getSelectedItemText()
public boolean isVerticallyScrollable()
public double getVerticalScrollPercent()
Copyright 2009-2012 Micro Focus. All Rights Reserved.