public class SLTextBox extends SLBase
Sample Usage
textBox.setText("some text"); textBox.setSelection(0, 4); // selects 4 characters starting from the first one textBox.typeKeys("<Ctrl+C>"); // copies the selected text to the clipboard String selectedText = desktop.getClipboardText(); // gets the text from the clipboard
Modifier | Constructor and Description |
---|---|
protected |
SLTextBox(JtfObjectHandle handle,
Desktop desktop)
Creates a new SLTextBox with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all text from the text field.
|
String |
getText()
Gets the text that is displayed in the text box.
|
boolean |
isReadOnly()
Gets whether the text box is read-only.
|
void |
setPosition(int position)
Sets the insertion point in the text field.
|
void |
setSelection(int startPosition,
int length)
Selects a range of text in the text box.
|
void |
setText(String text)
Replaces the text in the text field with the given text.
|
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, 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 SLTextBox(JtfObjectHandle handle, Desktop desktop)
handle
- the handle that identifies the SLTextBoxdesktop
- the desktop on which this object livespublic void clear()
public void setPosition(int position)
position
- the position of the caret within the text field. The value is zero-based.public void setSelection(int startPosition, int length)
startPosition
- the start index for the selection. The value is zero-based.length
- the number of characters to select from the start positionpublic void setText(String text)
text
- the new textpublic boolean isReadOnly()
public String getText()
getText
in class TestObject
Copyright 2009-2012 Micro Focus. All Rights Reserved.