|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AwtTextComponent
AwtTextComponent is created to represent java.awt.TextComponent component
The following code fragment illustrates how to create an
AwtTextComponent
element.
var element = engine.createAwtTextComponent(1, 5);where engine is object of
IScriptEngine
Method Summary | |
---|---|
int |
getCaretPos()
Gets the position of the text insertion caret for this text component. |
java.lang.String |
getSelectedText()
Returns the selected text from the text that is presented by this text component. |
int |
getSelectionEnd()
Gets the end position of the selected text in this text component. |
int |
getSelectionStart()
Gets the start position of the selected text in this text component. |
boolean |
isEditable()
Indicates whether or not this text component is editable. |
boolean |
setCaretPos(int position)
Sets the position of the text insertion caret for this text component. |
boolean |
setEditable(boolean editable)
Sets the flag that determines whether or not this text component is editable. |
boolean |
setSelection(int columnFrom,
int columnTo)
Sets the selection start and end for this text component to the specified start and ending positions. |
Methods inherited from interface com.appperfect.devcommon.script.javaelement.JavaComponent |
---|
activate, addAttribute, captureImage, click, close, dblClick, drag, drop, getName, getText, getToolTipText, maximize, minimize, mouseMove, restore, rightClick, set, setBreakPoint, setIgnored, setImagePath, setName, setThinkTime, setTitle, type |
Methods inherited from interface com.appperfect.devcommon.script.IScript |
---|
getReasonForFailure, isIgnored, isTaskSuccessful, isTaskTimedOut, setReasonForFailure, setTaskSuccessful, setTaskTimedout, setTimeout |
Method Detail |
---|
int getCaretPos()
java.lang.String getSelectedText()
int getSelectionEnd()
int getSelectionStart()
boolean isEditable()
true
if this text component is editable;
false
otherwiseboolean setCaretPos(int position)
position
that is greater than the end of the component's text, the caret position
is set to the end of the component's text. This happens silently and
without failure. The caret position also cannot be set to less than zero,
the beginning of the component's text.
position
- the position of the text insertion caret
boolean setEditable(boolean editable)
If the flag is set to true
, this text component becomes
user editable. If the flag is set to false
, the user
cannot change the text of this text component. By default, non-editable
text components have a background color of SystemColor.control. This
default can be overridden by calling setBackground.
editable
- a flag indicating whether this text component is user
editable.
boolean setSelection(int columnFrom, int columnTo)
selectionStart
that is out of bounds, the method
enforces these constraints silently, and without failure. The new end
point is constrained to be at or after the current selection start. It
also cannot be set beyond the end of the component's text. If the caller
supplies a value for selectionEnd
that is out of bounds,
the method enforces these constraints silently, and without failure.
columnFrom
- the start position of the selected textcolumnTo
- the start position of the selected text
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |