List of usage examples for java.awt Window getWindowListeners
public synchronized WindowListener[] getWindowListeners()
From source file:org.eclipse.jubula.rc.swing.components.AUTSwingHierarchy.java
/** * register a window listener to <code>window</code>.<br> deregistering happens in * <code>WindowClosingListener.windowClosed()</code>. * @param window the window to register to *//*from w w w. j a va2 s . c o m*/ private void registerAsWindowListener(final Window window) { Runnable registrationRunnable = new Runnable() { public void run() { if (log.isInfoEnabled()) { log.info("registering window listener to window " //$NON-NLS-1$ + window); } WindowListener[] listener = window.getWindowListeners(); for (int i = 0; i < listener.length; i++) { if (listener[i] instanceof WindowClosingListener) { return; } } window.addWindowListener(new WindowClosingListener()); } }; registerListener(registrationRunnable); }