Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Dialog Frozen Behavior
Dialog Frozen Behavior [message #793943] Wed, 08 February 2012 19:05 Go to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello,

the modal dialogs functionality of 1.5M5 is awkward.
when either button of the dialog event is called, the dialog disappears, but the modal nature remains, meaning the UI is frozen.

following is the code snippet which uses the message dialog :
final MessageDialog dialog = new MessageDialog(_toolBar.getShell(),
				"Delete Confirmation", null,
				"Do you wish to delete this record [y/n] ?",
				 MessageDialog.QUESTION, new String[] { "Yes", "No", "Cancel" },
				 2);
		final int answer = dialog.open();
		switch (answer) {
		case -1:
			/* no selection provided */
			break;
		case 0:
			/* dialog action - yes */
			final boolean status = runAction(ClientsideActionsContributor.ON_BEFORE_DELETE_RECORD_EVENT);
			if (status) {
				((DatasetController) getDatasetBroadcast())
						.setActionState(BusinessObject.ACTION_DELETE);
				((DatasetController) getDatasetBroadcast()).performDelete();
				refreshRecordAction();
			}
			runAction(ClientsideActionsContributor.ON_AFTER_DELETE_RECORD_EVENT);
			break;
		case 1:
			/* dialog action - no */
			break;
		case 2:
			/* dialog action - cancel */
			break;
		}


the above code snippet did work as expected in 1.4, but with 1.5M5 the dialog's modal behavior remains, even after closing the dialog.

i also have custom dialogs like "SetupCustomEditorDialog" extends the Dialog, which works as expected with modal behavior in 1.5M5. (after closing the dialog, UI become responsive)

also, if i refresh the page while frozen after the dialog, i get the following errors in console :


osgi> 2012-02-08 23:59:10.446:INFO:oejs.Server:jetty-8.1.0.RC4
2012-02-08 23:59:14.045:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:50140 STARTING
diff - -132
2012-02-09 00:00:55.714:WARN:/:ERROR:  Exception while executing dispose-listener.
java.lang.UnsupportedOperationException
	at org.eclipse.rwt.internal.lifecycle.FakeContextUtil$RequestInvocationHandler.invoke(FakeContextUtil.java:119)
	at $Proxy2.getParameter(Unknown Source)
	at org.eclipse.rwt.internal.textsize.MeasurementOperator.requestContainsMeasurementResult(MeasurementOperator.java:154)
	at org.eclipse.rwt.internal.textsize.MeasurementOperator.addItemToMeasure(MeasurementOperator.java:87)
	at org.eclipse.rwt.internal.textsize.MeasurementUtil.addItemToMeasure(MeasurementUtil.java:68)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.addItemToMeasure(TextSizeUtil.java:125)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.determineTextSize(TextSizeUtil.java:84)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.stringExtent(TextSizeUtil.java:33)
	at org.eclipse.rwt.graphics.Graphics.stringExtent(Graphics.java:330)
	at org.eclipse.swt.widgets.Button.computeSize(Button.java:392)
	at org.eclipse.jface.dialogs.Dialog.setButtonLayoutData(Dialog.java:934)
	at org.eclipse.jface.dialogs.Dialog.createButton(Dialog.java:619)
	at org.eclipse.jface.dialogs.MessageDialog.createButton(MessageDialog.java:486)
	at org.eclipse.jface.dialogs.MessageDialog.createButtonsForButtonBar(MessageDialog.java:231)
	at org.eclipse.jface.dialogs.IconAndMessageDialog.createButtonBar(IconAndMessageDialog.java:172)
	at org.eclipse.jface.dialogs.IconAndMessageDialog.createDialogAndButtonArea(IconAndMessageDialog.java:219)
	at org.eclipse.jface.dialogs.IconAndMessageDialog.createContents(IconAndMessageDialog.java:198)
	at org.eclipse.jface.window.Window.create(Window.java:444)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1071)
	at org.eclipse.jface.window.Window.open(Window.java:806)
	at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:334)
	at com.wface.entrypoint._rap.ApplicationWorkbenchAdvisor.preShutdown(ApplicationWorkbenchAdvisor.java:47)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1075)
	at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1072)
	at org.eclipse.ui.internal.Workbench$22.run(Workbench.java:1338)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1336)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1298)
	at org.eclipse.ui.internal.Workbench$ShutdownHandler.handleEvent(Workbench.java:388)
	at org.eclipse.swt.widgets.Display.sendDisposeEvent(Display.java:703)
	at org.eclipse.swt.widgets.Display.release(Display.java:680)
	at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
	at org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:297)
	at java.lang.Thread.run(Unknown Source)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)
!SESSION 2012-02-08 23:59:08.124 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -dev file:C:/accbldr/ws/.metadata/.plugins/org.eclipse.pde.core/accbldr/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console -data C:\accbldr\ws/.metadata/.plugins/org.eclipse.rap.ui.launch/accbldr

!ENTRY org.eclipse.ui.workbench 4 0 2012-02-09 00:00:55.731
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
	at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:175)
	at org.eclipse.swt.events.DisposeEvent.dispatchToObserver(DisposeEvent.java:63)
	at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)
	at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:166)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:774)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1097)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
	at org.eclipse.swt.widgets.Display.disposeShells(Display.java:717)
	at org.eclipse.swt.widgets.Display.release(Display.java:681)
	at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
	at org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:297)
	at java.lang.Thread.run(Unknown Source)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)




Is this a bug in 1.5M5 ? Kindly advise me how to resolve.

Regards,
Sudesh

[Updated on: Wed, 08 February 2012 19:16]

Report message to a moderator

Re: Dialog Frozen Behavior [message #793975 is a reply to message #793943] Wed, 08 February 2012 19:47 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sudesh,
I think that you are running into this bug:
370139: [Dialog] Modal dialog blocks application upon close
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370139
Could you attach your test snippet there? A complete self-running
snippet is welcomed.
Thanks,
Ivan

On 2/8/2012 9:05 PM, Sudesh Bulathsinhala wrote:
> Hello,
>
> the modal dialogs functionality of 1.5M5 is awkward. when either
> button of the dialog event is called, the dialog disappears, but the
> modal nature remains, meaning the UI is frozen.
>
> following is the code snippet which uses the message dialog :
>
> final MessageDialog dialog = new MessageDialog(_toolBar.getShell(),
> "Delete Confirmation", null,
> "Do you wish to delete this record [y/n] ?",
> MessageDialog.QUESTION, new String[] { "Yes", "No",
> "Cancel" },
> 2);
> final int answer = dialog.open();
> switch (answer) {
> case -1:
> /* no selection provided */
> break;
> case 0:
> /* dialog action - yes */
> final boolean status =
> runAction(ClientsideActionsContributor.ON_BEFORE_DELETE_RECORD_EVENT);
> if (status) {
> ((DatasetController) getDatasetBroadcast())
> .setActionState(BusinessObject.ACTION_DELETE);
> ((DatasetController)
> getDatasetBroadcast()).performDelete();
> refreshRecordAction();
> }
>
> runAction(ClientsideActionsContributor.ON_AFTER_DELETE_RECORD_EVENT);
> break;
> case 1:
> /* dialog action - no */
> break;
> case 2:
> /* dialog action - cancel */
> break;
> }
>
>
> the above code snippet did work as expected in 1.4, but with 1.5M5 the
> dialog's modal behavior remains, even after closing the dialog.
>
> i also have custom dialogs like "SetupCustomEditorDialog" extends the
> Dialog, which works as expected with modal behavior in 1.5M5. (after
> closing the dialog, UI become responsive)
>
> also, if i refresh the page while frozen after the dialog, i get the
> following errors in console :
>
>
>
> osgi> 2012-02-08 23:59:10.446:INFO:oejs.Server:jetty-8.1.0.RC4
> 2012-02-08 23:59:14.045:INFO:oejs.AbstractConnector:Started
> SelectChannelConnector@0.0.0.0:50140 STARTING
> diff - -132
> 2012-02-09 00:00:55.714:WARN:/:ERROR: Exception while executing
> dispose-listener.
> java.lang.UnsupportedOperationException
> at
> org.eclipse.rwt.internal.lifecycle.FakeContextUtil$RequestInvocationHandler.invoke(FakeContextUtil.java:119)
> at $Proxy2.getParameter(Unknown Source)
> at
> org.eclipse.rwt.internal.textsize.MeasurementOperator.requestContainsMeasurementResult(MeasurementOperator.java:154)
> at
> org.eclipse.rwt.internal.textsize.MeasurementOperator.addItemToMeasure(MeasurementOperator.java:87)
> at
> org.eclipse.rwt.internal.textsize.MeasurementUtil.addItemToMeasure(MeasurementUtil.java:68)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.addItemToMeasure(TextSizeUtil.java:125)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.determineTextSize(TextSizeUtil.java:84)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.stringExtent(TextSizeUtil.java:33)
> at org.eclipse.rwt.graphics.Graphics.stringExtent(Graphics.java:330)
> at org.eclipse.swt.widgets.Button.computeSize(Button.java:392)
> at
> org.eclipse.jface.dialogs.Dialog.setButtonLayoutData(Dialog.java:934)
> at org.eclipse.jface.dialogs.Dialog.createButton(Dialog.java:619)
> at
> org.eclipse.jface.dialogs.MessageDialog.createButton(MessageDialog.java:486)
> at
> org.eclipse.jface.dialogs.MessageDialog.createButtonsForButtonBar(MessageDialog.java:231)
> at
> org.eclipse.jface.dialogs.IconAndMessageDialog.createButtonBar(IconAndMessageDialog.java:172)
> at
> org.eclipse.jface.dialogs.IconAndMessageDialog.createDialogAndButtonArea(IconAndMessageDialog.java:219)
> at
> org.eclipse.jface.dialogs.IconAndMessageDialog.createContents(IconAndMessageDialog.java:198)
> at org.eclipse.jface.window.Window.create(Window.java:444)
> at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1071)
> at org.eclipse.jface.window.Window.open(Window.java:806)
> at
> org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:334)
> at
> com.wface.entrypoint._rap.ApplicationWorkbenchAdvisor.preShutdown(ApplicationWorkbenchAdvisor.java:47)
> at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1075)
> at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1072)
> at org.eclipse.ui.internal.Workbench$22.run(Workbench.java:1338)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
> at org.eclipse.ui.internal.Workbench.close(Workbench.java:1336)
> at org.eclipse.ui.internal.Workbench.close(Workbench.java:1298)
> at
> org.eclipse.ui.internal.Workbench$ShutdownHandler.handleEvent(Workbench.java:388)
> at org.eclipse.swt.widgets.Display.sendDisposeEvent(Display.java:703)
> at org.eclipse.swt.widgets.Display.release(Display.java:680)
> at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
> at
> org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:297)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)
> !SESSION 2012-02-08 23:59:08.124
> -----------------------------------------------
> eclipse.buildId=unknown
> java.version=1.6.0_25
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
> Command-line arguments: -dev
> file:C:/accbldr/ws/.metadata/.plugins/org.eclipse.pde.core/accbldr/dev.properties
> -os win32 -ws win32 -arch x86_64 -consoleLog -console -data
> C:\accbldr\ws/.metadata/.plugins/org.eclipse.rap.ui.launch/accbldr
>
> !ENTRY org.eclipse.ui.workbench 4 0 2012-02-09 00:00:55.731
> !MESSAGE Widget disposed too early!
> !STACK 0
> java.lang.RuntimeException: Widget disposed too early!
> at
> org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:175)
> at
> org.eclipse.swt.events.DisposeEvent.dispatchToObserver(DisposeEvent.java:63)
> at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)
> at
> org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:166)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:774)
> at
> org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
> at
> org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
> at
> org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
> at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1097)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:777)
> at org.eclipse.swt.widgets.Display.disposeShells(Display.java:717)
> at org.eclipse.swt.widgets.Display.release(Display.java:681)
> at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
> at
> org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:297)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)
>
>
>
>
> Is this a bug in 1.5M5 ? Kindly advise me how to resolve.
>
> Regards,
> Sudesh
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Dialog Frozen Behavior [message #799336 is a reply to message #793975] Wed, 15 February 2012 19:18 Go to previous messageGo to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello Ivan,

I've found something interesting on this case.
The frozen behavior of the dialog only exist, when calling the dialog using following code snippet :

		_deleteRecordAction.addHyperlinkListener(new HyperlinkAdapter() {
			@Override
			public void linkActivated(final HyperlinkEvent e) {
				if (_deleteRecordAction.isEnabled()) {
					final UIJob job = new UIJob("") {
						@Override
						public IStatus runInUIThread(
								final IProgressMonitor monitor) {
                                                        deleteRecordAction(); // This is the method that invokes the message dialog
							return Status.OK_STATUS;
						}
					};
					job.setUser(true);
					job.schedule();					
				}
			}
		});


if i remove the UIJob and just call the deleteRecordAction(), it works as expected.

Regards,
Sudesh Bulathsinhala
Re: Dialog Frozen Behavior [message #799340 is a reply to message #793975] Wed, 15 February 2012 19:18 Go to previous messageGo to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello Ivan,

I've found something interesting on this case.
The frozen behavior of the dialog only exist, when calling the dialog using following code snippet :


_deleteRecordAction.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(final HyperlinkEvent e) {
if (_deleteRecordAction.isEnabled()) {
final UIJob job = new UIJob("") {
@Override
public IStatus runInUIThread(
final IProgressMonitor monitor) {
deleteRecordAction(); // This is the method that invokes the message dialog
return Status.OK_STATUS;
}
};
job.setUser(true);
job.schedule();
}
}
});


if i remove the UIJob and just call the deleteRecordAction(), it works as expected.

Regards,
Sudesh Bulathsinhala
Re: Dialog Frozen Behavior [message #799347 is a reply to message #799340] Wed, 15 February 2012 19:28 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Sudesh,
thanks for your findings. Could you please create a self-running
snippet/project and attach it to the bug?
Thanks,
Ivan

On 2/15/2012 9:18 PM, Sudesh Bulathsinhala wrote:
> Hello Ivan,
>
> I've found something interesting on this case.
> The frozen behavior of the dialog only exist, when calling the dialog
> using following code snippet :
>
>
> _deleteRecordAction.addHyperlinkListener(new HyperlinkAdapter() {
> @Override
> public void linkActivated(final HyperlinkEvent e) {
> if (_deleteRecordAction.isEnabled()) {
> final UIJob job = new UIJob("") {
> @Override
> public IStatus runInUIThread(
> final IProgressMonitor monitor) {
>
> deleteRecordAction(); // This is the method that invokes the message
> dialog
> return Status.OK_STATUS;
> }
> };
> job.setUser(true);
> job.schedule();
> }
> }
> });
>
>
> if i remove the UIJob and just call the deleteRecordAction(), it works
> as expected.
>
> Regards,
> Sudesh Bulathsinhala

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Dialog Frozen Behavior [message #799915 is a reply to message #799347] Thu, 16 February 2012 13:16 Go to previous messageGo to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
hello Ivan,
i've attached simple project with RAP mail demo to the reported bug - https://bugs.eclipse.org/bugs/show_bug.cgi?id=370139, where Open Message action will trigger the frozen behavior.

regards,
sudesh bulathsinhala
Re: Dialog Frozen Behavior [message #799922 is a reply to message #799347] Thu, 16 February 2012 13:16 Go to previous messageGo to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
hello Ivan,
i've attached simple project with RAP mail demo to the reported bug - https://bugs.eclipse.org/bugs/show_bug.cgi?id=370139, where Open Message action will trigger the frozen behavior.

regards,
sudesh bulathsinhala
Re: Dialog Frozen Behavior [message #800697 is a reply to message #799922] Fri, 17 February 2012 11:14 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Great. Thanks for your help, Sudesh!

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Dialog Frozen Behavior
Next Topic:Building large modular application
Goto Forum:
  


Current Time: Tue Oct 19 07:08:37 GMT 2021

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

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

Back to the top