/** * Determines whether parent window a modal dialog. * * @param comp the component * @return true if parent window is a modal dialog, false if no parent, not * a dialog or not modal */ public boolean isParentWindowModal(Component comp) { Window w = getParentWindow(comp); return w instanceof Dialog && ((Dialog)w).isModal(); }
/** * Removes a window from the set (i.e. window is hidden or closed now) * @param w the window to remove */ public void removeWindow(Window w) { synchronized (windows) { if (windows.remove(w)) { if (w instanceof Dialog) { Dialog d = (Dialog) w; if (d.isModal()) { modalDialogs.remove(d); } } fireWindowActionPerformed(new ActionEvent(w, Event.ACTION_EVENT, "remove")); // NOI18N } } }
/** * Set the activation window. If the window is an instance of a * Dialog and the is modal, modallyActivated help is set to true and * ownerDialog is set to the window. In all other instances * modallyActivated is set to false and ownerDialog is set to null. * @param window the activating window */ public void setActivationWindow(Window window) { debug("setActivationWindow"); if (window != null && window instanceof Dialog) { Dialog tmpDialog = (Dialog) window; if (tmpDialog.isModal()) { ownerWindow = window; modallyActivated = true; } else { ownerWindow = null; modallyActivated = false; } } else { ownerWindow = null; modallyActivated = false; } }
public boolean matches(Component c) { return super.matches(c) && ((Dialog)c).isModal() && AWT.containsFocus(c); } };
@RunsInEDT static boolean isModal(final @Nonnull Dialog dialog) { Boolean result = execute(() -> dialog.isModal()); return checkNotNull(result); }
public static void addDialog(JDialog dialog) { if(TinyUtils.isOSMac()) return; if(!dialog.isModal()) { DIALOGS.add(dialog);
private static boolean hasModalDialog(Window w) { if (w == null) { // #63830 return false; } Window[] ws = w.getOwnedWindows(); for(int i = 0; i < ws.length; i++) { if(ws[i] instanceof Dialog && ((Dialog)ws[i]).isModal() && ws[i].isVisible()) { return true; } else if(hasModalDialog(ws[i])) { return true; } } return false; }
/** * Gets the top modal dialog of current window. * * @param w * @return the top modal dialog of current window. */ public static Window getTopModalDialog(Window w) { Window[] ws = w.getOwnedWindows(); for (Window w1 : ws) { if (w1.isVisible() && w1 instanceof Dialog && ((Dialog) w1).isModal()) { return (getTopModalDialog(w1)); } } return w; }
/** * Adds window to the set of windows (must be visible or iconified). * * @param w the window to add */ public void addWindow(Window w) { synchronized (windows) { if (windows.add(w)) { if (w instanceof Dialog && ((Dialog)w).isModal()) { modalDialogs.add((Dialog)w); } FormWindow fw = w instanceof FormWindow ? (FormWindow)w : null; if (fw != null && fw.isAutoCloseable()) { // start timer for autoclose for this window fw.setTimeOfLastValuesChanged(System.currentTimeMillis()); // start the autoclose-thread if not running if (autoCloseThread == null) { autoCloseThread = new AutoCloseThread(); autoCloseThread.start(); LOGGER.fine("autoclose-thread started"); } } fireWindowActionPerformed(new ActionEvent(w, Event.ACTION_EVENT, "add")); // NOI18N } } }
final boolean modal = dlg.isModal() && (fph != null); AbstractWindow w2;
if (d != null && d.isModal ()) { exDnD.setDnDActive (false); return ;
if (d != null && d.isModal ()) { exDnD.setDnDActive (false); return ;