Skip to content

Package: VSectionPackageImpl

VSectionPackageImpl

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