Package org.fest.swing.core.matcher
Class FrameMatcher
java.lang.Object
org.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.GenericTypeMatcher<T>
org.fest.swing.core.matcher.NamedComponentMatcherTemplate<Frame>
org.fest.swing.core.matcher.FrameMatcher
- All Implemented Interfaces:
ComponentMatcher
,ResettableComponentMatcher
Understands matching a
Frame
by type, name or title.-
Field Summary
FieldsFields inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate
ANY, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates that the
to match should be showing on the screen.Frame
Specifies the title to match.Specifies the title to match.static FrameMatcher
any()
Creates a new
that matches anyFrameMatcher
.Frame
protected boolean
isMatching
(Frame frame) Indicates whether the title of the given
is equal to the title in this matcher.Frame
toString()
static FrameMatcher
Creates a new
that matches aFrameMatcher
that: has a matching name (optionally) has matching title (optionally) is showing on the screenFrame
static FrameMatcher
Creates a new
that matches aFrameMatcher
by its title.Frame
static FrameMatcher
Creates a new
that matches aFrameMatcher
by its title.Frame
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
-
Field Details
-
title
-
-
Constructor Details
-
FrameMatcher
-
-
Method Details
-
withName
Creates a new
that matches aFrameMatcher
that:Frame
- has a matching name
- (optionally) has matching title
- (optionally) is showing on the screen
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
();- Parameters:
name
- the id to match.- Returns:
- the created matcher.
-
withTitle
Creates a new
that matches aFrameMatcher
by its title.Frame
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
();- Parameters:
title
- the title to match. It can be a regular expression.- Returns:
- the created matcher.
-
withTitle
Creates a new
that matches aFrameMatcher
by its title.Frame
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
();- Parameters:
titlePattern
- the title to match.- Returns:
- the created matcher.
- Since:
- 1.2
-
any
Creates a new
that matches anyFrameMatcher
.Frame
- Returns:
- the created matcher.
-
andTitle
Specifies the title to match. If this matcher was created using
orwithTitle(String)
, this method will simply update the title to match.withTitle(Pattern)
- Parameters:
newTitle
- the new title to match. It can be a regular expression.- Returns:
- this matcher.
-
andTitle
Specifies the title to match. If this matcher was created using
orwithTitle(String)
, this method will simply update the title to match.withTitle(Pattern)
- Parameters:
titlePattern
- the regular expression pattern to match.- Returns:
- this matcher.
- Since:
- 1.2
-
andShowing
Indicates that the
to match should be showing on the screen.Frame
- Returns:
- this matcher.
-
isMatching
Indicates whether the title of the given
is equal to the title in this matcher.Frame
Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
isMatching
in classGenericTypeMatcher<Frame>
- Parameters:
frame
- theFrame
to match.- Returns:
true
if the title in theFrame
is equal to the title in this matcher,false
otherwise.
-
toString
-