![JAR search and dependency download from the Maven repository](/logo.png)
com.objogate.wl.swing.matcher.JMenuTextMatcher 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.JMenu;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
public class JMenuTextMatcher extends TypeSafeMatcher {
private final String expectedText;
public JMenuTextMatcher(String expectedText) {
this.expectedText = expectedText;
}
@Override
public boolean matchesSafely(JMenu jButton) {
// Note that getText can seem to return null
return expectedText.equals(jButton.getText());
}
public void describeTo(Description description) {
description.appendText("JMenu with text '").appendText(expectedText).appendText("'");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy