1 11 package org.eclipse.core.internal.resources.mapping; 12 13 import org.eclipse.core.resources.IResource; 14 import org.eclipse.core.resources.mapping.ResourceMapping; 15 import org.eclipse.core.runtime.IAdapterFactory; 16 17 22 public class ResourceAdapterFactory implements IAdapterFactory { 23 24 27 public Object getAdapter(Object adaptableObject, Class adapterType) { 28 if (adapterType == ResourceMapping.class && adaptableObject instanceof IResource) { 29 return new SimpleResourceMapping((IResource) adaptableObject); 30 } 31 return null; 32 } 33 34 37 public Class [] getAdapterList() { 38 return new Class [] {ResourceMapping.class}; 39 } 40 } 41 | Popular Tags |