plugins/org.symbian.tools.tmw.ui/src/org/symbian/tools/tmw/internal/ui/project/ProjectTemplateImpl.java
changeset 473 8e8aed9adb99
parent 470 d4809db37847
child 477 b616697678bf
--- a/plugins/org.symbian.tools.tmw.ui/src/org/symbian/tools/tmw/internal/ui/project/ProjectTemplateImpl.java	Mon Aug 23 10:30:05 2010 -0700
+++ b/plugins/org.symbian.tools.tmw.ui/src/org/symbian/tools/tmw/internal/ui/project/ProjectTemplateImpl.java	Mon Aug 23 15:08:34 2010 -0700
@@ -18,7 +18,6 @@
  */
 package org.symbian.tools.tmw.internal.ui.project;
 
-import java.lang.reflect.InvocationTargetException;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -28,12 +27,9 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.common.project.facet.core.IProjectFacet;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -144,27 +140,13 @@
             monitor.beginTask("Copying project files", files.length * 10);
             templateInstaller.copyFiles(files, new SubProgressMonitor(monitor, files.length * 10));
             final IRunnableWithProgress action = templateInstaller.getPostCreateAction();
-            if (action != null) {
-                Display.getDefault().asyncExec(new Runnable() {
-                    public void run() {
-                        ProgressMonitorDialog dialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
-                                .getActiveWorkbenchWindow().getShell());
-                        try {
-                            dialog.run(false, true, action);
-                        } catch (InvocationTargetException e) {
-                            TMWCoreUI.log(e);
-                        } catch (InterruptedException e) {
-                            TMWCoreUI.log(e);
-                        }
-                    }
-                });
-            }
+            monitor.done();
+            new PrepareProjectJob(project, action).schedule();
         } catch (CoreException e) {
             TMWCoreUI.log(e);
         } finally {
             templateInstaller.cleanup();
         }
-        monitor.done();
     }
 
     public Map<String, String> getDefaultParameterValues() {