Skip to content

Package: VTUnsettableStylePropertyImpl

VTUnsettableStylePropertyImpl

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