Skip to content

Package: VTUnsettablePackageImpl

VTUnsettablePackageImpl

nameinstructionbranchcomplexitylinemethod
VTUnsettablePackageImpl()
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 32
97%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 8
89%
M: 0 C: 1
100%
getButtonAlignmentType()
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%
getButtonPlacementType()
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%
getUnsettableFactory()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUnsettableStyleProperty()
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%
getUnsettableStyleProperty_ButtonAlignment()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getUnsettableStyleProperty_ButtonPlacement()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
init()
M: 9 C: 30
77%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 1 C: 11
92%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 116
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 24
96%
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%

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.ecore.EAttribute;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.EEnum;
19: import org.eclipse.emf.ecore.EPackage;
20: import org.eclipse.emf.ecore.impl.EPackageImpl;
21: import org.eclipse.emf.ecp.view.template.model.VTTemplatePackage;
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.VTUnsettableFactory;
25: import org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettablePackage;
26: import org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettableStyleProperty;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * An implementation of the model <b>Package</b>.
31: * <!-- end-user-doc -->
32: *
33: * @generated
34: */
35: public class VTUnsettablePackageImpl extends EPackageImpl implements VTUnsettablePackage {
36:         /**
37:          * <!-- begin-user-doc -->
38:          * <!-- end-user-doc -->
39:          *
40:          * @generated
41:          */
42:         private EClass unsettableStylePropertyEClass = null;
43:
44:         /**
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         private EEnum buttonAlignmentTypeEEnum = null;
51:
52:         /**
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         private EEnum buttonPlacementTypeEEnum = null;
59:
60:         /**
61:          * Creates an instance of the model <b>Package</b>, registered with
62:          * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
63:          * package URI value.
64:          * <p>
65:          * Note: the correct way to create the package is via the static
66:          * factory method {@link #init init()}, which also performs
67:          * initialization of the package, or returns the registered package,
68:          * if one already exists.
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @see org.eclipse.emf.ecore.EPackage.Registry
73:          * @see org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettablePackage#eNS_URI
74:          * @see #init()
75:          * @generated
76:          */
77:         private VTUnsettablePackageImpl() {
78:                 super(eNS_URI, VTUnsettableFactory.eINSTANCE);
79:         }
80:
81:         /**
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         private static boolean isInited = false;
88:
89:         /**
90:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
91:          *
92:          * <p>
93:          * This method is used to initialize {@link VTUnsettablePackage#eINSTANCE} when that field is accessed.
94:          * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @see #eNS_URI
99:          * @see #createPackageContents()
100:          * @see #initializePackageContents()
101:          * @generated
102:          */
103:         public static VTUnsettablePackage init() {
104:•                if (isInited) {
105:                         return (VTUnsettablePackage) EPackage.Registry.INSTANCE.getEPackage(VTUnsettablePackage.eNS_URI);
106:                 }
107:
108:                 // Obtain or create and register package
109:                 final VTUnsettablePackageImpl theUnsettablePackage = (VTUnsettablePackageImpl) (EPackage.Registry.INSTANCE
110:•                        .get(eNS_URI) instanceof VTUnsettablePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
111:                                 : new VTUnsettablePackageImpl());
112:
113:                 isInited = true;
114:
115:                 // Initialize simple dependencies
116:                 VTTemplatePackage.eINSTANCE.eClass();
117:
118:                 // Create package meta-data objects
119:                 theUnsettablePackage.createPackageContents();
120:
121:                 // Initialize created meta-data
122:                 theUnsettablePackage.initializePackageContents();
123:
124:                 // Mark meta-data to indicate it can't be changed
125:                 theUnsettablePackage.freeze();
126:
127:                 // Update the registry and return the package
128:                 EPackage.Registry.INSTANCE.put(VTUnsettablePackage.eNS_URI, theUnsettablePackage);
129:                 return theUnsettablePackage;
130:         }
131:
132:         /**
133:          * <!-- begin-user-doc -->
134:          * <!-- end-user-doc -->
135:          *
136:          * @generated
137:          */
138:         @Override
139:         public EClass getUnsettableStyleProperty() {
140:                 return unsettableStylePropertyEClass;
141:         }
142:
143:         /**
144:          * <!-- begin-user-doc -->
145:          * <!-- end-user-doc -->
146:          *
147:          * @generated
148:          */
149:         @Override
150:         public EAttribute getUnsettableStyleProperty_ButtonAlignment() {
151:                 return (EAttribute) unsettableStylePropertyEClass.getEStructuralFeatures().get(0);
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @Override
161:         public EAttribute getUnsettableStyleProperty_ButtonPlacement() {
162:                 return (EAttribute) unsettableStylePropertyEClass.getEStructuralFeatures().get(1);
163:         }
164:
165:         /**
166:          * <!-- begin-user-doc -->
167:          * <!-- end-user-doc -->
168:          *
169:          * @generated
170:          */
171:         @Override
172:         public EEnum getButtonAlignmentType() {
173:                 return buttonAlignmentTypeEEnum;
174:         }
175:
176:         /**
177:          * <!-- begin-user-doc -->
178:          * <!-- end-user-doc -->
179:          *
180:          * @generated
181:          */
182:         @Override
183:         public EEnum getButtonPlacementType() {
184:                 return buttonPlacementTypeEEnum;
185:         }
186:
187:         /**
188:          * <!-- begin-user-doc -->
189:          * <!-- end-user-doc -->
190:          *
191:          * @generated
192:          */
193:         @Override
194:         public VTUnsettableFactory getUnsettableFactory() {
195:                 return (VTUnsettableFactory) getEFactoryInstance();
196:         }
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          * <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         private boolean isCreated = false;
205:
206:         /**
207:          * Creates the meta-model objects for the package. This method is
208:          * guarded to have no affect on any invocation but its first.
209:          * <!-- begin-user-doc -->
210:          * <!-- end-user-doc -->
211:          *
212:          * @generated
213:          */
214:         public void createPackageContents() {
215:•                if (isCreated) {
216:                         return;
217:                 }
218:                 isCreated = true;
219:
220:                 // Create classes and their features
221:                 unsettableStylePropertyEClass = createEClass(UNSETTABLE_STYLE_PROPERTY);
222:                 createEAttribute(unsettableStylePropertyEClass, UNSETTABLE_STYLE_PROPERTY__BUTTON_ALIGNMENT);
223:                 createEAttribute(unsettableStylePropertyEClass, UNSETTABLE_STYLE_PROPERTY__BUTTON_PLACEMENT);
224:
225:                 // Create enums
226:                 buttonAlignmentTypeEEnum = createEEnum(BUTTON_ALIGNMENT_TYPE);
227:                 buttonPlacementTypeEEnum = createEEnum(BUTTON_PLACEMENT_TYPE);
228:         }
229:
230:         /**
231:          * <!-- begin-user-doc -->
232:          * <!-- end-user-doc -->
233:          *
234:          * @generated
235:          */
236:         private boolean isInitialized = false;
237:
238:         /**
239:          * Complete the initialization of the package and its meta-model. This
240:          * method is guarded to have no affect on any invocation but its first.
241:          * <!-- begin-user-doc -->
242:          * <!-- end-user-doc -->
243:          *
244:          * @generated
245:          */
246:         public void initializePackageContents() {
247:•                if (isInitialized) {
248:                         return;
249:                 }
250:                 isInitialized = true;
251:
252:                 // Initialize package
253:                 setName(eNAME);
254:                 setNsPrefix(eNS_PREFIX);
255:                 setNsURI(eNS_URI);
256:
257:                 // Obtain other dependent packages
258:                 final VTTemplatePackage theTemplatePackage = (VTTemplatePackage) EPackage.Registry.INSTANCE
259:                         .getEPackage(VTTemplatePackage.eNS_URI);
260:
261:                 // Create type parameters
262:
263:                 // Set bounds for type parameters
264:
265:                 // Add supertypes to classes
266:                 unsettableStylePropertyEClass.getESuperTypes().add(theTemplatePackage.getStyleProperty());
267:
268:                 // Initialize classes, features, and operations; add parameters
269:                 initEClass(unsettableStylePropertyEClass, VTUnsettableStyleProperty.class, "UnsettableStyleProperty", //$NON-NLS-1$
270:                         !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
271:                 initEAttribute(getUnsettableStyleProperty_ButtonAlignment(), getButtonAlignmentType(), "buttonAlignment", //$NON-NLS-1$
272:                         "RIGHT", 1, 1, VTUnsettableStyleProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, //$NON-NLS-1$
273:                         !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
274:                 initEAttribute(getUnsettableStyleProperty_ButtonPlacement(), getButtonPlacementType(), "buttonPlacement", //$NON-NLS-1$
275:                         "RIGHT_OF_LABEL", 1, 1, VTUnsettableStyleProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, //$NON-NLS-1$
276:                         !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
277:
278:                 // Initialize enums and add enum literals
279:                 initEEnum(buttonAlignmentTypeEEnum, ButtonAlignmentType.class, "ButtonAlignmentType"); //$NON-NLS-1$
280:                 addEEnumLiteral(buttonAlignmentTypeEEnum, ButtonAlignmentType.RIGHT);
281:                 addEEnumLiteral(buttonAlignmentTypeEEnum, ButtonAlignmentType.LEFT);
282:
283:                 initEEnum(buttonPlacementTypeEEnum, ButtonPlacementType.class, "ButtonPlacementType"); //$NON-NLS-1$
284:                 addEEnumLiteral(buttonPlacementTypeEEnum, ButtonPlacementType.RIGHT_OF_LABEL);
285:                 addEEnumLiteral(buttonPlacementTypeEEnum, ButtonPlacementType.LEFT_OF_LABEL);
286:
287:                 // Create resource
288:                 createResource(eNS_URI);
289:         }
290:
291: } // VTUnsettablePackageImpl