package org.python.pydev.debug.ui;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IAdaptable;
import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper;
import org.python.pydev.navigator.elements.IWrappedResource;

public class PythonTypePropertyTester extends PropertyTester {

    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
        IFile iFile = getIFile(receiver);
        if (iFile != null) {
            if (PythonPathHelper.markAsPyDevFileIfDetected(iFile)) {
                return true;
            }
        }
        return false;
    }

    private IFile getIFile(Object receiver) {
        if (receiver instanceof IWrappedResource) {
            IWrappedResource wrappedResource = (IWrappedResource) receiver;
            Object actualObject = wrappedResource.getActualObject();
            if (actualObject instanceof IFile) {
                return (IFile) actualObject;
            }
        }
        if (receiver instanceof IAdaptable) {
            IAdaptable iAdaptable = (IAdaptable) receiver;
            return (IFile) iAdaptable.getAdapter(IFile.class);
        }
        return null;
    }

}

@@ -118,24 +118,68 @@
 rces.IFile;%0A
+import org.eclipse.core.resources.IProject;%0A
 import org.e
@@ -503,24 +503,25 @@
 tedValue) %7B%0A
+%0A
         IFil
@@ -534,253 +534,14 @@
 e = 
-getIFile(receiver);%0A        if (iFile != null) %7B%0A            if (PythonPathHelper.markAsPyDevFileIfDetected(iFile)) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A    private IFile getIFile(Object receiver) %7B
+null;%0A
 %0A   
@@ -775,20 +775,23 @@
 anceof I
-File
+Project
 ) %7B%0A    
@@ -800,32 +800,118 @@
           return
+ true;%0A            %7D else if (actualObject instanceof IFile) %7B%0A                iFile =
  (IFile) actualO
@@ -1058,22 +1058,23 @@
         
-return
+iFile =
  (IFile)
@@ -1124,27 +1124,180 @@
   %7D%0A
-        return null
+%0A        if (iFile != null) %7B%0A            if (PythonPathHelper.markAsPyDevFileIfDetected(iFile)) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false
 ;%0A  

Allow Pydev launch shortcuts from context of Pydev project selection.