![JAR search and dependency download from the Maven repository](/logo.png)
com.objogate.wl.swing.matcher.JLabelTextMatcher 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 static org.hamcrest.Matchers.equalTo;
import javax.swing.JLabel;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
public class JLabelTextMatcher extends TypeSafeMatcher {
private final Matcher matcher;
public JLabelTextMatcher(Matcher matcher) {
this.matcher = matcher;
}
@Override
public boolean matchesSafely(JLabel label) {
return matcher.matches(label.getText());
}
public void describeTo(Description description) {
description.appendText("with text ")
.appendDescriptionOf(matcher);
}
public static JLabelTextMatcher withLabelText(String text) {
return withLabelText(equalTo(text));
}
public static JLabelTextMatcher withLabelText(Matcher text) {
return new JLabelTextMatcher(text);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy