com.objogate.wl.swing.probe.ComponentFinders Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of windowlicker-swing Show documentation
Show all versions of windowlicker-swing Show documentation
This is the Windowlicker Swing library.
The newest version!
package com.objogate.wl.swing.probe;
import java.awt.Component;
import org.hamcrest.Matcher;
import com.objogate.wl.swing.ComponentFinder;
import com.objogate.wl.swing.ComponentSelector;
public class ComponentFinders {
/**
* Returns a selector that identifies all subcomponents of the component driven by this driver that match
* the given criteria.
*
* @param type The type of subcomponents to finde
* @param criteria The criteria by which to select subcomponents
* @return a selector that identifies the component driven by this driver.
*/
public static ComponentFinder all(Class type, Matcher super U> criteria, ComponentFinder extends Component> selector) {
return new RecursiveComponentFinder(type, criteria, selector);
}
/**
* Returns a selector that identifies a single subcomponent of the component driven by this driver that matches
* the given criteria.
*
* @param type The type of subcomponents to finde
* @param criteria The criteria by which to select subcomponents
* @return a selector that identifies the component driven by this driver.
*/
public static ComponentSelector the(Class type, Matcher super U> criteria, ComponentFinder extends Component> selector) {
return new SingleComponentFinder(all(type, criteria, selector));
}
}