1 11 package org.eclipse.team.internal.ccvs.core.mapping; 12 13 import org.eclipse.core.resources.mapping.ResourceMapping; 14 import org.eclipse.core.runtime.IAdapterFactory; 15 16 public class ChangeSetAdapterFactory implements IAdapterFactory { 17 18 public Object getAdapter(Object adaptableObject, Class adapterType) { 19 if (adaptableObject instanceof CVSActiveChangeSet && adapterType == ResourceMapping.class) { 20 CVSActiveChangeSet cs = (CVSActiveChangeSet) adaptableObject; 21 return new ChangeSetResourceMapping(cs); 22 } 23 if (adaptableObject instanceof CVSCheckedInChangeSet && adapterType == ResourceMapping.class) { 24 CVSCheckedInChangeSet cs = (CVSCheckedInChangeSet) adaptableObject; 25 return new ChangeSetResourceMapping(cs); 26 } 27 if (adaptableObject instanceof UnassignedDiffChangeSet && adapterType == ResourceMapping.class) { 28 UnassignedDiffChangeSet cs = (UnassignedDiffChangeSet) adaptableObject; 29 return new ChangeSetResourceMapping(cs); 30 } 31 return null; 32 } 33 34 public Class [] getAdapterList() { 35 return new Class [] { ResourceMapping.class }; 36 } 37 38 } 39 | Popular Tags |