|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.GenericTypeMatcher<T>
org.fest.swing.core.matcher.NamedComponentMatcherTemplate<JLabel>
org.fest.swing.core.matcher.JLabelMatcher
public final class JLabelMatcher
Understands matching a
by type, name or text.
JLabel
Field Summary |
---|
Fields inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate |
---|
ANY, name |
Method Summary | |
---|---|
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
The following code listing shows how to match a by name and text:
JLabelMatcher m = withName ("firstName"). |
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. |
Methods inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate |
---|
arePropertyValuesMatching, isNameMatching, quoted, quotedName |
Methods inherited from class org.fest.swing.core.GenericTypeMatcher |
---|
matches, supportedType |
Methods inherited from class org.fest.swing.core.AbstractComponentMatcher |
---|
requireShowing, requireShowing, requireShowingMatches, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |