Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Parent accessible on primary modal dialog(The parent dialog is accessible in case a primary modal child dialog is open)
Parent accessible on primary modal dialog [message #970957] Sun, 04 November 2012 13:06 Go to next message
Karl Hönninger is currently offline Karl HönningerFriend
Messages: 3
Registered: October 2012
Junior Member
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 08:41 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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/
Previous Topic:GUI Testing in RAP
Next Topic:SWT.VIRTUAL & SWT.CHECK table
Goto Forum:
  


Current Time: Fri Apr 19 21:43:59 GMT 2024

Powered by FUDForum. Page generated in 0.03057 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top