public class TextBox extends AbstractSwingUIComponent
Modifier and Type | Field and Description |
---|---|
static Class[] |
SWING_CLASSES |
static String |
TYPE_NAME |
Constructor and Description |
---|
TextBox(JLabel label) |
TextBox(JTextComponent textComponent) |
Modifier and Type | Method and Description |
---|---|
void |
appendText(String text)
Inserts text at the given position without pressing Enter.
|
void |
clear()
Clears the text without validating.
|
void |
clickOnHyperlink(String link)
Simulates a click on an hyperlink given a part of the link text.
|
void |
focusLost()
Simulates losing the focus., by calling directly the focus listeners of the component
without going through the focus mechanim.
|
JComponent |
getAwtComponent()
Returns the Java GUI component represented by this object.
|
String |
getDescriptionTypeName()
Returns the name of the component as it will appear in the XML representation
returned by
UIComponent.getDescription() . |
String |
getText() |
Assertion |
htmlEquals(String html)
Checks the displayed text in cases where HTML text is used.
|
Assertion |
iconEquals(Icon icon)
Checks the icon displayed by the component.
|
void |
insertText(String text,
int position)
Inserts text at the given position without pressing Enter.
|
Assertion |
isEditable() |
void |
setText(String text)
Replaces the text box contents and simulates pressing the Enter key.
|
void |
setText(String text,
boolean pressEnter)
Replaces the text box contents and simulates pressing Enter if pressEnter is set to true.
|
Assertion |
textContains(String... orderedTexts)
Checks that the text box contains a number of substrings, in a given order.
|
Assertion |
textContains(String text) |
Assertion |
textDoesNotContain(String text) |
Assertion |
textEquals(String text) |
Assertion |
textIsEmpty() |
Trigger |
triggerClickOnHyperlink(String name) |
tooltipContains, tooltipEquals
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, getSubDescription, isEnabled, isVisible, pressKey, releaseKey, typeKey
public static final String TYPE_NAME
public static final Class[] SWING_CLASSES
public TextBox(JTextComponent textComponent)
public TextBox(JLabel label)
public String getDescriptionTypeName()
UIComponent
UIComponent.getDescription()
.public JComponent getAwtComponent()
UIComponent
getAwtComponent
in interface UIComponent
getAwtComponent
in class AbstractSwingUIComponent
public void setText(String text)
public void setText(String text, boolean pressEnter)
public void insertText(String text, int position)
public void appendText(String text)
public void clear()
setText("")
to achieve the same effect with validation.public String getText()
public Assertion textIsEmpty()
public Assertion htmlEquals(String html)
textEquals(String)
in that whitespaces, carriage return
and other formatting adjustments are ignored.public Assertion textContains(String... orderedTexts)
public Assertion isEditable()
public Assertion iconEquals(Icon icon)
public void clickOnHyperlink(String link)
public Trigger triggerClickOnHyperlink(String name)
clickOnHyperlink(String)
public void focusLost()
Copyright © 2004–2016. All rights reserved.