Skip to content

Package: VTWrapPackageImpl

VTWrapPackageImpl

nameinstructionbranchcomplexitylinemethod
VTWrapPackageImpl()
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 17
94%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 5
83%
M: 0 C: 1
100%
getLabelWrapStyleProperty()
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%
getLabelWrapStyleProperty_WrapLabel()
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%
getWrapFactory()
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%
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: 63
98%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 15
94%
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-2018 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.wrap.model.impl;
15:
16: import org.eclipse.emf.ecore.EAttribute;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EPackageImpl;
20: import org.eclipse.emf.ecp.view.template.model.VTTemplatePackage;
21: import org.eclipse.emf.ecp.view.template.style.wrap.model.VTLabelWrapStyleProperty;
22: import org.eclipse.emf.ecp.view.template.style.wrap.model.VTWrapFactory;
23: import org.eclipse.emf.ecp.view.template.style.wrap.model.VTWrapPackage;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model <b>Package</b>.
28: * <!-- end-user-doc -->
29: *
30: * @generated
31: */
32: public class VTWrapPackageImpl extends EPackageImpl implements VTWrapPackage {
33:         /**
34:          * <!-- begin-user-doc -->
35:          * <!-- end-user-doc -->
36:          *
37:          * @generated
38:          */
39:         private EClass labelWrapStylePropertyEClass = null;
40:
41:         /**
42:          * Creates an instance of the model <b>Package</b>, registered with
43:          * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
44:          * package URI value.
45:          * <p>
46:          * Note: the correct way to create the package is via the static
47:          * factory method {@link #init init()}, which also performs
48:          * initialization of the package, or returns the registered package,
49:          * if one already exists.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @see org.eclipse.emf.ecore.EPackage.Registry
54:          * @see org.eclipse.emf.ecp.view.template.style.wrap.model.VTWrapPackage#eNS_URI
55:          * @see #init()
56:          * @generated
57:          */
58:         private VTWrapPackageImpl() {
59:                 super(eNS_URI, VTWrapFactory.eINSTANCE);
60:         }
61:
62:         /**
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @generated
67:          */
68:         private static boolean isInited = false;
69:
70:         /**
71:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
72:          *
73:          * <p>
74:          * This method is used to initialize {@link VTWrapPackage#eINSTANCE} when that field is accessed.
75:          * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @see #eNS_URI
80:          * @see #createPackageContents()
81:          * @see #initializePackageContents()
82:          * @generated
83:          */
84:         public static VTWrapPackage init() {
85:•                if (isInited) {
86:                         return (VTWrapPackage) EPackage.Registry.INSTANCE.getEPackage(VTWrapPackage.eNS_URI);
87:                 }
88:
89:                 // Obtain or create and register package
90:                 final VTWrapPackageImpl theWrapPackage = (VTWrapPackageImpl) (EPackage.Registry.INSTANCE
91:•                        .get(eNS_URI) instanceof VTWrapPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
92:                                 : new VTWrapPackageImpl());
93:
94:                 isInited = true;
95:
96:                 // Initialize simple dependencies
97:                 VTTemplatePackage.eINSTANCE.eClass();
98:
99:                 // Create package meta-data objects
100:                 theWrapPackage.createPackageContents();
101:
102:                 // Initialize created meta-data
103:                 theWrapPackage.initializePackageContents();
104:
105:                 // Mark meta-data to indicate it can't be changed
106:                 theWrapPackage.freeze();
107:
108:                 // Update the registry and return the package
109:                 EPackage.Registry.INSTANCE.put(VTWrapPackage.eNS_URI, theWrapPackage);
110:                 return theWrapPackage;
111:         }
112:
113:         /**
114:          * <!-- begin-user-doc -->
115:          * <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         public EClass getLabelWrapStyleProperty() {
121:                 return labelWrapStylePropertyEClass;
122:         }
123:
124:         /**
125:          * <!-- begin-user-doc -->
126:          * <!-- end-user-doc -->
127:          *
128:          * @generated
129:          */
130:         @Override
131:         public EAttribute getLabelWrapStyleProperty_WrapLabel() {
132:                 return (EAttribute) labelWrapStylePropertyEClass.getEStructuralFeatures().get(0);
133:         }
134:
135:         /**
136:          * <!-- begin-user-doc -->
137:          * <!-- end-user-doc -->
138:          *
139:          * @generated
140:          */
141:         @Override
142:         public VTWrapFactory getWrapFactory() {
143:                 return (VTWrapFactory) getEFactoryInstance();
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         private boolean isCreated = false;
153:
154:         /**
155:          * Creates the meta-model objects for the package. This method is
156:          * guarded to have no affect on any invocation but its first.
157:          * <!-- begin-user-doc -->
158:          * <!-- end-user-doc -->
159:          *
160:          * @generated
161:          */
162:         public void createPackageContents() {
163:•                if (isCreated) {
164:                         return;
165:                 }
166:                 isCreated = true;
167:
168:                 // Create classes and their features
169:                 labelWrapStylePropertyEClass = createEClass(LABEL_WRAP_STYLE_PROPERTY);
170:                 createEAttribute(labelWrapStylePropertyEClass, LABEL_WRAP_STYLE_PROPERTY__WRAP_LABEL);
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc -->
175:          * <!-- end-user-doc -->
176:          *
177:          * @generated
178:          */
179:         private boolean isInitialized = false;
180:
181:         /**
182:          * Complete the initialization of the package and its meta-model. This
183:          * method is guarded to have no affect on any invocation but its first.
184:          * <!-- begin-user-doc -->
185:          * <!-- end-user-doc -->
186:          *
187:          * @generated
188:          */
189:         public void initializePackageContents() {
190:•                if (isInitialized) {
191:                         return;
192:                 }
193:                 isInitialized = true;
194:
195:                 // Initialize package
196:                 setName(eNAME);
197:                 setNsPrefix(eNS_PREFIX);
198:                 setNsURI(eNS_URI);
199:
200:                 // Obtain other dependent packages
201:                 final VTTemplatePackage theTemplatePackage = (VTTemplatePackage) EPackage.Registry.INSTANCE
202:                         .getEPackage(VTTemplatePackage.eNS_URI);
203:
204:                 // Create type parameters
205:
206:                 // Set bounds for type parameters
207:
208:                 // Add supertypes to classes
209:                 labelWrapStylePropertyEClass.getESuperTypes().add(theTemplatePackage.getStyleProperty());
210:
211:                 // Initialize classes, features, and operations; add parameters
212:                 initEClass(labelWrapStylePropertyEClass, VTLabelWrapStyleProperty.class, "LabelWrapStyleProperty", !IS_ABSTRACT, //$NON-NLS-1$
213:                         !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
214:                 initEAttribute(getLabelWrapStyleProperty_WrapLabel(), ecorePackage.getEBoolean(), "wrapLabel", null, 0, 1, //$NON-NLS-1$
215:                         VTLabelWrapStyleProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
216:                         IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
217:
218:                 // Create resource
219:                 createResource(eNS_URI);
220:         }
221:
222: } // VTWrapPackageImpl