1 11 package org.eclipse.jdt.internal.debug.ui.sourcelookup; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.jdt.core.IType; 15 import org.eclipse.jdt.debug.core.IJavaStackFrame; 16 import org.eclipse.jdt.internal.debug.core.JavaDebugUtils; 17 import org.eclipse.jface.viewers.StructuredSelection; 18 import org.eclipse.ui.part.IShowInSource; 19 import org.eclipse.ui.part.ShowInContext; 20 21 25 public class StackFrameShowInSourceAdapter implements IShowInSource { 26 27 private IJavaStackFrame fFrame; 28 29 34 public StackFrameShowInSourceAdapter(IJavaStackFrame frame) { 35 fFrame = frame; 36 } 37 38 41 public ShowInContext getShowInContext() { 42 try { 43 IType type = JavaDebugUtils.resolveDeclaringType(fFrame); 44 if (type != null) { 45 return new ShowInContext(null, new StructuredSelection(type)); 46 } 47 } catch (CoreException e) { 48 } 49 return null; 50 } 51 52 } 53 | Popular Tags |