Skip to content

Package: VGroupImpl

VGroupImpl

nameinstructionbranchcomplexitylinemethod
VGroupImpl()
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 6
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: 0 C: 21
100%
M: 0 C: 5
100%
M: 0 C: 5
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
eIsSet(int)
M: 12 C: 31
72%
M: 5 C: 10
67%
M: 4 C: 6
60%
M: 0 C: 6
100%
M: 0 C: 1
100%
eSet(int, Object)
M: 5 C: 23
82%
M: 1 C: 4
80%
M: 1 C: 4
80%
M: 2 C: 9
82%
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: 22 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
getGroupType()
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%
getLabelAlignment()
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%
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: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setCollapsed(boolean)
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%
setGroupType(GroupType)
M: 13 C: 12
48%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 4
67%
M: 0 C: 1
100%
setLabelAlignment(GroupLabelAlignment)
M: 25 C: 0
0%
M: 4 C: 0
0%
M: 3 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: 1 C: 4
80%
M: 0 C: 1
100%
static {...}
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
toString()
M: 55 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 13 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.group.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecp.view.spi.group.model.GroupLabelAlignment;
20: import org.eclipse.emf.ecp.view.spi.group.model.GroupType;
21: import org.eclipse.emf.ecp.view.spi.group.model.VGroup;
22: import org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage;
23: import org.eclipse.emf.ecp.view.spi.model.VHasTooltip;
24: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
25: import org.eclipse.emf.ecp.view.spi.model.impl.VContainedContainerImpl;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>Group</b></em>'.
30: *
31: * @since 1.3
32: * <!-- end-user-doc -->
33: * <p>
34: * The following features are implemented:
35: * </p>
36: * <ul>
37: * <li>{@link org.eclipse.emf.ecp.view.spi.group.model.impl.VGroupImpl#getTooltip <em>Tooltip</em>}</li>
38: * <li>{@link org.eclipse.emf.ecp.view.spi.group.model.impl.VGroupImpl#getGroupType <em>Group Type</em>}</li>
39: * <li>{@link org.eclipse.emf.ecp.view.spi.group.model.impl.VGroupImpl#getLabelAlignment <em>Label
40: * Alignment</em>}</li>
41: * <li>{@link org.eclipse.emf.ecp.view.spi.group.model.impl.VGroupImpl#isCollapsed <em>Collapsed</em>}</li>
42: * </ul>
43: *
44: * @generated
45: */
46: public class VGroupImpl extends VContainedContainerImpl implements VGroup {
47:         /**
48:          * The default value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute.
49:          * <!-- begin-user-doc -->
50:          * <!-- end-user-doc -->
51:          *
52:          * @see #getTooltip()
53:          * @generated
54:          * @ordered
55:          * @since 1.13
56:          */
57:         protected static final String TOOLTIP_EDEFAULT = null;
58:         /**
59:          * The cached value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute.
60:          * <!-- begin-user-doc -->
61:          * <!-- end-user-doc -->
62:          *
63:          * @see #getTooltip()
64:          * @generated
65:          * @ordered
66:          * @since 1.13
67:          */
68:         protected String tooltip = TOOLTIP_EDEFAULT;
69:         /**
70:          * The default value of the '{@link #getGroupType() <em>Group Type</em>}' attribute.
71:          * <!-- begin-user-doc -->
72:          *
73:          * @since 1.4
74:          * <!-- end-user-doc -->
75:          * @see #getGroupType()
76:          * @generated
77:          * @ordered
78:          */
79:         protected static final GroupType GROUP_TYPE_EDEFAULT = GroupType.NORMAL;
80:         /**
81:          * The cached value of the '{@link #getGroupType() <em>Group Type</em>}' attribute.
82:          * <!-- begin-user-doc -->
83:          *
84:          * @since 1.4
85:          * <!-- end-user-doc -->
86:          * @see #getGroupType()
87:          * @generated
88:          * @ordered
89:          */
90:         protected GroupType groupType = GROUP_TYPE_EDEFAULT;
91:         /**
92:          * The default value of the '{@link #getLabelAlignment() <em>Label Alignment</em>}' attribute.
93:          * <!-- begin-user-doc -->
94:          *
95:          * @since 1.3
96:          * <!-- end-user-doc -->
97:          * @see #getLabelAlignment()
98:          * @generated
99:          * @ordered
100:          */
101:         protected static final GroupLabelAlignment LABEL_ALIGNMENT_EDEFAULT = GroupLabelAlignment.LABEL_ALIGNED;
102:         /**
103:          * The cached value of the '{@link #getLabelAlignment() <em>Label Alignment</em>}' attribute.
104:          * <!-- begin-user-doc -->
105:          *
106:          * @since 1.3
107:          * <!-- end-user-doc -->
108:          * @see #getLabelAlignment()
109:          * @generated
110:          * @ordered
111:          */
112:         protected GroupLabelAlignment labelAlignment = LABEL_ALIGNMENT_EDEFAULT;
113:
114:         /**
115:          * The default value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
116:          * <!-- begin-user-doc -->
117:          *
118:          * @since 1.4
119:          * <!-- end-user-doc -->
120:          * @see #isCollapsed()
121:          * @generated
122:          * @ordered
123:          */
124:         protected static final boolean COLLAPSED_EDEFAULT = false;
125:         /**
126:          * The cached value of the '{@link #isCollapsed() <em>Collapsed</em>}' attribute.
127:          * <!-- begin-user-doc -->
128:          *
129:          * @since 1.4
130:          * <!-- end-user-doc -->
131:          * @see #isCollapsed()
132:          * @generated
133:          * @ordered
134:          */
135:         protected boolean collapsed = COLLAPSED_EDEFAULT;
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         protected VGroupImpl() {
144:                 super();
145:         }
146:
147:         /**
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         @Override
154:         protected EClass eStaticClass() {
155:                 return VGroupPackage.Literals.GROUP;
156:         }
157:
158:         /**
159:          * <!-- begin-user-doc -->
160:          * <!-- end-user-doc -->
161:          *
162:          * @generated
163:          * @since 1.13
164:          */
165:         @Override
166:         public String getTooltip() {
167:                 return tooltip;
168:         }
169:
170:         /**
171:          * <!-- begin-user-doc -->
172:          * <!-- end-user-doc -->
173:          *
174:          * @generated
175:          * @since 1.13
176:          */
177:         @Override
178:         public void setTooltip(String newTooltip) {
179:                 final String oldTooltip = tooltip;
180:                 tooltip = newTooltip;
181:•                if (eNotificationRequired()) {
182:                         eNotify(new ENotificationImpl(this, Notification.SET, VGroupPackage.GROUP__TOOLTIP, oldTooltip, tooltip));
183:                 }
184:         }
185:
186:         /**
187:          * <!-- begin-user-doc -->
188:          *
189:          * @since 1.4
190:          * <!-- end-user-doc -->
191:          * @generated
192:          */
193:         @Override
194:         public GroupType getGroupType() {
195:                 return groupType;
196:         }
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          *
201:          * @since 1.4
202:          * <!-- end-user-doc -->
203:          * @generated
204:          */
205:         @Override
206:         public void setGroupType(GroupType newGroupType) {
207:                 final GroupType oldGroupType = groupType;
208:•                groupType = newGroupType == null ? GROUP_TYPE_EDEFAULT : newGroupType;
209:•                if (eNotificationRequired()) {
210:                         eNotify(new ENotificationImpl(this, Notification.SET, VGroupPackage.GROUP__GROUP_TYPE, oldGroupType,
211:                                 groupType));
212:                 }
213:         }
214:
215:         /**
216:          * <!-- begin-user-doc -->
217:          *
218:          * @since 1.3
219:          * <!-- end-user-doc -->
220:          * @generated
221:          */
222:         @Override
223:         public GroupLabelAlignment getLabelAlignment() {
224:                 return labelAlignment;
225:         }
226:
227:         /**
228:          * <!-- begin-user-doc -->
229:          *
230:          * @since 1.3
231:          * <!-- end-user-doc -->
232:          * @generated
233:          */
234:         @Override
235:         public void setLabelAlignment(GroupLabelAlignment newLabelAlignment) {
236:                 final GroupLabelAlignment oldLabelAlignment = labelAlignment;
237:•                labelAlignment = newLabelAlignment == null ? LABEL_ALIGNMENT_EDEFAULT : newLabelAlignment;
238:•                if (eNotificationRequired()) {
239:                         eNotify(new ENotificationImpl(this, Notification.SET, VGroupPackage.GROUP__LABEL_ALIGNMENT,
240:                                 oldLabelAlignment, labelAlignment));
241:                 }
242:         }
243:
244:         /**
245:          * <!-- begin-user-doc -->
246:          *
247:          * @since 1.4
248:          * <!-- end-user-doc -->
249:          * @generated
250:          */
251:         @Override
252:         public boolean isCollapsed() {
253:                 return collapsed;
254:         }
255:
256:         /**
257:          * <!-- begin-user-doc -->
258:          *
259:          * @since 1.4
260:          * <!-- end-user-doc -->
261:          * @generated
262:          */
263:         @Override
264:         public void setCollapsed(boolean newCollapsed) {
265:                 final boolean oldCollapsed = collapsed;
266:                 collapsed = newCollapsed;
267:•                if (eNotificationRequired()) {
268:                         eNotify(
269:                                 new ENotificationImpl(this, Notification.SET, VGroupPackage.GROUP__COLLAPSED, oldCollapsed, collapsed));
270:                 }
271:         }
272:
273:         /**
274:          * <!-- begin-user-doc -->
275:          * <!-- end-user-doc -->
276:          *
277:          * @generated
278:          */
279:         @Override
280:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
281:•                switch (featureID) {
282:                 case VGroupPackage.GROUP__TOOLTIP:
283:                         return getTooltip();
284:                 case VGroupPackage.GROUP__GROUP_TYPE:
285:                         return getGroupType();
286:                 case VGroupPackage.GROUP__LABEL_ALIGNMENT:
287:                         return getLabelAlignment();
288:                 case VGroupPackage.GROUP__COLLAPSED:
289:                         return isCollapsed();
290:                 }
291:                 return super.eGet(featureID, resolve, coreType);
292:         }
293:
294:         /**
295:          * <!-- begin-user-doc -->
296:          * <!-- end-user-doc -->
297:          *
298:          * @generated
299:          */
300:         @Override
301:         public void eSet(int featureID, Object newValue) {
302:•                switch (featureID) {
303:                 case VGroupPackage.GROUP__TOOLTIP:
304:                         setTooltip((String) newValue);
305:                         return;
306:                 case VGroupPackage.GROUP__GROUP_TYPE:
307:                         setGroupType((GroupType) newValue);
308:                         return;
309:                 case VGroupPackage.GROUP__LABEL_ALIGNMENT:
310:                         setLabelAlignment((GroupLabelAlignment) newValue);
311:                         return;
312:                 case VGroupPackage.GROUP__COLLAPSED:
313:                         setCollapsed((Boolean) newValue);
314:                         return;
315:                 }
316:                 super.eSet(featureID, newValue);
317:         }
318:
319:         /**
320:          * <!-- begin-user-doc -->
321:          * <!-- end-user-doc -->
322:          *
323:          * @generated
324:          */
325:         @Override
326:         public void eUnset(int featureID) {
327:•                switch (featureID) {
328:                 case VGroupPackage.GROUP__TOOLTIP:
329:                         setTooltip(TOOLTIP_EDEFAULT);
330:                         return;
331:                 case VGroupPackage.GROUP__GROUP_TYPE:
332:                         setGroupType(GROUP_TYPE_EDEFAULT);
333:                         return;
334:                 case VGroupPackage.GROUP__LABEL_ALIGNMENT:
335:                         setLabelAlignment(LABEL_ALIGNMENT_EDEFAULT);
336:                         return;
337:                 case VGroupPackage.GROUP__COLLAPSED:
338:                         setCollapsed(COLLAPSED_EDEFAULT);
339:                         return;
340:                 }
341:                 super.eUnset(featureID);
342:         }
343:
344:         /**
345:          * <!-- begin-user-doc -->
346:          * <!-- end-user-doc -->
347:          *
348:          * @generated
349:          */
350:         @Override
351:         public boolean eIsSet(int featureID) {
352:•                switch (featureID) {
353:                 case VGroupPackage.GROUP__TOOLTIP:
354:•                        return TOOLTIP_EDEFAULT == null ? tooltip != null : !TOOLTIP_EDEFAULT.equals(tooltip);
355:                 case VGroupPackage.GROUP__GROUP_TYPE:
356:•                        return groupType != GROUP_TYPE_EDEFAULT;
357:                 case VGroupPackage.GROUP__LABEL_ALIGNMENT:
358:•                        return labelAlignment != LABEL_ALIGNMENT_EDEFAULT;
359:                 case VGroupPackage.GROUP__COLLAPSED:
360:                         return collapsed != COLLAPSED_EDEFAULT;
361:                 }
362:                 return super.eIsSet(featureID);
363:         }
364:
365:         /**
366:          * <!-- begin-user-doc -->
367:          * <!-- end-user-doc -->
368:          *
369:          * @generated
370:          */
371:         @Override
372:         public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
373:•                if (baseClass == VHasTooltip.class) {
374:•                        switch (derivedFeatureID) {
375:                         case VGroupPackage.GROUP__TOOLTIP:
376:                                 return VViewPackage.HAS_TOOLTIP__TOOLTIP;
377:                         default:
378:                                 return -1;
379:                         }
380:                 }
381:                 return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
382:         }
383:
384:         /**
385:          * <!-- begin-user-doc -->
386:          * <!-- end-user-doc -->
387:          *
388:          * @generated
389:          */
390:         @Override
391:         public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
392:•                if (baseClass == VHasTooltip.class) {
393:•                        switch (baseFeatureID) {
394:                         case VViewPackage.HAS_TOOLTIP__TOOLTIP:
395:                                 return VGroupPackage.GROUP__TOOLTIP;
396:                         default:
397:                                 return -1;
398:                         }
399:                 }
400:                 return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
401:         }
402:
403:         /**
404:          * <!-- begin-user-doc -->
405:          * <!-- end-user-doc -->
406:          *
407:          * @generated
408:          */
409:         @Override
410:         public String toString() {
411:•                if (eIsProxy()) {
412:                         return super.toString();
413:                 }
414:
415:                 final StringBuffer result = new StringBuffer(super.toString());
416:                 result.append(" (tooltip: "); //$NON-NLS-1$
417:                 result.append(tooltip);
418:                 result.append(", groupType: "); //$NON-NLS-1$
419:                 result.append(groupType);
420:                 result.append(", labelAlignment: "); //$NON-NLS-1$
421:                 result.append(labelAlignment);
422:                 result.append(", collapsed: "); //$NON-NLS-1$
423:                 result.append(collapsed);
424:                 result.append(')');
425:                 return result.toString();
426:         }
427:
428: } // VGroupImpl