Skip to content

Package: VStackLayoutImpl

VStackLayoutImpl

nameinstructionbranchcomplexitylinemethod
VStackLayoutImpl()
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%
basicGetTopElement()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
basicSetDomainModelReference(VDomainModelReference, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 6 C: 4
40%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 8 C: 14
64%
M: 3 C: 3
50%
M: 2 C: 3
60%
M: 3 C: 4
57%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 20 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 2 C: 29
94%
M: 2 C: 10
83%
M: 2 C: 6
75%
M: 0 C: 5
100%
M: 0 C: 1
100%
eSet(int, Object)
M: 15 C: 12
44%
M: 2 C: 2
50%
M: 2 C: 2
50%
M: 5 C: 5
50%
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%
getDomainModelReference()
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%
getStackItems()
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%
getTopElement()
M: 28 C: 10
26%
M: 5 C: 3
38%
M: 3 C: 2
40%
M: 6 C: 2
25%
M: 0 C: 1
100%
setDomainModelReference(VDomainModelReference)
M: 16 C: 36
69%
M: 4 C: 6
60%
M: 3 C: 3
50%
M: 4 C: 11
73%
M: 0 C: 1
100%
setTopElement(VStackItem)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2014 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.spi.stack.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.util.EObjectContainmentEList;
25: import org.eclipse.emf.ecore.util.InternalEList;
26: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
27: import org.eclipse.emf.ecp.view.spi.model.impl.VContainedElementImpl;
28: import org.eclipse.emf.ecp.view.spi.stack.model.VStackItem;
29: import org.eclipse.emf.ecp.view.spi.stack.model.VStackLayout;
30: import org.eclipse.emf.ecp.view.spi.stack.model.VStackPackage;
31:
32: /**
33: * <!-- begin-user-doc -->
34: * An implementation of the model object '<em><b>Layout</b></em>'.
35: * <!-- end-user-doc -->
36: * <p>
37: * The following features are implemented:
38: * <ul>
39: * <li>{@link org.eclipse.emf.ecp.view.spi.stack.model.impl.VStackLayoutImpl#getDomainModelReference <em>Domain Model
40: * Reference</em>}</li>
41: * <li>{@link org.eclipse.emf.ecp.view.spi.stack.model.impl.VStackLayoutImpl#getStackItems <em>Stack Items</em>}</li>
42: * <li>{@link org.eclipse.emf.ecp.view.spi.stack.model.impl.VStackLayoutImpl#getTopElement <em>Top Element</em>}</li>
43: * </ul>
44: * </p>
45: *
46: * @generated
47: */
48: public class VStackLayoutImpl extends VContainedElementImpl implements VStackLayout {
49:         /**
50:          * The cached value of the '{@link #getDomainModelReference() <em>Domain Model Reference</em>}' containment
51:          * reference.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @see #getDomainModelReference()
56:          * @generated
57:          * @ordered
58:          */
59:         protected VDomainModelReference domainModelReference;
60:
61:         /**
62:          * The cached value of the '{@link #getStackItems() <em>Stack Items</em>}' containment reference list.
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @see #getStackItems()
67:          * @generated
68:          * @ordered
69:          */
70:         protected EList<VStackItem> stackItems;
71:
72:         /**
73:          * The cached value of the '{@link #getTopElement() <em>Top Element</em>}' reference.
74:          * <!-- begin-user-doc -->
75:          * <!-- end-user-doc -->
76:          *
77:          * @see #getTopElement()
78:          * @generated
79:          * @ordered
80:          */
81:         protected VStackItem topElement;
82:
83:         /**
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @generated
88:          */
89:         protected VStackLayoutImpl() {
90:                 super();
91:         }
92:
93:         /**
94:          * <!-- begin-user-doc -->
95:          * <!-- end-user-doc -->
96:          *
97:          * @generated
98:          */
99:         @Override
100:         protected EClass eStaticClass() {
101:                 return VStackPackage.Literals.STACK_LAYOUT;
102:         }
103:
104:         /**
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         @Override
111:         public VDomainModelReference getDomainModelReference() {
112:                 return domainModelReference;
113:         }
114:
115:         /**
116:          * <!-- begin-user-doc -->
117:          * <!-- end-user-doc -->
118:          *
119:          * @generated
120:          */
121:         public NotificationChain basicSetDomainModelReference(VDomainModelReference newDomainModelReference,
122:                 NotificationChain msgs) {
123:                 final VDomainModelReference oldDomainModelReference = domainModelReference;
124:                 domainModelReference = newDomainModelReference;
125:•                if (eNotificationRequired()) {
126:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
127:                                 VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE, oldDomainModelReference, newDomainModelReference);
128:•                        if (msgs == null) {
129:                                 msgs = notification;
130:                         } else {
131:                                 msgs.add(notification);
132:                         }
133:                 }
134:                 return msgs;
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public void setDomainModelReference(VDomainModelReference newDomainModelReference) {
145:•                if (newDomainModelReference != domainModelReference) {
146:                         NotificationChain msgs = null;
147:•                        if (domainModelReference != null) {
148:                                 msgs = ((InternalEObject) domainModelReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
149:                                         - VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE, null, msgs);
150:                         }
151:•                        if (newDomainModelReference != null) {
152:                                 msgs = ((InternalEObject) newDomainModelReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
153:                                         - VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE, null, msgs);
154:                         }
155:                         msgs = basicSetDomainModelReference(newDomainModelReference, msgs);
156:•                        if (msgs != null) {
157:                                 msgs.dispatch();
158:                         }
159:•                } else if (eNotificationRequired()) {
160:                         eNotify(new ENotificationImpl(this, Notification.SET, VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE,
161:                                 newDomainModelReference, newDomainModelReference));
162:                 }
163:         }
164:
165:         /**
166:          * <!-- begin-user-doc -->
167:          * <!-- end-user-doc -->
168:          *
169:          * @generated
170:          */
171:         @Override
172:         public EList<VStackItem> getStackItems() {
173:•                if (stackItems == null) {
174:                         stackItems = new EObjectContainmentEList<VStackItem>(VStackItem.class, this,
175:                                 VStackPackage.STACK_LAYOUT__STACK_ITEMS);
176:                 }
177:                 return stackItems;
178:         }
179:
180:         /**
181:          * <!-- begin-user-doc -->
182:          * <!-- end-user-doc -->
183:          *
184:          * @generated
185:          */
186:         @Override
187:         public VStackItem getTopElement() {
188:•                if (topElement != null && topElement.eIsProxy()) {
189:                         final InternalEObject oldTopElement = (InternalEObject) topElement;
190:                         topElement = (VStackItem) eResolveProxy(oldTopElement);
191:•                        if (topElement != oldTopElement) {
192:•                                if (eNotificationRequired()) {
193:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE, VStackPackage.STACK_LAYOUT__TOP_ELEMENT,
194:                                                 oldTopElement, topElement));
195:                                 }
196:                         }
197:                 }
198:                 return topElement;
199:         }
200:
201:         /**
202:          * <!-- begin-user-doc -->
203:          * <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         public VStackItem basicGetTopElement() {
208:                 return topElement;
209:         }
210:
211:         /**
212:          * <!-- begin-user-doc -->
213:          * <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         @Override
218:         public void setTopElement(VStackItem newTopElement) {
219:                 final VStackItem oldTopElement = topElement;
220:                 topElement = newTopElement;
221:•                if (eNotificationRequired()) {
222:                         eNotify(new ENotificationImpl(this, Notification.SET, VStackPackage.STACK_LAYOUT__TOP_ELEMENT,
223:                                 oldTopElement, topElement));
224:                 }
225:         }
226:
227:         /**
228:          * <!-- begin-user-doc -->
229:          * <!-- end-user-doc -->
230:          *
231:          * @generated
232:          */
233:         @Override
234:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
235:•                switch (featureID) {
236:                 case VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE:
237:                         return basicSetDomainModelReference(null, msgs);
238:                 case VStackPackage.STACK_LAYOUT__STACK_ITEMS:
239:                         return ((InternalEList<?>) getStackItems()).basicRemove(otherEnd, msgs);
240:                 }
241:                 return super.eInverseRemove(otherEnd, featureID, msgs);
242:         }
243:
244:         /**
245:          * <!-- begin-user-doc -->
246:          * <!-- end-user-doc -->
247:          *
248:          * @generated
249:          */
250:         @Override
251:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
252:•                switch (featureID) {
253:                 case VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE:
254:                         return getDomainModelReference();
255:                 case VStackPackage.STACK_LAYOUT__STACK_ITEMS:
256:                         return getStackItems();
257:                 case VStackPackage.STACK_LAYOUT__TOP_ELEMENT:
258:•                        if (resolve) {
259:                                 return getTopElement();
260:                         }
261:                         return basicGetTopElement();
262:                 }
263:                 return super.eGet(featureID, resolve, coreType);
264:         }
265:
266:         /**
267:          * <!-- begin-user-doc -->
268:          * <!-- end-user-doc -->
269:          *
270:          * @generated
271:          */
272:         @SuppressWarnings("unchecked")
273:         @Override
274:         public void eSet(int featureID, Object newValue) {
275:•                switch (featureID) {
276:                 case VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE:
277:                         setDomainModelReference((VDomainModelReference) newValue);
278:                         return;
279:                 case VStackPackage.STACK_LAYOUT__STACK_ITEMS:
280:                         getStackItems().clear();
281:                         getStackItems().addAll((Collection<? extends VStackItem>) newValue);
282:                         return;
283:                 case VStackPackage.STACK_LAYOUT__TOP_ELEMENT:
284:                         setTopElement((VStackItem) newValue);
285:                         return;
286:                 }
287:                 super.eSet(featureID, newValue);
288:         }
289:
290:         /**
291:          * <!-- begin-user-doc -->
292:          * <!-- end-user-doc -->
293:          *
294:          * @generated
295:          */
296:         @Override
297:         public void eUnset(int featureID) {
298:•                switch (featureID) {
299:                 case VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE:
300:                         setDomainModelReference((VDomainModelReference) null);
301:                         return;
302:                 case VStackPackage.STACK_LAYOUT__STACK_ITEMS:
303:                         getStackItems().clear();
304:                         return;
305:                 case VStackPackage.STACK_LAYOUT__TOP_ELEMENT:
306:                         setTopElement((VStackItem) null);
307:                         return;
308:                 }
309:                 super.eUnset(featureID);
310:         }
311:
312:         /**
313:          * <!-- begin-user-doc -->
314:          * <!-- end-user-doc -->
315:          *
316:          * @generated
317:          */
318:         @Override
319:         public boolean eIsSet(int featureID) {
320:•                switch (featureID) {
321:                 case VStackPackage.STACK_LAYOUT__DOMAIN_MODEL_REFERENCE:
322:•                        return domainModelReference != null;
323:                 case VStackPackage.STACK_LAYOUT__STACK_ITEMS:
324:•                        return stackItems != null && !stackItems.isEmpty();
325:                 case VStackPackage.STACK_LAYOUT__TOP_ELEMENT:
326:•                        return topElement != null;
327:                 }
328:                 return super.eIsSet(featureID);
329:         }
330:
331: } // VStackLayoutImpl