Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/actions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5832/src_navigator/org/python/pydev/navigator/actions
Modified Files:
PythonLinkHelper.java
Log Message:
Linking working in the compare editor
bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2002654&group_id=85796&atid=577329
Index: PythonLinkHelper.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/actions/PythonLinkHelper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PythonLinkHelper.java 7 Jul 2007 12:06:02 -0000 1.2
--- PythonLinkHelper.java 30 Jun 2008 00:29:06 -0000 1.3
***************
*** 6,9 ****
--- 6,10 ----
import org.eclipse.core.resources.IFile;
+ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
***************
*** 27,30 ****
--- 28,39 ----
return new StructuredSelection(((IFileEditorInput) anInput).getFile());
}
+ if(anInput instanceof IAdaptable){
+ //handles org.eclipse.compare.CompareEditorInput without a specific reference to it
+ Object adapter = anInput.getAdapter(IFile.class);
+ if(adapter != null){
+ return new StructuredSelection(adapter);
+ }
+ }
+
return StructuredSelection.EMPTY;
}
|