|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.jemmy.operators.Operator
org.netbeans.jemmy.operators.ComponentOperator
org.netbeans.jemmy.operators.TextComponentOperator
public class TextComponentOperator
This operator type covers java.awt.TextArea component.
Timeouts
Nested Class Summary | |
---|---|
static class |
TextComponentOperator.TextComponentByTextFinder
Allows to find component by text. |
static class |
TextComponentOperator.TextComponentFinder
Checks component type. |
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator |
---|
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator |
Field Summary | |
---|---|
static java.lang.String |
TEXT_DPROP
Identifier for a "text" property. |
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator |
---|
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP |
Fields inherited from class org.netbeans.jemmy.operators.Operator |
---|
CLASS_DPROP, TO_STRING_DPROP |
Constructor Summary | |
---|---|
TextComponentOperator(ContainerOperator cont)
Constructor. |
|
TextComponentOperator(ContainerOperator cont,
ComponentChooser chooser)
Constructs a TextComponentOperator object. |
|
TextComponentOperator(ContainerOperator cont,
ComponentChooser chooser,
int index)
Constructs a TextComponentOperator object. |
|
TextComponentOperator(ContainerOperator cont,
int index)
Constructor. |
|
TextComponentOperator(ContainerOperator cont,
java.lang.String text)
Constructor. |
|
TextComponentOperator(ContainerOperator cont,
java.lang.String text,
int index)
Constructor. |
|
TextComponentOperator(java.awt.TextComponent b)
Constructor. |
Method Summary | |
---|---|
void |
addTextListener(java.awt.event.TextListener textListener)
Maps TextComponent.addTextListener(TextListener) through queue |
void |
changeCaretPosition(int position)
Changes caret position. |
void |
clearText()
Clears text. |
void |
copyEnvironment(Operator anotherOperator)
Copies all environment (output, timeouts, visualizer) from another operator. |
void |
enterText(java.lang.String text)
Requests a focus, clears text, types new one and pushes Enter. |
static java.awt.TextComponent |
findTextComponent(java.awt.Container cont,
ComponentChooser chooser)
Searches for the first TextComponent in a container. |
static java.awt.TextComponent |
findTextComponent(java.awt.Container cont,
ComponentChooser chooser,
int index)
Searches TextComponent in a container. |
static java.awt.TextComponent |
findTextComponent(java.awt.Container cont,
java.lang.String text,
boolean ce,
boolean ccs)
Searches TextComponent by text. |
static java.awt.TextComponent |
findTextComponent(java.awt.Container cont,
java.lang.String text,
boolean ce,
boolean ccs,
int index)
Searches TextComponent by text. |
int |
getCaretPosition()
Maps TextComponent.getCaretPosition() through queue |
java.util.Hashtable |
getDump()
Returns information about component. |
TestOut |
getOutput()
Returns print output streams or writers. |
int |
getPositionByText(java.lang.String text)
Finds start text position. |
int |
getPositionByText(java.lang.String text,
int index)
Finds start text position. |
java.lang.String |
getSelectedText()
Maps TextComponent.getSelectedText() through queue |
int |
getSelectionEnd()
Maps TextComponent.getSelectionEnd() through queue |
int |
getSelectionStart()
Maps TextComponent.getSelectionStart() through queue |
java.lang.String |
getText()
Maps TextComponent.getText() through queue |
protected TextDriver |
getTextDriver()
Return a TextDriver used by this component. |
Timeouts |
getTimeouts()
Return current timeouts. |
boolean |
isEditable()
Maps TextComponent.isEditable() through queue |
void |
removeTextListener(java.awt.event.TextListener textListener)
Maps TextComponent.removeTextListener(TextListener) through queue |
void |
select(int i,
int i1)
Maps TextComponent.select(int, int) through queue |
void |
selectAll()
Maps TextComponent.selectAll() through queue |
void |
selectText(int startPosition,
int finalPosition)
Selects a part of text. |
void |
setCaretPosition(int i)
Maps TextComponent.setCaretPosition(int) through queue |
void |
setEditable(boolean b)
Maps TextComponent.setEditable(boolean) through queue |
void |
setOutput(TestOut out)
Defines print output streams or writers. |
void |
setSelectionEnd(int i)
Maps TextComponent.setSelectionEnd(int) through queue |
void |
setSelectionStart(int i)
Maps TextComponent.setSelectionStart(int) through queue |
void |
setText(java.lang.String string)
Maps TextComponent.setText(String) through queue |
void |
setTimeouts(Timeouts timeouts)
Defines current timeouts. |
void |
typeText(java.lang.String text)
Types text starting from known position. |
void |
typeText(java.lang.String text,
int caretPosition)
Types text starting from known position. |
static java.awt.TextComponent |
waitTextComponent(java.awt.Container cont,
ComponentChooser chooser)
Waits 0'th TextComponent in container. |
static java.awt.TextComponent |
waitTextComponent(java.awt.Container cont,
ComponentChooser chooser,
int index)
Waits TextComponent in container. |
static java.awt.TextComponent |
waitTextComponent(java.awt.Container cont,
java.lang.String text,
boolean ce,
boolean ccs)
Waits TextComponent by text. |
static java.awt.TextComponent |
waitTextComponent(java.awt.Container cont,
java.lang.String text,
boolean ce,
boolean ccs,
int index)
Waits TextComponent by text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TEXT_DPROP
getDump()
,
Constant Field ValuesConstructor Detail |
---|
public TextComponentOperator(java.awt.TextComponent b)
b
- The java.awt.TextComponent
managed by
this instance.public TextComponentOperator(ContainerOperator cont, ComponentChooser chooser, int index)
cont
- a containerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.public TextComponentOperator(ContainerOperator cont, ComponentChooser chooser)
cont
- a containerchooser
- a component chooser specifying searching criteria.public TextComponentOperator(ContainerOperator cont, java.lang.String text, int index)
index+1
'th
java.awt.TextComponent
that shows, lies below
the container in the display containment hierarchy,
and that has the desired text. Uses cont's timeout and output
for waiting and to init this operator.
cont
- The operator for a container containing the sought for textComponent.text
- TextComponent text.index
- Ordinal component index. The first component has index
0.Operator.isCaptionEqual(String, String, boolean, boolean)
public TextComponentOperator(ContainerOperator cont, java.lang.String text)
java.awt.TextComponent
that shows, lies below
the container in the display containment hierarchy,
and that has the desired text. Uses cont's timeout and output
for waiting and to init this operator.
cont
- The operator for a container containing the sought for textComponent.text
- TextComponent text.Operator.isCaptionEqual(String, String, boolean, boolean)
public TextComponentOperator(ContainerOperator cont, int index)
cont
- The operator for a container containing the sought for textComponent.index
- Ordinal component index.Operator.isCaptionEqual(String, String, boolean, boolean)
public TextComponentOperator(ContainerOperator cont)
cont
- The operator for a container containing the sought for textComponent.Operator.isCaptionEqual(String, String, boolean, boolean)
Method Detail |
---|
public static java.awt.TextComponent findTextComponent(java.awt.Container cont, ComponentChooser chooser, int index)
cont
- Container in which to search for the component. The container
lies above the component in the display containment hierarchy. The containment
need not be direct.chooser
- org.netbeans.jemmy.ComponentChooser implementation, defining and
applying search criteria.index
- Ordinal component index. The first index
is 0.
public static java.awt.TextComponent findTextComponent(java.awt.Container cont, ComponentChooser chooser)
cont
- Container in which to search for the component. The container
lies above the component in the display containment hierarchy. The containment
need not be direct.chooser
- org.netbeans.jemmy.ComponentChooser implementation, defining and
applying search criteria.
public static java.awt.TextComponent findTextComponent(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)
cont
- Container to search component in.text
- TextComponent text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.index
- Ordinal component index.
Operator.isCaptionEqual(String, String, boolean, boolean)
public static java.awt.TextComponent findTextComponent(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)
cont
- Container to search component in.text
- TextComponent text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.
Operator.isCaptionEqual(String, String, boolean, boolean)
public static java.awt.TextComponent waitTextComponent(java.awt.Container cont, ComponentChooser chooser, int index)
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.
public static java.awt.TextComponent waitTextComponent(java.awt.Container cont, ComponentChooser chooser)
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.
public static java.awt.TextComponent waitTextComponent(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)
cont
- Container to search component in.text
- TextComponent text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.index
- Ordinal component index.
Operator.isCaptionEqual(String, String, boolean, boolean)
public static java.awt.TextComponent waitTextComponent(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)
cont
- Container to search component in.text
- TextComponent text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.
Operator.isCaptionEqual(String, String, boolean, boolean)
public void setTimeouts(Timeouts timeouts)
Timeoutable
setTimeouts
in interface Timeoutable
setTimeouts
in class ComponentOperator
timeouts
- A collection of timeout assignments.Timeoutable.getTimeouts()
public Timeouts getTimeouts()
Timeoutable
getTimeouts
in interface Timeoutable
getTimeouts
in class ComponentOperator
Timeoutable.setTimeouts(org.netbeans.jemmy.Timeouts)
public void setOutput(TestOut out)
Outputable
setOutput
in interface Outputable
setOutput
in class ComponentOperator
out
- Identify the streams or writers used for print output.Outputable.getOutput()
public TestOut getOutput()
Outputable
getOutput
in interface Outputable
getOutput
in class ComponentOperator
Outputable.setOutput(org.netbeans.jemmy.TestOut)
public void copyEnvironment(Operator anotherOperator)
Operator
copyEnvironment
in class ComponentOperator
anotherOperator
- an operator to copy the environment to.public void changeCaretPosition(int position)
position
- Position to move caret to.public void selectText(int startPosition, int finalPosition)
startPosition
- Start caret positionfinalPosition
- Final caret positionpublic int getPositionByText(java.lang.String text, int index)
text
- Text to be searched.index
- Index of text instance (first instance has index 0)
public int getPositionByText(java.lang.String text)
text
- Text to be searched.
public void clearText()
public void typeText(java.lang.String text, int caretPosition)
text
- Text to be typed.caretPosition
- Position to start type textpublic void typeText(java.lang.String text)
text
- Text to be typed.public void enterText(java.lang.String text)
text
- New text value. Shouln't include final '\n'.public java.util.Hashtable getDump()
ComponentOperator
getDump
in class ComponentOperator
public void addTextListener(java.awt.event.TextListener textListener)
TextComponent.addTextListener(TextListener)
through queue
public int getCaretPosition()
TextComponent.getCaretPosition()
through queue
public java.lang.String getSelectedText()
TextComponent.getSelectedText()
through queue
public int getSelectionEnd()
TextComponent.getSelectionEnd()
through queue
public int getSelectionStart()
TextComponent.getSelectionStart()
through queue
public java.lang.String getText()
TextComponent.getText()
through queue
public boolean isEditable()
TextComponent.isEditable()
through queue
public void removeTextListener(java.awt.event.TextListener textListener)
TextComponent.removeTextListener(TextListener)
through queue
public void select(int i, int i1)
TextComponent.select(int, int)
through queue
public void selectAll()
TextComponent.selectAll()
through queue
public void setCaretPosition(int i)
TextComponent.setCaretPosition(int)
through queue
public void setEditable(boolean b)
TextComponent.setEditable(boolean)
through queue
public void setSelectionEnd(int i)
TextComponent.setSelectionEnd(int)
through queue
public void setSelectionStart(int i)
TextComponent.setSelectionStart(int)
through queue
public void setText(java.lang.String string)
TextComponent.setText(String)
through queue
protected TextDriver getTextDriver()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |