X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPLaunchShortcut.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPLaunchShortcut.java index c33a7d0..53b337f 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPLaunchShortcut.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPLaunchShortcut.java @@ -3,6 +3,12 @@ package net.sourceforge.phpdt.internal.debug.ui.launcher; import java.util.ArrayList; import java.util.List; +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; import org.eclipse.core.runtime.Status; @@ -17,24 +23,16 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; -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; 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) @@ -107,10 +105,10 @@ public class PHPLaunchShortcut implements ILaunchShortcut { } protected void log(String message) { - PHPDebugUiPlugin.getDefault().log(new Status(Status.INFO, PHPDebugUiPlugin.PLUGIN_ID, Status.INFO, message, null)); + PHPDebugUiPlugin.log(new Status(Status.INFO, PHPDebugUiPlugin.PLUGIN_ID, Status.INFO, message, null)); } protected void log(Throwable t) { - PHPDebugUiPlugin.getDefault().log(t); + PHPDebugUiPlugin.log(t); } }