|
||||||||||
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<Dialog>
org.fest.swing.core.matcher.DialogMatcher
public final class DialogMatcher
Understands matching a
by name, title and visibility on the screen.
Dialog
Field Summary |
---|
Fields inherited from class org.fest.swing.core.matcher.NamedComponentMatcherTemplate |
---|
ANY, name |
Method Summary | |
---|---|
DialogMatcher |
andShowing()
Indicates that the to match should be showing on the screen. |
DialogMatcher |
andTitle(Pattern titlePattern)
Specifies the title to match. |
DialogMatcher |
andTitle(String newTitle)
Specifies the title to match. |
static DialogMatcher |
any()
Creates a new that matches any . |
protected boolean |
isMatching(Dialog dialog)
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
|
String |
toString()
|
static DialogMatcher |
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 DialogMatcher |
withTitle(Pattern titlePattern)
Creates a new that matches a by its title. |
static DialogMatcher |
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 DialogMatcher withName(String name)
DialogMatcher
that matches a Dialog
that:
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
();
name
- the id to match.
public static DialogMatcher withTitle(String title)
DialogMatcher
that matches a Dialog
by its title.
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
();
title
- the title to match. It can be a regular expression.
public static DialogMatcher withTitle(Pattern titlePattern)
DialogMatcher
that matches a Dialog
by its title.
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
();
titlePattern
- the regular expression pattern to match.
public static DialogMatcher any()
DialogMatcher
that matches any Dialog
.
public DialogMatcher 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 DialogMatcher 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 DialogMatcher andShowing()
Dialog
to match should be showing on the screen.
@RunsInCurrentThread protected boolean isMatching(Dialog dialog)
Dialog
is equal to the name in this matcher, andDialog
matches the text (or pattern) in this matcherNote: 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<Dialog>
dialog
- the Dialog
to match.
true
if the Dialog
matches the search criteria in this matcher.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |