3
* Created on Apr 23, 2004
4
* License: Common Public License v1.0
6
package org.python.pydev.debug.model;
8
import org.eclipse.core.runtime.IPath;
9
import org.eclipse.debug.core.model.ISourceLocator;
10
import org.eclipse.debug.core.model.IStackFrame;
11
import org.eclipse.debug.ui.ISourcePresentation;
12
import org.eclipse.ui.IEditorInput;
13
import org.python.pydev.editor.PyEdit;
14
import org.python.pydev.plugin.PydevPlugin;
17
* Locates source files from stack elements
20
public class PySourceLocator implements ISourceLocator, ISourcePresentation {
22
public Object getSourceElement(IStackFrame stackFrame) {
27
public IEditorInput getEditorInput(Object element) {
28
IEditorInput edInput = null;
29
if (element instanceof PyStackFrame) {
31
IPath path = ((PyStackFrame)element).getPath();
33
if (path != null && !path.toString().startsWith("<")){
34
edInput = PydevPlugin.createEditorInput(path);
42
public String getEditorId(IEditorInput input, Object element) {
43
return PyEdit.EDITOR_ID;