misc changes in the internal builder
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / PHPFileWizard.java
index 992f064..d172145 100644 (file)
@@ -37,6 +37,7 @@ import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
 
 /**
  * This wizard creates one file with the extension
@@ -134,7 +135,7 @@ public class PHPFileWizard extends Wizard implements INewWizard {
       public void run() {
         IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
         try {
-          page.openEditor(file);
+          IDE.openEditor(page,file,true);
         } catch (PartInitException e) {
         }
       }
@@ -153,7 +154,7 @@ public class PHPFileWizard extends Wizard implements INewWizard {
     final int precLastDot = fileName.lastIndexOf('.',lastDot-1);
     if (precLastDot == -1) return null;
     if (!fileName.substring(precLastDot+1,lastDot).toUpperCase().equals("CLASS")) return null;
-    return fileName.substring(0,precLastDot-1);
+    return fileName.substring(0,precLastDot);
   }
 
   /**