Delete association of htmledit.gif for the PHPUnitEditor
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.ui / src / net / sourceforge / phpdt / internal / debug / ui / launcher / PHPLaunchShortcut.java
index ec84fd5..53b337f 100644 (file)
@@ -7,6 +7,7 @@ import net.sourceforge.phpdt.debug.ui.PHPDebugUiConstants;
 import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages;
 import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin;
 import net.sourceforge.phpdt.internal.launching.PHPLaunchConfigurationAttribute;
+import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
@@ -26,16 +27,12 @@ import org.eclipse.ui.IEditorPart;
 public class PHPLaunchShortcut implements ILaunchShortcut {
        public PHPLaunchShortcut() {
        }
-
        public void launch(ISelection selection, String mode)  {
-               if (selection instanceof IStructuredSelection) {
+               if (selection instanceof IStructuredSelection) { 
                        Object firstSelection = ((IStructuredSelection)selection).getFirstElement();
-                       if (firstSelection instanceof IFile) {
-                               if (
-             ((IFile) firstSelection).getFileExtension().equals("php") ||
-             ((IFile) firstSelection).getFileExtension().equals("php3") ||
-             ((IFile) firstSelection).getFileExtension().equals("php4")
-            ) {
+                       if (firstSelection instanceof IFile) { 
+                               if (PHPFileUtil.isPHPFile((IFile) firstSelection)) {
                                        ILaunchConfiguration config = findLaunchConfiguration((IFile)firstSelection, mode);
                                        try {
                                                if (config != null)