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.provisional.IAsynchronousContentAdapter; 15 import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapter; 16 import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter; 17 import org.eclipse.jdt.debug.core.IJavaDebugTarget; 18 import org.eclipse.jdt.debug.core.IJavaThreadGroup; 19 20 24 public class JavaDebugElementLabelAdapterFactory implements IAdapterFactory{ 25 26 private static IAsynchronousLabelAdapter fgThreadGroupLabelAdapter = new JavaThreadGroupLabelAdapter(); 27 private static IAsynchronousContentAdapter fgThreadGroupTreeAdapter = new JavaThreadGroupContentAdapter(); 28 private static IAsynchronousContentAdapter fgTargetTreeAdapter = new JavaDebugTargetContentAdapter(); 29 private static IModelProxyFactoryAdapter fgJavaModelProxyFactory = new JavaModelProxyFactory(); 30 31 34 public Object getAdapter(Object adaptableObject, Class adapterType) { 35 if (adapterType.equals(IAsynchronousLabelAdapter.class)) { 36 if (adaptableObject instanceof IJavaThreadGroup) { 37 return fgThreadGroupLabelAdapter; 38 } 39 } 40 if (adapterType.equals(IAsynchronousContentAdapter.class)) { 41 if (adaptableObject instanceof IJavaThreadGroup) { 42 return fgThreadGroupTreeAdapter; 43 } 44 if (adaptableObject instanceof IJavaDebugTarget) { 45 return fgTargetTreeAdapter; 46 } 47 } 48 if (adapterType.equals(IModelProxyFactoryAdapter.class)) { 49 if (adaptableObject instanceof IJavaDebugTarget) { 50 return fgJavaModelProxyFactory; 51 } 52 } 53 return null; 54 } 55 56 59 public Class [] getAdapterList() { 60 return new Class []{IAsynchronousLabelAdapter.class, IAsynchronousContentAdapter.class, IModelProxyFactoryAdapter.class}; 61 } 62 63 } 64 | Popular Tags |