blob: 24fdf550b2a14bda7c602e0acdaecd2a46ecafbb [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (Heidelberg)
* 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
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.dialogdsl.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.osbp.dsl.semantic.common.types.OSBPTypesPackage;
import org.eclipse.osbp.dsl.semantic.dto.OSBPDtoPackage;
import org.eclipse.osbp.ecview.semantic.uimodel.UiModelPackage;
import org.eclipse.osbp.xtext.action.ActionDSLPackage;
import org.eclipse.osbp.xtext.dialogdsl.Dialog;
import org.eclipse.osbp.xtext.dialogdsl.DialogBase;
import org.eclipse.osbp.xtext.dialogdsl.DialogDSLFactory;
import org.eclipse.osbp.xtext.dialogdsl.DialogDSLPackage;
import org.eclipse.osbp.xtext.dialogdsl.DialogLazyResolver;
import org.eclipse.osbp.xtext.dialogdsl.DialogModel;
import org.eclipse.osbp.xtext.dialogdsl.DialogPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class DialogDSLPackageImpl extends EPackageImpl implements DialogDSLPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dialogModelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dialogLazyResolverEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dialogBaseEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dialogPackageEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dialogEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EDataType internalEObjectEDataType = 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.osbp.xtext.dialogdsl.DialogDSLPackage#eNS_URI
* @see #init()
* @generated
*/
private DialogDSLPackageImpl() {
super(eNS_URI, DialogDSLFactory.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 DialogDSLPackage#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 DialogDSLPackage init() {
if (isInited) return (DialogDSLPackage)EPackage.Registry.INSTANCE.getEPackage(DialogDSLPackage.eNS_URI);
// Obtain or create and register package
DialogDSLPackageImpl theDialogDSLPackage = (DialogDSLPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DialogDSLPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DialogDSLPackageImpl());
isInited = true;
// Initialize simple dependencies
UiModelPackage.eINSTANCE.eClass();
OSBPDtoPackage.eINSTANCE.eClass();
ActionDSLPackage.eINSTANCE.eClass();
// Create package meta-data objects
theDialogDSLPackage.createPackageContents();
// Initialize created meta-data
theDialogDSLPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theDialogDSLPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(DialogDSLPackage.eNS_URI, theDialogDSLPackage);
return theDialogDSLPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDialogModel() {
return dialogModelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getDialogModel_Pckg() {
return (EReference)dialogModelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDialogLazyResolver() {
return dialogLazyResolverEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EOperation getDialogLazyResolver__EResolveProxy__InternalEObject() {
return dialogLazyResolverEClass.getEOperations().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDialogBase() {
return dialogBaseEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialogBase_Name() {
return (EAttribute)dialogBaseEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDialogPackage() {
return dialogPackageEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getDialogPackage_Dialogs() {
return (EReference)dialogPackageEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getDialog() {
return dialogEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_Description() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_DescriptionValue() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getDialog_UiView() {
return (EReference)dialogEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getDialog_Toolbar() {
return (EReference)dialogEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_Embedded() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_Pure() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_Stateful() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getDialog_Autowire() {
return (EAttribute)dialogEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getDialog_Dto() {
return (EReference)dialogEClass.getEStructuralFeatures().get(8);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EDataType getInternalEObject() {
return internalEObjectEDataType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DialogDSLFactory getDialogDSLFactory() {
return (DialogDSLFactory)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
dialogModelEClass = createEClass(DIALOG_MODEL);
createEReference(dialogModelEClass, DIALOG_MODEL__PCKG);
dialogLazyResolverEClass = createEClass(DIALOG_LAZY_RESOLVER);
createEOperation(dialogLazyResolverEClass, DIALOG_LAZY_RESOLVER___ERESOLVE_PROXY__INTERNALEOBJECT);
dialogBaseEClass = createEClass(DIALOG_BASE);
createEAttribute(dialogBaseEClass, DIALOG_BASE__NAME);
dialogPackageEClass = createEClass(DIALOG_PACKAGE);
createEReference(dialogPackageEClass, DIALOG_PACKAGE__DIALOGS);
dialogEClass = createEClass(DIALOG);
createEAttribute(dialogEClass, DIALOG__DESCRIPTION);
createEAttribute(dialogEClass, DIALOG__DESCRIPTION_VALUE);
createEReference(dialogEClass, DIALOG__UI_VIEW);
createEReference(dialogEClass, DIALOG__TOOLBAR);
createEAttribute(dialogEClass, DIALOG__EMBEDDED);
createEAttribute(dialogEClass, DIALOG__PURE);
createEAttribute(dialogEClass, DIALOG__STATEFUL);
createEAttribute(dialogEClass, DIALOG__AUTOWIRE);
createEReference(dialogEClass, DIALOG__DTO);
// Create data types
internalEObjectEDataType = createEDataType(INTERNAL_EOBJECT);
}
/**
* <!-- 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
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
OSBPTypesPackage theOSBPTypesPackage = (OSBPTypesPackage)EPackage.Registry.INSTANCE.getEPackage(OSBPTypesPackage.eNS_URI);
UiModelPackage theUiModelPackage = (UiModelPackage)EPackage.Registry.INSTANCE.getEPackage(UiModelPackage.eNS_URI);
ActionDSLPackage theActionDSLPackage = (ActionDSLPackage)EPackage.Registry.INSTANCE.getEPackage(ActionDSLPackage.eNS_URI);
OSBPDtoPackage theOSBPDtoPackage = (OSBPDtoPackage)EPackage.Registry.INSTANCE.getEPackage(OSBPDtoPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
dialogBaseEClass.getESuperTypes().add(this.getDialogLazyResolver());
dialogPackageEClass.getESuperTypes().add(theOSBPTypesPackage.getLPackage());
dialogEClass.getESuperTypes().add(this.getDialogBase());
// Initialize classes, features, and operations; add parameters
initEClass(dialogModelEClass, DialogModel.class, "DialogModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDialogModel_Pckg(), this.getDialogPackage(), null, "pckg", null, 0, 1, DialogModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(dialogLazyResolverEClass, DialogLazyResolver.class, "DialogLazyResolver", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
EOperation op = initEOperation(getDialogLazyResolver__EResolveProxy__InternalEObject(), theEcorePackage.getEObject(), "eResolveProxy", 0, 1, !IS_UNIQUE, IS_ORDERED);
addEParameter(op, this.getInternalEObject(), "proxy", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(dialogBaseEClass, DialogBase.class, "DialogBase", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getDialogBase_Name(), theEcorePackage.getEString(), "name", null, 0, 1, DialogBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(dialogPackageEClass, DialogPackage.class, "DialogPackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDialogPackage_Dialogs(), this.getDialog(), null, "dialogs", null, 0, -1, DialogPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(dialogEClass, Dialog.class, "Dialog", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getDialog_Description(), theEcorePackage.getEBoolean(), "description", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getDialog_DescriptionValue(), theEcorePackage.getEString(), "descriptionValue", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDialog_UiView(), theUiModelPackage.getUiView(), null, "uiView", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDialog_Toolbar(), theActionDSLPackage.getActionToolbar(), null, "toolbar", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getDialog_Embedded(), theEcorePackage.getEBoolean(), "embedded", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getDialog_Pure(), theEcorePackage.getEBoolean(), "pure", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getDialog_Stateful(), theEcorePackage.getEBoolean(), "stateful", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getDialog_Autowire(), theEcorePackage.getEBoolean(), "autowire", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDialog_Dto(), theOSBPDtoPackage.getLDto(), null, "dto", null, 0, 1, Dialog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Initialize data types
initEDataType(internalEObjectEDataType, InternalEObject.class, "InternalEObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
// Create annotations
// http://www.eclipse.org/emf/2002/Ecore
createEcoreAnnotations();
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createEcoreAnnotations() {
String source = "http://www.eclipse.org/emf/2002/Ecore";
addAnnotation
(this,
source,
new String[] {
"rootPackage", "dialogdsl"
});
}
} //DialogDSLPackageImpl