Skip to content

Package: VLabelPackageImpl

VLabelPackageImpl

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