1 11 package org.eclipse.jdt.internal.debug.ui.monitors; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; 16 17 22 public class OwningThreadContentProvider extends JavaElementContentProvider { 23 24 27 protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { 28 if (((JavaOwningThread)element).getContendedMonitor() != null) { 29 return 1; 30 } 31 return 0; 32 } 33 34 37 protected Object [] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { 38 JavaContendedMonitor contendedMonitor= ((JavaOwningThread)parent).getContendedMonitor(); 39 if (contendedMonitor == null) { 40 return EMPTY; 41 } 42 return new Object []{contendedMonitor}; 43 } 44 45 } 46 | Popular Tags |