/******************************************************************************* * Copyright (c) 2010 Herman Lee. * 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: * Herman Lee - initial API and implementation ******************************************************************************/ package ca.uwaterloo.gsd.fsml.implModel.provider; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.edit.provider.ChangeNotifier; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ComposedAdapterFactory; import org.eclipse.emf.edit.provider.IChangeNotifier; import org.eclipse.emf.edit.provider.IDisposable; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.INotifyChangedListener; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import ca.uwaterloo.gsd.fsml.implModel.util.ImplModelAdapterFactory; /** * This is the factory that is used to provide the interfaces needed to support Viewers. * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. * The adapters also support Eclipse property sheets. * Note that most of the adapters are shared among multiple instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class ImplModelItemProviderAdapterFactory extends ImplModelAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { /** * This keeps track of the root adapter factory that delegates to this adapter factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ComposedAdapterFactory parentAdapterFactory; /** * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IChangeNotifier changeNotifier = new ChangeNotifier(); /** * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected Collection<Object> supportedTypes = new ArrayList<Object>(); /** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ImplModelItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); supportedTypes.add(IItemLabelProvider.class); supportedTypes.add(IItemPropertySource.class); } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.implModel} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected implModelItemProvider implModelItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.implModel}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createimplModelAdapter() { if (implModelItemProvider == null) { implModelItemProvider = new implModelItemProvider(this); } return implModelItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_assignedWithNew} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_assignedWithNewItemProvider default_assignedWithNewItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_assignedWithNew}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_assignedWithNewAdapter() { if (default_assignedWithNewItemProvider == null) { default_assignedWithNewItemProvider = new default_assignedWithNewItemProvider(this); } return default_assignedWithNewItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_assignedWithNull} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_assignedWithNullItemProvider default_assignedWithNullItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_assignedWithNull}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_assignedWithNullAdapter() { if (default_assignedWithNullItemProvider == null) { default_assignedWithNullItemProvider = new default_assignedWithNullItemProvider(this); } return default_assignedWithNullItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_extendsClass} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_extendsClassItemProvider default_extendsClassItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_extendsClass}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_extendsClassAdapter() { if (default_extendsClassItemProvider == null) { default_extendsClassItemProvider = new default_extendsClassItemProvider(this); } return default_extendsClassItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_implementsInterface} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_implementsInterfaceItemProvider default_implementsInterfaceItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_implementsInterface}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_implementsInterfaceAdapter() { if (default_implementsInterfaceItemProvider == null) { default_implementsInterfaceItemProvider = new default_implementsInterfaceItemProvider(this); } return default_implementsInterfaceItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_callsReceived} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_callsReceivedItemProvider default_callsReceivedItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_callsReceived}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_callsReceivedAdapter() { if (default_callsReceivedItemProvider == null) { default_callsReceivedItemProvider = new default_callsReceivedItemProvider(this); } return default_callsReceivedItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_methodCalls} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_methodCallsItemProvider default_methodCallsItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_methodCalls}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_methodCallsAdapter() { if (default_methodCallsItemProvider == null) { default_methodCallsItemProvider = new default_methodCallsItemProvider(this); } return default_methodCallsItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.default_typedWith} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_typedWithItemProvider default_typedWithItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.default_typedWith}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createdefault_typedWithAdapter() { if (default_typedWithItemProvider == null) { default_typedWithItemProvider = new default_typedWithItemProvider(this); } return default_typedWithItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNew_Initializer} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_assignedWithNew_InitializerItemProvider variant_assignedWithNew_InitializerItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNew_Initializer}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_assignedWithNew_InitializerAdapter() { if (variant_assignedWithNew_InitializerItemProvider == null) { variant_assignedWithNew_InitializerItemProvider = new variant_assignedWithNew_InitializerItemProvider(this); } return variant_assignedWithNew_InitializerItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNew_InMethod} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_assignedWithNew_InMethodItemProvider variant_assignedWithNew_InMethodItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNew_InMethod}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_assignedWithNew_InMethodAdapter() { if (variant_assignedWithNew_InMethodItemProvider == null) { variant_assignedWithNew_InMethodItemProvider = new variant_assignedWithNew_InMethodItemProvider(this); } return variant_assignedWithNew_InMethodItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_extendsClass_Directly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_extendsClass_DirectlyItemProvider variant_extendsClass_DirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_extendsClass_Directly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_extendsClass_DirectlyAdapter() { if (variant_extendsClass_DirectlyItemProvider == null) { variant_extendsClass_DirectlyItemProvider = new variant_extendsClass_DirectlyItemProvider(this); } return variant_extendsClass_DirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_extendsClass_Indirectly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_extendsClass_IndirectlyItemProvider variant_extendsClass_IndirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_extendsClass_Indirectly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_extendsClass_IndirectlyAdapter() { if (variant_extendsClass_IndirectlyItemProvider == null) { variant_extendsClass_IndirectlyItemProvider = new variant_extendsClass_IndirectlyItemProvider(this); } return variant_extendsClass_IndirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_implementsInterface_Directly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_implementsInterface_DirectlyItemProvider variant_implementsInterface_DirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_implementsInterface_Directly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_implementsInterface_DirectlyAdapter() { if (variant_implementsInterface_DirectlyItemProvider == null) { variant_implementsInterface_DirectlyItemProvider = new variant_implementsInterface_DirectlyItemProvider(this); } return variant_implementsInterface_DirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_implementsInterface_Indirectly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_implementsInterface_IndirectlyItemProvider variant_implementsInterface_IndirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_implementsInterface_Indirectly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_implementsInterface_IndirectlyAdapter() { if (variant_implementsInterface_IndirectlyItemProvider == null) { variant_implementsInterface_IndirectlyItemProvider = new variant_implementsInterface_IndirectlyItemProvider(this); } return variant_implementsInterface_IndirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_callsReceived_InMethod} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_callsReceived_InMethodItemProvider variant_callsReceived_InMethodItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_callsReceived_InMethod}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_callsReceived_InMethodAdapter() { if (variant_callsReceived_InMethodItemProvider == null) { variant_callsReceived_InMethodItemProvider = new variant_callsReceived_InMethodItemProvider(this); } return variant_callsReceived_InMethodItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_methodCalls_InMethod} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_methodCalls_InMethodItemProvider variant_methodCalls_InMethodItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_methodCalls_InMethod}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_methodCalls_InMethodAdapter() { if (variant_methodCalls_InMethodItemProvider == null) { variant_methodCalls_InMethodItemProvider = new variant_methodCalls_InMethodItemProvider(this); } return variant_methodCalls_InMethodItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_typedWith_Directly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_typedWith_DirectlyItemProvider variant_typedWith_DirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_typedWith_Directly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_typedWith_DirectlyAdapter() { if (variant_typedWith_DirectlyItemProvider == null) { variant_typedWith_DirectlyItemProvider = new variant_typedWith_DirectlyItemProvider(this); } return variant_typedWith_DirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_typedWith_Indirectly} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_typedWith_IndirectlyItemProvider variant_typedWith_IndirectlyItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_typedWith_Indirectly}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_typedWith_IndirectlyAdapter() { if (variant_typedWith_IndirectlyItemProvider == null) { variant_typedWith_IndirectlyItemProvider = new variant_typedWith_IndirectlyItemProvider(this); } return variant_typedWith_IndirectlyItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNull_Initializer} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_assignedWithNull_InitializerItemProvider variant_assignedWithNull_InitializerItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNull_Initializer}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_assignedWithNull_InitializerAdapter() { if (variant_assignedWithNull_InitializerItemProvider == null) { variant_assignedWithNull_InitializerItemProvider = new variant_assignedWithNull_InitializerItemProvider(this); } return variant_assignedWithNull_InitializerItemProvider; } /** * This keeps track of the one adapter used for all {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNull_InMethod} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected variant_assignedWithNull_InMethodItemProvider variant_assignedWithNull_InMethodItemProvider; /** * This creates an adapter for a {@link ca.uwaterloo.gsd.fsml.implModel.variant_assignedWithNull_InMethod}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter createvariant_assignedWithNull_InMethodAdapter() { if (variant_assignedWithNull_InMethodItemProvider == null) { variant_assignedWithNull_InMethodItemProvider = new variant_assignedWithNull_InMethodItemProvider(this); } return variant_assignedWithNull_InMethodItemProvider; } /** * This returns the root adapter factory that contains this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ComposeableAdapterFactory getRootAdapterFactory() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } /** * This sets the composed adapter factory that contains this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean isFactoryForType(Object type) { return supportedTypes.contains(type) || super.isFactoryForType(type); } /** * This implementation substitutes the factory itself as the key for the adapter. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Adapter adapt(Notifier notifier, Object type) { return super.adapt(notifier, this); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object adapt(Object object, Object type) { if (isFactoryForType(type)) { Object adapter = super.adapt(object, type); if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter))) { return adapter; } } return null; } /** * This adds a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } /** * This removes a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } /** * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(notification); } } /** * This disposes all of the item providers created by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void dispose() { if (implModelItemProvider != null) implModelItemProvider.dispose(); if (default_assignedWithNewItemProvider != null) default_assignedWithNewItemProvider.dispose(); if (default_assignedWithNullItemProvider != null) default_assignedWithNullItemProvider.dispose(); if (default_extendsClassItemProvider != null) default_extendsClassItemProvider.dispose(); if (default_implementsInterfaceItemProvider != null) default_implementsInterfaceItemProvider.dispose(); if (default_callsReceivedItemProvider != null) default_callsReceivedItemProvider.dispose(); if (default_methodCallsItemProvider != null) default_methodCallsItemProvider.dispose(); if (default_typedWithItemProvider != null) default_typedWithItemProvider.dispose(); if (variant_assignedWithNew_InitializerItemProvider != null) variant_assignedWithNew_InitializerItemProvider.dispose(); if (variant_assignedWithNew_InMethodItemProvider != null) variant_assignedWithNew_InMethodItemProvider.dispose(); if (variant_extendsClass_DirectlyItemProvider != null) variant_extendsClass_DirectlyItemProvider.dispose(); if (variant_extendsClass_IndirectlyItemProvider != null) variant_extendsClass_IndirectlyItemProvider.dispose(); if (variant_implementsInterface_DirectlyItemProvider != null) variant_implementsInterface_DirectlyItemProvider.dispose(); if (variant_implementsInterface_IndirectlyItemProvider != null) variant_implementsInterface_IndirectlyItemProvider.dispose(); if (variant_callsReceived_InMethodItemProvider != null) variant_callsReceived_InMethodItemProvider.dispose(); if (variant_methodCalls_InMethodItemProvider != null) variant_methodCalls_InMethodItemProvider.dispose(); if (variant_typedWith_DirectlyItemProvider != null) variant_typedWith_DirectlyItemProvider.dispose(); if (variant_typedWith_IndirectlyItemProvider != null) variant_typedWith_IndirectlyItemProvider.dispose(); if (variant_assignedWithNull_InitializerItemProvider != null) variant_assignedWithNull_InitializerItemProvider.dispose(); if (variant_assignedWithNull_InMethodItemProvider != null) variant_assignedWithNull_InMethodItemProvider.dispose(); } }