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 theto match should be showing on the screen.DialogSpecifies the title to match.Specifies the title to match.static DialogMatcherany()Creates a newthat matches anyDialogMatcher.Dialogprotected booleanisMatching(Dialog dialog) Indicates whether: the name of the givenDialogis equal to the name in this matcher, and the title of the givenDialogmatches the text (or pattern) in this matchertoString()static DialogMatcherCreates a newthat matches aDialogMatcherthat: has a matching name (optionally) has matching title (optionally) is showing on the screenDialogstatic DialogMatcherCreates a newthat matches aDialogMatcherby its title.Dialogstatic DialogMatcherCreates a newthat matches aDialogMatcherby its title.DialogMethods 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
-
DialogMatcher
-
-
Method Details
-
withName
Creates a newthat matches aDialogMatcherthat: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:DialogDialogMatcher 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:DialogDialogMatcher m =
withName("saveFile").andTitle("Save File").andShowing();- Parameters:
name- the id to match.- Returns:
- the created matcher.
-
withTitle
Creates a newthat matches aDialogMatcherby its title.DialogThe following code listing shows how to match a
title:DialogDialogMatcher m =
withTitle("Save File");The following code listing shows how to match a
, that should be showing on the screen, by title:DialogDialogMatcher m =
withTitle("Save File").andShowing();- Parameters:
title- the title to match. It can be a regular expression.- Returns:
- the created matcher.
-
withTitle
Creates a newthat matches aDialogMatcherby its title.DialogThe following code listing shows how to match a
title, using a regular expression pattern:DialogDialogMatcher 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:DialogDialogMatcher m =
withTitle(Pattern.compile("Sav.*")).andShowing();- Parameters:
titlePattern- the regular expression pattern to match.- Returns:
- the created matcher.
- Since:
- 1.2
-
any
Creates a newthat matches anyDialogMatcher.Dialog- 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 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 theto match should be showing on the screen.Dialog- Returns:
- this matcher.
-
isMatching
Indicates whether:- the name of the given
Dialogis equal to the name in this matcher, and - the title of the given
Dialogmatches 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:
isMatchingin classGenericTypeMatcher<Dialog>- Parameters:
dialog- theDialogto match.- Returns:
trueif theDialogmatches the search criteria in this matcher.
- the name of the given
-
toString
-