org.eclipse.swtbot.swt.finder.matchers
Class WidgetMatcherFactory

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory
Direct Known Subclasses:
WidgetMatcherFactory

public abstract class WidgetMatcherFactory
extends Object


Constructor Summary
WidgetMatcherFactory()
           
 
Method Summary
static
<T extends Widget>
Matcher<T>
allOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T extends Widget>
Matcher<T>
allOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T extends Widget>
Matcher<T>
anyOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ANY of the passed in matchers evaluate to true.
static
<T extends Widget>
Matcher<T>
anyOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ANY of the passed in matchers evaluate to true.
static
<T extends Widget>
Matcher<T>
inGroup(Matcher<?> matcher)
          Matches a widget in a group, if the matcher evaluates to true for the group.
static
<T extends Widget>
Matcher<T>
inGroup(String labelText)
          Matches a widget that belongs to the specified group
static
<T extends Widget>
Matcher<T>
inUIThread(Matcher<?> matcher)
          Deprecated. this has been deprecated and will be removed in future releases of swtbot.
static
<T extends Widget>
Matcher<T>
widgetOfType(Class<T> type)
          Matches a widget that has the specified type
static
<T extends Widget>
Matcher<T>
withId(String value)
          Matches a widget that has the specified value set for the key SWTBotPreferences.DEFAULT_KEY.
static
<T extends Widget>
Matcher<T>
withId(String key, String value)
          Matches a widget that has the specified Key/Value pair set as data into it.
static
<T extends Item>
Matcher<T>
withItem(Matcher<?> matcher)
          Returns a matcher that matches objects containing an item that matches the matcher.
static
<T extends Widget>
Matcher<T>
withLabel(String labelText)
          Matches a widget that has the specified labelText.
static
<T extends Widget>
Matcher<T>
withLabel(String labelText, Finder finder)
          Matches a widget that has the specified labelText within the given parent.
static
<T extends Widget>
Matcher<T>
withMessage(String message)
          Matches a widget that has the specified exact message.
static
<T extends Widget>
Matcher<T>
withMnemonic(String text)
          Matches a widget that has the specified text, after striping the mnemonics "&"
static
<T extends Widget>
Matcher<T>
withRegex(String regex)
          Matches a widget that has the specified regex.
static
<T extends Widget>
Matcher<T>
withStyle(int style, String styleDescription)
          Matches a widget that has the specified style bit set.
static
<T extends Widget>
Matcher<T>
withText(String text)
          Matches a widget that has the specified exact text.
static
<T extends Widget>
Matcher<T>
withTextIgnoringCase(String text)
          Matches a widget that has the specified text, ignoring case considerations.
static
<T extends Widget>
Matcher<T>
withTooltip(String text)
          Matches a widget that has the specified exact tooltip.
static
<T extends Widget>
Matcher<T>
withTooltipIgoringCase(String text)
          Matches a widget that has the specified tooltip, ignoring case considerations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetMatcherFactory

public WidgetMatcherFactory()
Method Detail

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

withMnemonic

public static <T extends Widget> Matcher<T> withMnemonic(String text)
Matches a widget that has the specified text, after striping the mnemonics "&"

Parameters:
text - the text.
Returns:
a matcher.
Since:
2.0

withRegex

public static <T extends Widget> Matcher<T> withRegex(String regex)
Matches a widget that has the specified regex.

Parameters:
regex - the label.
Returns:
a matcher.
Since:
2.0

withText

public static <T extends Widget> Matcher<T> withText(String text)
Matches a widget that has the specified exact text.

Parameters:
text - the label.
Returns:
a matcher.
Since:
2.0

withTextIgnoringCase

public static <T extends Widget> Matcher<T> withTextIgnoringCase(String text)
Matches a widget that has the specified text, ignoring case considerations.

Parameters:
text - the label.
Returns:
a matcher.
Since:
2.0

withMessage

public static <T extends Widget> Matcher<T> withMessage(String message)
Matches a widget that has the specified exact message.

Parameters:
message - the message.
Returns:
a matcher.
Since:
2.0

withStyle

public static <T extends Widget> Matcher<T> withStyle(int style,
                                                      String styleDescription)
Matches a widget that has the specified style bit set.

Parameters:
style - the style bits.
styleDescription - the description of the style bits.
Returns:
a matcher.
Since:
2.0

withTooltip

public static <T extends Widget> Matcher<T> withTooltip(String text)
Matches a widget that has the specified exact tooltip.

Parameters:
text - the label.
Returns:
a matcher.
Since:
2.0

withTooltipIgoringCase

public static <T extends Widget> Matcher<T> withTooltipIgoringCase(String text)
Matches a widget that has the specified tooltip, ignoring case considerations.

Parameters:
text - the label.
Returns:
a matcher.
Since:
2.0

withId

public static <T extends Widget> Matcher<T> withId(String key,
                                                   String value)
Matches a widget that has the specified Key/Value pair set as data into it.

Parameters:
key - the key
value - the value
Returns:
a matcher.
See Also:
Widget.setData(String, Object)

withId

public static <T extends Widget> Matcher<T> withId(String value)
Matches a widget that has the specified value set for the key SWTBotPreferences.DEFAULT_KEY.

Parameters:
value - the value
Returns:
a matcher.
Since:
2.0
See Also:
Widget.setData(String, Object)

withItem

public static <T extends Item> Matcher<T> withItem(Matcher<?> matcher)
Returns a matcher that matches objects containing an item that matches the matcher.

Note: This invokes getItems method on the object and expects to see an array as a return value.

Parameters:
matcher - the matcher.
Returns:
a matcher.

inGroup

public static <T extends Widget> Matcher<T> inGroup(String labelText)
Matches a widget that belongs to the specified group

Parameters:
labelText - the label.
Returns:
a matcher.
Since:
2.0

inGroup

public static <T extends Widget> Matcher<T> inGroup(Matcher<?> matcher)
Matches a widget in a group, if the matcher evaluates to true for the group.

Parameters:
matcher - the matcher.
Returns:
a matcher.
Since:
2.0

widgetOfType

public static <T extends Widget> Matcher<T> widgetOfType(Class<T> type)
Matches a widget that has the specified type

Parameters:
type - the type of the widget.
Returns:
a matcher.
Since:
2.0

inUIThread

public static <T extends Widget> Matcher<T> inUIThread(Matcher<?> matcher)
Deprecated. this has been deprecated and will be removed in future releases of swtbot.

Matches another matcher in the context of the UI thread. Useful if you want to make a matcher UI thread safe.

Parameters:
matcher - the matcher
Returns:
a matcher.
Since:
2.0

allOf

public static <T extends Widget> Matcher<T> allOf(Matcher<? extends T>... matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true.

Returns:
a matcher.

allOf

public static <T extends Widget> Matcher<T> allOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true.

Returns:
a matcher.

anyOf

public static <T extends Widget> Matcher<T> anyOf(Matcher<? extends T>... matchers)
Evaluates to true only if ANY of the passed in matchers evaluate to true.

Returns:
a matcher.

anyOf

public static <T extends Widget> Matcher<T> anyOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ANY of the passed in matchers evaluate to true.

Returns:
a matcher.