public class SLListBox extends SLBase
Modifier | Constructor and Description |
---|---|
protected |
SLListBox(JtfObjectHandle handle,
Desktop desktop)
Creates a new SLListBox with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canSelectMultiple()
Gets whether the list box allows more than one child element to be selected concurrently.
|
void |
deselectAll()
Deselects all list items.
|
double |
getHorizontalScrollPercent()
Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.
|
List<SLListItem> |
getItems()
Gets the list of list box items.
|
List<String> |
getItemTexts()
Gets the list of all item texts.
|
int |
getSelectedIndex()
Gets the index of the first item in the current selection or returns negative one (-1) if the selection is empty.
|
List<Integer> |
getSelectedIndices()
Gets the indices of the currently selected items.
|
SLListItem |
getSelectedItem()
Gets the first item in the current selection or returns null if the selection is empty.
|
List<SLListItem> |
getSelectedItems()
Gets the currently selected items.
|
String |
getSelectedItemText()
Gets the text of the first selected item.
|
List<String> |
getSelectedItemTexts()
Gets the texts of the currently selected items.
|
double |
getVerticalScrollPercent()
Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.
|
boolean |
isHorizontallyScrollable()
Gets a value that indicates whether the list box can scroll horizontally.
|
boolean |
isVerticallyScrollable()
Gets a value that indicates whether the list box can scroll vertically.
|
void |
scrollHorizontal(ScrollAmount scrollAmount)
Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.
|
void |
scrollVertical(ScrollAmount scrollAmount)
Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.
|
void |
select(int itemIndex)
Selects the given list box item.
|
void |
select(int itemIndex,
ModifierKey modifiers)
Selects the given list box item.
|
void |
select(ItemIdentifier item)
Selects the given list box item.
|
void |
select(ItemIdentifier item,
ModifierKey modifiers)
Selects the given list box item.
|
void |
select(String itemText)
Selects the given list box item.
|
void |
select(String itemText,
ModifierKey modifiers)
Selects the given list box item.
|
void |
selectAll()
Selects all items in the list.
|
void |
setHorizontalScrollPercent(double percent)
Sets the horizontal scroll position as a percentage of the total content area within the list box.
|
void |
setVerticalScrollPercent(double percent)
Sets the vertical scroll position as a percentage of the total content area within the list box.
|
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
- the handle that identifies the SLListBoxdesktop
- the desktop on which this object livespublic void deselectAll()
public void scrollHorizontal(ScrollAmount scrollAmount)
scrollAmount
- the direction and distance to scrollpublic void scrollVertical(ScrollAmount scrollAmount)
scrollAmount
- =The direction and distance to scrollpublic void select(ItemIdentifier item)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
item
- the name or index of the item to selectpublic void select(ItemIdentifier item, ModifierKey modifiers)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
item
- the name or index of the item to selectmodifiers
- the modifier keys (Alt, Shift and Ctrl) to press while selecting an item. Default: Don't use modifier keys.public void select(String itemText)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemText
- the name or index of the item to selectpublic void select(String itemText, ModifierKey modifiers)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemText
- the name or index of the item to selectmodifiers
- the modifier keys (Alt, Shift and Ctrl) to press while selecting an item. Default: Don't use modifier keys.public void select(int itemIndex)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemIndex
- the name or index of the item to selectpublic void select(int itemIndex, ModifierKey modifiers)
Sample Usage In order to select the item with the text "item 1" from a list box type:
listBox.select("item 1");In order to select the third item from a list box type:
listBox.select(3);In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.select("item 1"); listBox.select("item 3", ModifierKey.Ctrl);In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.select("item 1"); listBox.select("item 3"); listBox.select("item 1"); // deselects "item 1"
itemIndex
- the name or index of the item to selectmodifiers
- the modifier keys (Alt, Shift and Ctrl) to press while selecting an item. Default: Don't use modifier keys.public void selectAll()
public void setHorizontalScrollPercent(double percent)
percent
- the percentage of the total horizontal content areapublic void setVerticalScrollPercent(double percent)
percent
- the percentage of the total vertical content areapublic boolean canSelectMultiple()
public boolean isHorizontallyScrollable()
public double getHorizontalScrollPercent()
public List<SLListItem> getItems()
public int getSelectedIndex()
public List<Integer> getSelectedIndices()
public SLListItem getSelectedItem()
public List<SLListItem> getSelectedItems()
public String getSelectedItemText()
public List<String> getSelectedItemTexts()
public boolean isVerticallyScrollable()
public double getVerticalScrollPercent()
Copyright 2009-2012 Micro Focus. All Rights Reserved.