Skip to content

Package: VGroupPackageImpl

VGroupPackageImpl

nameinstructionbranchcomplexitylinemethod
VGroupPackageImpl()
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: 37
97%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 9
90%
M: 0 C: 1
100%
getGroup()
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%
getGroupFactory()
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%
getGroupLabelAlignment()
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%
getGroupType()
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%
getGroup_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%
getGroup_GroupType()
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%
getGroup_LabelAlignment()
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: 149
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 25
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-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.group.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.spi.group.model.GroupLabelAlignment;
22: import org.eclipse.emf.ecp.view.spi.group.model.GroupType;
23: import org.eclipse.emf.ecp.view.spi.group.model.VGroup;
24: import org.eclipse.emf.ecp.view.spi.group.model.VGroupFactory;
25: import org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage;
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 VGroupPackageImpl extends EPackageImpl implements VGroupPackage {
36:         /**
37:          * <!-- begin-user-doc -->
38:          * <!-- end-user-doc -->
39:          *
40:          * @generated
41:          */
42:         private EClass groupEClass = null;
43:
44:         /**
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         private EEnum groupTypeEEnum = null;
51:
52:         /**
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         private EEnum groupLabelAlignmentEEnum = null;
59:
60:         /**
61:          * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
62:          * EPackage.Registry} by the package
63:          * package URI value.
64:          * <p>
65:          * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
66:          * performs initialization of the package, or returns the registered package, if one already exists. <!--
67:          * begin-user-doc --> <!-- end-user-doc -->
68:          *
69:          * @see org.eclipse.emf.ecore.EPackage.Registry
70:          * @see org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage#eNS_URI
71:          * @see #init()
72:          * @generated
73:          */
74:         private VGroupPackageImpl() {
75:                 super(eNS_URI, VGroupFactory.eINSTANCE);
76:         }
77:
78:         /**
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @generated
83:          */
84:         private static boolean isInited = false;
85:
86:         /**
87:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
88:          *
89:          * <p>
90:          * This method is used to initialize {@link VGroupPackage#eINSTANCE} when that field is accessed.
91:          * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
92:          * <!-- begin-user-doc -->
93:          * <!-- end-user-doc -->
94:          *
95:          * @see #eNS_URI
96:          * @see #createPackageContents()
97:          * @see #initializePackageContents()
98:          * @generated
99:          */
100:         public static VGroupPackage init() {
101:•                if (isInited)
102:                         return (VGroupPackage) EPackage.Registry.INSTANCE.getEPackage(VGroupPackage.eNS_URI);
103:
104:                 // Obtain or create and register package
105:                 VGroupPackageImpl theGroupPackage = (VGroupPackageImpl) (EPackage.Registry.INSTANCE
106:•                        .get(eNS_URI) instanceof VGroupPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
107:                                 : new VGroupPackageImpl());
108:
109:                 isInited = true;
110:
111:                 // Initialize simple dependencies
112:                 VViewPackage.eINSTANCE.eClass();
113:
114:                 // Create package meta-data objects
115:                 theGroupPackage.createPackageContents();
116:
117:                 // Initialize created meta-data
118:                 theGroupPackage.initializePackageContents();
119:
120:                 // Mark meta-data to indicate it can't be changed
121:                 theGroupPackage.freeze();
122:
123:                 // Update the registry and return the package
124:                 EPackage.Registry.INSTANCE.put(VGroupPackage.eNS_URI, theGroupPackage);
125:                 return theGroupPackage;
126:         }
127:
128:         /**
129:          * <!-- begin-user-doc -->
130:          * <!-- end-user-doc -->
131:          *
132:          * @generated
133:          */
134:         @Override
135:         public EClass getGroup() {
136:                 return groupEClass;
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc -->
141:          *
142:          * @since 1.4
143:          * <!-- end-user-doc -->
144:          * @generated
145:          */
146:         @Override
147:         public EAttribute getGroup_GroupType() {
148:                 return (EAttribute) groupEClass.getEStructuralFeatures().get(0);
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          *
154:          * @since 1.3
155:          * <!-- end-user-doc -->
156:          * @generated
157:          */
158:         @Override
159:         public EAttribute getGroup_LabelAlignment() {
160:                 return (EAttribute) groupEClass.getEStructuralFeatures().get(1);
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          *
166:          * @since 1.4
167:          * <!-- end-user-doc -->
168:          * @generated
169:          */
170:         @Override
171:         public EAttribute getGroup_Collapsed() {
172:                 return (EAttribute) groupEClass.getEStructuralFeatures().get(2);
173:         }
174:
175:         /**
176:          * <!-- begin-user-doc -->
177:          *
178:          * @since 1.4
179:          * <!-- end-user-doc -->
180:          * @generated
181:          */
182:         @Override
183:         public EEnum getGroupType() {
184:                 return groupTypeEEnum;
185:         }
186:
187:         /**
188:          * <!-- begin-user-doc -->
189:          * <!-- end-user-doc -->
190:          *
191:          * @generated
192:          */
193:         @Override
194:         public EEnum getGroupLabelAlignment() {
195:                 return groupLabelAlignmentEEnum;
196:         }
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          * <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         @Override
205:         public VGroupFactory getGroupFactory() {
206:                 return (VGroupFactory) getEFactoryInstance();
207:         }
208:
209:         /**
210:          * <!-- begin-user-doc -->
211:          * <!-- end-user-doc -->
212:          *
213:          * @generated
214:          */
215:         private boolean isCreated = false;
216:
217:         /**
218:          * Creates the meta-model objects for the package. This method is
219:          * 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 createPackageContents() {
226:•                if (isCreated)
227:                         return;
228:                 isCreated = true;
229:
230:                 // Create classes and their features
231:                 groupEClass = createEClass(GROUP);
232:                 createEAttribute(groupEClass, GROUP__GROUP_TYPE);
233:                 createEAttribute(groupEClass, GROUP__LABEL_ALIGNMENT);
234:                 createEAttribute(groupEClass, GROUP__COLLAPSED);
235:
236:                 // Create enums
237:                 groupTypeEEnum = createEEnum(GROUP_TYPE);
238:                 groupLabelAlignmentEEnum = createEEnum(GROUP_LABEL_ALIGNMENT);
239:         }
240:
241:         /**
242:          * <!-- begin-user-doc -->
243:          * <!-- end-user-doc -->
244:          *
245:          * @generated
246:          */
247:         private boolean isInitialized = false;
248:
249:         /**
250:          * Complete the initialization of the package and its meta-model. This
251:          * method is guarded to have no affect on any invocation but its first.
252:          * <!-- begin-user-doc -->
253:          * <!-- end-user-doc -->
254:          *
255:          * @generated
256:          */
257:         public void initializePackageContents() {
258:•                if (isInitialized)
259:                         return;
260:                 isInitialized = true;
261:
262:                 // Initialize package
263:                 setName(eNAME);
264:                 setNsPrefix(eNS_PREFIX);
265:                 setNsURI(eNS_URI);
266:
267:                 // Obtain other dependent packages
268:                 VViewPackage theViewPackage = (VViewPackage) EPackage.Registry.INSTANCE.getEPackage(VViewPackage.eNS_URI);
269:
270:                 // Create type parameters
271:
272:                 // Set bounds for type parameters
273:
274:                 // Add supertypes to classes
275:                 groupEClass.getESuperTypes().add(theViewPackage.getContainedContainer());
276:                 groupEClass.getESuperTypes().add(theViewPackage.getHasTooltip());
277:
278:                 // Initialize classes and features; add operations and parameters
279:                 initEClass(groupEClass, VGroup.class, "Group", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
280:                 initEAttribute(getGroup_GroupType(), this.getGroupType(), "groupType", null, 1, 1, VGroup.class, !IS_TRANSIENT, //$NON-NLS-1$
281:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
282:                 initEAttribute(getGroup_LabelAlignment(), this.getGroupLabelAlignment(), "labelAlignment", "LabelAligned", 0, 1, //$NON-NLS-1$ //$NON-NLS-2$
283:                         VGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
284:                         IS_ORDERED);
285:                 initEAttribute(getGroup_Collapsed(), ecorePackage.getEBoolean(), "collapsed", null, 0, 1, VGroup.class, //$NON-NLS-1$
286:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
287:
288:                 // Initialize enums and add enum literals
289:                 initEEnum(groupTypeEEnum, GroupType.class, "GroupType"); //$NON-NLS-1$
290:                 addEEnumLiteral(groupTypeEEnum, GroupType.NORMAL);
291:                 addEEnumLiteral(groupTypeEEnum, GroupType.EMBEDDED);
292:                 addEEnumLiteral(groupTypeEEnum, GroupType.COLLAPSIBLE);
293:
294:                 initEEnum(groupLabelAlignmentEEnum, GroupLabelAlignment.class, "GroupLabelAlignment"); //$NON-NLS-1$
295:                 addEEnumLiteral(groupLabelAlignmentEEnum, GroupLabelAlignment.LABEL_ALIGNED);
296:                 addEEnumLiteral(groupLabelAlignmentEEnum, GroupLabelAlignment.INPUT_ALIGNED);
297:
298:                 // Create resource
299:                 createResource(eNS_URI);
300:         }
301:
302: } // VGroupPackageImpl