Provides an indication whether a Component matches some desired
criteria. For use with implementations of
ComponentFinder .
You can conveniently inline a custom matcher like so:
ComponentFinder finder;
...
// Find a label with known text
JLabel label = (JLabel)finder.find(new Matcher() {
public boolean matches(Component c) {
return c instanceof JLabel
&& "expected text".equals(((JLabel)c).getText());
}
});
See Also: ComponentFinder |