/** * WindowClosing event handler. * * <p>args[0] Boolean that specifies whether the window was created from script. args[1] Boolean * value that specifies whether the window is prevented from closing. * * @param args event arguments */ public void WindowClosing(Variant[] args) { boolean isChild = args[0].changeType(Variant.VariantBoolean).getBoolean(); for (WindowListener l : m_windowListeners) { if (l.windowClosing(isChild) == true) { args[1].putBoolean(true); } } }
public void hide() { WindowListener listener = windowListener; if (listener != null) { // We're not getting WINDOW_CLOSING from the native code when hiding // the window programmatically. So, create it and notify the listener. listener.windowClosing(new WindowEvent((Window) target, WindowEvent.WINDOW_CLOSING)); } super.hide(); }
// WARNING: it's called on the Toolkit thread! void preprocessPostEvent(AWTEvent event) { if (event instanceof WindowEvent) { WindowListener listener = windowListener; if (listener != null) { switch (event.getID()) { case WindowEvent.WINDOW_CLOSING: listener.windowClosing((WindowEvent) event); break; case WindowEvent.WINDOW_ICONIFIED: listener.windowIconified((WindowEvent) event); break; } } } }
/** * Handles the windowClosing event by invoking the windowClosing methods on listener-a and * listener-b. * * @param e the window event */ public void windowClosing(WindowEvent e) { ((WindowListener) a).windowClosing(e); ((WindowListener) b).windowClosing(e); }