001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: ModelAdapterFactory.java 18807 2006-03-25 01:16:09Z chorner $
006: */package net.refractions.udig.printing.model.util;
007:
008: import net.refractions.udig.printing.model.Box;
009: import net.refractions.udig.printing.model.Connection;
010: import net.refractions.udig.printing.model.DecoratorBox;
011: import net.refractions.udig.printing.model.Element;
012: import net.refractions.udig.printing.model.ModelPackage;
013: import net.refractions.udig.printing.model.Page;
014: import net.refractions.udig.project.IProjectElement;
015: import net.refractions.udig.project.internal.ProjectElement;
016:
017: import org.eclipse.core.runtime.IAdaptable;
018: import org.eclipse.emf.common.notify.Adapter;
019: import org.eclipse.emf.common.notify.Notifier;
020: import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
021: import org.eclipse.emf.ecore.EObject;
022:
023: /**
024: * <!-- begin-user-doc -->
025: * The <b>Adapter Factory</b> for the model.
026: * It provides an adapter <code>createXXX</code> method for each class of the model.
027: * <!-- end-user-doc -->
028: * @see net.refractions.udig.printing.model.ModelPackage
029: * @generated
030: */
031: public class ModelAdapterFactory extends AdapterFactoryImpl {
032: /**
033: * The cached model package.
034: * <!-- begin-user-doc -->
035: * <!-- end-user-doc -->
036: * @generated
037: */
038: protected static ModelPackage modelPackage;
039:
040: /**
041: * Creates an instance of the adapter factory.
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @generated
045: */
046: public ModelAdapterFactory() {
047: if (modelPackage == null) {
048: modelPackage = ModelPackage.eINSTANCE;
049: }
050: }
051:
052: /**
053: * Returns whether this factory is applicable for the type of the object.
054: * <!-- begin-user-doc -->
055: * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
056: * <!-- end-user-doc -->
057: * @return whether this factory is applicable for the type of the object.
058: * @generated
059: */
060: public boolean isFactoryForType(Object object) {
061: if (object == modelPackage) {
062: return true;
063: }
064: if (object instanceof EObject) {
065: return ((EObject) object).eClass().getEPackage() == modelPackage;
066: }
067: return false;
068: }
069:
070: /**
071: * The switch the delegates to the <code>createXXX</code> methods.
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: * @generated
075: */
076: protected ModelSwitch modelSwitch = new ModelSwitch() {
077: public Object caseBox(Box object) {
078: return createBoxAdapter();
079: }
080:
081: public Object caseConnection(Connection object) {
082: return createConnectionAdapter();
083: }
084:
085: public Object caseDecoratorBox(DecoratorBox object) {
086: return createDecoratorBoxAdapter();
087: }
088:
089: public Object caseElement(Element object) {
090: return createElementAdapter();
091: }
092:
093: public Object casePage(Page object) {
094: return createPageAdapter();
095: }
096:
097: public Object caseIProjectElement(IProjectElement object) {
098: return createIProjectElementAdapter();
099: }
100:
101: public Object caseIAdaptable(IAdaptable object) {
102: return createIAdaptableAdapter();
103: }
104:
105: public Object caseProjectElement(ProjectElement object) {
106: return createProjectElementAdapter();
107: }
108:
109: public Object defaultCase(EObject object) {
110: return createEObjectAdapter();
111: }
112: };
113:
114: /**
115: * Creates an adapter for the <code>target</code>.
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: * @param target the object to adapt.
119: * @return the adapter for the <code>target</code>.
120: * @generated
121: */
122: public Adapter createAdapter(Notifier target) {
123: return (Adapter) modelSwitch.doSwitch((EObject) target);
124: }
125:
126: /**
127: * Creates a new adapter for an object of class '{@link net.refractions.udig.printing.model.Box <em>Box</em>}'.
128: * <!-- begin-user-doc -->
129: * This default implementation returns null so that we can easily ignore cases;
130: * it's useful to ignore a case when inheritance will catch all the cases anyway.
131: * <!-- end-user-doc -->
132: * @return the new adapter.
133: * @see net.refractions.udig.printing.model.Box
134: * @generated
135: */
136: public Adapter createBoxAdapter() {
137: return null;
138: }
139:
140: /**
141: * Creates a new adapter for an object of class '{@link net.refractions.udig.printing.model.Connection <em>Connection</em>}'.
142: * <!-- begin-user-doc -->
143: * This default implementation returns null so that we can easily ignore cases;
144: * it's useful to ignore a case when inheritance will catch all the cases anyway.
145: * <!-- end-user-doc -->
146: * @return the new adapter.
147: * @see net.refractions.udig.printing.model.Connection
148: * @generated
149: */
150: public Adapter createConnectionAdapter() {
151: return null;
152: }
153:
154: /**
155: * Creates a new adapter for an object of class '{@link net.refractions.udig.printing.model.DecoratorBox <em>Decorator Box</em>}'.
156: * <!-- begin-user-doc -->
157: * This default implementation returns null so that we can easily ignore cases;
158: * it's useful to ignore a case when inheritance will catch all the cases anyway.
159: * <!-- end-user-doc -->
160: * @return the new adapter.
161: * @see net.refractions.udig.printing.model.DecoratorBox
162: * @generated
163: */
164: public Adapter createDecoratorBoxAdapter() {
165: return null;
166: }
167:
168: /**
169: * Creates a new adapter for an object of class '{@link net.refractions.udig.printing.model.Element <em>Element</em>}'.
170: * <!-- begin-user-doc -->
171: * This default implementation returns null so that we can easily ignore cases;
172: * it's useful to ignore a case when inheritance will catch all the cases anyway.
173: * <!-- end-user-doc -->
174: * @return the new adapter.
175: * @see net.refractions.udig.printing.model.Element
176: * @generated
177: */
178: public Adapter createElementAdapter() {
179: return null;
180: }
181:
182: /**
183: * Creates a new adapter for an object of class '{@link net.refractions.udig.printing.model.Page <em>Page</em>}'.
184: * <!-- begin-user-doc -->
185: * This default implementation returns null so that we can easily ignore cases;
186: * it's useful to ignore a case when inheritance will catch all the cases anyway.
187: * <!-- end-user-doc -->
188: * @return the new adapter.
189: * @see net.refractions.udig.printing.model.Page
190: * @generated
191: */
192: public Adapter createPageAdapter() {
193: return null;
194: }
195:
196: /**
197: * Creates a new adapter for an object of class '{@link net.refractions.udig.project.IProjectElement <em>IProject Element</em>}'.
198: * <!-- begin-user-doc -->
199: * This default implementation returns null so that we can easily ignore cases;
200: * it's useful to ignore a case when inheritance will catch all the cases anyway.
201: * <!-- end-user-doc -->
202: * @return the new adapter.
203: * @see net.refractions.udig.project.IProjectElement
204: * @generated
205: */
206: public Adapter createIProjectElementAdapter() {
207: return null;
208: }
209:
210: /**
211: * Creates a new adapter for an object of class '{@link org.eclipse.core.runtime.IAdaptable <em>IAdaptable</em>}'.
212: * <!-- begin-user-doc -->
213: * This default implementation returns null so that we can easily ignore cases;
214: * it's useful to ignore a case when inheritance will catch all the cases anyway.
215: * <!-- end-user-doc -->
216: * @return the new adapter.
217: * @see org.eclipse.core.runtime.IAdaptable
218: * @generated
219: */
220: public Adapter createIAdaptableAdapter() {
221: return null;
222: }
223:
224: /**
225: * Creates a new adapter for an object of class '{@link net.refractions.udig.project.internal.ProjectElement <em>Element</em>}'.
226: * <!-- begin-user-doc -->
227: * This default implementation returns null so that we can easily ignore cases;
228: * it's useful to ignore a case when inheritance will catch all the cases anyway.
229: * <!-- end-user-doc -->
230: * @return the new adapter.
231: * @see net.refractions.udig.project.internal.ProjectElement
232: * @generated
233: */
234: public Adapter createProjectElementAdapter() {
235: return null;
236: }
237:
238: /**
239: * Creates a new adapter for the default case.
240: * <!-- begin-user-doc -->
241: * This default implementation returns null.
242: * <!-- end-user-doc -->
243: * @return the new adapter.
244: * @generated
245: */
246: public Adapter createEObjectAdapter() {
247: return null;
248: }
249:
250: } //ModelAdapterFactory
|