Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with setBlockOnOpen in Dialog
Problem with setBlockOnOpen in Dialog [message #120143] Fri, 30 January 2009 08:51 Go to next message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Hello

I found a problem with setBlockOnOpen method. When you create a dialog the
default strategy is to block the open method until the dialogs window
closes. But if we will not close dialog and refresh window the session id
will be the same so the locked UI thread will be used. So the user will
not be able to restart the application.

As possible solution I can not to block the UI thread and do it after I
call open member manually. So I have two questions:
1) Is it a bug?
2) If not - is it possible to find platform-independent solution?
Re: Problem with setBlockOnOpen in Dialog [message #120462 is a reply to message #120143] Wed, 04 February 2009 17:27 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Igor,

I haven't encountered yet what you describe. If you can reproduce it
with a self-contained snippet, feel free to file a bug report. If it
is of interest, see here for a bug-reporting how-to:
http://wiki.eclipse.org/RAP_Bug_Reporting_Howto.

Cheers,
Rüdiger

Igor Pavlenko wrote:
> Hello
>
> I found a problem with setBlockOnOpen method. When you create a dialog
> the default strategy is to block the open method until the dialogs
> window closes. But if we will not close dialog and refresh window the
> session id will be the same so the locked UI thread will be used. So the
> user will not be able to restart the application.
>
> As possible solution I can not to block the UI thread and do it after I
> call open member manually. So I have two questions:
> 1) Is it a bug?
> 2) If not - is it possible to find platform-independent solution?
>
Re: Problem with setBlockOnOpen in Dialog [message #120620 is a reply to message #120462] Thu, 05 February 2009 20:11 Go to previous messageGo to next message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Hello

Lets create a simple dialog:

public class DemoDialog extends Dialog
{
protected DemoDialog(Shell parentShell)
{
super(parentShell);
}

protected void configureShell(Shell newShell)
{
super.configureShell(newShell);
newShell.setText("Demo dialog");
}

protected Control createDialogArea(Composite parent)
{
Composite composite = (Composite)super.createDialogArea(parent);
Label label = new Label(composite, SWT.NONE);
label.setText("Refresh your browser");
return composite;
}
}

Lets create somewhere two different buttons with two different selection
listeners:

Button button1 = new Button(parent, SWT.NONE);
button1.setText("Open dialog");
button1.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
DemoDialog demoDialog = new DemoDialog(parent.getShell());
demoDialog.open();
}
});

Button button2 = new Button(parent, SWT.NONE);
button2.setText("Open dialog with ProgressMonitorDialog");
button2.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
final ProgressMonitorDialog progressDialog =
new ProgressMonitorDialog(parent.getShell());
try
{
progressDialog.run(true, false, new IRunnableWithProgress()
{
public void run(final IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException
{
monitor.beginTask(
"Show dialog task", IProgressMonitor.UNKNOWN);
final DemoDialog demoDialog =
new DemoDialog(progressDialog.getShell());
parent.getDisplay().syncExec(new Runnable()
{
public void run()
{
demoDialog.open();
}
});
monitor.done();
}
});
}
catch (InvocationTargetException e1)
{
e1.printStackTrace();
}
catch (InterruptedException e1)
{
e1.printStackTrace();
}
}
});

Use first button to open dialog. Refresh browser. Everithing is fine.
Use second button to open dialog. Refresh browser.

org.eclipse.swt.SWTException: Failed to execute runnable
(org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTer minatedError)

will be thrown.

I can post this bug to bugzilla if it necessary.

Regards,
Igor
Re: Problem with setBlockOnOpen in Dialog [message #120631 is a reply to message #120620] Fri, 06 February 2009 07:10 Go to previous messageGo to next message
Lars Martin is currently offline Lars MartinFriend
Messages: 24
Registered: July 2009
Junior Member
Hi Igor,

we can confirm the erroneous behaviour. But I'm not sure if this is
dependent on setBlockOnOpen(true). We're using setBlockOnOpen(false) and
get the same exception when we refresh the browser.

Regards, Lars

Igor Pavlenko wrote:
> Hello
>
> Lets create a simple dialog:
>
> public class DemoDialog extends Dialog
> {
> protected DemoDialog(Shell parentShell)
> {
> super(parentShell);
> }
> protected void configureShell(Shell newShell)
> {
> super.configureShell(newShell);
> newShell.setText("Demo dialog");
> }
> protected Control createDialogArea(Composite parent)
> {
> Composite composite = (Composite)super.createDialogArea(parent);
> Label label = new Label(composite, SWT.NONE);
> label.setText("Refresh your browser");
> return composite;
> }
> }
>
> Lets create somewhere two different buttons with two different selection
> listeners:
>
> Button button1 = new Button(parent, SWT.NONE);
> button1.setText("Open dialog");
> button1.addSelectionListener(new SelectionAdapter()
> {
> public void widgetSelected(SelectionEvent e)
> {
> DemoDialog demoDialog = new DemoDialog(parent.getShell());
> demoDialog.open();
> }
> });
> Button button2 = new Button(parent, SWT.NONE);
> button2.setText("Open dialog with ProgressMonitorDialog");
> button2.addSelectionListener(new SelectionAdapter()
> {
> public void widgetSelected(SelectionEvent e)
> {
> final ProgressMonitorDialog progressDialog =
> new ProgressMonitorDialog(parent.getShell());
> try
> {
> progressDialog.run(true, false, new IRunnableWithProgress()
> {
> public void run(final IProgressMonitor monitor)
> throws InvocationTargetException, InterruptedException
> {
> monitor.beginTask(
> "Show dialog task", IProgressMonitor.UNKNOWN);
> final DemoDialog demoDialog =
> new DemoDialog(progressDialog.getShell());
> parent.getDisplay().syncExec(new Runnable()
> {
> public void run()
> {
> demoDialog.open();
> }
> });
> monitor.done();
> }
> });
> }
> catch (InvocationTargetException e1)
> {
> e1.printStackTrace();
> }
> catch (InterruptedException e1)
> {
> e1.printStackTrace();
> }
> }
> });
>
> Use first button to open dialog. Refresh browser. Everithing is fine.
> Use second button to open dialog. Refresh browser.
>
> org.eclipse.swt.SWTException: Failed to execute runnable
> (org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTer minatedError)
>
> will be thrown.
>
> I can post this bug to bugzilla if it necessary.
>
> Regards,
> Igor
>
Re: Problem with setBlockOnOpen in Dialog [message #120669 is a reply to message #120620] Fri, 06 February 2009 08:43 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Igor,

what you describe might be a duplicate of
258102: ProgressMonitorDialog causes an Exception on page reload
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258102
Can you confirm this?

Cheers,
Rüdiger

Igor Pavlenko wrote:
> Hello
>
> Lets create a simple dialog:
>
> public class DemoDialog extends Dialog
> {
> protected DemoDialog(Shell parentShell)
> {
> super(parentShell);
> }
> protected void configureShell(Shell newShell)
> {
> super.configureShell(newShell);
> newShell.setText("Demo dialog");
> }
> protected Control createDialogArea(Composite parent)
> {
> Composite composite = (Composite)super.createDialogArea(parent);
> Label label = new Label(composite, SWT.NONE);
> label.setText("Refresh your browser");
> return composite;
> }
> }
>
> Lets create somewhere two different buttons with two different selection
> listeners:
>
> Button button1 = new Button(parent, SWT.NONE);
> button1.setText("Open dialog");
> button1.addSelectionListener(new SelectionAdapter()
> {
> public void widgetSelected(SelectionEvent e)
> {
> DemoDialog demoDialog = new DemoDialog(parent.getShell());
> demoDialog.open();
> }
> });
> Button button2 = new Button(parent, SWT.NONE);
> button2.setText("Open dialog with ProgressMonitorDialog");
> button2.addSelectionListener(new SelectionAdapter()
> {
> public void widgetSelected(SelectionEvent e)
> {
> final ProgressMonitorDialog progressDialog =
> new ProgressMonitorDialog(parent.getShell());
> try
> {
> progressDialog.run(true, false, new IRunnableWithProgress()
> {
> public void run(final IProgressMonitor monitor)
> throws InvocationTargetException, InterruptedException
> {
> monitor.beginTask(
> "Show dialog task", IProgressMonitor.UNKNOWN);
> final DemoDialog demoDialog =
> new DemoDialog(progressDialog.getShell());
> parent.getDisplay().syncExec(new Runnable()
> {
> public void run()
> {
> demoDialog.open();
> }
> });
> monitor.done();
> }
> });
> }
> catch (InvocationTargetException e1)
> {
> e1.printStackTrace();
> }
> catch (InterruptedException e1)
> {
> e1.printStackTrace();
> }
> }
> });
>
> Use first button to open dialog. Refresh browser. Everithing is fine.
> Use second button to open dialog. Refresh browser.
>
> org.eclipse.swt.SWTException: Failed to execute runnable
> (org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTer minatedError)
>
> will be thrown.
>
> I can post this bug to bugzilla if it necessary.
>
> Regards,
> Igor
>
Re: Problem with setBlockOnOpen in Dialog [message #120700 is a reply to message #120669] Fri, 06 February 2009 09:04 Go to previous message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
It seems so. It is the same problem.
Previous Topic:File Upload and Download in RWT standalone
Next Topic:Register PespectiveListener
Goto Forum:
  


Current Time: Fri Apr 19 07:55:08 GMT 2024

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

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

Back to the top