Community
Participate
Working Groups
This bug was initially opened as https://issues.jboss.org/browse/JBIDE-16616 {quote} STEP: Open Maven Project STEP: Click on the button Next in New Maven Project dialog (now you are in Select an Archetype page) ASSERT: Job "Retrieving archetypes:" is running (This need to be done before the job ends) STEP: Use filter to get an archetype (e.g. type "org.jboss.portletbridge" or just "portletbridge") STEP: Select one from the table and click on the button Next STEP: Fill text fields Group Id and Artifact Id ASSERT: Button Finish is enabled STEP: Wait until job ends ASSERT: Button Finish is still enabled FAIL: Button Finish is now disabled {quote} While trying to reproduce, I saw on one occasion the archetype I selected was literally changed to the simple maven quickstart archetype.
Additionally, an error occurs if the wizard finsihes before the "retrieving archetypes" job completes : !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Need an underlying widget to be able to set the input.(Has the widget been disposed?)) at org.eclipse.swt.SWT.error(SWT.java:4441) at org.eclipse.swt.SWT.error(SWT.java:4356) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) at org.eclipse.jface.window.Window.runEventLoop(Window.java:832) at org.eclipse.jface.window.Window.open(Window.java:808) at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:341) at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:371) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:434) at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$6$1.run(MavenProjectWizard.java:258) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:630) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:574) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1462) at org.eclipse.equinox.launcher.Main.main(Main.java:1438) Caused by: java.lang.IllegalStateException: Need an underlying widget to be able to set the input.(Has the widget been disposed?) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1704) at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage.updateViewer(MavenProjectWizardArchetypePage.java:682) at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage$15$3.run(MavenProjectWizardArchetypePage.java:583) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
Fixed with http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=3b9e42f946dc2b5560a86f3895492938e1e3fcc7
Curious, why not use getContainer().run(...) to make running operation visible to the user? I think this will also simplify (as in "eliminate") job synchronization logic.
I honestly didn't even think about it. But you're right, and it provides better feedback. I'll update the fix some time over the week end.
Actually I don't quite like the result : http://screencast.com/t/WlxXEj5k0heR all widgets are disabled during process, and given we can't really interrupt a given catalog processing, this is a very unpleasant UX
Not changing to getContainer().run as it degrades the UX.
Moved to https://github.com/eclipse-m2e/m2e-core/issues/