Skip to content

Package: KeybindingAdapterFactory

KeybindingAdapterFactory

nameinstructionbranchcomplexitylinemethod
KeybindingAdapterFactory()
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%
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%
createKeyBindingAdapter()
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%
createKeyBindingsAdapter()
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-2018 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.keybinding.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.keybinding.model.VTKeyBinding;
22: import org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBindings;
23: import org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeybindingPackage;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * The <b>Adapter Factory</b> for the model.
28: * It provides an adapter <code>createXXX</code> method for each class of the model.
29: * <!-- end-user-doc -->
30: *
31: * @see org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeybindingPackage
32: * @generated
33: * @since 1.18
34: */
35: public class KeybindingAdapterFactory extends AdapterFactoryImpl {
36:         /**
37:          * The cached model package.
38:          * <!-- begin-user-doc -->
39:          * <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         protected static VTKeybindingPackage 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 KeybindingAdapterFactory() {
53:•                if (modelPackage == null) {
54:                         modelPackage = VTKeybindingPackage.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 KeybindingSwitch<Adapter> modelSwitch = new KeybindingSwitch<Adapter>() {
87:                 @Override
88:                 public Adapter caseKeyBindings(VTKeyBindings object) {
89:                         return createKeyBindingsAdapter();
90:                 }
91:
92:                 @Override
93:                 public Adapter caseKeyBinding(VTKeyBinding object) {
94:                         return createKeyBindingAdapter();
95:                 }
96:
97:                 @Override
98:                 public Adapter caseStyleProperty(VTStyleProperty object) {
99:                         return createStylePropertyAdapter();
100:                 }
101:
102:                 @Override
103:                 public Adapter defaultCase(EObject object) {
104:                         return createEObjectAdapter();
105:                 }
106:         };
107:
108:         /**
109:          * Creates an adapter for the <code>target</code>.
110:          * <!-- begin-user-doc -->
111:          * <!-- end-user-doc -->
112:          *
113:          * @param target the object to adapt.
114:          * @return the adapter for the <code>target</code>.
115:          * @generated
116:          */
117:         @Override
118:         public Adapter createAdapter(Notifier target) {
119:                 return modelSwitch.doSwitch((EObject) target);
120:         }
121:
122:         /**
123:          * Creates a new adapter for an object of class
124:          * '{@link org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBindings <em>Key Bindings</em>}'.
125:          * <!-- begin-user-doc -->
126:          * This default implementation returns null so that we can easily ignore cases;
127:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
128:          * <!-- end-user-doc -->
129:          *
130:          * @return the new adapter.
131:          * @see org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBindings
132:          * @generated
133:          */
134:         public Adapter createKeyBindingsAdapter() {
135:                 return null;
136:         }
137:
138:         /**
139:          * Creates a new adapter for an object of class
140:          * '{@link org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBinding <em>Key Binding</em>}'.
141:          * <!-- begin-user-doc -->
142:          * This default implementation returns null so that we can easily ignore cases;
143:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
144:          * <!-- end-user-doc -->
145:          *
146:          * @return the new adapter.
147:          * @see org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBinding
148:          * @generated
149:          */
150:         public Adapter createKeyBindingAdapter() {
151:                 return null;
152:         }
153:
154:         /**
155:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.template.model.VTStyleProperty
156:          * <em>Style Property</em>}'.
157:          * <!-- begin-user-doc -->
158:          * This default implementation returns null so that we can easily ignore cases;
159:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
160:          * <!-- end-user-doc -->
161:          *
162:          * @return the new adapter.
163:          * @see org.eclipse.emf.ecp.view.template.model.VTStyleProperty
164:          * @generated
165:          */
166:         public Adapter createStylePropertyAdapter() {
167:                 return null;
168:         }
169:
170:         /**
171:          * Creates a new adapter for the default case.
172:          * <!-- begin-user-doc -->
173:          * This default implementation returns null.
174:          * <!-- end-user-doc -->
175:          *
176:          * @return the new adapter.
177:          * @generated
178:          */
179:         public Adapter createEObjectAdapter() {
180:                 return null;
181:         }
182:
183: } // KeybindingAdapterFactory