Package org.fest.swing.core.matcher
Class DialogMatcher
java.lang.Object
org.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.GenericTypeMatcher<T>
org.fest.swing.core.matcher.NamedComponentMatcherTemplate<Dialog>
org.fest.swing.core.matcher.DialogMatcher
- All Implemented Interfaces:
ComponentMatcher
,ResettableComponentMatcher
Understands matching a
Dialog
by name, title and visibility on the screen.-
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.Dialog
Specifies the title to match.Specifies the title to match.static DialogMatcher
any()
Creates a new
that matches anyDialogMatcher
.Dialog
protected boolean
isMatching
(Dialog dialog) Indicates whether: the name of the givenDialog
is equal to the name in this matcher, and the title of the givenDialog
matches the text (or pattern) in this matchertoString()
static DialogMatcher
Creates a new
that matches aDialogMatcher
that: has a matching name (optionally) has matching title (optionally) is showing on the screenDialog
static DialogMatcher
Creates a new
that matches aDialogMatcher
by its title.Dialog
static DialogMatcher
Creates a new
that matches aDialogMatcher
by its title.Dialog
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
-
DialogMatcher
-
-
Method Details
-
withName
Creates a new
that matches aDialogMatcher
that:Dialog
- 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:Dialog
DialogMatcher m =
withName
("saveFile").andTitle
("Save File");The following code listing shows how to match a
, that should be showing on the screen, by name and title:Dialog
DialogMatcher m =
withName
("saveFile").andTitle
("Save File").andShowing
();- Parameters:
name
- the id to match.- Returns:
- the created matcher.
-
withTitle
Creates a new
that matches aDialogMatcher
by its title.Dialog
The following code listing shows how to match a
title:Dialog
DialogMatcher m =
withTitle
("Save File");The following code listing shows how to match a
, that should be showing on the screen, by title:Dialog
DialogMatcher m =
withTitle
("Save File").andShowing
();- Parameters:
title
- the title to match. It can be a regular expression.- Returns:
- the created matcher.
-
withTitle
Creates a new
that matches aDialogMatcher
by its title.Dialog
The following code listing shows how to match a
title, using a regular expression pattern:Dialog
DialogMatcher m =
withTitle
(Pattern.compile("Sav.*"));The following code listing shows how to match a
, that should be showing on the screen, by title, using a regular expression pattern:Dialog
DialogMatcher m =
withTitle
(Pattern.compile("Sav.*")).andShowing
();- Parameters:
titlePattern
- the regular expression pattern to match.- Returns:
- the created matcher.
- Since:
- 1.2
-
any
Creates a new
that matches anyDialogMatcher
.Dialog
- 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.Dialog
- Returns:
- this matcher.
-
isMatching
Indicates whether:- the name of the given
Dialog
is equal to the name in this matcher, and - the title of the given
Dialog
matches the text (or pattern) in this matcher
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<Dialog>
- Parameters:
dialog
- theDialog
to match.- Returns:
true
if theDialog
matches the search criteria in this matcher.
- the name of the given
-
toString
-