Skip to content

Package: VTMandatoryStylePropertyImpl

VTMandatoryStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTMandatoryStylePropertyImpl()
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%
eGet(int, boolean, boolean)
M: 6 C: 9
60%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 13 C: 18
58%
M: 5 C: 6
55%
M: 4 C: 3
43%
M: 1 C: 5
83%
M: 0 C: 1
100%
eSet(int, Object)
M: 11 C: 7
39%
M: 2 C: 1
33%
M: 2 C: 1
33%
M: 4 C: 3
43%
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%
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%
getMandatoryMarker()
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%
isHighliteMandatoryFields()
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%
setHighliteMandatoryFields(boolean)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 3 C: 4
57%
M: 0 C: 1
100%
setMandatoryMarker(String)
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%
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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.mandatory.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.mandatory.model.VTMandatoryPackage;
23: import org.eclipse.emf.ecp.view.template.style.mandatory.model.VTMandatoryStyleProperty;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model object '<em><b>Style Property</b></em>'.
28: * <!-- end-user-doc -->
29: * <p>
30: * The following features are implemented:
31: * <ul>
32: * <li>
33: * {@link org.eclipse.emf.ecp.view.template.style.mandatory.model.impl.VTMandatoryStylePropertyImpl#isHighliteMandatoryFields
34: * <em>Highlite Mandatory Fields</em>}</li>
35: * <li>
36: * {@link org.eclipse.emf.ecp.view.template.style.mandatory.model.impl.VTMandatoryStylePropertyImpl#getMandatoryMarker
37: * <em>Mandatory Marker</em>}</li>
38: * </ul>
39: * </p>
40: *
41: * @generated
42: */
43: public class VTMandatoryStylePropertyImpl extends MinimalEObjectImpl.Container implements VTMandatoryStyleProperty {
44:         /**
45:          * The default value of the '{@link #isHighliteMandatoryFields() <em>Highlite Mandatory Fields</em>}' attribute.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @see #isHighliteMandatoryFields()
50:          * @generated
51:          * @ordered
52:          */
53:         protected static final boolean HIGHLITE_MANDATORY_FIELDS_EDEFAULT = true;
54:
55:         /**
56:          * The cached value of the '{@link #isHighliteMandatoryFields() <em>Highlite Mandatory Fields</em>}' attribute.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @see #isHighliteMandatoryFields()
61:          * @generated
62:          * @ordered
63:          */
64:         protected boolean highliteMandatoryFields = HIGHLITE_MANDATORY_FIELDS_EDEFAULT;
65:
66:         /**
67:          * The default value of the '{@link #getMandatoryMarker() <em>Mandatory Marker</em>}' attribute.
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @see #getMandatoryMarker()
72:          * @generated
73:          * @ordered
74:          */
75:         protected static final String MANDATORY_MARKER_EDEFAULT = "*"; //$NON-NLS-1$
76:
77:         /**
78:          * The cached value of the '{@link #getMandatoryMarker() <em>Mandatory Marker</em>}' attribute.
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @see #getMandatoryMarker()
83:          * @generated
84:          * @ordered
85:          */
86:         protected String mandatoryMarker = MANDATORY_MARKER_EDEFAULT;
87:
88:         /**
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         protected VTMandatoryStylePropertyImpl() {
95:                 super();
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         protected EClass eStaticClass() {
106:                 return VTMandatoryPackage.Literals.MANDATORY_STYLE_PROPERTY;
107:         }
108:
109:         /**
110:          * <!-- begin-user-doc -->
111:          * <!-- end-user-doc -->
112:          *
113:          * @generated
114:          */
115:         @Override
116:         public boolean isHighliteMandatoryFields() {
117:                 return highliteMandatoryFields;
118:         }
119:
120:         /**
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @generated
125:          */
126:         @Override
127:         public void setHighliteMandatoryFields(boolean newHighliteMandatoryFields) {
128:                 final boolean oldHighliteMandatoryFields = highliteMandatoryFields;
129:                 highliteMandatoryFields = newHighliteMandatoryFields;
130:•                if (eNotificationRequired()) {
131:                         eNotify(new ENotificationImpl(this, Notification.SET,
132:                                 VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__HIGHLITE_MANDATORY_FIELDS, oldHighliteMandatoryFields,
133:                                 highliteMandatoryFields));
134:                 }
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public String getMandatoryMarker() {
145:                 return mandatoryMarker;
146:         }
147:
148:         /**
149:          * <!-- begin-user-doc -->
150:          * <!-- end-user-doc -->
151:          *
152:          * @generated
153:          */
154:         @Override
155:         public void setMandatoryMarker(String newMandatoryMarker) {
156:                 final String oldMandatoryMarker = mandatoryMarker;
157:                 mandatoryMarker = newMandatoryMarker;
158:•                if (eNotificationRequired()) {
159:                         eNotify(new ENotificationImpl(this, Notification.SET,
160:                                 VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__MANDATORY_MARKER, oldMandatoryMarker, mandatoryMarker));
161:                 }
162:         }
163:
164:         /**
165:          * <!-- begin-user-doc -->
166:          * <!-- end-user-doc -->
167:          *
168:          * @generated
169:          */
170:         @Override
171:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
172:•                switch (featureID) {
173:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__HIGHLITE_MANDATORY_FIELDS:
174:                         return isHighliteMandatoryFields();
175:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__MANDATORY_MARKER:
176:                         return getMandatoryMarker();
177:                 }
178:                 return super.eGet(featureID, resolve, coreType);
179:         }
180:
181:         /**
182:          * <!-- begin-user-doc -->
183:          * <!-- end-user-doc -->
184:          *
185:          * @generated
186:          */
187:         @Override
188:         public void eSet(int featureID, Object newValue) {
189:•                switch (featureID) {
190:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__HIGHLITE_MANDATORY_FIELDS:
191:                         setHighliteMandatoryFields((Boolean) newValue);
192:                         return;
193:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__MANDATORY_MARKER:
194:                         setMandatoryMarker((String) newValue);
195:                         return;
196:                 }
197:                 super.eSet(featureID, newValue);
198:         }
199:
200:         /**
201:          * <!-- begin-user-doc -->
202:          * <!-- end-user-doc -->
203:          *
204:          * @generated
205:          */
206:         @Override
207:         public void eUnset(int featureID) {
208:•                switch (featureID) {
209:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__HIGHLITE_MANDATORY_FIELDS:
210:                         setHighliteMandatoryFields(HIGHLITE_MANDATORY_FIELDS_EDEFAULT);
211:                         return;
212:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__MANDATORY_MARKER:
213:                         setMandatoryMarker(MANDATORY_MARKER_EDEFAULT);
214:                         return;
215:                 }
216:                 super.eUnset(featureID);
217:         }
218:
219:         /**
220:          * <!-- begin-user-doc -->
221:          * <!-- end-user-doc -->
222:          *
223:          * @generated
224:          */
225:         @Override
226:         public boolean eIsSet(int featureID) {
227:•                switch (featureID) {
228:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__HIGHLITE_MANDATORY_FIELDS:
229:•                        return highliteMandatoryFields != HIGHLITE_MANDATORY_FIELDS_EDEFAULT;
230:                 case VTMandatoryPackage.MANDATORY_STYLE_PROPERTY__MANDATORY_MARKER:
231:•                        return MANDATORY_MARKER_EDEFAULT == null ? mandatoryMarker != null
232:                                 : !MANDATORY_MARKER_EDEFAULT
233:•                                        .equals(mandatoryMarker);
234:                 }
235:                 return super.eIsSet(featureID);
236:         }
237:
238:         /**
239:          * <!-- begin-user-doc -->
240:          * <!-- end-user-doc -->
241:          *
242:          * @generated
243:          */
244:         @Override
245:         public String toString() {
246:•                if (eIsProxy()) {
247:                         return super.toString();
248:                 }
249:
250:                 final StringBuffer result = new StringBuffer(super.toString());
251:                 result.append(" (highliteMandatoryFields: "); //$NON-NLS-1$
252:                 result.append(highliteMandatoryFields);
253:                 result.append(", mandatoryMarker: "); //$NON-NLS-1$
254:                 result.append(mandatoryMarker);
255:                 result.append(')');
256:                 return result.toString();
257:         }
258:
259:         /**
260:          * {@inheritDoc}
261:          *
262:          * @see org.eclipse.emf.ecp.view.template.model.VTStyleProperty#equalStyles(org.eclipse.emf.ecp.view.template.model.VTStyleProperty)
263:          */
264:         @Override
265:         public boolean equalStyles(VTStyleProperty styleProperty) {
266:                 return EMFUtils.filteredEquals(this, styleProperty);
267:         }
268:
269: } // VTMandatoryStylePropertyImpl