Skip to content

Package: VTControlLabelAlignmentStylePropertyImpl

VTControlLabelAlignmentStylePropertyImpl

nameinstructionbranchcomplexitylinemethod
VTControlLabelAlignmentStylePropertyImpl()
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: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
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: 2 C: 23
92%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 1 C: 6
86%
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: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 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.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.view.template.model.VTStyleProperty;
21: import org.eclipse.emf.ecp.view.template.style.alignment.model.AlignmentType;
22: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTAlignmentPackage;
23: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTControlLabelAlignmentStyleProperty;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model object '<em><b>Control Label Alignment 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.alignment.model.impl.VTControlLabelAlignmentStylePropertyImpl#getType
34: * <em>Type</em>}</li>
35: * </ul>
36: *
37: * @generated
38: */
39: public class VTControlLabelAlignmentStylePropertyImpl extends MinimalEObjectImpl.Container
40:         implements VTControlLabelAlignmentStyleProperty {
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 VTControlLabelAlignmentStylePropertyImpl() {
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.CONTROL_LABEL_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,
107:                                 VTAlignmentPackage.CONTROL_LABEL_ALIGNMENT_STYLE_PROPERTY__TYPE, 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.CONTROL_LABEL_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.CONTROL_LABEL_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.CONTROL_LABEL_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.CONTROL_LABEL_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:         @Override
193:         public boolean equalStyles(VTStyleProperty styleProperty) {
194:•                if (styleProperty == null) {
195:                         return false;
196:                 }
197:•                if (eClass() != styleProperty.eClass()) {
198:                         return false;
199:                 }
200:
201:                 final VTControlLabelAlignmentStyleProperty other = VTControlLabelAlignmentStyleProperty.class
202:                         .cast(styleProperty);
203:
204:•                return getType() == other.getType();
205:         }
206:
207: } // VTControlLabelAlignmentStylePropertyImpl