Skip to content

Package: VTReferenceStylePropertyImpl

VTReferenceStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTReferenceStylePropertyImpl()
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: 10
63%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 8 C: 12
60%
M: 3 C: 4
57%
M: 3 C: 2
40%
M: 1 C: 3
75%
M: 0 C: 1
100%
eSet(int, Object)
M: 11 C: 8
42%
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%
isShowCreateAndLinkButtonForCrossReferences()
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%
isShowLinkButtonForContainmentReferences()
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%
setShowCreateAndLinkButtonForCrossReferences(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%
setShowLinkButtonForContainmentReferences(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%
toString()
M: 3 C: 34
92%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 8
89%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2018 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.reference.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.reference.model.VTReferencePackage;
23: import org.eclipse.emf.ecp.view.template.style.reference.model.VTReferenceStyleProperty;
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: * </p>
32: * <ul>
33: * <li>{@link org.eclipse.emf.ecp.view.template.style.reference.model.impl.VTReferenceStylePropertyImpl#isShowCreateAndLinkButtonForCrossReferences
34: * <em>Show Create And Link Button For Cross References</em>}</li>
35: * <li>{@link org.eclipse.emf.ecp.view.template.style.reference.model.impl.VTReferenceStylePropertyImpl#isShowLinkButtonForContainmentReferences
36: * <em>Show Link Button For Containment References</em>}</li>
37: * </ul>
38: *
39: * @generated
40: */
41: public class VTReferenceStylePropertyImpl extends MinimalEObjectImpl.Container implements VTReferenceStyleProperty {
42:         /**
43:          * The default value of the '{@link #isShowCreateAndLinkButtonForCrossReferences() <em>Show Create And Link Button
44:          * For Cross References</em>}' attribute.
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @see #isShowCreateAndLinkButtonForCrossReferences()
49:          * @generated
50:          * @ordered
51:          */
52:         protected static final boolean SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES_EDEFAULT = true;
53:
54:         /**
55:          * The cached value of the '{@link #isShowCreateAndLinkButtonForCrossReferences() <em>Show Create And Link Button
56:          * For Cross References</em>}' attribute.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @see #isShowCreateAndLinkButtonForCrossReferences()
61:          * @generated
62:          * @ordered
63:          */
64:         protected boolean showCreateAndLinkButtonForCrossReferences = SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES_EDEFAULT;
65:
66:         /**
67:          * The default value of the '{@link #isShowLinkButtonForContainmentReferences() <em>Show Link Button For Containment
68:          * References</em>}' attribute.
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @see #isShowLinkButtonForContainmentReferences()
73:          * @generated
74:          * @ordered
75:          */
76:         protected static final boolean SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES_EDEFAULT = true;
77:
78:         /**
79:          * The cached value of the '{@link #isShowLinkButtonForContainmentReferences() <em>Show Link Button For Containment
80:          * References</em>}' attribute.
81:          * <!-- begin-user-doc -->
82:          * <!-- end-user-doc -->
83:          *
84:          * @see #isShowLinkButtonForContainmentReferences()
85:          * @generated
86:          * @ordered
87:          */
88:         protected boolean showLinkButtonForContainmentReferences = SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES_EDEFAULT;
89:
90:         /**
91:          * <!-- begin-user-doc -->
92:          * <!-- end-user-doc -->
93:          *
94:          * @generated
95:          */
96:         protected VTReferenceStylePropertyImpl() {
97:                 super();
98:         }
99:
100:         /**
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         @Override
107:         protected EClass eStaticClass() {
108:                 return VTReferencePackage.Literals.REFERENCE_STYLE_PROPERTY;
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public boolean isShowCreateAndLinkButtonForCrossReferences() {
119:                 return showCreateAndLinkButtonForCrossReferences;
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public void setShowCreateAndLinkButtonForCrossReferences(boolean newShowCreateAndLinkButtonForCrossReferences) {
130:                 final boolean oldShowCreateAndLinkButtonForCrossReferences = showCreateAndLinkButtonForCrossReferences;
131:                 showCreateAndLinkButtonForCrossReferences = newShowCreateAndLinkButtonForCrossReferences;
132:•                if (eNotificationRequired()) {
133:                         eNotify(new ENotificationImpl(this, Notification.SET,
134:                                 VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES,
135:                                 oldShowCreateAndLinkButtonForCrossReferences, showCreateAndLinkButtonForCrossReferences));
136:                 }
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc -->
141:          * <!-- end-user-doc -->
142:          *
143:          * @generated
144:          */
145:         @Override
146:         public boolean isShowLinkButtonForContainmentReferences() {
147:                 return showLinkButtonForContainmentReferences;
148:         }
149:
150:         /**
151:          * <!-- begin-user-doc -->
152:          * <!-- end-user-doc -->
153:          *
154:          * @generated
155:          */
156:         @Override
157:         public void setShowLinkButtonForContainmentReferences(boolean newShowLinkButtonForContainmentReferences) {
158:                 final boolean oldShowLinkButtonForContainmentReferences = showLinkButtonForContainmentReferences;
159:                 showLinkButtonForContainmentReferences = newShowLinkButtonForContainmentReferences;
160:•                if (eNotificationRequired()) {
161:                         eNotify(new ENotificationImpl(this, Notification.SET,
162:                                 VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES,
163:                                 oldShowLinkButtonForContainmentReferences, showLinkButtonForContainmentReferences));
164:                 }
165:         }
166:
167:         /**
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         @Override
174:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
175:•                switch (featureID) {
176:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES:
177:                         return isShowCreateAndLinkButtonForCrossReferences();
178:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES:
179:                         return isShowLinkButtonForContainmentReferences();
180:                 }
181:                 return super.eGet(featureID, resolve, coreType);
182:         }
183:
184:         /**
185:          * <!-- begin-user-doc -->
186:          * <!-- end-user-doc -->
187:          *
188:          * @generated
189:          */
190:         @Override
191:         public void eSet(int featureID, Object newValue) {
192:•                switch (featureID) {
193:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES:
194:                         setShowCreateAndLinkButtonForCrossReferences((Boolean) newValue);
195:                         return;
196:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES:
197:                         setShowLinkButtonForContainmentReferences((Boolean) newValue);
198:                         return;
199:                 }
200:                 super.eSet(featureID, newValue);
201:         }
202:
203:         /**
204:          * <!-- begin-user-doc -->
205:          * <!-- end-user-doc -->
206:          *
207:          * @generated
208:          */
209:         @Override
210:         public void eUnset(int featureID) {
211:•                switch (featureID) {
212:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES:
213:                         setShowCreateAndLinkButtonForCrossReferences(SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES_EDEFAULT);
214:                         return;
215:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES:
216:                         setShowLinkButtonForContainmentReferences(SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES_EDEFAULT);
217:                         return;
218:                 }
219:                 super.eUnset(featureID);
220:         }
221:
222:         /**
223:          * <!-- begin-user-doc -->
224:          * <!-- end-user-doc -->
225:          *
226:          * @generated
227:          */
228:         @Override
229:         public boolean eIsSet(int featureID) {
230:•                switch (featureID) {
231:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES:
232:•                        return showCreateAndLinkButtonForCrossReferences != SHOW_CREATE_AND_LINK_BUTTON_FOR_CROSS_REFERENCES_EDEFAULT;
233:                 case VTReferencePackage.REFERENCE_STYLE_PROPERTY__SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES:
234:•                        return showLinkButtonForContainmentReferences != SHOW_LINK_BUTTON_FOR_CONTAINMENT_REFERENCES_EDEFAULT;
235:                 }
236:                 return super.eIsSet(featureID);
237:         }
238:
239:         /**
240:          * <!-- begin-user-doc -->
241:          * <!-- end-user-doc -->
242:          *
243:          * @generated
244:          */
245:         @Override
246:         public String toString() {
247:•                if (eIsProxy()) {
248:                         return super.toString();
249:                 }
250:
251:                 final StringBuilder result = new StringBuilder(super.toString());
252:                 result.append(" (showCreateAndLinkButtonForCrossReferences: "); //$NON-NLS-1$
253:                 result.append(showCreateAndLinkButtonForCrossReferences);
254:                 result.append(", showLinkButtonForContainmentReferences: "); //$NON-NLS-1$
255:                 result.append(showLinkButtonForContainmentReferences);
256:                 result.append(')');
257:                 return result.toString();
258:         }
259:
260:         @Override
261:         public boolean equalStyles(VTStyleProperty styleProperty) {
262:                 return EMFUtils.filteredEquals(this, styleProperty);
263:         }
264:
265: } // VTReferenceStylePropertyImpl