blob: 893315aa5e16984c28fbc84803b3d7ebc9e596c3 [file] [log] [blame]
/*
* Copyright (c) 2014, 2015 Eike Stepper (Berlin, Germany) and others.
* 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:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.oomph.setup.workbench.impl;
import org.eclipse.oomph.base.BasePackage;
import org.eclipse.oomph.setup.SetupPackage;
import org.eclipse.oomph.setup.workbench.CommandParameter;
import org.eclipse.oomph.setup.workbench.FileAssociationsTask;
import org.eclipse.oomph.setup.workbench.FileEditor;
import org.eclipse.oomph.setup.workbench.FileMapping;
import org.eclipse.oomph.setup.workbench.KeyBindingContext;
import org.eclipse.oomph.setup.workbench.KeyBindingTask;
import org.eclipse.oomph.setup.workbench.WorkbenchFactory;
import org.eclipse.oomph.setup.workbench.WorkbenchPackage;
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 WorkbenchPackageImpl extends EPackageImpl implements WorkbenchPackage
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass fileAssociationsTaskEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass fileMappingEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass fileEditorEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass keyBindingTaskEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass keyBindingContextEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass commandParameterEClass = 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.workbench.WorkbenchPackage#eNS_URI
* @see #init()
* @generated
*/
private WorkbenchPackageImpl()
{
super(eNS_URI, WorkbenchFactory.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 WorkbenchPackage#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 WorkbenchPackage init()
{
if (isInited)
{
return (WorkbenchPackage)EPackage.Registry.INSTANCE.getEPackage(WorkbenchPackage.eNS_URI);
}
// Obtain or create and register package
WorkbenchPackageImpl theWorkbenchPackage = (WorkbenchPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof WorkbenchPackageImpl
? EPackage.Registry.INSTANCE.get(eNS_URI) : new WorkbenchPackageImpl());
isInited = true;
// Initialize simple dependencies
SetupPackage.eINSTANCE.eClass();
// Create package meta-data objects
theWorkbenchPackage.createPackageContents();
// Initialize created meta-data
theWorkbenchPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theWorkbenchPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(WorkbenchPackage.eNS_URI, theWorkbenchPackage);
return theWorkbenchPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFileAssociationsTask()
{
return fileAssociationsTaskEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFileAssociationsTask_Mappings()
{
return (EReference)fileAssociationsTaskEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFileMapping()
{
return fileMappingEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getFileMapping_FilePattern()
{
return (EAttribute)fileMappingEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getFileMapping_DefaultEditorID()
{
return (EAttribute)fileMappingEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFileMapping_Editors()
{
return (EReference)fileMappingEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFileEditor()
{
return fileEditorEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getFileEditor_ID()
{
return (EAttribute)fileEditorEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getKeyBindingTask()
{
return keyBindingTaskEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingTask_Scheme()
{
return (EAttribute)keyBindingTaskEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getKeyBindingTask_Contexts()
{
return (EReference)keyBindingTaskEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingTask_Platform()
{
return (EAttribute)keyBindingTaskEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingTask_Locale()
{
return (EAttribute)keyBindingTaskEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingTask_Keys()
{
return (EAttribute)keyBindingTaskEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingTask_Command()
{
return (EAttribute)keyBindingTaskEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getKeyBindingTask_CommandParameters()
{
return (EReference)keyBindingTaskEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getKeyBindingContext()
{
return keyBindingContextEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getKeyBindingContext_ID()
{
return (EAttribute)keyBindingContextEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getCommandParameter()
{
return commandParameterEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getCommandParameter_ID()
{
return (EAttribute)commandParameterEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getCommandParameter_Value()
{
return (EAttribute)commandParameterEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WorkbenchFactory getWorkbenchFactory()
{
return (WorkbenchFactory)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
fileAssociationsTaskEClass = createEClass(FILE_ASSOCIATIONS_TASK);
createEReference(fileAssociationsTaskEClass, FILE_ASSOCIATIONS_TASK__MAPPINGS);
fileMappingEClass = createEClass(FILE_MAPPING);
createEAttribute(fileMappingEClass, FILE_MAPPING__FILE_PATTERN);
createEAttribute(fileMappingEClass, FILE_MAPPING__DEFAULT_EDITOR_ID);
createEReference(fileMappingEClass, FILE_MAPPING__EDITORS);
fileEditorEClass = createEClass(FILE_EDITOR);
createEAttribute(fileEditorEClass, FILE_EDITOR__ID);
keyBindingTaskEClass = createEClass(KEY_BINDING_TASK);
createEAttribute(keyBindingTaskEClass, KEY_BINDING_TASK__SCHEME);
createEReference(keyBindingTaskEClass, KEY_BINDING_TASK__CONTEXTS);
createEAttribute(keyBindingTaskEClass, KEY_BINDING_TASK__PLATFORM);
createEAttribute(keyBindingTaskEClass, KEY_BINDING_TASK__LOCALE);
createEAttribute(keyBindingTaskEClass, KEY_BINDING_TASK__KEYS);
createEAttribute(keyBindingTaskEClass, KEY_BINDING_TASK__COMMAND);
createEReference(keyBindingTaskEClass, KEY_BINDING_TASK__COMMAND_PARAMETERS);
keyBindingContextEClass = createEClass(KEY_BINDING_CONTEXT);
createEAttribute(keyBindingContextEClass, KEY_BINDING_CONTEXT__ID);
commandParameterEClass = createEClass(COMMAND_PARAMETER);
createEAttribute(commandParameterEClass, COMMAND_PARAMETER__ID);
createEAttribute(commandParameterEClass, COMMAND_PARAMETER__VALUE);
}
/**
* <!-- 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);
BasePackage theBasePackage = (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
fileAssociationsTaskEClass.getESuperTypes().add(theSetupPackage.getSetupTask());
fileMappingEClass.getESuperTypes().add(theBasePackage.getModelElement());
fileEditorEClass.getESuperTypes().add(theBasePackage.getModelElement());
keyBindingTaskEClass.getESuperTypes().add(theSetupPackage.getSetupTask());
keyBindingContextEClass.getESuperTypes().add(theBasePackage.getModelElement());
commandParameterEClass.getESuperTypes().add(theBasePackage.getModelElement());
// Initialize classes and features; add operations and parameters
initEClass(fileAssociationsTaskEClass, FileAssociationsTask.class, "FileAssociationsTask", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFileAssociationsTask_Mappings(), getFileMapping(), null, "mappings", null, 1, -1, FileAssociationsTask.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(fileMappingEClass, FileMapping.class, "FileMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getFileMapping_FilePattern(), ecorePackage.getEString(), "filePattern", null, 1, 1, FileMapping.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getFileMapping_DefaultEditorID(), ecorePackage.getEString(), "defaultEditorID", null, 0, 1, FileMapping.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFileMapping_Editors(), getFileEditor(), null, "editors", null, 0, -1, FileMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(fileEditorEClass, FileEditor.class, "FileEditor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getFileEditor_ID(), ecorePackage.getEString(), "iD", null, 1, 1, FileEditor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(keyBindingTaskEClass, KeyBindingTask.class, "KeyBindingTask", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getKeyBindingTask_Scheme(), ecorePackage.getEString(), "scheme", "org.eclipse.ui.defaultAcceleratorConfiguration", 1, 1,
KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getKeyBindingTask_Contexts(), getKeyBindingContext(), null, "contexts", null, 1, -1, KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getKeyBindingTask_Platform(), ecorePackage.getEString(), "platform", null, 0, 1, KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getKeyBindingTask_Locale(), ecorePackage.getEString(), "locale", null, 0, 1, KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getKeyBindingTask_Keys(), ecorePackage.getEString(), "keys", null, 1, 1, KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getKeyBindingTask_Command(), ecorePackage.getEString(), "command", null, 1, 1, KeyBindingTask.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getKeyBindingTask_CommandParameters(), getCommandParameter(), null, "commandParameters", null, 0, -1, KeyBindingTask.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(keyBindingContextEClass, KeyBindingContext.class, "KeyBindingContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getKeyBindingContext_ID(), ecorePackage.getEString(), "iD", "org.eclipse.ui.contexts.window", 0, 1, KeyBindingContext.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(commandParameterEClass, CommandParameter.class, "CommandParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getCommandParameter_ID(), ecorePackage.getEString(), "iD", null, 1, 1, CommandParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCommandParameter_Value(), ecorePackage.getEString(), "value", null, 1, 1, CommandParameter.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource("http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Workbench.ecore");
// Create annotations
// http://www.eclipse.org/emf/2002/Ecore
createEcoreAnnotations();
// http://www.eclipse.org/oomph/setup/Enablement
createEnablementAnnotations();
// http://www.eclipse.org/oomph/base/LabelProvider
createLabelProviderAnnotations();
// http://www.eclipse.org/oomph/setup/ValidTriggers
createValidTriggersAnnotations();
// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
createExtendedMetaDataAnnotations();
}
/**
* 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[] { "schemaLocation", "http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Workbench.ecore" });
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/oomph/setup/Enablement</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createEnablementAnnotations()
{
String source = "http://www.eclipse.org/oomph/setup/Enablement";
addAnnotation(this, source, new String[] { "variableName", "setup.workbench.p2", "repository", "${oomph.update.url}", "installableUnits",
"org.eclipse.oomph.setup.workbench.feature.group" });
}
/**
* 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";
addAnnotation(this, source, new String[] { "imageBaseURI",
"http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/plugins/org.eclipse.oomph.setup.workbench.edit/icons/full/obj16" });
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/oomph/setup/ValidTriggers</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createValidTriggersAnnotations()
{
String source = "http://www.eclipse.org/oomph/setup/ValidTriggers";
addAnnotation(fileAssociationsTaskEClass, source, new String[] { "triggers", "STARTUP MANUAL" });
addAnnotation(keyBindingTaskEClass, source, new String[] { "triggers", "STARTUP MANUAL" });
}
/**
* 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";
addAnnotation(getFileAssociationsTask_Mappings(), source, new String[] { "name", "mapping" });
addAnnotation(getFileMapping_Editors(), source, new String[] { "name", "editor" });
addAnnotation(getFileEditor_ID(), source, new String[] { "kind", "attribute", "name", "id" });
addAnnotation(getKeyBindingTask_Contexts(), source, new String[] { "name", "context" });
addAnnotation(getKeyBindingTask_CommandParameters(), source, new String[] { "name", "commandParameter" });
addAnnotation(getKeyBindingContext_ID(), source, new String[] { "kind", "attribute", "name", "id" });
addAnnotation(getCommandParameter_ID(), source, new String[] { "kind", "attribute", "name", "id" });
}
} // WorkbenchPackageImpl