/** * Attempts to close all windows managed by this window manager, * as well as windows managed by any descendent window managers. * * @return <code>true</code> if all windows were sucessfully closed, * and <code>false</code> if any window refused to close */ public boolean close() { List<Window> t = new ArrayList<>(windows); // make iteration robust Iterator<Window> e = t.iterator(); while (e.hasNext()) { Window window = e.next(); boolean closed = window.close(); if (!closed) { return false; } } if (subManagers != null) { Iterator<WindowManager> i = subManagers.iterator(); while (i.hasNext()) { WindowManager wm = i.next(); boolean closed = wm.close(); if (!closed) { return false; } } } return true; }
/** * Attempts to close all windows managed by this window manager, * as well as windows managed by any descendent window managers. * * @return <code>true</code> if all windows were sucessfully closed, * and <code>false</code> if any window refused to close */ public boolean close() { List<Window> t = new ArrayList<>(windows); // make iteration robust Iterator<Window> e = t.iterator(); while (e.hasNext()) { Window window = e.next(); boolean closed = window.close(); if (!closed) { return false; } } if (subManagers != null) { Iterator<WindowManager> i = subManagers.iterator(); while (i.hasNext()) { WindowManager wm = i.next(); boolean closed = wm.close(); if (!closed) { return false; } } } return true; }
/** * Attempts to close all windows managed by this window manager, * as well as windows managed by any descendent window managers. * * @return <code>true</code> if all windows were sucessfully closed, * and <code>false</code> if any window refused to close */ public boolean close() { List t = (List) windows.clone(); // make iteration robust Iterator e = t.iterator(); while (e.hasNext()) { Window window = (Window) e.next(); boolean closed = window.close(); if (!closed) { return false; } } if (subManagers != null) { e = subManagers.iterator(); while (e.hasNext()) { WindowManager wm = (WindowManager) e.next(); boolean closed = wm.close(); if (!closed) { return false; } } } return true; }