Skip to content

Package: BackgroundAdapterFactory

BackgroundAdapterFactory

nameinstructionbranchcomplexitylinemethod
BackgroundAdapterFactory()
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%
createBackgroundStylePropertyAdapter()
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%
createStylePropertyAdapter()
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-2015 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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.background.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.template.model.VTStyleProperty;
21: import org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundPackage;
22: import org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundStyleProperty;
23:
24: /**
25: * <!-- begin-user-doc -->
26: * The <b>Adapter Factory</b> for the model.
27: * It provides an adapter <code>createXXX</code> method for each class of the model.
28: *
29: * @since 1.5
30: * <!-- end-user-doc -->
31: *
32: * @see org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundPackage
33: * @generated
34: */
35: public class BackgroundAdapterFactory extends AdapterFactoryImpl {
36:         /**
37:          * The cached model package.
38:          * <!-- begin-user-doc -->
39:          * <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         protected static VTBackgroundPackage modelPackage;
44:
45:         /**
46:          * Creates an instance of the adapter factory.
47:          * <!-- begin-user-doc -->
48:          * <!-- end-user-doc -->
49:          *
50:          * @generated
51:          */
52:         public BackgroundAdapterFactory() {
53:•                if (modelPackage == null) {
54:                         modelPackage = VTBackgroundPackage.eINSTANCE;
55:                 }
56:         }
57:
58:         /**
59:          * Returns whether this factory is applicable for the type of the object.
60:          * <!-- begin-user-doc -->
61:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
62:          * object of the model.
63:          * <!-- end-user-doc -->
64:          *
65:          * @return whether this factory is applicable for the type of the object.
66:          * @generated
67:          */
68:         @Override
69:         public boolean isFactoryForType(Object object) {
70:•                if (object == modelPackage) {
71:                         return true;
72:                 }
73:•                if (object instanceof EObject) {
74:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
75:                 }
76:                 return false;
77:         }
78:
79:         /**
80:          * The switch that delegates to the <code>createXXX</code> methods.
81:          * <!-- begin-user-doc -->
82:          * <!-- end-user-doc -->
83:          *
84:          * @generated
85:          */
86:         protected BackgroundSwitch<Adapter> modelSwitch = new BackgroundSwitch<Adapter>() {
87:                 @Override
88:                 public Adapter caseBackgroundStyleProperty(VTBackgroundStyleProperty object) {
89:                         return createBackgroundStylePropertyAdapter();
90:                 }
91:
92:                 @Override
93:                 public Adapter caseStyleProperty(VTStyleProperty object) {
94:                         return createStylePropertyAdapter();
95:                 }
96:
97:                 @Override
98:                 public Adapter defaultCase(EObject object) {
99:                         return createEObjectAdapter();
100:                 }
101:         };
102:
103:         /**
104:          * Creates an adapter for the <code>target</code>.
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @param target the object to adapt.
109:          * @return the adapter for the <code>target</code>.
110:          * @generated
111:          */
112:         @Override
113:         public Adapter createAdapter(Notifier target) {
114:                 return modelSwitch.doSwitch((EObject) target);
115:         }
116:
117:         /**
118:          * Creates a new adapter for an object of class '
119:          * {@link org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundStyleProperty
120:          * <em>Style Property</em>}'.
121:          * <!-- begin-user-doc -->
122:          * This default implementation returns null so that we can easily ignore cases;
123:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
124:          * <!-- end-user-doc -->
125:          *
126:          * @return the new adapter.
127:          * @see org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundStyleProperty
128:          * @generated
129:          */
130:         public Adapter createBackgroundStylePropertyAdapter() {
131:                 return null;
132:         }
133:
134:         /**
135:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.template.model.VTStyleProperty
136:          * <em>Style Property</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:          *
142:          * @return the new adapter.
143:          * @see org.eclipse.emf.ecp.view.template.model.VTStyleProperty
144:          * @generated
145:          */
146:         public Adapter createStylePropertyAdapter() {
147:                 return null;
148:         }
149:
150:         /**
151:          * Creates a new adapter for the default case.
152:          * <!-- begin-user-doc -->
153:          * This default implementation returns null.
154:          * <!-- end-user-doc -->
155:          *
156:          * @return the new adapter.
157:          * @generated
158:          */
159:         public Adapter createEObjectAdapter() {
160:                 return null;
161:         }
162:
163: } // BackgroundAdapterFactory