Fix java 1.4 VM compatibility.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / TempnewPHPProject.java
index d0ac04f..05cace3 100644 (file)
@@ -19,76 +19,85 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
 import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
 import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
 
-public class TempnewPHPProject extends BasicNewResourceWizard implements INewWizard {
-  /*
-   * This class has been added to cvs to provide a project page that works correctly and doesn't freezde while i investigate the
-   * errors completely
-   */
-  private WizardNewProjectCreationPage phpProjPage;
+public class TempnewPHPProject extends BasicNewResourceWizard implements
+               INewWizard {
+       /*
+        * This class has been added to cvs to provide a project page that works
+        * correctly and doesn't freezde while i investigate the errors completely
+        */
+       private WizardNewProjectCreationPage phpProjPage;
 
-  private IConfigurationElement fConfigElement;
+       private IConfigurationElement fConfigElement;
 
-  public TempnewPHPProject() {
-    setNeedsProgressMonitor(true);
-    setWindowTitle("New Project creation"); //$NON-NLS-1$
+       public TempnewPHPProject() {
+               setNeedsProgressMonitor(true);
+               setWindowTitle("New Project creation"); //$NON-NLS-1$
 
-  }
+       }
 
-  public void addPages() {
-    super.addPages();
-    phpProjPage = new WizardNewProjectCreationPage("NewProjectCreationWizard"); //$NON-NLS-1$
-    phpProjPage.setTitle(PHPWizardMessages.getString("WizardNewProjectCreationPage.pageTitle")); //$NON-NLS-1$
-    phpProjPage.setDescription(PHPWizardMessages.getString("WizardNewProjectCreationPage.pageDescription")); //$NON-NLS-1$
-    addPage(phpProjPage);
-  }
+       public void addPages() {
+               super.addPages();
+               phpProjPage = new WizardNewProjectCreationPage(
+                               "NewProjectCreationWizard"); //$NON-NLS-1$
+               phpProjPage.setTitle(PHPWizardMessages
+                               .getString("WizardNewProjectCreationPage.pageTitle")); //$NON-NLS-1$
+               phpProjPage.setDescription(PHPWizardMessages
+                               .getString("WizardNewProjectCreationPage.pageDescription")); //$NON-NLS-1$
+               addPage(phpProjPage);
+       }
 
-  public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
-    fConfigElement = cfig;
-  }
+       public void setInitializationData(IConfigurationElement cfig,
+                       String propertyName, Object data) {
+               fConfigElement = cfig;
+       }
 
-  protected void initializeDefaultPageImageDescriptor() {
-    // not used yet
-  }
+       protected void initializeDefaultPageImageDescriptor() {
+               // not used yet
+       }
 
-  protected void finishPage() throws InterruptedException, CoreException {
-    createProject(phpProjPage.getProjectHandle(), phpProjPage.getLocationPath(), new NullProgressMonitor());
-    BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
-    selectAndReveal(phpProjPage.getProjectHandle());
-  }
+       protected void finishPage() throws InterruptedException, CoreException {
+               createProject(phpProjPage.getProjectHandle(), phpProjPage
+                               .getLocationPath(), new NullProgressMonitor());
+               BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
+               selectAndReveal(phpProjPage.getProjectHandle());
+       }
 
-  protected void handleFinishException(Shell shell, InvocationTargetException e) {
-    ExceptionHandler.handle(e, getShell(), "Error title", "Error message");
-  }
+       protected void handleFinishException(Shell shell,
+                       InvocationTargetException e) {
+               ExceptionHandler.handle(e, getShell(), "Error title", "Error message");
+       }
 
-  public boolean performFinish() {
-    try {
-      finishPage();
-    } catch (InterruptedException e) {
-    } catch (CoreException e) {
-    }
-    return true;
-  }
+       public boolean performFinish() {
+               try {
+                       finishPage();
+               } catch (InterruptedException e) {
+               } catch (CoreException e) {
+               }
+               return true;
+       }
 
-  public void createProject(IProject project, IPath locationPath, IProgressMonitor monitor) throws CoreException {
-    try {
-      if (!project.exists()) {
-        IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName());
-        if (Platform.getLocation().equals(locationPath)) {
-          locationPath = null;
-        }
-        desc.setLocation(locationPath);
-        project.create(desc, monitor);
-        monitor = null;
-      }
-      if (!project.isOpen()) {
-        project.open(monitor);
-        monitor = null;
-      }
-      JavaCore.addPHPNature(project, new NullProgressMonitor());
-    } finally {
-      if (monitor != null) {
-        monitor.done();
-      }
-    }
-  }
+       public void createProject(IProject project, IPath locationPath,
+                       IProgressMonitor monitor) throws CoreException {
+               try {
+                       if (!project.exists()) {
+                               IProjectDescription desc = project.getWorkspace()
+                                               .newProjectDescription(project.getName());
+                               if (Platform.getLocation().equals(locationPath)) {
+                                       locationPath = null;
+                               }
+                               desc.setLocation(locationPath);
+                               project.create(desc, monitor);
+                               monitor = null;
+                       }
+                       if (!project.isOpen()) {
+                               project.open(monitor);
+                               monitor = null;
+                       }
+                       JavaCore.addPHPNature(project, new NullProgressMonitor());
+               } finally {
+                       if (monitor != null) {
+                               monitor.done();
+                       }
+               }
+       }
 }
\ No newline at end of file