[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.albireo] Re: JOptionPane and dispose() problems

This sounds like a bug that was fixed in the code after the most recent release. Basically the call to forceActive() from SwtInputBlocker needs to be wrapped in an if statement that makes sure the shell has not been disposed. (More info: http://dev.eclipse.org/mhonarc/lists/albireo-dev/msg00250.html)

If you check out the most recent source code from CVS and build it, you'll have the fix.

Meanwhile, I guess it's about time to release a new version of the code. I'll try to get to that in the next week or so.

Stephan Nagy wrote:
Hi,

We recently switched from our much hacked on EmbeddedSwingComposite to Alberio, and I'm happy to say many of the problems we had experienced have gone away. However, we have encountered a new problem that we are a bit puzzled by.

When we spawn JOptionPane from our SwingControl we get the stack at the end of this email dispose. We hacked on the JOptionPane and replaced

dialog.show();
dialog.dispose();

with

        dialog.setVisible(true);
        dialog.setVisible(false);
        SwingUtilities.invokeLater(new Runnable() {public void run() {
            dialog.dispose();
        }});

which makes the problem go away, but isn't really an acceptable solution. Any thoughts or ideas on how we might avoid the problem?

org.eclipse.swt.SWTException: Widget is disposed

      at org.eclipse.swt.SWT.error(SWT.java:3563)

      at org.eclipse.swt.SWT.error(SWT.java:3481)

      at org.eclipse.swt.SWT.error(SWT.java:3452)

      at org.eclipse.swt.widgets.Widget.error(Widget.java:432)

      at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:325)

      at org.eclipse.swt.widgets.Shell.forceActive(Shell.java:806)

      at org.eclipse.albireo.internal.SwtInputBlocker.open(Unknown Source)

      at org.eclipse.albireo.internal.SwtInputBlocker.block(Unknown Source)

at org.eclipse.albireo.internal.AwtDialogListener$2.run(Unknown Source)

      at org.eclipse.albireo.core.ThreadingHandler$1.run(Unknown Source)

      at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129)


at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)


      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)

      at org.eclipse.swing.integration.SwtInputBlocker.open(Unknown Source)

at org.eclipse.swing.integration.SwtInputBlocker.block(Unknown Source)

at org.eclipse.swing.integration.AwtDialogListener$2.run(Unknown Source)

      at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129)


at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)


      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)

      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)

      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)

      at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)


at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)


at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at com.tripos.nexus.application.NexusApplication.start(Unknown Source)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)


at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)



at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)



at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)



at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)



at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)

      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)

      at org.eclipse.equinox.launcher.Main.run(Main.java:1173)

      at org.eclipse.equinox.launcher.Main.main(Main.java:1148)