1 11 package org.eclipse.jdt.internal.debug.ui; 12 13 import org.eclipse.core.runtime.IStatus; 14 import org.eclipse.debug.core.IStatusHandler; 15 import org.eclipse.debug.core.model.IDebugElement; 16 import org.eclipse.jdt.debug.core.IJavaDebugTarget; 17 import org.eclipse.jdt.debug.core.IJavaStackFrame; 18 import org.eclipse.ui.IWorkbenchWindow; 19 20 27 public class EvaluationContextStatusHandler implements IStatusHandler { 28 29 32 public Object handleStatus(IStatus status, Object source) { 33 if (source instanceof IDebugElement) { 34 IDebugElement element = (IDebugElement) source; 35 IJavaDebugTarget target = (IJavaDebugTarget) element.getDebugTarget().getAdapter(IJavaDebugTarget.class); 36 if (target != null) { 37 IJavaStackFrame frame = EvaluationContextManager.getEvaluationContext((IWorkbenchWindow)null); 38 if (frame != null && frame.getDebugTarget().equals(target)) { 39 return frame.getThread(); 40 } 41 } 42 } 43 return null; 44 } 45 46 } 47 | Popular Tags |