improved PHP parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / wizards / NewClassCreationWizard.java
index a98164c..efb355c 100644 (file)
  *******************************************************************************/
 package net.sourceforge.phpdt.internal.ui.wizards;
 
+import net.sourceforge.phpdt.core.ICompilationUnit;
+import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil;
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import net.sourceforge.phpdt.ui.wizards.NewClassWizardPage;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 
@@ -41,16 +45,16 @@ public class NewClassCreationWizard extends NewElementWizard {
 
 
        /* (non-Javadoc)
-        * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
+        * @see net.sourceforge.phpdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
         */
        protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
-//             fPage.createType(monitor); // use the full progress monitor
-//             ICompilationUnit cu= JavaModelUtil.toOriginal(fPage.getCreatedType().getCompilationUnit());
-//             if (cu != null) {
-//                     IResource resource= cu.getResource();
-//                     selectAndReveal(resource);
-//                     openResource((IFile) resource);
-//             }       
+               fPage.createType(monitor); // use the full progress monitor
+               ICompilationUnit cu= JavaModelUtil.toOriginal(fPage.getCreatedType().getCompilationUnit());
+               if (cu != null) {
+                       IResource resource= cu.getResource();
+                       selectAndReveal(resource);
+                       openResource((IFile) resource);
+               }       
        }
        
        /* (non-Javadoc)