Skip to content

Package: GroupAdapterFactory

GroupAdapterFactory

nameinstructionbranchcomplexitylinemethod
GroupAdapterFactory()
M: 0 C: 13
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createAdapter(Notifier)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createContainedContainerAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createContainedElementAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createContainerAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createEObjectAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createElementAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createGroupAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createHasTooltipAdapter()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isFactoryForType(Object)
M: 2 C: 18
90%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 0 C: 5
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.group.model.util;
15:
16: import org.eclipse.emf.common.notify.Adapter;
17: import org.eclipse.emf.common.notify.Notifier;
18: import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
19: import org.eclipse.emf.ecore.EObject;
20: import org.eclipse.emf.ecp.view.spi.group.model.VGroup;
21: import org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage;
22: import org.eclipse.emf.ecp.view.spi.model.VContainedContainer;
23: import org.eclipse.emf.ecp.view.spi.model.VContainedElement;
24: import org.eclipse.emf.ecp.view.spi.model.VContainer;
25: import org.eclipse.emf.ecp.view.spi.model.VElement;
26: import org.eclipse.emf.ecp.view.spi.model.VHasTooltip;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * The <b>Adapter Factory</b> for the model.
31: * It provides an adapter <code>createXXX</code> method for each class of the model.
32: * <!-- end-user-doc -->
33: *
34: * @see org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage
35: * @generated
36: */
37: public class GroupAdapterFactory extends AdapterFactoryImpl {
38:         /**
39:          * The cached model package.
40:          * <!-- begin-user-doc -->
41:          * <!-- end-user-doc -->
42:          *
43:          * @generated
44:          */
45:         protected static VGroupPackage modelPackage;
46:
47:         /**
48:          * Creates an instance of the adapter factory.
49:          * <!-- begin-user-doc -->
50:          * <!-- end-user-doc -->
51:          *
52:          * @generated
53:          */
54:         public GroupAdapterFactory() {
55:•                if (modelPackage == null) {
56:                         modelPackage = VGroupPackage.eINSTANCE;
57:                 }
58:         }
59:
60:         /**
61:          * Returns whether this factory is applicable for the type of the object.
62:          * <!-- begin-user-doc -->
63:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
64:          * object of the model.
65:          * <!-- end-user-doc -->
66:          *
67:          * @return whether this factory is applicable for the type of the object.
68:          * @generated
69:          */
70:         @Override
71:         public boolean isFactoryForType(Object object) {
72:•                if (object == modelPackage) {
73:                         return true;
74:                 }
75:•                if (object instanceof EObject) {
76:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
77:                 }
78:                 return false;
79:         }
80:
81:         /**
82:          * The switch that delegates to the <code>createXXX</code> methods.
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         protected GroupSwitch<Adapter> modelSwitch = new GroupSwitch<Adapter>() {
89:                 @Override
90:                 public Adapter caseGroup(VGroup object) {
91:                         return createGroupAdapter();
92:                 }
93:
94:                 @Override
95:                 public Adapter caseElement(VElement object) {
96:                         return createElementAdapter();
97:                 }
98:
99:                 @Override
100:                 public Adapter caseContainedElement(VContainedElement object) {
101:                         return createContainedElementAdapter();
102:                 }
103:
104:                 @Override
105:                 public Adapter caseContainer(VContainer object) {
106:                         return createContainerAdapter();
107:                 }
108:
109:                 @Override
110:                 public Adapter caseContainedContainer(VContainedContainer object) {
111:                         return createContainedContainerAdapter();
112:                 }
113:
114:                 @Override
115:                 public Adapter caseHasTooltip(VHasTooltip object) {
116:                         return createHasTooltipAdapter();
117:                 }
118:
119:                 @Override
120:                 public Adapter defaultCase(EObject object) {
121:                         return createEObjectAdapter();
122:                 }
123:         };
124:
125:         /**
126:          * Creates an adapter for the <code>target</code>.
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @param target the object to adapt.
131:          * @return the adapter for the <code>target</code>.
132:          * @generated
133:          */
134:         @Override
135:         public Adapter createAdapter(Notifier target) {
136:                 return modelSwitch.doSwitch((EObject) target);
137:         }
138:
139:         /**
140:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.group.model.VGroup
141:          * <em>Group</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:          *
147:          * @return the new adapter.
148:          * @see org.eclipse.emf.ecp.view.spi.group.model.VGroup
149:          * @generated
150:          */
151:         public Adapter createGroupAdapter() {
152:                 return null;
153:         }
154:
155:         /**
156:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VElement
157:          * <em>Element</em>}'.
158:          * <!-- begin-user-doc -->
159:          * This default implementation returns null so that we can easily ignore cases;
160:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
161:          * <!-- end-user-doc -->
162:          *
163:          * @return the new adapter.
164:          * @see org.eclipse.emf.ecp.view.spi.model.VElement
165:          * @generated
166:          */
167:         public Adapter createElementAdapter() {
168:                 return null;
169:         }
170:
171:         /**
172:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VContainedElement
173:          * <em>Contained Element</em>}'.
174:          * <!-- begin-user-doc -->
175:          * This default implementation returns null so that we can easily ignore cases;
176:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
177:          * <!-- end-user-doc -->
178:          *
179:          * @return the new adapter.
180:          * @see org.eclipse.emf.ecp.view.spi.model.VContainedElement
181:          * @generated
182:          */
183:         public Adapter createContainedElementAdapter() {
184:                 return null;
185:         }
186:
187:         /**
188:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VContainer
189:          * <em>Container</em>}'.
190:          * <!-- begin-user-doc -->
191:          * This default implementation returns null so that we can easily ignore cases;
192:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
193:          * <!-- end-user-doc -->
194:          *
195:          * @return the new adapter.
196:          * @see org.eclipse.emf.ecp.view.spi.model.VContainer
197:          * @generated
198:          */
199:         public Adapter createContainerAdapter() {
200:                 return null;
201:         }
202:
203:         /**
204:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VContainedContainer
205:          * <em>Contained Container</em>}'.
206:          * <!-- begin-user-doc -->
207:          * This default implementation returns null so that we can easily ignore cases;
208:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
209:          *
210:          * @since 1.4
211:          * <!-- end-user-doc -->
212:          * @return the new adapter.
213:          * @see org.eclipse.emf.ecp.view.spi.model.VContainedContainer
214:          * @generated
215:          */
216:         public Adapter createContainedContainerAdapter() {
217:                 return null;
218:         }
219:
220:         /**
221:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VHasTooltip <em>Has
222:          * Tooltip</em>}'.
223:          * <!-- begin-user-doc -->
224:          * This default implementation returns null so that we can easily ignore cases;
225:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
226:          *
227:          * @since 1.13
228:          * <!-- end-user-doc -->
229:          *
230:          * @return the new adapter.
231:          * @see org.eclipse.emf.ecp.view.spi.model.VHasTooltip
232:          * @generated
233:          */
234:         public Adapter createHasTooltipAdapter() {
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:          *
244:          * @return the new adapter.
245:          * @generated
246:          */
247:         public Adapter createEObjectAdapter() {
248:                 return null;
249:         }
250:
251: } // GroupAdapterFactory