public final class JLabelMatcher extends NamedComponentMatcherTemplate<JLabel>
JLabel
by type, name or text.ANY, name
Modifier and Type | Method and Description |
---|---|
JLabelMatcher |
andShowing()
Indicates that the
to match should be showing on the screen. |
JLabelMatcher |
andText(Pattern textPattern)
Specifies the text to match.
|
JLabelMatcher |
andText(String newText)
Specifies the text to match.
|
static JLabelMatcher |
any()
Creates a new
that matches any . |
protected boolean |
isMatching(JLabel button)
Indicates whether the text of the given
is equal to the text in this matcher. |
String |
toString() |
static JLabelMatcher |
withName(String name)
Creates a new
that matches a that:
has a matching name
(optionally) has matching text
(optionally) is showing on the screen |
static JLabelMatcher |
withText(Pattern textPattern)
Creates a new
that matches a by its text. |
static JLabelMatcher |
withText(String text)
Creates a new
that matches a by its text. |
arePropertyValuesMatching, isNameMatching, quoted, quotedName
matches, supportedType
requireShowing, requireShowing, requireShowingMatches, reset
public static JLabelMatcher withName(String name)
JLabelMatcher
that matches a JLabel
that:
The following code listing shows how to match a
by name and text:
JLabel
JLabelMatcher m =withName
("firstName").andText
("First Name:");
The following code listing shows how to match a
, that should be showing on the screen,
by name and text:
JLabel
JLabelMatcher m =withName
("firstName").andText
("First Name:").andShowing
();
name
- the id to match.public static JLabelMatcher withText(String text)
JLabelMatcher
that matches a JLabel
by its text.
The following code listing shows how to match a
by text:
JLabel
JLabelMatcher m = withText
("First Name:");
The following code listing shows how to match a
, that should be showing on the screen,
by text:
JLabel
JLabelMatcher m =withText
("First Name:").andShowing
();
text
- the text to match. It can be a regular expression.public static JLabelMatcher withText(Pattern textPattern)
JLabelMatcher
that matches a JLabel
by its text.
The following code listing shows how to match a
by text:
JLabel
JLabelMatcher m = withText
(Pattern.compile("F.*");
The following code listing shows how to match a
, that should be showing on the screen,
by text:
JLabel
JLabelMatcher m =withText
(Pattern.compile("F.*").andShowing
();
textPattern
- the regular expression pattern to match.public static JLabelMatcher any()
JLabelMatcher
that matches any JLabel
.public JLabelMatcher andText(String newText)
withText(String)
or
withText(Pattern)
, this method will simply update the text to match.newText
- the new text to match. It can be a regular expression.public JLabelMatcher andText(Pattern textPattern)
withText(String)
or
withText(Pattern)
, this method will simply update the text to match.textPattern
- the regular expression pattern to match.public JLabelMatcher andShowing()
JLabel
to match should be showing on the screen.@RunsInCurrentThread protected boolean isMatching(JLabel button)
JLabel
is equal to the text in this matcher.
Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
isMatching
in class GenericTypeMatcher<JLabel>
button
- the JLabel
to match.true
if the text in the JLabel
is equal to the text in this matcher,
false
otherwise.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.