Skip to content

Package: VTAlignmentStylePropertyImpl

VTAlignmentStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTAlignmentStylePropertyImpl()
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: 5
45%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
eIsSet(int)
M: 14 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 12 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: 10 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%
getType()
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%
setType(AlignmentType)
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: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 3 C: 25
89%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 6
86%
M: 0 C: 1
100%

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.alignment.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.alignment.model.AlignmentType;
23: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTAlignmentPackage;
24: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTAlignmentStyleProperty;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model object '<em><b>Style Property</b></em>'.
29: * <!-- end-user-doc -->
30: * <p>
31: * The following features are implemented:
32: * </p>
33: * <ul>
34: * <li>{@link org.eclipse.emf.ecp.view.template.style.alignment.model.impl.VTAlignmentStylePropertyImpl#getType
35: * <em>Type</em>}</li>
36: * </ul>
37: *
38: * @generated
39: */
40: public class VTAlignmentStylePropertyImpl extends MinimalEObjectImpl.Container implements VTAlignmentStyleProperty {
41:         /**
42:          * The default value of the '{@link #getType() <em>Type</em>}' attribute.
43:          * <!-- begin-user-doc -->
44:          * <!-- end-user-doc -->
45:          *
46:          * @see #getType()
47:          * @generated
48:          * @ordered
49:          */
50:         protected static final AlignmentType TYPE_EDEFAULT = AlignmentType.LEFT;
51:
52:         /**
53:          * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @see #getType()
58:          * @generated
59:          * @ordered
60:          */
61:         protected AlignmentType type = TYPE_EDEFAULT;
62:
63:         /**
64:          * <!-- begin-user-doc -->
65:          * <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         protected VTAlignmentStylePropertyImpl() {
70:                 super();
71:         }
72:
73:         /**
74:          * <!-- begin-user-doc -->
75:          * <!-- end-user-doc -->
76:          *
77:          * @generated
78:          */
79:         @Override
80:         protected EClass eStaticClass() {
81:                 return VTAlignmentPackage.Literals.ALIGNMENT_STYLE_PROPERTY;
82:         }
83:
84:         /**
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @generated
89:          */
90:         @Override
91:         public AlignmentType getType() {
92:                 return type;
93:         }
94:
95:         /**
96:          * <!-- begin-user-doc -->
97:          * <!-- end-user-doc -->
98:          *
99:          * @generated
100:          */
101:         @Override
102:         public void setType(AlignmentType newType) {
103:                 final AlignmentType oldType = type;
104:•                type = newType == null ? TYPE_EDEFAULT : newType;
105:•                if (eNotificationRequired()) {
106:                         eNotify(new ENotificationImpl(this, Notification.SET, VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY__TYPE,
107:                                 oldType, type));
108:                 }
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
119:•                switch (featureID) {
120:                 case VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY__TYPE:
121:                         return getType();
122:                 }
123:                 return super.eGet(featureID, resolve, coreType);
124:         }
125:
126:         /**
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @generated
131:          */
132:         @Override
133:         public void eSet(int featureID, Object newValue) {
134:•                switch (featureID) {
135:                 case VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY__TYPE:
136:                         setType((AlignmentType) newValue);
137:                         return;
138:                 }
139:                 super.eSet(featureID, newValue);
140:         }
141:
142:         /**
143:          * <!-- begin-user-doc -->
144:          * <!-- end-user-doc -->
145:          *
146:          * @generated
147:          */
148:         @Override
149:         public void eUnset(int featureID) {
150:•                switch (featureID) {
151:                 case VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY__TYPE:
152:                         setType(TYPE_EDEFAULT);
153:                         return;
154:                 }
155:                 super.eUnset(featureID);
156:         }
157:
158:         /**
159:          * <!-- begin-user-doc -->
160:          * <!-- end-user-doc -->
161:          *
162:          * @generated
163:          */
164:         @Override
165:         public boolean eIsSet(int featureID) {
166:•                switch (featureID) {
167:                 case VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY__TYPE:
168:•                        return type != TYPE_EDEFAULT;
169:                 }
170:                 return super.eIsSet(featureID);
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc -->
175:          * <!-- end-user-doc -->
176:          *
177:          * @generated
178:          */
179:         @Override
180:         public String toString() {
181:•                if (eIsProxy()) {
182:                         return super.toString();
183:                 }
184:
185:                 final StringBuffer result = new StringBuffer(super.toString());
186:                 result.append(" (type: "); //$NON-NLS-1$
187:                 result.append(type);
188:                 result.append(')');
189:                 return result.toString();
190:         }
191:
192:         /**
193:          * {@inheritDoc}
194:          *
195:          * @see org.eclipse.emf.ecp.view.template.model.VTStyleProperty#equalStyles(org.eclipse.emf.ecp.view.template.model.VTStyleProperty)
196:          */
197:         @Override
198:         public boolean equalStyles(VTStyleProperty styleProperty) {
199:                 return EMFUtils.filteredEquals(this, styleProperty);
200:         }
201:
202: } // VTAlignmentStylePropertyImpl