org.eclipse.swtbot.swt.finder.matchers
Class WithLabel<T extends Widget>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher<T>
org.eclipse.swtbot.swt.finder.matchers.WithLabel<T>
- All Implemented Interfaces:
- Matcher<T>, SelfDescribing
public class WithLabel<T extends Widget>
- extends AbstractMatcher<T>
Tells if a particular widget has a label with the specified text.
NOTE: This will drill upwards in the widget hierarchy in an attempt to find the label for a widget.
- Since:
- 2.0
- Version:
- $Id$
- Author:
- Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>
- See Also:
WithMnemonic
Method Summary |
void |
describeTo(Description description)
|
protected boolean |
doMatch(Object obj)
Subclasses must override, this is the actual method that does the matching |
static
|
withLabel(String labelText)
Matches a widget that has the specified labelText. |
static
|
withLabel(String labelText,
Finder finder)
Matches a widget that has the specified labelText within the given parent. |
doMatch
protected boolean doMatch(Object obj)
- Description copied from class:
AbstractMatcher
- Subclasses must override, this is the actual method that does the matching
- Specified by:
doMatch
in class AbstractMatcher<T extends Widget>
- Parameters:
obj
- the item to match.
- Returns:
true
if the item matches, false
otherwise.
describeTo
public void describeTo(Description description)
withLabel
public static <T extends Widget> Matcher<T> withLabel(String labelText)
- Matches a widget that has the specified labelText.
- Parameters:
labelText
- the label.
- Returns:
- a matcher.
- Since:
- 2.0
withLabel
public static <T extends Widget> Matcher<T> withLabel(String labelText,
Finder finder)
- Matches a widget that has the specified labelText within the given parent.
- Parameters:
labelText
- the label.finder
- finder for locating widgets
- Returns:
- a matcher.
- Since:
- 2.0