1 17 package org.eclipse.emf.ecore.change.util; 18 19 import java.util.Map ; 20 21 import org.eclipse.emf.common.notify.Adapter; 22 import org.eclipse.emf.common.notify.Notifier; 23 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; 24 import org.eclipse.emf.ecore.EObject; 25 import org.eclipse.emf.ecore.change.*; 26 27 28 36 public class ChangeAdapterFactory extends AdapterFactoryImpl 37 { 38 44 protected static ChangePackage modelPackage; 45 46 52 public ChangeAdapterFactory() 53 { 54 if (modelPackage == null) 55 { 56 modelPackage = ChangePackage.eINSTANCE; 57 } 58 } 59 60 68 public boolean isFactoryForType(Object object) 69 { 70 if (object == modelPackage) 71 { 72 return true; 73 } 74 if (object instanceof EObject) 75 { 76 return ((EObject)object).eClass().getEPackage() == modelPackage; 77 } 78 return false; 79 } 80 81 87 protected ChangeSwitch modelSwitch = 88 new ChangeSwitch() 89 { 90 public Object caseChangeDescription(ChangeDescription object) 91 { 92 return createChangeDescriptionAdapter(); 93 } 94 public Object caseEObjectToChangesMapEntry(Map.Entry object) 95 { 96 return createEObjectToChangesMapEntryAdapter(); 97 } 98 public Object caseFeatureChange(FeatureChange object) 99 { 100 return createFeatureChangeAdapter(); 101 } 102 public Object caseListChange(ListChange object) 103 { 104 return createListChangeAdapter(); 105 } 106 public Object caseResourceChange(ResourceChange object) 107 { 108 return createResourceChangeAdapter(); 109 } 110 public Object caseFeatureMapEntry(FeatureMapEntry object) 111 { 112 return createFeatureMapEntryAdapter(); 113 } 114 public Object defaultCase(EObject object) 115 { 116 return createEObjectAdapter(); 117 } 118 }; 119 120 128 public Adapter createAdapter(Notifier target) 129 { 130 return (Adapter)modelSwitch.doSwitch((EObject)target); 131 } 132 133 134 144 public Adapter createChangeDescriptionAdapter() 145 { 146 return null; 147 } 148 149 159 public Adapter createEObjectToChangesMapEntryAdapter() 160 { 161 return null; 162 } 163 164 174 public Adapter createFeatureChangeAdapter() 175 { 176 return null; 177 } 178 179 189 public Adapter createListChangeAdapter() 190 { 191 return null; 192 } 193 194 204 public Adapter createResourceChangeAdapter() 205 { 206 return null; 207 } 208 209 219 public Adapter createFeatureMapEntryAdapter() 220 { 221 return null; 222 } 223 224 232 public Adapter createEObjectAdapter() 233 { 234 return null; 235 } 236 237 } | Popular Tags |