com.objogate.wl.swing.matcher.ScrollBarMatcher 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.matcher;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import java.awt.Container;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
public class ScrollBarMatcher extends TypeSafeMatcher {
private final Container parent;
private final int orientation;
public ScrollBarMatcher(JScrollPane pane, int orientation) {
parent = pane;
this.orientation = orientation;
}
@Override
public boolean matchesSafely(JScrollBar component) {
return parent == component.getParent() && component.getOrientation() == orientation;
}
public void describeTo(Description description) {
description.appendText("scrollbar");
}
}