| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.infogrid.model.gridsource.style.impl; |
| |
| 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; |
| |
| import org.eclipse.osbp.infogrid.model.gridsource.style.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class CxGridStyleFactoryImpl extends EFactoryImpl implements CxGridStyleFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static CxGridStyleFactory init() { |
| try { |
| CxGridStyleFactory theCxGridStyleFactory = (CxGridStyleFactory)EPackage.Registry.INSTANCE.getEFactory(CxGridStylePackage.eNS_URI); |
| if (theCxGridStyleFactory != null) { |
| return theCxGridStyleFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new CxGridStyleFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridStyleFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case CxGridStylePackage.CX_GRID_PROP_HTML_STYLE: return createCxGridPropHtmlStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_TEXT_STYLE: return createCxGridPropTextStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_BUTTON_STYLE: return createCxGridPropButtonStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_PROGRESSBAR_STYLE: return createCxGridPropProgressbarStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_SPARKLINE_STYLE: return createCxGridPropSparklineStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_BOOLEAN_STYLE: return createCxGridPropBooleanStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_NUMBER_STYLE: return createCxGridPropNumberStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE: return createCxGridPropImageStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE: return createCxGridPropIndicatorStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_DATE_STYLE: return createCxGridPropDateStyle(); |
| case CxGridStylePackage.CX_GRID_STYLE_CONFIG: return createCxGridStyleConfig(); |
| case CxGridStylePackage.CX_GRID_STYLE_CONFIG_STRING_TO_RESOURCE: return createCxGridStyleConfigStringToResource(); |
| case CxGridStylePackage.CX_GRID_STYLE_CONFIG_NUMERIC_TO_RESOURCE: return createCxGridStyleConfigNumericToResource(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE: return createCxGridPropQuantityStyle(); |
| case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE: return createCxGridPropPriceStyle(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object createFromString(EDataType eDataType, String initialValue) { |
| switch (eDataType.getClassifierID()) { |
| case CxGridStylePackage.CX_GRID_COMPARE: |
| return createCxGridCompareFromString(eDataType, initialValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String convertToString(EDataType eDataType, Object instanceValue) { |
| switch (eDataType.getClassifierID()) { |
| case CxGridStylePackage.CX_GRID_COMPARE: |
| return convertCxGridCompareToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropHtmlStyle createCxGridPropHtmlStyle() { |
| CxGridPropHtmlStyleImpl cxGridPropHtmlStyle = new CxGridPropHtmlStyleImpl(); |
| return cxGridPropHtmlStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropTextStyle createCxGridPropTextStyle() { |
| CxGridPropTextStyleImpl cxGridPropTextStyle = new CxGridPropTextStyleImpl(); |
| return cxGridPropTextStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropButtonStyle createCxGridPropButtonStyle() { |
| CxGridPropButtonStyleImpl cxGridPropButtonStyle = new CxGridPropButtonStyleImpl(); |
| return cxGridPropButtonStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropProgressbarStyle createCxGridPropProgressbarStyle() { |
| CxGridPropProgressbarStyleImpl cxGridPropProgressbarStyle = new CxGridPropProgressbarStyleImpl(); |
| return cxGridPropProgressbarStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropSparklineStyle createCxGridPropSparklineStyle() { |
| CxGridPropSparklineStyleImpl cxGridPropSparklineStyle = new CxGridPropSparklineStyleImpl(); |
| return cxGridPropSparklineStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropBooleanStyle createCxGridPropBooleanStyle() { |
| CxGridPropBooleanStyleImpl cxGridPropBooleanStyle = new CxGridPropBooleanStyleImpl(); |
| return cxGridPropBooleanStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropNumberStyle createCxGridPropNumberStyle() { |
| CxGridPropNumberStyleImpl cxGridPropNumberStyle = new CxGridPropNumberStyleImpl(); |
| return cxGridPropNumberStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropImageStyle createCxGridPropImageStyle() { |
| CxGridPropImageStyleImpl cxGridPropImageStyle = new CxGridPropImageStyleImpl(); |
| return cxGridPropImageStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropIndicatorStyle createCxGridPropIndicatorStyle() { |
| CxGridPropIndicatorStyleImpl cxGridPropIndicatorStyle = new CxGridPropIndicatorStyleImpl(); |
| return cxGridPropIndicatorStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropDateStyle createCxGridPropDateStyle() { |
| CxGridPropDateStyleImpl cxGridPropDateStyle = new CxGridPropDateStyleImpl(); |
| return cxGridPropDateStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridStyleConfig createCxGridStyleConfig() { |
| CxGridStyleConfigImpl cxGridStyleConfig = new CxGridStyleConfigImpl(); |
| return cxGridStyleConfig; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridStyleConfigStringToResource createCxGridStyleConfigStringToResource() { |
| CxGridStyleConfigStringToResourceImpl cxGridStyleConfigStringToResource = new CxGridStyleConfigStringToResourceImpl(); |
| return cxGridStyleConfigStringToResource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridStyleConfigNumericToResource createCxGridStyleConfigNumericToResource() { |
| CxGridStyleConfigNumericToResourceImpl cxGridStyleConfigNumericToResource = new CxGridStyleConfigNumericToResourceImpl(); |
| return cxGridStyleConfigNumericToResource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropQuantityStyle createCxGridPropQuantityStyle() { |
| CxGridPropQuantityStyleImpl cxGridPropQuantityStyle = new CxGridPropQuantityStyleImpl(); |
| return cxGridPropQuantityStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridPropPriceStyle createCxGridPropPriceStyle() { |
| CxGridPropPriceStyleImpl cxGridPropPriceStyle = new CxGridPropPriceStyleImpl(); |
| return cxGridPropPriceStyle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridCompare createCxGridCompareFromString(EDataType eDataType, String initialValue) { |
| CxGridCompare result = CxGridCompare.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertCxGridCompareToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridStylePackage getCxGridStylePackage() { |
| return (CxGridStylePackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static CxGridStylePackage getPackage() { |
| return CxGridStylePackage.eINSTANCE; |
| } |
| |
| } //CxGridStyleFactoryImpl |