org.eclipse.swtbot.swt.finder.matchers
Class WithTooltip<T extends Widget>

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher<T>
          extended by org.eclipse.swtbot.swt.finder.matchers.WithTooltip<T>
All Implemented Interfaces:
Matcher<T>, SelfDescribing

public class WithTooltip<T extends Widget>
extends AbstractMatcher<T>

Matches widgets if the getToolTipText() method of the widget matches the specified text.

Since:
2.0
Version:
$Id$
Author:
Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>

Field Summary
protected  boolean ignoreCase
          A flag to denote if this should ignore case.
protected  String text
          The text
 
Fields inherited from class org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher
log
 
Method Summary
 void describeTo(Description description)
           
protected  boolean doMatch(Object obj)
          Subclasses must override, this is the actual method that does the matching
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 org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher
matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

text

protected String text
The text


ignoreCase

protected boolean ignoreCase
A flag to denote if this should ignore case.

Since:
1.2
Method Detail

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)

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