Parent accessible on primary modal dialog [message #970957] |
Sun, 04 November 2012 08:06  |
Eclipse User |
|
|
|
Hello,
what is the intended accessibility of a parent dialog in case a primary modal child dialog is open in mode 'OperationMode.SWT_COMPATIBILITY'?
I found out the following:
APPLICATION_MODAL: parent dialog inaccessible
PRIMARY_MODAL: parent dialog accessible
(version = 2.0.0.20121001-1623)
I would expect that the parent dialog is inaccessible also in case of a primary modal child dialog.
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();
}
}
}
}
Thank you,
best regards,
Karl
|
|
|
Re: Parent accessible on primary modal dialog [message #971958 is a reply to message #970957] |
Mon, 05 November 2012 03:41  |
Eclipse User |
|
|
|
Hi Karl,
please open a bugzilla about this issue.
Thanks,
Ivan
On 11/4/2012 3:06 PM, Karl Hönninger wrote:
> Hello,
>
> what is the intended accessibility of a parent dialog in case a
> primary modal child dialog is open in mode
> 'OperationMode.SWT_COMPATIBILITY'?
> I found out the following:
> APPLICATION_MODAL: parent dialog inaccessible
> PRIMARY_MODAL: parent dialog accessible
>
> (version = 2.0.0.20121001-1623)
>
> I would expect that the parent dialog is inaccessible also in case of
> a primary modal child dialog.
>
> 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();
> }
> }
> }
> }
>
>
>
> Thank you,
> best regards,
> Karl
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Powered by
FUDForum. Page generated in 0.03906 seconds