1 11 package org.eclipse.jdt.internal.debug.ui.actions; 12 13 import org.eclipse.debug.ui.DebugPopup; 14 import org.eclipse.debug.ui.InspectPopupDialog; 15 import org.eclipse.jdt.debug.eval.IEvaluationResult; 16 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 17 import org.eclipse.jdt.internal.debug.ui.display.JavaInspectExpression; 18 import org.eclipse.swt.custom.StyledText; 19 import org.eclipse.ui.IWorkbenchPart; 20 21 public class PopupInspectAction extends InspectAction { 22 23 public static final String ACTION_DEFININITION_ID = "org.eclipse.jdt.debug.ui.commands.Inspect"; 25 JavaInspectExpression expression; 26 27 30 protected void displayResult(final IEvaluationResult result) { 31 IWorkbenchPart part = getTargetPart(); 32 final StyledText styledText = getStyledText(part); 33 if (styledText == null) { 34 super.displayResult(result); 35 } else { 36 expression = new JavaInspectExpression(result); 37 JDIDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable () { 38 public void run() { 39 showPopup(styledText); 40 } 41 }); 42 } 43 44 evaluationCleanup(); 45 } 46 47 protected void showPopup(StyledText textWidget) { 48 DebugPopup displayPopup = new InspectPopupDialog(getShell(), getPopupAnchor(textWidget), ACTION_DEFININITION_ID, expression); 49 displayPopup.open(); 50 } 51 52 } 53 | Popular Tags |