public class TextField extends Control
| Modifier | Constructor and Description |
|---|---|
protected |
TextField(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 TextField。
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearText()
删除文本字段中的所有文本。
|
List<String> |
getMultiText()
返回多行文本字段中指定的文本行。
|
List<String> |
getMultiText(int startLine)
返回多行文本字段中指定的文本行。
|
List<String> |
getMultiText(int startLine,
int numberOfLines)
返回多行文本字段中指定的文本行。
|
TextPosition |
getPosition()
获取 文本字段中脱字号的位置。
|
TextRange |
getSelectedRange()
获取 文本字段中的所选范围。
|
String |
getSelectedText()
获取 文本字段中的所选文本。
|
boolean |
isMultiLine()
获取 控件是否为多行。
|
boolean |
isPassword()
获取 控件是否为密码文本字段。
|
void |
setMultiText(List<String> text)
替换多行文本字段中的所有或部分行。
|
void |
setMultiText(List<String> text,
int startLine)
替换多行文本字段中的所有或部分行。
|
void |
setMultiText(List<String> text,
int startLine,
int numberOfLines)
替换多行文本字段中的所有或部分行。
|
void |
setPosition(TextPosition position)
设置文本字段中的插入点。
|
void |
setSelectedRange(TextRange selectedRange)
设置 文本字段中的所选范围。
|
void |
setSelectionRange(TextRange selectionRange)
选择单行或多行文本字段的指定范围。
|
void |
setText(String text)
替换文本字段中的所有或部分文本为新文本。
|
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 TextField(JtfObjectHandle handle, Desktop desktop)
handle - 可确定 TextField 的句柄desktop - 此对象所在的桌面public void clearText()
public List<String> getMultiText(int startLine)
startLine - 可返回的第一行编号。. The value is zero-based.public List<String> getMultiText(int startLine, int numberOfLines)
startLine - 可返回的第一行编号。. The value is zero-based.numberOfLines - 可返回的行数public void setMultiText(List<String> text)
text - 可替换的文本public void setMultiText(List<String> text, int startLine)
text - 可替换的文本startLine - 可替换的文本字段中的行(从 0 开始). The value is zero-based.public void setMultiText(List<String> text, int startLine, int numberOfLines)
text - 可替换的文本startLine - 可替换的文本字段中的行(从 0 开始). The value is zero-based.numberOfLines - 可替换的行数public void setPosition(TextPosition position)
position - 文本字段中脱字号的位置public void setSelectionRange(TextRange selectionRange)
selectionRange - 文本字段中的所选范围public void setText(String text)
text - 可替换的文本public boolean isPassword()
public boolean isMultiLine()
public TextPosition getPosition()
public TextRange getSelectedRange()
public void setSelectedRange(TextRange selectedRange)
selectedRange - 文本字段中的所选范围public String getSelectedText()
Copyright 2009-2012 Micro Focus. All Rights Reserved.