Skip to content

Package: VTLabelWidthStylePropertyImpl

VTLabelWidthStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTLabelWidthStylePropertyImpl()
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%
eGet(int, boolean, boolean)
M: 6 C: 6
50%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
eIsSet(int)
M: 4 C: 5
56%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
eSet(int, Object)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
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: 9 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
equalStyles(VTStyleProperty)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getWidth()
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%
isSetWidth()
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%
setWidth(int)
M: 16 C: 16
50%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 2 C: 6
75%
M: 0 C: 1
100%
toString()
M: 36 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
unsetWidth()
M: 11 C: 16
59%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 6
75%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2017 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.template.style.labelwidth.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.ecore.impl.MinimalEObjectImpl;
20: import org.eclipse.emf.ecp.common.spi.EMFUtils;
21: import org.eclipse.emf.ecp.view.template.model.VTStyleProperty;
22: import org.eclipse.emf.ecp.view.template.style.labelwidth.model.VTLabelWidthStyleProperty;
23: import org.eclipse.emf.ecp.view.template.style.labelwidth.model.VTLabelwidthPackage;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model object '<em><b>Label Width Style Property</b></em>'.
28: * <!-- end-user-doc -->
29: * <p>
30: * The following features are implemented:
31: * </p>
32: * <ul>
33: * <li>{@link org.eclipse.emf.ecp.view.template.style.labelwidth.model.impl.VTLabelWidthStylePropertyImpl#getWidth
34: * <em>Width</em>}</li>
35: * </ul>
36: *
37: * @generated
38: */
39: public class VTLabelWidthStylePropertyImpl extends MinimalEObjectImpl.Container implements VTLabelWidthStyleProperty {
40:         /**
41:          * The default value of the '{@link #getWidth() <em>Width</em>}' attribute.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @see #getWidth()
46:          * @generated
47:          * @ordered
48:          */
49:         protected static final int WIDTH_EDEFAULT = 0;
50:
51:         /**
52:          * The cached value of the '{@link #getWidth() <em>Width</em>}' attribute.
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @see #getWidth()
57:          * @generated
58:          * @ordered
59:          */
60:         protected int width = WIDTH_EDEFAULT;
61:
62:         /**
63:          * This is true if the Width attribute has been set.
64:          * <!-- begin-user-doc -->
65:          * <!-- end-user-doc -->
66:          *
67:          * @generated
68:          * @ordered
69:          */
70:         protected boolean widthESet;
71:
72:         /**
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         protected VTLabelWidthStylePropertyImpl() {
79:                 super();
80:         }
81:
82:         /**
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         @Override
89:         protected EClass eStaticClass() {
90:                 return VTLabelwidthPackage.Literals.LABEL_WIDTH_STYLE_PROPERTY;
91:         }
92:
93:         /**
94:          * <!-- begin-user-doc -->
95:          * <!-- end-user-doc -->
96:          *
97:          * @generated
98:          */
99:         @Override
100:         public int getWidth() {
101:                 return width;
102:         }
103:
104:         /**
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         @Override
111:         public void setWidth(int newWidth) {
112:                 final int oldWidth = width;
113:                 width = newWidth;
114:                 final boolean oldWidthESet = widthESet;
115:                 widthESet = true;
116:•                if (eNotificationRequired()) {
117:                         eNotify(new ENotificationImpl(this, Notification.SET, VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH,
118:•                                oldWidth, width, !oldWidthESet));
119:                 }
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public void unsetWidth() {
130:                 final int oldWidth = width;
131:                 final boolean oldWidthESet = widthESet;
132:                 width = WIDTH_EDEFAULT;
133:                 widthESet = false;
134:•                if (eNotificationRequired()) {
135:                         eNotify(new ENotificationImpl(this, Notification.UNSET,
136:                                 VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH, oldWidth, WIDTH_EDEFAULT, oldWidthESet));
137:                 }
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public boolean isSetWidth() {
148:                 return widthESet;
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
159:•                switch (featureID) {
160:                 case VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH:
161:                         return getWidth();
162:                 }
163:                 return super.eGet(featureID, resolve, coreType);
164:         }
165:
166:         /**
167:          * <!-- begin-user-doc -->
168:          * <!-- end-user-doc -->
169:          *
170:          * @generated
171:          */
172:         @Override
173:         public void eSet(int featureID, Object newValue) {
174:•                switch (featureID) {
175:                 case VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH:
176:                         setWidth((Integer) newValue);
177:                         return;
178:                 }
179:                 super.eSet(featureID, newValue);
180:         }
181:
182:         /**
183:          * <!-- begin-user-doc -->
184:          * <!-- end-user-doc -->
185:          *
186:          * @generated
187:          */
188:         @Override
189:         public void eUnset(int featureID) {
190:•                switch (featureID) {
191:                 case VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH:
192:                         unsetWidth();
193:                         return;
194:                 }
195:                 super.eUnset(featureID);
196:         }
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          * <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         @Override
205:         public boolean eIsSet(int featureID) {
206:•                switch (featureID) {
207:                 case VTLabelwidthPackage.LABEL_WIDTH_STYLE_PROPERTY__WIDTH:
208:                         return isSetWidth();
209:                 }
210:                 return super.eIsSet(featureID);
211:         }
212:
213:         /**
214:          * <!-- begin-user-doc -->
215:          * <!-- end-user-doc -->
216:          *
217:          * @generated
218:          */
219:         @Override
220:         public String toString() {
221:•                if (eIsProxy()) {
222:                         return super.toString();
223:                 }
224:
225:                 final StringBuffer result = new StringBuffer(super.toString());
226:                 result.append(" (width: "); //$NON-NLS-1$
227:•                if (widthESet) {
228:                         result.append(width);
229:                 } else {
230:                         result.append("<unset>"); //$NON-NLS-1$
231:                 }
232:                 result.append(')');
233:                 return result.toString();
234:         }
235:
236:         @Override
237:         public boolean equalStyles(VTStyleProperty styleProperty) {
238:                 return EMFUtils.filteredEquals(this, styleProperty);
239:         }
240:
241: } // VTLabelWidthStylePropertyImpl