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 theto match should be showing on the screen.FrameSpecifies the title to match.Specifies the title to match.static FrameMatcherany()Creates a newthat matches anyFrameMatcher.Frameprotected booleanisMatching(Frame frame) Indicates whether the title of the givenis equal to the title in this matcher.FrametoString()static FrameMatcherCreates a newthat matches aFrameMatcherthat: has a matching name (optionally) has matching title (optionally) is showing on the screenFramestatic FrameMatcherCreates a newthat matches aFrameMatcherby its title.Framestatic FrameMatcherCreates a newthat matches aFrameMatcherby its title.FrameMethods inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate
arePropertyValuesMatching, isNameMatching, quoted, quotedNameMethods inherited from class org.fest.swing.core.GenericTypeMatcher
matches, supportedTypeMethods inherited from class org.fest.swing.core.AbstractComponentMatcher
requireShowing, requireShowing, requireShowingMatches, reset
-
Field Details
-
title
-
-
Constructor Details
-
FrameMatcher
-
-
Method Details
-
withName
Creates a newthat matches aFrameMatcherthat: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:FrameFrameMatcher 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:FrameFrameMatcher m =
withName("myApp").andTitle("My App").andShowing();- Parameters:
name- the id to match.- Returns:
- the created matcher.
-
withTitle
Creates a newthat matches aFrameMatcherby its title.FrameThe following code listing shows how to match a
by title:FrameFrameMatcher m =
withTitle("My App");The following code listing shows how to match a
, that should be showing on the screen, by title:FrameFrameMatcher m =
withTitle("My App").andShowing();- Parameters:
title- the title to match. It can be a regular expression.- Returns:
- the created matcher.
-
withTitle
Creates a newthat matches aFrameMatcherby its title.FrameThe following code listing shows how to match a
by title, using a regular expression matcher:FrameFrameMatcher m =
withTitle(Pattern.compile("My.*"));The following code listing shows how to match a
, that should be showing on the screen, by title:FrameFrameMatcher m =
withTitle(Pattern.compile("My.*")).andShowing();- Parameters:
titlePattern- the title to match.- Returns:
- the created matcher.
- Since:
- 1.2
-
any
Creates a newthat matches anyFrameMatcher.Frame- Returns:
- the created matcher.
-
andTitle
Specifies the title to match. If this matcher was created usingorwithTitle(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 usingorwithTitle(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 theto match should be showing on the screen.Frame- Returns:
- this matcher.
-
isMatching
Indicates whether the title of the givenis equal to the title in this matcher.FrameNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
isMatchingin classGenericTypeMatcher<Frame>- Parameters:
frame- theFrameto match.- Returns:
trueif the title in theFrameis equal to the title in this matcher,falseotherwise.
-
toString
-