Skip to content

Package: VTViewTemplateImpl

VTViewTemplateImpl

nameinstructionbranchcomplexitylinemethod
VTViewTemplateImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
basicSetControlValidationConfiguration(VTControlValidationTemplate, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 7 C: 4
36%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 9 C: 8
47%
M: 2 C: 2
50%
M: 2 C: 2
50%
M: 2 C: 3
60%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 6 C: 14
70%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 10 C: 25
71%
M: 4 C: 10
71%
M: 3 C: 6
67%
M: 1 C: 4
80%
M: 0 C: 1
100%
eSet(int, Object)
M: 25 C: 7
22%
M: 3 C: 1
25%
M: 3 C: 1
25%
M: 8 C: 3
27%
M: 0 C: 1
100%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 18 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getControlValidationConfiguration()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getReferencedEcores()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getStyles()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
setControlValidationConfiguration(VTControlValidationTemplate)
M: 25 C: 27
52%
M: 6 C: 4
40%
M: 5 C: 1
17%
M: 8 C: 10
56%
M: 0 C: 1
100%
toString()
M: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%

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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.model.impl;
15:
16: import java.util.Collection;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.common.notify.NotificationChain;
20: import org.eclipse.emf.common.util.EList;
21: import org.eclipse.emf.ecore.EClass;
22: import org.eclipse.emf.ecore.InternalEObject;
23: import org.eclipse.emf.ecore.impl.ENotificationImpl;
24: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
25: import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
26: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
27: import org.eclipse.emf.ecore.util.InternalEList;
28: import org.eclipse.emf.ecp.view.template.model.VTControlValidationTemplate;
29: import org.eclipse.emf.ecp.view.template.model.VTStyle;
30: import org.eclipse.emf.ecp.view.template.model.VTTemplatePackage;
31: import org.eclipse.emf.ecp.view.template.model.VTViewTemplate;
32:
33: /**
34: * <!-- begin-user-doc -->
35: * An implementation of the model object '<em><b>View Template</b></em>'.
36: * <!-- end-user-doc -->
37: * <p>
38: * The following features are implemented:
39: * </p>
40: * <ul>
41: * <li>{@link org.eclipse.emf.ecp.view.template.model.impl.VTViewTemplateImpl#getControlValidationConfiguration
42: * <em>Control Validation Configuration</em>}</li>
43: * <li>{@link org.eclipse.emf.ecp.view.template.model.impl.VTViewTemplateImpl#getStyles <em>Styles</em>}</li>
44: * <li>{@link org.eclipse.emf.ecp.view.template.model.impl.VTViewTemplateImpl#getReferencedEcores <em>Referenced
45: * Ecores</em>}</li>
46: * </ul>
47: *
48: * @generated
49: */
50: public class VTViewTemplateImpl extends MinimalEObjectImpl.Container implements VTViewTemplate {
51:         /**
52:          * The cached value of the '{@link #getControlValidationConfiguration() <em>Control Validation Configuration</em>}'
53:          * containment reference.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @see #getControlValidationConfiguration()
58:          * @generated
59:          * @ordered
60:          */
61:         protected VTControlValidationTemplate controlValidationConfiguration;
62:
63:         /**
64:          * The cached value of the '{@link #getStyles() <em>Styles</em>}' containment reference list.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @see #getStyles()
69:          * @generated
70:          * @ordered
71:          */
72:         protected EList<VTStyle> styles;
73:
74:         /**
75:          * The cached value of the '{@link #getReferencedEcores() <em>Referenced Ecores</em>}' attribute list.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @see #getReferencedEcores()
80:          * @generated
81:          * @ordered
82:          */
83:         protected EList<String> referencedEcores;
84:
85:         /**
86:          * <!-- begin-user-doc -->
87:          * <!-- end-user-doc -->
88:          *
89:          * @generated
90:          */
91:         protected VTViewTemplateImpl() {
92:                 super();
93:         }
94:
95:         /**
96:          * <!-- begin-user-doc -->
97:          * <!-- end-user-doc -->
98:          *
99:          * @generated
100:          */
101:         @Override
102:         protected EClass eStaticClass() {
103:                 return VTTemplatePackage.Literals.VIEW_TEMPLATE;
104:         }
105:
106:         /**
107:          * <!-- begin-user-doc -->
108:          *
109:          * @deprecated
110:          *                         <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         @Deprecated
115:         @Override
116:         public VTControlValidationTemplate getControlValidationConfiguration() {
117:                 return controlValidationConfiguration;
118:         }
119:
120:         /**
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @generated
125:          */
126:         public NotificationChain basicSetControlValidationConfiguration(
127:                 VTControlValidationTemplate newControlValidationConfiguration, NotificationChain msgs) {
128:                 final VTControlValidationTemplate oldControlValidationConfiguration = controlValidationConfiguration;
129:                 controlValidationConfiguration = newControlValidationConfiguration;
130:•                if (eNotificationRequired()) {
131:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
132:                                 VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION, oldControlValidationConfiguration,
133:                                 newControlValidationConfiguration);
134:•                        if (msgs == null) {
135:                                 msgs = notification;
136:                         } else {
137:                                 msgs.add(notification);
138:                         }
139:                 }
140:                 return msgs;
141:         }
142:
143:         /**
144:          * <!-- begin-user-doc -->
145:          *
146:          * @deprecated
147:          *                         <!-- end-user-doc -->
148:          *
149:          * @generated
150:          */
151:         @Deprecated
152:         @Override
153:         public void setControlValidationConfiguration(VTControlValidationTemplate newControlValidationConfiguration) {
154:•                if (newControlValidationConfiguration != controlValidationConfiguration) {
155:                         NotificationChain msgs = null;
156:•                        if (controlValidationConfiguration != null) {
157:                                 msgs = ((InternalEObject) controlValidationConfiguration).eInverseRemove(this,
158:                                         EOPPOSITE_FEATURE_BASE - VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION, null,
159:                                         msgs);
160:                         }
161:•                        if (newControlValidationConfiguration != null) {
162:                                 msgs = ((InternalEObject) newControlValidationConfiguration).eInverseAdd(this,
163:                                         EOPPOSITE_FEATURE_BASE - VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION, null,
164:                                         msgs);
165:                         }
166:                         msgs = basicSetControlValidationConfiguration(newControlValidationConfiguration, msgs);
167:•                        if (msgs != null) {
168:                                 msgs.dispatch();
169:                         }
170:•                } else if (eNotificationRequired()) {
171:                         eNotify(new ENotificationImpl(this, Notification.SET,
172:                                 VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION, newControlValidationConfiguration,
173:                                 newControlValidationConfiguration));
174:                 }
175:         }
176:
177:         /**
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @generated
182:          */
183:         @Override
184:         public EList<VTStyle> getStyles() {
185:•                if (styles == null) {
186:                         styles = new EObjectContainmentEList<VTStyle>(VTStyle.class, this, VTTemplatePackage.VIEW_TEMPLATE__STYLES);
187:                 }
188:                 return styles;
189:         }
190:
191:         /**
192:          * <!-- begin-user-doc -->
193:          * <!-- end-user-doc -->
194:          *
195:          * @generated
196:          */
197:         @Override
198:         public EList<String> getReferencedEcores() {
199:•                if (referencedEcores == null) {
200:                         referencedEcores = new EDataTypeUniqueEList<String>(String.class, this,
201:                                 VTTemplatePackage.VIEW_TEMPLATE__REFERENCED_ECORES);
202:                 }
203:                 return referencedEcores;
204:         }
205:
206:         /**
207:          * <!-- begin-user-doc -->
208:          * <!-- end-user-doc -->
209:          *
210:          * @generated
211:          */
212:         @Override
213:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
214:•                switch (featureID) {
215:                 case VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION:
216:                         return basicSetControlValidationConfiguration(null, msgs);
217:                 case VTTemplatePackage.VIEW_TEMPLATE__STYLES:
218:                         return ((InternalEList<?>) getStyles()).basicRemove(otherEnd, msgs);
219:                 }
220:                 return super.eInverseRemove(otherEnd, featureID, msgs);
221:         }
222:
223:         /**
224:          * <!-- begin-user-doc -->
225:          * <!-- end-user-doc -->
226:          *
227:          * @generated
228:          */
229:         @Override
230:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
231:•                switch (featureID) {
232:                 case VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION:
233:                         return getControlValidationConfiguration();
234:                 case VTTemplatePackage.VIEW_TEMPLATE__STYLES:
235:                         return getStyles();
236:                 case VTTemplatePackage.VIEW_TEMPLATE__REFERENCED_ECORES:
237:                         return getReferencedEcores();
238:                 }
239:                 return super.eGet(featureID, resolve, coreType);
240:         }
241:
242:         /**
243:          * <!-- begin-user-doc -->
244:          * <!-- end-user-doc -->
245:          *
246:          * @generated
247:          */
248:         @SuppressWarnings("unchecked")
249:         @Override
250:         public void eSet(int featureID, Object newValue) {
251:•                switch (featureID) {
252:                 case VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION:
253:                         setControlValidationConfiguration((VTControlValidationTemplate) newValue);
254:                         return;
255:                 case VTTemplatePackage.VIEW_TEMPLATE__STYLES:
256:                         getStyles().clear();
257:                         getStyles().addAll((Collection<? extends VTStyle>) newValue);
258:                         return;
259:                 case VTTemplatePackage.VIEW_TEMPLATE__REFERENCED_ECORES:
260:                         getReferencedEcores().clear();
261:                         getReferencedEcores().addAll((Collection<? extends String>) newValue);
262:                         return;
263:                 }
264:                 super.eSet(featureID, newValue);
265:         }
266:
267:         /**
268:          * <!-- begin-user-doc -->
269:          * <!-- end-user-doc -->
270:          *
271:          * @generated
272:          */
273:         @Override
274:         public void eUnset(int featureID) {
275:•                switch (featureID) {
276:                 case VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION:
277:                         setControlValidationConfiguration((VTControlValidationTemplate) null);
278:                         return;
279:                 case VTTemplatePackage.VIEW_TEMPLATE__STYLES:
280:                         getStyles().clear();
281:                         return;
282:                 case VTTemplatePackage.VIEW_TEMPLATE__REFERENCED_ECORES:
283:                         getReferencedEcores().clear();
284:                         return;
285:                 }
286:                 super.eUnset(featureID);
287:         }
288:
289:         /**
290:          * <!-- begin-user-doc -->
291:          * <!-- end-user-doc -->
292:          *
293:          * @generated
294:          */
295:         @Override
296:         public boolean eIsSet(int featureID) {
297:•                switch (featureID) {
298:                 case VTTemplatePackage.VIEW_TEMPLATE__CONTROL_VALIDATION_CONFIGURATION:
299:•                        return controlValidationConfiguration != null;
300:                 case VTTemplatePackage.VIEW_TEMPLATE__STYLES:
301:•                        return styles != null && !styles.isEmpty();
302:                 case VTTemplatePackage.VIEW_TEMPLATE__REFERENCED_ECORES:
303:•                        return referencedEcores != null && !referencedEcores.isEmpty();
304:                 }
305:                 return super.eIsSet(featureID);
306:         }
307:
308:         /**
309:          * <!-- begin-user-doc -->
310:          * <!-- end-user-doc -->
311:          *
312:          * @generated
313:          */
314:         @Override
315:         public String toString() {
316:•                if (eIsProxy()) {
317:                         return super.toString();
318:                 }
319:
320:                 final StringBuffer result = new StringBuffer(super.toString());
321:                 result.append(" (referencedEcores: "); //$NON-NLS-1$
322:                 result.append(referencedEcores);
323:                 result.append(')');
324:                 return result.toString();
325:         }
326:
327: } // VTViewTemplateImpl