com.objogate.wl.swing.probe.ComponentManipulatorProbe 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.Description;
import com.objogate.wl.Probe;
import com.objogate.wl.swing.ComponentFinder;
import com.objogate.wl.swing.ComponentManipulation;
public class ComponentManipulatorProbe implements Probe {
private final ComponentFinder finder;
private final ComponentManipulation super T> manipulation;
public ComponentManipulatorProbe(ComponentFinder finder, ComponentManipulation super T> manipulation) {
this.finder = finder;
this.manipulation = manipulation;
}
public void probe() {
finder.probe();
if (finder.isSatisfied()) {
for (T component : finder.components()) {
manipulation.manipulate(component);
}
}
}
public boolean isSatisfied() {
return finder.isSatisfied();
}
public void describeTo(Description description) {
finder.describeTo(description);
}
public void describeFailureTo(Description description) {
finder.describeFailureTo(description);
}
}