|
||||||||||
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<Frame>
org.fest.swing.core.matcher.FrameMatcher
public final class FrameMatcher
Understands matching a
by type, name or title.
Frame
Field Summary |
---|
Fields inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate |
---|
ANY, name |
Method Summary | |
---|---|
FrameMatcher |
andShowing()
Indicates that the to match should be showing on the screen. |
FrameMatcher |
andTitle(Pattern titlePattern)
Specifies the title to match. |
FrameMatcher |
andTitle(String newTitle)
Specifies the title to match. |
static FrameMatcher |
any()
Creates a new that matches any . |
protected boolean |
isMatching(Frame frame)
Indicates whether the title of the given is equal to the title in this matcher. |
String |
toString()
|
static FrameMatcher |
withName(String name)
Creates a new that matches a that:
has a matching name
(optionally) has matching title
(optionally) is showing on the screen |
static FrameMatcher |
withTitle(Pattern titlePattern)
Creates a new that matches a by its title. |
static FrameMatcher |
withTitle(String title)
Creates a new that matches a by its title. |
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 FrameMatcher withName(String name)
FrameMatcher
that matches a Frame
that:
The following code listing shows how to match a
by name and title:
Frame
FrameMatcher m =withName
("myApp").andTitle
("My App");
The following code listing shows how to match a
, that should be showing on the screen,
by name and title:
Frame
FrameMatcher m =withName
("myApp").andTitle
("My App").andShowing
();
name
- the id to match.
public static FrameMatcher withTitle(String title)
FrameMatcher
that matches a Frame
by its title.
The following code listing shows how to match a
by title:
Frame
FrameMatcher m = withTitle
("My App");
The following code listing shows how to match a
, that should be showing on the screen,
by title:
Frame
FrameMatcher m =withTitle
("My App").andShowing
();
title
- the title to match. It can be a regular expression.
public static FrameMatcher withTitle(Pattern titlePattern)
FrameMatcher
that matches a Frame
by its title.
The following code listing shows how to match a
by title, using a regular expression
matcher:
Frame
FrameMatcher m = withTitle
(Pattern.compile("My.*"));
The following code listing shows how to match a
, that should be showing on the screen,
by title:
Frame
FrameMatcher m =withTitle
(Pattern.compile("My.*")).andShowing
();
titlePattern
- the title to match.
public static FrameMatcher any()
FrameMatcher
that matches any Frame
.
public FrameMatcher andTitle(String newTitle)
withTitle(String)
or
withTitle(Pattern)
, this method will simply update the title to match.
newTitle
- the new title to match. It can be a regular expression.
public FrameMatcher andTitle(Pattern titlePattern)
withTitle(String)
or
withTitle(Pattern)
, this method will simply update the title to match.
titlePattern
- the regular expression pattern to match.
public FrameMatcher andShowing()
Frame
to match should be showing on the screen.
@RunsInCurrentThread protected boolean isMatching(Frame frame)
Frame
is equal to the title 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<Frame>
frame
- the Frame
to match.
true
if the title in the Frame
is equal to the title 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 |