1 11 package org.eclipse.jdt.internal.debug.ui.threadgroups; 12 13 import org.eclipse.core.runtime.IAdapterFactory; 14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider; 16 import org.eclipse.jdt.debug.core.IJavaThreadGroup; 17 18 21 public class ThreadGroupAdapterFactory implements IAdapterFactory{ 22 23 24 private static IElementContentProvider fgCPThreadGroup = new JavaThreadGroupContentProvider(); 25 private static IElementLabelProvider fgLPThreadGroup = new JavaThreadGroupLabelProvider(); 26 27 30 public Object getAdapter(Object adaptableObject, Class adapterType) { 31 32 if (adapterType.equals(IElementContentProvider.class)) { 33 if (adaptableObject instanceof IJavaThreadGroup) { 34 return fgCPThreadGroup; 35 } 36 } 37 if (adapterType.equals(IElementLabelProvider.class)) { 38 if (adaptableObject instanceof IJavaThreadGroup) { 39 return fgLPThreadGroup; 40 } 41 } 42 return null; 43 } 44 45 48 public Class [] getAdapterList() { 49 return new Class []{ 50 IElementContentProvider.class, 51 IElementLabelProvider.class}; 52 } 53 54 } 55 | Popular Tags |