| /** |
| * Copyright (c) 2008 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 |
| * |
| * $Id: ApplicationFactoryImpl.java,v 1.1 2008/11/11 18:19:11 bbokowski Exp $ |
| */ |
| package org.eclipse.e4.ui.model.internal.application; |
| |
| import org.eclipse.e4.ui.model.application.*; |
| |
| import org.eclipse.emf.ecore.EClass; |
| 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 ApplicationFactoryImpl extends EFactoryImpl implements ApplicationFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ApplicationFactory init() { |
| try { |
| ApplicationFactory theApplicationFactory = (ApplicationFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/ui/2008/Application"); //$NON-NLS-1$ |
| if (theApplicationFactory != null) { |
| return theApplicationFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new ApplicationFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ApplicationFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case ApplicationPackage.APPLICATION: return createApplication(); |
| case ApplicationPackage.PART: return createPart(); |
| case ApplicationPackage.STACK: return createStack(); |
| case ApplicationPackage.SASH_FORM: return createSashForm(); |
| case ApplicationPackage.CONTRIBUTED_PART: return createContributedPart(); |
| case ApplicationPackage.HANDLER: return createHandler(); |
| case ApplicationPackage.HANDLED_ITEM: return createHandledItem(); |
| case ApplicationPackage.MENU_ITEM: return createMenuItem(); |
| case ApplicationPackage.TOOL_BAR_ITEM: return createToolBarItem(); |
| case ApplicationPackage.MENU: return createMenu(); |
| case ApplicationPackage.TOOL_BAR: return createToolBar(); |
| case ApplicationPackage.TRIM: return createTrim(); |
| case ApplicationPackage.ITEM_PART: return createItemPart(); |
| case ApplicationPackage.WINDOW: return createWindow(); |
| case ApplicationPackage.COMMAND: return createCommand(); |
| 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 |
| */ |
| public <W extends Window<?>> Application<W> createApplication() { |
| ApplicationImpl<W> application = new ApplicationImpl<W>(); |
| return application; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <P extends Part<?>> Part<P> createPart() { |
| PartImpl<P> part = new PartImpl<P>(); |
| return part; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Stack createStack() { |
| StackImpl stack = new StackImpl(); |
| return stack; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <P extends Part<?>> SashForm<P> createSashForm() { |
| SashFormImpl<P> sashForm = new SashFormImpl<P>(); |
| return sashForm; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <P extends Part<?>> ContributedPart<P> createContributedPart() { |
| ContributedPartImpl<P> contributedPart = new ContributedPartImpl<P>(); |
| return contributedPart; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Handler createHandler() { |
| HandlerImpl handler = new HandlerImpl(); |
| return handler; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public HandledItem createHandledItem() { |
| HandledItemImpl handledItem = new HandledItemImpl(); |
| return handledItem; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MenuItem createMenuItem() { |
| MenuItemImpl menuItem = new MenuItemImpl(); |
| return menuItem; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ToolBarItem createToolBarItem() { |
| ToolBarItemImpl toolBarItem = new ToolBarItemImpl(); |
| return toolBarItem; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Menu createMenu() { |
| MenuImpl menu = new MenuImpl(); |
| return menu; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ToolBar createToolBar() { |
| ToolBarImpl toolBar = new ToolBarImpl(); |
| return toolBar; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Trim createTrim() { |
| TrimImpl trim = new TrimImpl(); |
| return trim; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <P extends Part<?>> ItemPart<P> createItemPart() { |
| ItemPartImpl<P> itemPart = new ItemPartImpl<P>(); |
| return itemPart; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public <P extends Part<?>> Window<P> createWindow() { |
| WindowImpl<P> window = new WindowImpl<P>(); |
| return window; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Command createCommand() { |
| CommandImpl command = new CommandImpl(); |
| return command; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ApplicationPackage getApplicationPackage() { |
| return (ApplicationPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static ApplicationPackage getPackage() { |
| return ApplicationPackage.eINSTANCE; |
| } |
| |
| } //ApplicationFactoryImpl |