/** * Sets the window manager of this window. * <p> * Note that this method is used by <code>WindowManager</code> to maintain * a backpointer. Clients must not call the method directly. * </p> * * @param manager * the window manager, or <code>null</code> if none */ public void setWindowManager(WindowManager manager) { windowManager = manager; // Code to detect invalid usage if (manager != null) { Window[] windows = manager.getWindows(); for (Window window : windows) { if (window == this) { return; } } manager.add(this); } }
/** * Creates an empty window manager with the given * window manager as parent. * * @param parent the parent window manager */ public WindowManager(WindowManager parent) { Assert.isNotNull(parent); parent.addWindowManager(this); }
/** * 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; }
windowManager.remove(this); windowManager = null;
/** * 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; }
windowManager.remove(this); windowManager = null;
/** * Sets the window manager of this window. * <p> * Note that this method is used by <code>WindowManager</code> to maintain * a backpointer. Clients must not call the method directly. * </p> * * @param manager * the window manager, or <code>null</code> if none */ public void setWindowManager(WindowManager manager) { windowManager = manager; // Code to detect invalid usage if (manager != null) { Window[] windows = manager.getWindows(); for (int i = 0; i < windows.length; i++) { if (windows[i] == this) { return; } } manager.add(this); } }
/** * Creates an empty window manager with the given * window manager as parent. * * @param parent the parent window manager */ public WindowManager(WindowManager parent) { Assert.isNotNull(parent); parent.addWindowManager(this); }
/** * 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; }
windowManager.remove(this); windowManager = null;
/** * Sets the window manager of this window. * <p> * Note that this method is used by <code>WindowManager</code> to maintain * a backpointer. Clients must not call the method directly. * </p> * * @param manager * the window manager, or <code>null</code> if none */ public void setWindowManager(WindowManager manager) { windowManager = manager; // Code to detect invalid usage if (manager != null) { Window[] windows = manager.getWindows(); for (int i = 0; i < windows.length; i++) { if (windows[i] == this) { return; } } manager.add(this); } }
/** * Creates an empty window manager with the given * window manager as parent. * * @param parent the parent window manager */ public WindowManager(WindowManager parent) { Assert.isNotNull(parent); parent.addWindowManager(this); }