1 /** 2 * Copyright (c) 2008, 2015 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 */ 14 package org.eclipse.e4.ui.model.application.ui.basic.impl; 15 16 import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory; 17 import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart; 18 import org.eclipse.e4.ui.model.application.ui.basic.MInputPart; 19 import org.eclipse.e4.ui.model.application.ui.basic.MPart; 20 import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; 21 import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; 22 import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar; 23 import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; 24 import org.eclipse.e4.ui.model.application.ui.basic.MWindow; 25 import org.eclipse.emf.ecore.EClass; 26 import org.eclipse.emf.ecore.EObject; 27 import org.eclipse.emf.ecore.EPackage; 28 import org.eclipse.emf.ecore.impl.EFactoryImpl; 29 import org.eclipse.emf.ecore.plugin.EcorePlugin; 30 31 /** 32 * <!-- begin-user-doc --> 33 * An implementation of the model <b>Factory</b>. 34 * <!-- end-user-doc --> 35 * @generated 36 */ 37 @SuppressWarnings("deprecation") 38 public class BasicFactoryImpl extends EFactoryImpl implements MBasicFactory { 39 /** 40 * The singleton instance of the factory. 41 * <!-- begin-user-doc --> 42 * <!-- end-user-doc --> 43 * @generated 44 */ 45 public static final BasicFactoryImpl eINSTANCE = init(); 46 47 /** 48 * Creates the default factory implementation. 49 * <!-- begin-user-doc --> 50 * <!-- end-user-doc --> 51 * @generated 52 */ init()53 public static BasicFactoryImpl init() { 54 try { 55 BasicFactoryImpl theBasicFactory = (BasicFactoryImpl) EPackage.Registry.INSTANCE 56 .getEFactory(BasicPackageImpl.eNS_URI); 57 if (theBasicFactory != null) { 58 return theBasicFactory; 59 } 60 } catch (Exception exception) { 61 EcorePlugin.INSTANCE.log(exception); 62 } 63 return new BasicFactoryImpl(); 64 } 65 66 /** 67 * Creates an instance of the factory. 68 * <!-- begin-user-doc --> 69 * <!-- end-user-doc --> 70 * @generated 71 */ BasicFactoryImpl()72 public BasicFactoryImpl() { 73 super(); 74 } 75 76 /** 77 * <!-- begin-user-doc --> 78 * <!-- end-user-doc --> 79 * @generated 80 */ 81 @Override create(EClass eClass)82 public EObject create(EClass eClass) { 83 switch (eClass.getClassifierID()) { 84 case BasicPackageImpl.PART: 85 return (EObject) createPart(); 86 case BasicPackageImpl.COMPOSITE_PART: 87 return (EObject) createCompositePart(); 88 case BasicPackageImpl.INPUT_PART: 89 return (EObject) createInputPart(); 90 case BasicPackageImpl.PART_STACK: 91 return (EObject) createPartStack(); 92 case BasicPackageImpl.PART_SASH_CONTAINER: 93 return (EObject) createPartSashContainer(); 94 case BasicPackageImpl.WINDOW: 95 return (EObject) createWindow(); 96 case BasicPackageImpl.TRIMMED_WINDOW: 97 return (EObject) createTrimmedWindow(); 98 case BasicPackageImpl.TRIM_BAR: 99 return (EObject) createTrimBar(); 100 default: 101 throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ 102 } 103 } 104 105 /** 106 * <!-- begin-user-doc --> 107 * <!-- end-user-doc --> 108 * @since 1.0 109 * @generated 110 */ 111 @Override createPart()112 public MPart createPart() { 113 return new PartImpl(); 114 } 115 116 /** 117 * <!-- begin-user-doc --> 118 * <!-- end-user-doc --> 119 * @since 1.1 120 * @generated 121 */ 122 @Override createCompositePart()123 public MCompositePart createCompositePart() { 124 return new CompositePartImpl(); 125 } 126 127 /** 128 * <!-- begin-user-doc --> 129 * <!-- end-user-doc --> 130 * @since 1.0 131 * @deprecated See {@link MInputPart model documentation} for details. 132 * @noreference See {@link MInputPart model documentation} for details. 133 * @generated 134 */ 135 @Deprecated 136 @Override createInputPart()137 public MInputPart createInputPart() { 138 return new InputPartImpl(); 139 } 140 141 /** 142 * <!-- begin-user-doc --> 143 * <!-- end-user-doc --> 144 * @since 1.0 145 * @generated 146 */ 147 @Override createPartStack()148 public MPartStack createPartStack() { 149 return new PartStackImpl(); 150 } 151 152 /** 153 * <!-- begin-user-doc --> 154 * <!-- end-user-doc --> 155 * @since 1.0 156 * @generated 157 */ 158 @Override createPartSashContainer()159 public MPartSashContainer createPartSashContainer() { 160 return new PartSashContainerImpl(); 161 } 162 163 /** 164 * <!-- begin-user-doc --> 165 * <!-- end-user-doc --> 166 * @since 1.0 167 * @generated 168 */ 169 @Override createWindow()170 public MWindow createWindow() { 171 return new WindowImpl(); 172 } 173 174 /** 175 * <!-- begin-user-doc --> 176 * <!-- end-user-doc --> 177 * @since 1.0 178 * @generated 179 */ 180 @Override createTrimmedWindow()181 public MTrimmedWindow createTrimmedWindow() { 182 return new TrimmedWindowImpl(); 183 } 184 185 /** 186 * <!-- begin-user-doc --> 187 * <!-- end-user-doc --> 188 * @since 1.0 189 * @generated 190 */ 191 @Override createTrimBar()192 public MTrimBar createTrimBar() { 193 return new TrimBarImpl(); 194 } 195 196 /** 197 * <!-- begin-user-doc --> 198 * <!-- end-user-doc --> 199 * @generated 200 */ getBasicPackage()201 public BasicPackageImpl getBasicPackage() { 202 return (BasicPackageImpl) getEPackage(); 203 } 204 205 } //BasicFactoryImpl 206