Skip to content

Package: VTBackgroundPackageImpl

VTBackgroundPackageImpl

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