fix browse button in create new PHP file wizard
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / PHPFileWizardPage.java
index eb48f26..ec91d2b 100644 (file)
@@ -9,11 +9,9 @@ package net.sourceforge.phpeclipse.wizards;
 
  Contributors:
  IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
+ www.phpeclipse.de
  **********************************************************************/
 
-import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
-
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -127,7 +125,7 @@ public class PHPFileWizardPage extends WizardPage {
         containerText.setText(container.getFullPath().toString());
       }
     }
-    fileText.setText("index.php");
+    fileText.setText("*.php");
   }
 
   /**
@@ -140,10 +138,13 @@ public class PHPFileWizardPage extends WizardPage {
         ResourcesPlugin.getWorkspace().getRoot(), false, PHPWizardMessages
             .getString("WizardPage.selectNewFileContainer"));
     if (dialog.open() == ContainerSelectionDialog.OK) {
-      Object[] result = dialog.getResult();
-      if (result.length == 1) {
-        IContainer container = (IContainer) result[0];
-        containerText.setText(container.getFullPath().toString());
+      Object[] results = dialog.getResult();
+      if (results.length == 1) {
+         Object result=results[0];
+         if (result instanceof IPath) {
+                 IPath ipath = (IPath) result;
+                 containerText.setText(ipath.toString());
+         }
       }
     }
   }
@@ -165,10 +166,10 @@ public class PHPFileWizardPage extends WizardPage {
       return;
     }
 
-    if (!PHPFileUtil.isPHPFileName(fileName)) {
-      updateStatus(PHPWizardMessages.getString("WizardPage.mustBePHP"));
-      return;
-    }
+//    if (!PHPFileUtil.isPHPFileName(fileName)) {
+//      updateStatus(PHPWizardMessages.getString("WizardPage.mustBePHP"));
+//      return;
+//    }
     updateStatus(null);
   }