|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.uispec4j.AbstractUIComponent
org.uispec4j.AbstractSwingUIComponent
org.uispec4j.TextBox
public class TextBox
Wrapper for JTextComponent/JLabel components.
| Field Summary | |
|---|---|
static java.lang.Class[] |
SWING_CLASSES
|
static java.lang.String |
TYPE_NAME
|
| Constructor Summary | |
|---|---|
TextBox(javax.swing.JLabel label)
|
|
TextBox(javax.swing.text.JTextComponent textComponent)
|
|
| Method Summary | |
|---|---|
void |
appendText(java.lang.String text)
Inserts text at the given position without pressing Enter. |
void |
clear()
Clears the text without validating. |
void |
clickOnHyperlink(java.lang.String link)
Simulates a click on an hyperlink given a part of the link text. |
javax.swing.JComponent |
getAwtComponent()
Returns the Java GUI component represented by this object. |
java.lang.String |
getDescriptionTypeName()
Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription(). |
java.lang.String |
getText()
|
Assertion |
htmlEquals(java.lang.String html)
Checks the displayed text in cases where HTML text is used. |
Assertion |
iconEquals(javax.swing.Icon icon)
Checks the icon displayed by the component. |
void |
insertText(java.lang.String text,
int position)
Inserts text at the given position without pressing Enter. |
Assertion |
isEditable()
|
TextBox |
pressKey(Key key)
Simulates pressing a key while the focus is in the text box. Warning: the default cursor position is 0. |
void |
setText(java.lang.String text)
Replaces the text box contents and simulates pressing the Enter key. |
Assertion |
textContains(java.lang.String text)
|
Assertion |
textContains(java.lang.String[] orderedTexts)
Checks that the text box contains a number of substrings, in a given order. |
Assertion |
textDoesNotContain(java.lang.String text)
|
Assertion |
textEquals(java.lang.String text)
|
Assertion |
textIsEmpty()
|
Trigger |
triggerClickOnHyperlink(java.lang.String name)
|
| Methods inherited from class org.uispec4j.AbstractSwingUIComponent |
|---|
tooltipContains, tooltipEquals |
| Methods inherited from class org.uispec4j.AbstractUIComponent |
|---|
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, getSubDescription, isEnabled, isVisible |
| 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 TYPE_NAME
public static final java.lang.Class[] SWING_CLASSES
| Constructor Detail |
|---|
public TextBox(javax.swing.text.JTextComponent textComponent)
public TextBox(javax.swing.JLabel label)
| Method Detail |
|---|
public java.lang.String getDescriptionTypeName()
UIComponentUIComponent.getDescription().
public javax.swing.JComponent getAwtComponent()
UIComponent
getAwtComponent in interface UIComponentgetAwtComponent in class AbstractSwingUIComponentpublic TextBox pressKey(Key key)
public void setText(java.lang.String text)
public void insertText(java.lang.String text,
int position)
public void appendText(java.lang.String text)
public void clear()
setText("") to achieve the same effect with validation.
public java.lang.String getText()
public Assertion textIsEmpty()
public Assertion htmlEquals(java.lang.String html)
textEquals(String) in that whitespaces, carriage return
and other formatting adjustments are ignored.
public Assertion textContains(java.lang.String[] orderedTexts)
public Assertion textEquals(java.lang.String text)
public Assertion textContains(java.lang.String text)
public Assertion textDoesNotContain(java.lang.String text)
public Assertion isEditable()
public Assertion iconEquals(javax.swing.Icon icon)
public void clickOnHyperlink(java.lang.String link)
public Trigger triggerClickOnHyperlink(java.lang.String name)
clickOnHyperlink(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||