![JAR search and dependency download from the Maven repository](/logo.png)
com.objogate.wl.swing.matcher.AbstractButtonAcceleratorMatcher 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.AbstractButton;
import java.awt.event.KeyEvent;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
public class AbstractButtonAcceleratorMatcher extends TypeSafeMatcher {
private int keyCode;
public AbstractButtonAcceleratorMatcher(int keyCode) {
this.keyCode = keyCode;
}
@Override
public boolean matchesSafely(T buttonAlike) {
return buttonAlike.getMnemonic() == keyCode;
}
public void describeTo(Description description) {
description.appendText("accelerator equals '");
description.appendValue(KeyEvent.getKeyText(keyCode));
description.appendText("'");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy