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