Skip to content

Package: VLabelImpl

VLabelImpl

nameinstructionbranchcomplexitylinemethod
VLabelImpl()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
basicSetDomainModelReference(VDomainModelReference, NotificationChain)
M: 29 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 0 C: 14
100%
M: 0 C: 3
100%
M: 0 C: 3
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 2 C: 19
90%
M: 1 C: 6
86%
M: 1 C: 4
80%
M: 0 C: 4
100%
M: 0 C: 1
100%
eSet(int, Object)
M: 5 C: 12
71%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 2 C: 5
71%
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: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 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%
getStyle()
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%
setDomainModelReference(VDomainModelReference)
M: 52 C: 0
0%
M: 10 C: 0
0%
M: 6 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
setStyle(VLabelStyle)
M: 2 C: 23
92%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 0 C: 5
100%
M: 0 C: 1
100%
static {...}
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%
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: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.label.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.common.notify.NotificationChain;
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecore.InternalEObject;
20: import org.eclipse.emf.ecore.impl.ENotificationImpl;
21: import org.eclipse.emf.ecp.view.spi.label.model.VLabel;
22: import org.eclipse.emf.ecp.view.spi.label.model.VLabelPackage;
23: import org.eclipse.emf.ecp.view.spi.label.model.VLabelStyle;
24: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
25: import org.eclipse.emf.ecp.view.spi.model.impl.VContainedElementImpl;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>Label</b></em>'.
30: * <!-- end-user-doc -->
31: * <p>
32: * The following features are implemented:
33: * <ul>
34: * <li>{@link org.eclipse.emf.ecp.view.spi.label.model.impl.VLabelImpl#getStyle <em>Style</em>}</li>
35: * <li>{@link org.eclipse.emf.ecp.view.spi.label.model.impl.VLabelImpl#getDomainModelReference <em>Domain Model
36: * Reference</em>}</li>
37: * </ul>
38: * </p>
39: *
40: * @generated
41: */
42: public class VLabelImpl extends VContainedElementImpl implements VLabel {
43:         /**
44:          * The default value of the '{@link #getStyle() <em>Style</em>}' attribute.
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @see #getStyle()
49:          * @generated
50:          * @ordered
51:          */
52:         protected static final VLabelStyle STYLE_EDEFAULT = VLabelStyle.H0;
53:
54:         /**
55:          * The cached value of the '{@link #getStyle() <em>Style</em>}' attribute.
56:          * <!-- begin-user-doc -->
57:          * <!-- end-user-doc -->
58:          *
59:          * @see #getStyle()
60:          * @generated
61:          * @ordered
62:          */
63:         protected VLabelStyle style = STYLE_EDEFAULT;
64:
65:         /**
66:          * The cached value of the '{@link #getDomainModelReference() <em>Domain Model Reference</em>}' containment
67:          * reference.
68:          * <!-- begin-user-doc -->
69:          *
70:          * @since 1.4
71:          * <!-- end-user-doc -->
72:          *
73:          * @see #getDomainModelReference()
74:          * @generated
75:          * @ordered
76:          */
77:         protected VDomainModelReference domainModelReference;
78:
79:         /**
80:          * <!-- begin-user-doc -->
81:          * <!-- end-user-doc -->
82:          *
83:          * @generated
84:          */
85:         protected VLabelImpl() {
86:                 super();
87:         }
88:
89:         /**
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @generated
94:          */
95:         @Override
96:         protected EClass eStaticClass() {
97:                 return VLabelPackage.Literals.LABEL;
98:         }
99:
100:         /**
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         @Override
107:         public VLabelStyle getStyle() {
108:                 return style;
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public void setStyle(VLabelStyle newStyle) {
119:                 final VLabelStyle oldStyle = style;
120:•                style = newStyle == null ? STYLE_EDEFAULT : newStyle;
121:•                if (eNotificationRequired()) {
122:                         eNotify(new ENotificationImpl(this, Notification.SET, VLabelPackage.LABEL__STYLE, oldStyle, style));
123:                 }
124:         }
125:
126:         /**
127:          * <!-- begin-user-doc -->
128:          *
129:          * @since 1.4
130:          * <!-- end-user-doc -->
131:          *
132:          * @generated
133:          */
134:         @Override
135:         public VDomainModelReference getDomainModelReference() {
136:                 return domainModelReference;
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc -->
141:          *
142:          * @since 1.4
143:          * <!-- end-user-doc -->
144:          *
145:          * @generated
146:          */
147:         public NotificationChain basicSetDomainModelReference(VDomainModelReference newDomainModelReference,
148:                 NotificationChain msgs) {
149:                 final VDomainModelReference oldDomainModelReference = domainModelReference;
150:                 domainModelReference = newDomainModelReference;
151:•                if (eNotificationRequired()) {
152:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
153:                                 VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE, oldDomainModelReference, newDomainModelReference);
154:•                        if (msgs == null) {
155:                                 msgs = notification;
156:                         } else {
157:                                 msgs.add(notification);
158:                         }
159:                 }
160:                 return msgs;
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          *
166:          * @since 1.4
167:          * <!-- end-user-doc -->
168:          *
169:          * @generated
170:          */
171:         @Override
172:         public void setDomainModelReference(VDomainModelReference newDomainModelReference) {
173:•                if (newDomainModelReference != domainModelReference) {
174:                         NotificationChain msgs = null;
175:•                        if (domainModelReference != null) {
176:                                 msgs = ((InternalEObject) domainModelReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
177:                                         - VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE, null, msgs);
178:                         }
179:•                        if (newDomainModelReference != null) {
180:                                 msgs = ((InternalEObject) newDomainModelReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
181:                                         - VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE, null, msgs);
182:                         }
183:                         msgs = basicSetDomainModelReference(newDomainModelReference, msgs);
184:•                        if (msgs != null) {
185:                                 msgs.dispatch();
186:                         }
187:•                } else if (eNotificationRequired()) {
188:                         eNotify(new ENotificationImpl(this, Notification.SET, VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE,
189:                                 newDomainModelReference, newDomainModelReference));
190:                 }
191:         }
192:
193:         /**
194:          * <!-- begin-user-doc -->
195:          * <!-- end-user-doc -->
196:          *
197:          * @generated
198:          */
199:         @Override
200:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
201:•                switch (featureID) {
202:                 case VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE:
203:                         return basicSetDomainModelReference(null, msgs);
204:                 }
205:                 return super.eInverseRemove(otherEnd, featureID, msgs);
206:         }
207:
208:         /**
209:          * <!-- begin-user-doc -->
210:          * <!-- end-user-doc -->
211:          *
212:          * @generated
213:          */
214:         @Override
215:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
216:•                switch (featureID) {
217:                 case VLabelPackage.LABEL__STYLE:
218:                         return getStyle();
219:                 case VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE:
220:                         return getDomainModelReference();
221:                 }
222:                 return super.eGet(featureID, resolve, coreType);
223:         }
224:
225:         /**
226:          * <!-- begin-user-doc -->
227:          * <!-- end-user-doc -->
228:          *
229:          * @generated
230:          */
231:         @Override
232:         public void eSet(int featureID, Object newValue) {
233:•                switch (featureID) {
234:                 case VLabelPackage.LABEL__STYLE:
235:                         setStyle((VLabelStyle) newValue);
236:                         return;
237:                 case VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE:
238:                         setDomainModelReference((VDomainModelReference) newValue);
239:                         return;
240:                 }
241:                 super.eSet(featureID, newValue);
242:         }
243:
244:         /**
245:          * <!-- begin-user-doc -->
246:          * <!-- end-user-doc -->
247:          *
248:          * @generated
249:          */
250:         @Override
251:         public void eUnset(int featureID) {
252:•                switch (featureID) {
253:                 case VLabelPackage.LABEL__STYLE:
254:                         setStyle(STYLE_EDEFAULT);
255:                         return;
256:                 case VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE:
257:                         setDomainModelReference((VDomainModelReference) null);
258:                         return;
259:                 }
260:                 super.eUnset(featureID);
261:         }
262:
263:         /**
264:          * <!-- begin-user-doc -->
265:          * <!-- end-user-doc -->
266:          *
267:          * @generated
268:          */
269:         @Override
270:         public boolean eIsSet(int featureID) {
271:•                switch (featureID) {
272:                 case VLabelPackage.LABEL__STYLE:
273:•                        return style != STYLE_EDEFAULT;
274:                 case VLabelPackage.LABEL__DOMAIN_MODEL_REFERENCE:
275:•                        return domainModelReference != null;
276:                 }
277:                 return super.eIsSet(featureID);
278:         }
279:
280:         /**
281:          * <!-- begin-user-doc -->
282:          * <!-- end-user-doc -->
283:          *
284:          * @generated
285:          */
286:         @Override
287:         public String toString() {
288:•                if (eIsProxy()) {
289:                         return super.toString();
290:                 }
291:
292:                 final StringBuffer result = new StringBuffer(super.toString());
293:                 result.append(" (style: "); //$NON-NLS-1$
294:                 result.append(style);
295:                 result.append(')');
296:                 return result.toString();
297:         }
298:
299: } // VLabelImpl