| Summary: | [Shell] Parent shell of a primary modal dialog is accessible | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Karl Hönninger <karl> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ivan |
| Version: | 2.0 | ||
| Target Milestone: | 2.0 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Currently only APPLICATION_MODAL Shell is fully supported. The SWT.PRIMARY_MODAL style flag has been introduced by bug 231864, but never really implemented due to old client-side Shell restrictions. More over the style flag is marked as HINT, which means it's normal not to be supported on some platforms. Regarding not supported modality styles you can find a note here: http://help.eclipse.org/juno/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Dialog.html Here is an extract: "Note: The modality styles supported by this class are treated as HINTs, because not all are supported by every subclass on every platform. If a modality style is not supported, it is "upgraded" to a more restrictive modality style that is supported. For example, if PRIMARY_MODAL is not supported by a particular dialog, it would be upgraded to APPLICATION_MODAL. In addition, as is the case for shells, the window manager for the desktop on which the instance is visible has ultimate control over the appearance and behavior of the instance, including its modality." Maybe as a possible solution such an upgrade could be taken in consideration for RWT. (In reply to comment #2) > Maybe as a possible solution such an upgrade could be taken in consideration > for RWT. Yes... We will implement the PRIMARY_MODAL style flag as APPLICATION_MODAL. Fixed as suggested with commit 7399bb4dd7f0d17dc2234467fa5e178b936fad27. |
The parent shell of a primary modal dialog is accessible. I would expect that the parent is inaccessible (which is the case for an application modal dialog). I found this behaviour in version '2.0.0.20121001-1623' and in mode 'OperationMode.SWT_COMPATIBILITY'. Here is a short snippet to reproduce this: package org.openxma.rwt.launch; import org.eclipse.rap.rwt.lifecycle.IEntryPoint; public class RWTTest implements IEntryPoint { public int createUI() { Display display = new Display(); final Shell shell = new Shell(display); shell.setText("Parent"); shell.setSize(500,400); shell.setLayout(new FillLayout(SWT.VERTICAL)); /* primary modal shell */ Button primaryModalButton = new Button(shell, SWT.PUSH); primaryModalButton.setText("Open primary modal shell"); primaryModalButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent arg0) { Shell primaryModalShell = new Shell(shell, SWT.PRIMARY_MODAL | SWT.TITLE | SWT.CLOSE); primaryModalShell.setText("Primary modal"); primaryModalShell.open(); eventLoop(primaryModalShell); } }); /* application modal shell */ Button applicationModalButton = new Button(shell, SWT.PUSH); applicationModalButton.setText("Open application modal shell"); applicationModalButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent arg0) { Shell applicationModalShell = new Shell(shell, SWT.APPLICATION_MODAL | SWT.TITLE | SWT.CLOSE); applicationModalShell.setText("Application modal"); applicationModalShell.open(); eventLoop(applicationModalShell); } }); /* open parent shell */ shell.open(); eventLoop(shell); return 0; } protected void eventLoop(Shell shell) { Display display = shell.getDisplay(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } }