use of java.awt.event.AWTEventListenerProxy in project jdk8u_jdk by JetBrains.
the class bug6872503 method layerEventControllerMaskEquals.
static boolean layerEventControllerMaskEquals(long mask) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
AWTEventListener layerEventController = null;
for (AWTEventListener listener : toolkit.getAWTEventListeners(mask)) {
if (listener instanceof AWTEventListenerProxy) {
listener = ((AWTEventListenerProxy) listener).getListener();
}
if ("LayerEventController".equals(listener.getClass().getSimpleName())) {
if (layerEventController != null) {
throw new RuntimeException("Duplicated LayerEventController");
}
layerEventController = listener;
}
}
boolean ret = layerEventController != null;
if (ret) {
System.out.println("LayerEventController with the correct mask found");
} else {
System.out.println("No LayerEventController with the correct mask");
}
return ret;
}
use of java.awt.event.AWTEventListenerProxy in project jdk8u_jdk by JetBrains.
the class bug6872503 method isLayerEventControllerAdded.
static boolean isLayerEventControllerAdded() {
Toolkit toolkit = Toolkit.getDefaultToolkit();
AWTEventListener layerEventController = null;
for (AWTEventListener listener : toolkit.getAWTEventListeners()) {
if (listener instanceof AWTEventListenerProxy) {
listener = ((AWTEventListenerProxy) listener).getListener();
}
if ("LayerEventController".equals(listener.getClass().getSimpleName())) {
if (layerEventController != null) {
throw new RuntimeException("Duplicated LayerEventController");
}
layerEventController = listener;
}
}
boolean ret = layerEventController != null;
if (ret) {
System.out.println("LayerEventController found");
} else {
System.out.println("No LayerEventController");
}
return ret;
}
Aggregations