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.IModelProxyFactory; 16 import org.eclipse.jdt.debug.core.IJavaDebugTarget; 17 18 23 public class TargetAdapterFactory implements IAdapterFactory{ 24 25 private static IModelProxyFactory fgJavaModelProxyFactory = new JavaModelProxyFactory(); 26 private static IElementContentProvider fgCPTarget = new JavaDebugTargetContentProvider(); 27 28 31 public Object getAdapter(Object adaptableObject, Class adapterType) { 32 if (adapterType.equals(IModelProxyFactory.class)) { 33 if (adaptableObject instanceof IJavaDebugTarget) { 34 return fgJavaModelProxyFactory; 35 } 36 } 37 if (adapterType.equals(IElementContentProvider.class)) { 38 if (adaptableObject instanceof IJavaDebugTarget) { 39 return fgCPTarget; 40 } 41 } 42 return null; 43 } 44 45 48 public Class [] getAdapterList() { 49 return new Class []{ 50 IModelProxyFactory.class, 51 IElementContentProvider.class}; 52 } 53 54 } 55 | Popular Tags |