| /* |
| * Copyright (c) 2014, 2015 Eike Stepper (Loehne, Germany) and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Eike Stepper - initial API and implementation |
| */ |
| package org.eclipse.oomph.setup.p2.impl; |
| |
| import org.eclipse.oomph.base.BasePackage; |
| import org.eclipse.oomph.p2.P2Package; |
| import org.eclipse.oomph.setup.SetupPackage; |
| import org.eclipse.oomph.setup.p2.P2Task; |
| import org.eclipse.oomph.setup.p2.SetupP2Factory; |
| import org.eclipse.oomph.setup.p2.SetupP2Package; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class SetupP2PackageImpl extends EPackageImpl implements SetupP2Package |
| { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass p2TaskEClass = 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.oomph.setup.p2.SetupP2Package#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private SetupP2PackageImpl() |
| { |
| super(eNS_URI, SetupP2Factory.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 SetupP2Package#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 SetupP2Package init() |
| { |
| if (isInited) |
| { |
| return (SetupP2Package)EPackage.Registry.INSTANCE.getEPackage(SetupP2Package.eNS_URI); |
| } |
| |
| // Obtain or create and register package |
| Object registeredSetupP2Package = EPackage.Registry.INSTANCE.get(eNS_URI); |
| SetupP2PackageImpl theSetupP2Package = registeredSetupP2Package instanceof SetupP2PackageImpl ? (SetupP2PackageImpl)registeredSetupP2Package |
| : new SetupP2PackageImpl(); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| BasePackage.eINSTANCE.eClass(); |
| P2Package.eINSTANCE.eClass(); |
| SetupPackage.eINSTANCE.eClass(); |
| |
| // Create package meta-data objects |
| theSetupP2Package.createPackageContents(); |
| |
| // Initialize created meta-data |
| theSetupP2Package.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theSetupP2Package.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(SetupP2Package.eNS_URI, theSetupP2Package); |
| return theSetupP2Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getP2Task() |
| { |
| return p2TaskEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getP2Task_Label() |
| { |
| return (EAttribute)p2TaskEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getP2Task_Requirements() |
| { |
| return (EReference)p2TaskEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getP2Task_Repositories() |
| { |
| return (EReference)p2TaskEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getP2Task_LicenseConfirmationDisabled() |
| { |
| return (EAttribute)p2TaskEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getP2Task_MergeDisabled() |
| { |
| return (EAttribute)p2TaskEClass.getEStructuralFeatures().get(4); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getP2Task_ProfileProperties() |
| { |
| return (EAttribute)p2TaskEClass.getEStructuralFeatures().get(5); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SetupP2Factory getSetupP2Factory() |
| { |
| return (SetupP2Factory)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 |
| p2TaskEClass = createEClass(P2_TASK); |
| createEAttribute(p2TaskEClass, P2_TASK__LABEL); |
| createEReference(p2TaskEClass, P2_TASK__REQUIREMENTS); |
| createEReference(p2TaskEClass, P2_TASK__REPOSITORIES); |
| createEAttribute(p2TaskEClass, P2_TASK__LICENSE_CONFIRMATION_DISABLED); |
| createEAttribute(p2TaskEClass, P2_TASK__MERGE_DISABLED); |
| createEAttribute(p2TaskEClass, P2_TASK__PROFILE_PROPERTIES); |
| } |
| |
| /** |
| * <!-- 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 |
| SetupPackage theSetupPackage = (SetupPackage)EPackage.Registry.INSTANCE.getEPackage(SetupPackage.eNS_URI); |
| P2Package theP2Package = (P2Package)EPackage.Registry.INSTANCE.getEPackage(P2Package.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| p2TaskEClass.getESuperTypes().add(theSetupPackage.getSetupTask()); |
| |
| // Initialize classes and features; add operations and parameters |
| initEClass(p2TaskEClass, P2Task.class, "P2Task", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEAttribute(getP2Task_Label(), ecorePackage.getEString(), "label", null, 0, 1, P2Task.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, //$NON-NLS-1$ |
| !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getP2Task_Requirements(), theP2Package.getRequirement(), null, "requirements", null, 0, -1, P2Task.class, !IS_TRANSIENT, !IS_VOLATILE, //$NON-NLS-1$ |
| IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getP2Task_Repositories(), theP2Package.getRepository(), null, "repositories", null, 0, -1, P2Task.class, !IS_TRANSIENT, !IS_VOLATILE, //$NON-NLS-1$ |
| IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getP2Task_LicenseConfirmationDisabled(), ecorePackage.getEBoolean(), "licenseConfirmationDisabled", null, 0, 1, P2Task.class, !IS_TRANSIENT, //$NON-NLS-1$ |
| !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getP2Task_MergeDisabled(), ecorePackage.getEBoolean(), "mergeDisabled", null, 0, 1, P2Task.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, //$NON-NLS-1$ |
| !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getP2Task_ProfileProperties(), ecorePackage.getEString(), "profileProperties", null, 0, 1, P2Task.class, !IS_TRANSIENT, !IS_VOLATILE, //$NON-NLS-1$ |
| IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| |
| // Create annotations |
| // http://www.eclipse.org/oomph/base/LabelProvider |
| createLabelProviderAnnotations(); |
| // http:///org/eclipse/emf/ecore/util/ExtendedMetaData |
| createExtendedMetaDataAnnotations(); |
| } |
| |
| /** |
| * Initializes the annotations for <b>http://www.eclipse.org/oomph/base/LabelProvider</b>. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void createLabelProviderAnnotations() |
| { |
| String source = "http://www.eclipse.org/oomph/base/LabelProvider"; //$NON-NLS-1$ |
| addAnnotation(this, source, |
| new String[] { "imageBaseURI", "http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/plugins/org.eclipse.oomph.setup.p2.edit/icons/full/obj16" //$NON-NLS-1$ //$NON-NLS-2$ |
| }); |
| } |
| |
| /** |
| * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void createExtendedMetaDataAnnotations() |
| { |
| String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; //$NON-NLS-1$ |
| addAnnotation(getP2Task_Requirements(), source, new String[] { "name", "requirement" //$NON-NLS-1$ //$NON-NLS-2$ |
| }); |
| addAnnotation(getP2Task_Repositories(), source, new String[] { "name", "repository" //$NON-NLS-1$ //$NON-NLS-2$ |
| }); |
| } |
| |
| } // SetupP2PackageImpl |