Package org.fest.swing.core
Class LabelMatcher
java.lang.Object
org.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.LabelMatcher
- All Implemented Interfaces:
ComponentMatcher
,ResettableComponentMatcher
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLabelMatcher
(String label) Creates a new
.LabelMatcher
LabelMatcher
(String label, boolean requireShowing) Creates a new
.LabelMatcher
LabelMatcher
(String label, Class<? extends Component> type) Creates a new
.LabelMatcher
LabelMatcher
(String label, Class<? extends Component> type, boolean requireShowing) Creates a new
.LabelMatcher
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the given
matches the criteria specified in this matcher: the text of theComponent
attached to the component to look for matches the text specified in this matcher the component to look for is of the type specified in this matcher (if specified) visibility of the givenJLabel
matches the value specified in this matcherComponent
toString()
Methods inherited from class org.fest.swing.core.AbstractComponentMatcher
requireShowing, requireShowing, requireShowingMatches, reset
-
Field Details
-
label
-
type
-
-
Constructor Details
-
LabelMatcher
Creates a new
. The component to match does not have to be showing.LabelMatcher
- Parameters:
label
- the text of the label associated to the component we are looking for.- Throws:
NullPointerException
- if the given label isnull
.IllegalArgumentException
- if the given label is empty.
-
LabelMatcher
Creates a new
.LabelMatcher
- Parameters:
label
- the text of the label associated to the component we are looking for.requireShowing
- indicates if the component to match should be showing or not.- Throws:
NullPointerException
- if the given label isnull
.IllegalArgumentException
- if the given label is empty.
-
LabelMatcher
Creates a new
. The component to match does not have to be showing.LabelMatcher
- Parameters:
label
- the text of the label associated to the component we are looking for.type
- the type of the component we are looking for.- Throws:
NullPointerException
- if the given label isnull
.IllegalArgumentException
- if the given label is empty.NullPointerException
- if the given type isnull
.
-
LabelMatcher
Creates a new
.LabelMatcher
- Parameters:
label
- the text of the label associated to the component we are looking for.type
- the type of the component we are looking for.requireShowing
- indicates if the component to match should be showing or not.- Throws:
NullPointerException
- if the given label isnull
.IllegalArgumentException
- if the given label is empty.NullPointerException
- if the given type isnull
.
-
-
Method Details
-
matches
Indicates whether the given
matches the criteria specified in this matcher:Component
- the text of the
JLabel
attached to the component to look for matches the text
specified in this matcher
- the component to look for is of the type specified in this matcher (if specified)
- visibility of the given
matches the value specified in this matcherComponent
Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c
- theComponent
to verify.- Returns:
true
if the name and visibility of the givenComponent
matches the values specified in this matcher,false
otherwise.
- the text of the
-
toString
-