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.LabelMatcherLabelMatcher(String label, boolean requireShowing) Creates a new.LabelMatcherLabelMatcher(String label, Class<? extends Component> type) Creates a new.LabelMatcherLabelMatcher(String label, Class<? extends Component> type, boolean requireShowing) Creates a new.LabelMatcher -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the givenmatches the criteria specified in this matcher: the text of theComponentattached 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 givenJLabelmatches the value specified in this matcherComponenttoString()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 givenmatches 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- theComponentto verify.- Returns:
trueif the name and visibility of the givenComponentmatches the values specified in this matcher,falseotherwise.
- the text of the
-
toString
-