@Override protected void setParent(Container parent) { if (parent != null && (!(parent instanceof Display))) { throw new IllegalArgumentException("Window parent must be null or display, cannot be " + parent); } if (parent == null && isActive()) { clearActive(); } super.setParent(parent); }
@Override protected void setParent(Container parent) { if (parent != null && (!(parent instanceof Display))) { throw new IllegalArgumentException("Window parent must be null or display, cannot be " + parent); } if (parent == null && isActive()) { clearActive(); } super.setParent(parent); }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (!enabled && isActive()) { clearActive(); } }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (!enabled && isActive()) { clearActive(); } }
@Override public void setVisible(boolean visible) { if (visible && owner != null && !owner.isVisible()) { throw new IllegalStateException("Owner is not visible."); } super.setVisible(visible); if (visible && isActive()) { clearActive(); } for (Window ownedWindow : ownedWindows) { ownedWindow.setVisible(visible); } }
@Override public void setVisible(boolean visible) { if (visible && owner != null && !owner.isVisible()) { throw new IllegalStateException("Owner is not visible."); } super.setVisible(visible); if (visible && isActive()) { clearActive(); } for (Window ownedWindow : ownedWindows) { ownedWindow.setVisible(visible); } }
/** * Requests that this window become the active window. * * @return * <tt>true</tt> if the window became active; <tt>false</tt>, otherwise. */ public boolean requestActive() { if (isOpen() && isVisible() && isEnabled()) { setActiveWindow(this); } return isActive(); }
/** * Requests that this window become the active window. * * @return * <tt>true</tt> if the window became active; <tt>false</tt>, otherwise. */ public boolean requestActive() { if (isOpen() && isVisible() && isEnabled()) { setActiveWindow(this); } return isActive(); }
/** * Moves the window to the bottom of the window stack. If the window is * active, the active window will be cleared. If the window is the focus * host, the focus will be cleared. */ public void moveToBack() { if (!isOpen()) { throw new IllegalStateException("Window is not open."); } if (isActive()) { clearActive(); } if (containsFocus()) { clearFocus(); } // Ensure that the window and all of its owning ancestors are moved // to the back Display display = getDisplay(); int i = display.indexOf(this); if (i > 0) { display.move(i, 0); } if (owner != null) { owner.moveToBack(); } }
/** * Moves the window to the bottom of the window stack. If the window is * active, the active window will be cleared. If the window is the focus * host, the focus will be cleared. */ public void moveToBack() { if (!isOpen()) { throw new IllegalStateException("Window is not open."); } if (isActive()) { clearActive(); } if (containsFocus()) { clearFocus(); } // Ensure that the window and all of its owning ancestors are moved // to the back Display display = getDisplay(); int i = display.indexOf(this); if (i > 0) { display.move(i, 0); } if (owner != null) { owner.moveToBack(); } }