1 11 package org.eclipse.jdt.internal.debug.ui; 12 13 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.debug.core.model.IBreakpoint; 16 import org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint; 17 import org.eclipse.jdt.debug.core.IJavaThread; 18 import org.eclipse.ui.IActionFilter; 19 20 24 public class JavaThreadActionFilter implements IActionFilter { 25 26 public boolean testAttribute(Object target, String name, String value) { 27 if (target instanceof IJavaThread) { 28 if (name.equals("TerminateEvaluationActionFilter") && value.equals("supportsTerminateEvaluation")) { IJavaThread thread = (IJavaThread) target; 31 return thread.isPerformingEvaluation(); 32 } else if (name.equals("ExcludeExceptionLocationFilter") && value.equals("suspendedAtException")) { IJavaThread thread = (IJavaThread) target; 35 IBreakpoint[] breakpoints= thread.getBreakpoints(); 36 for (int i = 0; i < breakpoints.length; i++) { 37 IBreakpoint breakpoint= breakpoints[i]; 38 try { 39 if (breakpoint.isRegistered() && breakpoint instanceof IJavaExceptionBreakpoint) { 40 return true; 41 } 42 } catch (CoreException e) { 43 } 44 } 45 } 46 47 } 48 return false; 49 } 50 } 51 | Popular Tags |