1 11 package org.eclipse.jdt.internal.debug.ui.threadgroups; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.internal.ui.model.elements.DebugTargetContentProvider; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; 16 import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; 17 import org.eclipse.debug.ui.IDebugUIConstants; 18 import org.eclipse.jdt.debug.core.IJavaDebugTarget; 19 import org.eclipse.jdt.internal.debug.ui.monitors.JavaElementContentProvider; 20 21 24 public class JavaDebugTargetContentProvider extends DebugTargetContentProvider { 25 26 29 protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { 30 if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { 31 if (JavaElementContentProvider.isDisplayThreadGroups()) { 32 IJavaDebugTarget debugTarget = (IJavaDebugTarget)element; 33 if (debugTarget.isDisconnected() || debugTarget.isTerminated()) { 34 return 0; 35 } 36 return debugTarget.getRootThreadGroups().length; 37 } 38 } 39 return super.getChildCount(element, context, monitor); 40 } 41 42 45 protected Object [] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { 46 if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { 47 if (JavaElementContentProvider.isDisplayThreadGroups()) { 48 return getElements(((IJavaDebugTarget)parent).getRootThreadGroups(), index, length); 49 } 50 } 51 return super.getChildren(parent, index, length, context, monitor); 52 } 53 54 } 55 | Popular Tags |