| /** |
| * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Johannes Faltermeier - initial API and implementation |
| */ |
| package org.eclipse.emf.emfforms.spi.view.controlgrid.model.impl; |
| |
| 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.ecp.view.spi.model.VViewPackage; |
| import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGrid; |
| import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGridCell; |
| import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGridRow; |
| import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlgridFactory; |
| import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlgridPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public class VControlgridPackageImpl extends EPackageImpl implements VControlgridPackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass controlGridEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass controlGridRowEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass controlGridCellEClass = 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.emfforms.spi.view.controlgrid.model.VControlgridPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private VControlgridPackageImpl() { |
| super(eNS_URI, VControlgridFactory.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 VControlgridPackage#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 VControlgridPackage init() { |
| if (isInited) { |
| return (VControlgridPackage) EPackage.Registry.INSTANCE.getEPackage(VControlgridPackage.eNS_URI); |
| } |
| |
| // Obtain or create and register package |
| final VControlgridPackageImpl theControlgridPackage = (VControlgridPackageImpl) (EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof VControlgridPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) |
| : new VControlgridPackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| VViewPackage.eINSTANCE.eClass(); |
| |
| // Create package meta-data objects |
| theControlgridPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theControlgridPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theControlgridPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(VControlgridPackage.eNS_URI, theControlgridPackage); |
| return theControlgridPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getControlGrid() { |
| return controlGridEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getControlGrid_Rows() { |
| return (EReference) controlGridEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getControlGridRow() { |
| return controlGridRowEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getControlGridRow_Cells() { |
| return (EReference) controlGridRowEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getControlGridCell() { |
| return controlGridCellEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getControlGridCell_Control() { |
| return (EReference) controlGridCellEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public VControlgridFactory getControlgridFactory() { |
| return (VControlgridFactory) 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 |
| controlGridEClass = createEClass(CONTROL_GRID); |
| createEReference(controlGridEClass, CONTROL_GRID__ROWS); |
| |
| controlGridRowEClass = createEClass(CONTROL_GRID_ROW); |
| createEReference(controlGridRowEClass, CONTROL_GRID_ROW__CELLS); |
| |
| controlGridCellEClass = createEClass(CONTROL_GRID_CELL); |
| createEReference(controlGridCellEClass, CONTROL_GRID_CELL__CONTROL); |
| } |
| |
| /** |
| * <!-- 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 |
| final VViewPackage theViewPackage = (VViewPackage) EPackage.Registry.INSTANCE.getEPackage(VViewPackage.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| controlGridEClass.getESuperTypes().add(theViewPackage.getContainedElement()); |
| |
| // Initialize classes and features; add operations and parameters |
| initEClass(controlGridEClass, VControlGrid.class, "ControlGrid", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getControlGrid_Rows(), getControlGridRow(), null, "rows", null, 0, -1, VControlGrid.class, //$NON-NLS-1$ |
| !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(controlGridRowEClass, VControlGridRow.class, "ControlGridRow", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getControlGridRow_Cells(), getControlGridCell(), null, "cells", null, 0, -1, //$NON-NLS-1$ |
| VControlGridRow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, |
| !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(controlGridCellEClass, VControlGridCell.class, "ControlGridCell", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getControlGridCell_Control(), theViewPackage.getControl(), null, "control", null, 0, 1, //$NON-NLS-1$ |
| VControlGridCell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, |
| !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| } |
| |
| } // VControlgridPackageImpl |