/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.eef.components.impl;
import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.eef.components.ComponentsFactory;
import org.eclipse.emf.eef.components.ComponentsPackage;
import org.eclipse.emf.eef.components.EEFElement;
import org.eclipse.emf.eef.components.PropertiesEditionComponent;
import org.eclipse.emf.eef.components.PropertiesEditionContext;
import org.eclipse.emf.eef.components.PropertiesEditionElement;
import org.eclipse.emf.eef.components.PropertiesMultiEditionElement;
import org.eclipse.emf.eef.mapping.MappingPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ComponentsPackageImpl extends EPackageImpl implements ComponentsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass propertiesEditionContextEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass propertiesEditionComponentEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass propertiesEditionElementEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass propertiesMultiEditionElementEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass eefElementEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.emf.eef.components.ComponentsPackage#eNS_URI
* @see #init()
* @generated
*/
private ComponentsPackageImpl() {
super(eNS_URI, ComponentsFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link ComponentsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static ComponentsPackage init() {
if (isInited)
return (ComponentsPackage)EPackage.Registry.INSTANCE.getEPackage(ComponentsPackage.eNS_URI);
// Obtain or create and register package
ComponentsPackageImpl theComponentsPackage = (ComponentsPackageImpl)(EPackage.Registry.INSTANCE
.get(eNS_URI) instanceof ComponentsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
: new ComponentsPackageImpl());
isInited = true;
// Initialize simple dependencies
GenModelPackage.eINSTANCE.eClass();
MappingPackage.eINSTANCE.eClass();
// Create package meta-data objects
theComponentsPackage.createPackageContents();
// Initialize created meta-data
theComponentsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theComponentsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(ComponentsPackage.eNS_URI, theComponentsPackage);
return theComponentsPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPropertiesEditionContext() {
return propertiesEditionContextEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPropertiesEditionContext_Model() {
return (EReference)propertiesEditionContextEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPropertiesEditionComponent() {
return propertiesEditionComponentEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getPropertiesEditionComponent_Explicit() {
return (EAttribute)propertiesEditionComponentEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPropertiesEditionElement() {
return propertiesEditionElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPropertiesMultiEditionElement() {
return propertiesMultiEditionElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getEEFElement() {
return eefElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getEEFElement_HelpID() {
return (EAttribute)eefElementEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentsFactory getComponentsFactory() {
return (ComponentsFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated)
return;
isCreated = true;
// Create classes and their features
propertiesEditionContextEClass = createEClass(PROPERTIES_EDITION_CONTEXT);
createEReference(propertiesEditionContextEClass, PROPERTIES_EDITION_CONTEXT__MODEL);
propertiesEditionComponentEClass = createEClass(PROPERTIES_EDITION_COMPONENT);
createEAttribute(propertiesEditionComponentEClass, PROPERTIES_EDITION_COMPONENT__EXPLICIT);
propertiesEditionElementEClass = createEClass(PROPERTIES_EDITION_ELEMENT);
propertiesMultiEditionElementEClass = createEClass(PROPERTIES_MULTI_EDITION_ELEMENT);
eefElementEClass = createEClass(EEF_ELEMENT);
createEAttribute(eefElementEClass, EEF_ELEMENT__HELP_ID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized)
return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
MappingPackage theMappingPackage = (MappingPackage)EPackage.Registry.INSTANCE
.getEPackage(MappingPackage.eNS_URI);
GenModelPackage theGenModelPackage = (GenModelPackage)EPackage.Registry.INSTANCE
.getEPackage(GenModelPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
propertiesEditionContextEClass.getESuperTypes().add(theMappingPackage.getDatabinding());
propertiesEditionComponentEClass.getESuperTypes().add(theMappingPackage.getEMFElementBinding());
propertiesEditionComponentEClass.getESuperTypes().add(this.getEEFElement());
propertiesEditionElementEClass.getESuperTypes().add(theMappingPackage.getEMFPropertyBinding());
propertiesEditionElementEClass.getESuperTypes().add(this.getEEFElement());
propertiesMultiEditionElementEClass.getESuperTypes().add(
theMappingPackage.getEMFMultiPropertiesBinding());
propertiesMultiEditionElementEClass.getESuperTypes().add(this.getEEFElement());
// Initialize classes and features; add operations and parameters
initEClass(propertiesEditionContextEClass, PropertiesEditionContext.class,
"PropertiesEditionContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPropertiesEditionContext_Model(), theGenModelPackage.getGenPackage(), null,
"model", null, 1, 1, PropertiesEditionContext.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEClass(propertiesEditionComponentEClass, PropertiesEditionComponent.class,
"PropertiesEditionComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getPropertiesEditionComponent_Explicit(), ecorePackage.getEBoolean(), "explicit",
"true", 0, 1, PropertiesEditionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propertiesEditionElementEClass, PropertiesEditionElement.class,
"PropertiesEditionElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(propertiesMultiEditionElementEClass, PropertiesMultiEditionElement.class,
"PropertiesMultiEditionElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(eefElementEClass, EEFElement.class, "EEFElement", IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEEFElement_HelpID(), ecorePackage.getEString(), "helpID", null, 0, 1,
EEFElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //ComponentsPackageImpl