/** * Returns parent shell, under which this window's shell is created. * * @return the parent shell, or <code>null</code> if there is no parent * shell */ protected Shell getParentShell() { Shell parent = parentShell.getShell(); int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL; if ((getShellStyle() & modal) != 0) { // If this is a modal shell with no parent, pick a shell using defaultModalParent. if (parent == null) { parent = defaultModalParent.getShell(); } } return parent; }
/** * Returns parent shell, under which this window's shell is created. * * @return the parent shell, or <code>null</code> if there is no parent * shell */ protected Shell getParentShell() { Shell parent = parentShell.getShell(); int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL; if ((getShellStyle() & modal) != 0) { // If this is a modal shell with no parent, pick a shell using defaultModalParent. if (parent == null) { parent = defaultModalParent.getShell(); } } return parent; }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
/** * Creates a window instance, whose shell will be created under the given * parent shell. Note that the window will have no visual representation * until it is told to open. By default, <code>open</code> does not block. * * @param parentShell * the parent shell, or <code>null</code> to create a top-level * shell. Try passing "(Shell)null" to this method instead of "null" * if your compiler complains about an ambiguity error. * @see #setBlockOnOpen * @see #getDefaultOrientation() */ protected Window(Shell parentShell) { this(new SameShellProvider(parentShell)); if(parentShell == null) { setShellStyle(getShellStyle() | getDefaultOrientation()); } }
/** * Returns parent shell, under which this window's shell is created. * * @return the parent shell, or <code>null</code> if there is no parent * shell */ protected Shell getParentShell() { Shell parent = parentShell.getShell(); int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL; if ((getShellStyle() & modal) != 0) { // If this is a modal shell with no parent, pick a shell using defaultModalParent. if (parent == null) { // RAP [if] Session scoped defaultModalParent // parent = defaultModalParent.getShell(); parent = getDefaultModalParent().getShell(); } } return parent; }
Shell newShell = new Shell(newParent, getShellStyle());
Shell newShell = new Shell(newParent, getShellStyle());
Shell newShell = new Shell(newParent, getShellStyle());