Skip to content

Package: VSectionImpl

VSectionImpl

nameinstructionbranchcomplexitylinemethod
VSectionImpl()
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
eBaseStructuralFeatureID(int, Class)
M: 14 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
eDerivedStructuralFeatureID(int, Class)
M: 2 C: 12
86%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 1 C: 4
80%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 4 C: 14
78%
M: 1 C: 3
75%
M: 1 C: 3
75%
M: 1 C: 4
80%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 15 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: 21 C: 17
45%
M: 9 C: 5
36%
M: 6 C: 3
33%
M: 2 C: 3
60%
M: 0 C: 1
100%
eSet(int, Object)
M: 21 C: 7
25%
M: 3 C: 1
25%
M: 3 C: 1
25%
M: 7 C: 3
30%
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%
getChildItems()
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%
getTooltip()
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%
isCollapsed()
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%
setCollapsed(boolean)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
setTooltip(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
static {...}
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%
toString()
M: 37 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

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.section.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.VHasTooltip;
27: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
28: import org.eclipse.emf.ecp.view.spi.model.impl.VContainerImpl;
29: import org.eclipse.emf.ecp.view.spi.section.model.VSection;
30: import org.eclipse.emf.ecp.view.spi.section.model.VSectionPackage;
31:
32: /**
33: * <!-- begin-user-doc -->
34: * An implementation of the model object '<em><b>Section</b></em>'.
35: * <!-- end-user-doc -->
36: * <p>
37: * The following features are implemented:
38: * </p>
39: * <ul>
40: * <li>{@link org.eclipse.emf.ecp.view.spi.section.model.impl.VSectionImpl#getTooltip <em>Tooltip</em>}</li>
41: * <li>{@link org.eclipse.emf.ecp.view.spi.section.model.impl.VSectionImpl#getChildItems <em>Child Items</em>}</li>
42: * <li>{@link org.eclipse.emf.ecp.view.spi.section.model.impl.VSectionImpl#isCollapsed <em>Collapsed</em>}</li>
43: * </ul>
44: *
45: * @generated
46: */
47: public class VSectionImpl extends VContainerImpl implements VSection {
48:         /**
49:          * The default value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @see #getTooltip()
54:          * @generated
55:          * @ordered
56:          * @since 1.13
57:          */
58:         protected static final String TOOLTIP_EDEFAULT = null;
59:         /**
60:          * The cached value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute.
61:          * <!-- begin-user-doc -->
62:          * <!-- end-user-doc -->
63:          *
64:          * @see #getTooltip()
65:          * @generated
66:          * @ordered
67:          * @since 1.13
68:          */
69:         protected String tooltip = TOOLTIP_EDEFAULT;
70:         /**
71:          * The cached value of the '{@link #getChildItems() <em>Child Items</em>}' containment reference list.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @see #getChildItems()
76:          * @generated
77:          * @ordered
78:          */
79:         protected EList<VSection> childItems;
80:         /**
81:          * The default value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @see #isCollapsed()
86:          * @generated
87:          * @ordered
88:          */
89:         protected static final boolean COLLAPSED_EDEFAULT = false;
90:         /**
91:          * The cached value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
92:          * <!-- begin-user-doc -->
93:          * <!-- end-user-doc -->
94:          *
95:          * @see #isCollapsed()
96:          * @generated
97:          * @ordered
98:          */
99:         protected boolean collapsed = COLLAPSED_EDEFAULT;
100:
101:         /**
102:          * <!-- begin-user-doc -->
103:          * <!-- end-user-doc -->
104:          *
105:          * @generated
106:          */
107:         protected VSectionImpl() {
108:                 super();
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         protected EClass eStaticClass() {
119:                 return VSectionPackage.Literals.SECTION;
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          * @since 1.13
128:          */
129:         @Override
130:         public String getTooltip() {
131:                 return tooltip;
132:         }
133:
134:         /**
135:          * <!-- begin-user-doc -->
136:          * <!-- end-user-doc -->
137:          *
138:          * @generated
139:          * @since 1.13
140:          */
141:         @Override
142:         public void setTooltip(String newTooltip) {
143:                 final String oldTooltip = tooltip;
144:                 tooltip = newTooltip;
145:•                if (eNotificationRequired()) {
146:                         eNotify(
147:                                 new ENotificationImpl(this, Notification.SET, VSectionPackage.SECTION__TOOLTIP, oldTooltip, tooltip));
148:                 }
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public EList<VSection> getChildItems() {
159:•                if (childItems == null) {
160:                         childItems = new EObjectContainmentEList<VSection>(VSection.class, this,
161:                                 VSectionPackage.SECTION__CHILD_ITEMS);
162:                 }
163:                 return childItems;
164:         }
165:
166:         /**
167:          * <!-- begin-user-doc -->
168:          * <!-- end-user-doc -->
169:          *
170:          * @generated
171:          */
172:         @Override
173:         public boolean isCollapsed() {
174:                 return collapsed;
175:         }
176:
177:         /**
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @generated
182:          */
183:         @Override
184:         public void setCollapsed(boolean newCollapsed) {
185:                 final boolean oldCollapsed = collapsed;
186:                 collapsed = newCollapsed;
187:•                if (eNotificationRequired()) {
188:                         eNotify(new ENotificationImpl(this, Notification.SET, VSectionPackage.SECTION__COLLAPSED, oldCollapsed,
189:                                 collapsed));
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 VSectionPackage.SECTION__CHILD_ITEMS:
203:                         return ((InternalEList<?>) getChildItems()).basicRemove(otherEnd, 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 VSectionPackage.SECTION__TOOLTIP:
218:                         return getTooltip();
219:                 case VSectionPackage.SECTION__CHILD_ITEMS:
220:                         return getChildItems();
221:                 case VSectionPackage.SECTION__COLLAPSED:
222:                         return isCollapsed();
223:                 }
224:                 return super.eGet(featureID, resolve, coreType);
225:         }
226:
227:         /**
228:          * <!-- begin-user-doc -->
229:          * <!-- end-user-doc -->
230:          *
231:          * @generated
232:          */
233:         @SuppressWarnings("unchecked")
234:         @Override
235:         public void eSet(int featureID, Object newValue) {
236:•                switch (featureID) {
237:                 case VSectionPackage.SECTION__TOOLTIP:
238:                         setTooltip((String) newValue);
239:                         return;
240:                 case VSectionPackage.SECTION__CHILD_ITEMS:
241:                         getChildItems().clear();
242:                         getChildItems().addAll((Collection<? extends VSection>) newValue);
243:                         return;
244:                 case VSectionPackage.SECTION__COLLAPSED:
245:                         setCollapsed((Boolean) newValue);
246:                         return;
247:                 }
248:                 super.eSet(featureID, newValue);
249:         }
250:
251:         /**
252:          * <!-- begin-user-doc -->
253:          * <!-- end-user-doc -->
254:          *
255:          * @generated
256:          */
257:         @Override
258:         public void eUnset(int featureID) {
259:•                switch (featureID) {
260:                 case VSectionPackage.SECTION__TOOLTIP:
261:                         setTooltip(TOOLTIP_EDEFAULT);
262:                         return;
263:                 case VSectionPackage.SECTION__CHILD_ITEMS:
264:                         getChildItems().clear();
265:                         return;
266:                 case VSectionPackage.SECTION__COLLAPSED:
267:                         setCollapsed(COLLAPSED_EDEFAULT);
268:                         return;
269:                 }
270:                 super.eUnset(featureID);
271:         }
272:
273:         /**
274:          * <!-- begin-user-doc -->
275:          * <!-- end-user-doc -->
276:          *
277:          * @generated
278:          */
279:         @Override
280:         public boolean eIsSet(int featureID) {
281:•                switch (featureID) {
282:                 case VSectionPackage.SECTION__TOOLTIP:
283:•                        return TOOLTIP_EDEFAULT == null ? tooltip != null : !TOOLTIP_EDEFAULT.equals(tooltip);
284:                 case VSectionPackage.SECTION__CHILD_ITEMS:
285:•                        return childItems != null && !childItems.isEmpty();
286:                 case VSectionPackage.SECTION__COLLAPSED:
287:                         return collapsed != COLLAPSED_EDEFAULT;
288:                 }
289:                 return super.eIsSet(featureID);
290:         }
291:
292:         /**
293:          * <!-- begin-user-doc -->
294:          * <!-- end-user-doc -->
295:          *
296:          * @generated
297:          */
298:         @Override
299:         public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
300:•                if (baseClass == VHasTooltip.class) {
301:•                        switch (derivedFeatureID) {
302:                         case VSectionPackage.SECTION__TOOLTIP:
303:                                 return VViewPackage.HAS_TOOLTIP__TOOLTIP;
304:                         default:
305:                                 return -1;
306:                         }
307:                 }
308:                 return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
309:         }
310:
311:         /**
312:          * <!-- begin-user-doc -->
313:          * <!-- end-user-doc -->
314:          *
315:          * @generated
316:          */
317:         @Override
318:         public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
319:•                if (baseClass == VHasTooltip.class) {
320:•                        switch (baseFeatureID) {
321:                         case VViewPackage.HAS_TOOLTIP__TOOLTIP:
322:                                 return VSectionPackage.SECTION__TOOLTIP;
323:                         default:
324:                                 return -1;
325:                         }
326:                 }
327:                 return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
328:         }
329:
330:         /**
331:          * <!-- begin-user-doc -->
332:          * <!-- end-user-doc -->
333:          *
334:          * @generated
335:          */
336:         @Override
337:         public String toString() {
338:•                if (eIsProxy()) {
339:                         return super.toString();
340:                 }
341:
342:                 final StringBuffer result = new StringBuffer(super.toString());
343:                 result.append(" (tooltip: "); //$NON-NLS-1$
344:                 result.append(tooltip);
345:                 result.append(", collapsed: "); //$NON-NLS-1$
346:                 result.append(collapsed);
347:                 result.append(')');
348:                 return result.toString();
349:         }
350:
351: } // VSectionImpl