01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.wizards;
05:
06: import org.eclipse.jdt.core.IJavaProject;
07: import org.eclipse.jdt.internal.ui.wizards.JavaProjectWizard;
08: import org.eclipse.jface.dialogs.ProgressMonitorDialog;
09: import org.eclipse.swt.widgets.Shell;
10:
11: import org.terracotta.dso.TcPlugin;
12:
13: public class NewProjectWizard extends JavaProjectWizard {
14: public NewProjectWizard() {
15: super ();
16: }
17:
18: public boolean performFinish() {
19: boolean result = super .performFinish();
20:
21: if (result) {
22: IJavaProject javaProject = (IJavaProject) getCreatedElement();
23: ProjectWizard wizard = new ProjectWizard(javaProject);
24: Shell shell = getShell();
25:
26: try {
27: new ProgressMonitorDialog(shell).run(false, true,
28: wizard.getWorker());
29: } catch (Exception e) {
30: TcPlugin plugin = TcPlugin.getDefault();
31:
32: plugin.openError("Problem creating Terracotta project",
33: e);
34: plugin.removeTerracottaNature(javaProject);
35: }
36: }
37:
38: return result;
39: }
40: }
|