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;
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") ||
- ((IFile) firstSelection).getFileExtension().equals("php5")
- ) {
+ if (firstSelection instanceof IFile) {
+ if (PHPFileUtil.isPHPFile((IFile) firstSelection)) {
ILaunchConfiguration config = findLaunchConfiguration((IFile)firstSelection, mode);
try {
if (config != null)