1 11 package org.eclipse.jdt.internal.debug.ui.threadgroups; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.Preferences; 15 import org.eclipse.debug.internal.ui.elements.adapters.DebugTargetContentAdapter; 16 import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext; 17 import org.eclipse.debug.ui.IDebugUIConstants; 18 import org.eclipse.jdt.debug.core.IJavaDebugTarget; 19 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants; 20 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 21 22 27 public class JavaDebugTargetContentAdapter extends DebugTargetContentAdapter { 28 29 protected Object [] getChildren(Object parent, IPresentationContext context) throws CoreException { 30 String id = context.getPart().getSite().getId(); 31 if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) { 32 if (isShowThreadGroups()) { 33 if (parent instanceof IJavaDebugTarget) { 34 IJavaDebugTarget target = (IJavaDebugTarget) parent; 35 return target.getRootThreadGroups(); 36 } 37 } 38 } 39 return super.getChildren(parent, context); 40 } 41 42 47 protected static boolean isShowThreadGroups() { 48 Preferences pluginPreferences = JDIDebugUIPlugin.getDefault().getPluginPreferences(); 49 return pluginPreferences.getBoolean(IJavaDebugUIConstants.PREF_SHOW_THREAD_GROUPS); 50 } 51 52 } 53 | Popular Tags |