25 import java.util.Set; |
25 import java.util.Set; |
26 |
26 |
27 import org.eclipse.core.databinding.DataBindingContext; |
27 import org.eclipse.core.databinding.DataBindingContext; |
28 import org.eclipse.core.resources.IncrementalProjectBuilder; |
28 import org.eclipse.core.resources.IncrementalProjectBuilder; |
29 import org.eclipse.core.runtime.CoreException; |
29 import org.eclipse.core.runtime.CoreException; |
|
30 import org.eclipse.core.runtime.IConfigurationElement; |
|
31 import org.eclipse.core.runtime.IExecutableExtension; |
30 import org.eclipse.core.runtime.IPath; |
32 import org.eclipse.core.runtime.IPath; |
31 import org.eclipse.core.runtime.IProgressMonitor; |
33 import org.eclipse.core.runtime.IProgressMonitor; |
32 import org.eclipse.core.runtime.SubProgressMonitor; |
34 import org.eclipse.core.runtime.SubProgressMonitor; |
33 import org.eclipse.jface.viewers.IStructuredSelection; |
35 import org.eclipse.jface.viewers.IStructuredSelection; |
34 import org.eclipse.jface.wizard.IWizardPage; |
36 import org.eclipse.jface.wizard.IWizardPage; |
|
37 import org.eclipse.swt.widgets.Display; |
35 import org.eclipse.ui.INewWizard; |
38 import org.eclipse.ui.INewWizard; |
36 import org.eclipse.ui.IWorkbench; |
39 import org.eclipse.ui.IWorkbench; |
|
40 import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; |
37 import org.eclipse.wst.common.project.facet.core.IFacetedProject; |
41 import org.eclipse.wst.common.project.facet.core.IFacetedProject; |
38 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action; |
42 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action; |
39 import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy; |
43 import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy; |
40 import org.eclipse.wst.common.project.facet.core.IProjectFacet; |
44 import org.eclipse.wst.common.project.facet.core.IProjectFacet; |
41 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; |
45 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; |
53 /** |
57 /** |
54 * This is the wizard that guides through new mobile application project creation. |
58 * This is the wizard that guides through new mobile application project creation. |
55 * |
59 * |
56 * @author Eugene Ostroukhov (eugeneo@symbian.org) |
60 * @author Eugene Ostroukhov (eugeneo@symbian.org) |
57 */ |
61 */ |
58 public final class NewApplicationWizard extends ModifyFacetedProjectWizard implements INewWizard { |
62 public final class NewApplicationWizard extends ModifyFacetedProjectWizard implements INewWizard, IExecutableExtension { |
59 public static final String ID = "org.symbian.tools.tmw.newproject"; |
63 public static final String ID = "org.symbian.tools.tmw.newproject"; |
60 |
64 |
61 private final PageContributions contributions = new PageContributions(); |
65 private final PageContributions contributions = new PageContributions(); |
62 private final DataBindingContext databindingContext = new DataBindingContext(); |
66 private final DataBindingContext databindingContext = new DataBindingContext(); |
63 private IWizardPage[] staticPages; |
67 private IWizardPage[] staticPages; |
140 return nextPage; |
144 return nextPage; |
141 } |
145 } |
142 |
146 |
143 private boolean reentry = false; |
147 private boolean reentry = false; |
144 private final Collection<IProjectFacetVersion> currentFacets = new HashSet<IProjectFacetVersion>(); |
148 private final Collection<IProjectFacetVersion> currentFacets = new HashSet<IProjectFacetVersion>(); |
|
149 private IConfigurationElement configElement; |
145 |
150 |
146 private Set<IProjectFacet> getCurrentFixedFacets() { |
151 private Set<IProjectFacet> getCurrentFixedFacets() { |
147 final Set<IProjectFacetVersion> fixedFacets = getCurrentFixedFacetVersions(); |
152 final Set<IProjectFacetVersion> fixedFacets = getCurrentFixedFacetVersions(); |
148 final Set<IProjectFacet> facets = new HashSet<IProjectFacet>(); |
153 final Set<IProjectFacet> facets = new HashSet<IProjectFacet>(); |
149 for (IProjectFacetVersion facet : fixedFacets) { |
154 for (IProjectFacetVersion facet : fixedFacets) { |
212 getFacetedProject().getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, |
217 getFacetedProject().getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, |
213 new SubProgressMonitor(monitor, 100)); |
218 new SubProgressMonitor(monitor, 100)); |
214 getFacetedProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, |
219 getFacetedProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, |
215 new SubProgressMonitor(monitor, 100)); |
220 new SubProgressMonitor(monitor, 100)); |
216 monitor.done(); |
221 monitor.done(); |
217 } |
222 Display.getDefault().asyncExec(new Runnable() { |
|
223 public void run() { |
|
224 BasicNewProjectResourceWizard.updatePerspective(configElement); |
|
225 } |
|
226 }); |
|
227 } |
|
228 |
|
229 public void setInitializationData(IConfigurationElement config, |
|
230 String propertyName, Object data) throws CoreException { |
|
231 configElement = config; |
|
232 } |
218 } |
233 } |