blob: 72e3912292340474bf259030dfe03208b5501ea4 [file] [log] [blame]
/**
* Copyright (c) 2008, 2015 IBM Corporation 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:
* IBM Corporation - initial API and implementation
*/
package org.eclipse.e4.ui.model.application.commands.impl;
import org.eclipse.e4.ui.model.application.commands.*;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class CommandsFactoryImpl extends EFactoryImpl implements MCommandsFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final CommandsFactoryImpl eINSTANCE = init();
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static CommandsFactoryImpl init() {
try {
CommandsFactoryImpl theCommandsFactory = (CommandsFactoryImpl)EPackage.Registry.INSTANCE.getEFactory(CommandsPackageImpl.eNS_URI);
if (theCommandsFactory != null) {
return theCommandsFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new CommandsFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CommandsFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case CommandsPackageImpl.BINDING_CONTEXT: return (EObject)createBindingContext();
case CommandsPackageImpl.BINDING_TABLE: return (EObject)createBindingTable();
case CommandsPackageImpl.COMMAND: return (EObject)createCommand();
case CommandsPackageImpl.COMMAND_PARAMETER: return (EObject)createCommandParameter();
case CommandsPackageImpl.HANDLER: return (EObject)createHandler();
case CommandsPackageImpl.KEY_BINDING: return (EObject)createKeyBinding();
case CommandsPackageImpl.PARAMETER: return (EObject)createParameter();
case CommandsPackageImpl.CATEGORY: return (EObject)createCategory();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MBindingContext createBindingContext() {
BindingContextImpl bindingContext = new BindingContextImpl();
return bindingContext;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MBindingTable createBindingTable() {
BindingTableImpl bindingTable = new BindingTableImpl();
return bindingTable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MCommand createCommand() {
CommandImpl command = new CommandImpl();
return command;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MCommandParameter createCommandParameter() {
CommandParameterImpl commandParameter = new CommandParameterImpl();
return commandParameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MHandler createHandler() {
HandlerImpl handler = new HandlerImpl();
return handler;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MKeyBinding createKeyBinding() {
KeyBindingImpl keyBinding = new KeyBindingImpl();
return keyBinding;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MParameter createParameter() {
ParameterImpl parameter = new ParameterImpl();
return parameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 1.0
* @generated
*/
public MCategory createCategory() {
CategoryImpl category = new CategoryImpl();
return category;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CommandsPackageImpl getCommandsPackage() {
return (CommandsPackageImpl)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static CommandsPackageImpl getPackage() {
return CommandsPackageImpl.eINSTANCE;
}
} //CommandsFactoryImpl