/* * Copyright (c) 2003- michael lawley and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation * which accompanies this distribution, and is available by writing to * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Contributors: * michael lawley * * * $Id$ */ package tefkat.model.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.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 tefkat.model.util.TefkatAdapterFactory; /** * 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 TefkatItemProviderAdapterFactory extends TefkatAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final String copyright = "Copyright michael lawley Pty Ltd 2003-2007"; /** * 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 supportedTypes = new ArrayList(); /** * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TefkatItemProviderAdapterFactory() { 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 tefkat.model.ContainerExtent} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ContainerExtentItemProvider containerExtentItemProvider; /** * This creates an adapter for a {@link tefkat.model.ContainerExtent}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createContainerExtentAdapter() { if (containerExtentItemProvider == null) { containerExtentItemProvider = new ContainerExtentItemProvider(this); } return containerExtentItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.ReferenceExtent} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ReferenceExtentItemProvider referenceExtentItemProvider; /** * This creates an adapter for a {@link tefkat.model.ReferenceExtent}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createReferenceExtentAdapter() { if (referenceExtentItemProvider == null) { referenceExtentItemProvider = new ReferenceExtentItemProvider(this); } return referenceExtentItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.Var} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected VarItemProvider varItemProvider; /** * This creates an adapter for a {@link tefkat.model.Var}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createVarAdapter() { if (varItemProvider == null) { varItemProvider = new VarItemProvider(this); } return varItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.VarScope} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected VarScopeItemProvider varScopeItemProvider; /** * This creates an adapter for a {@link tefkat.model.VarScope}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createVarScopeAdapter() { if (varScopeItemProvider == null) { varScopeItemProvider = new VarScopeItemProvider(this); } return varScopeItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.TRule} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TRuleItemProvider tRuleItemProvider; /** * This creates an adapter for a {@link tefkat.model.TRule}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createTRuleAdapter() { if (tRuleItemProvider == null) { tRuleItemProvider = new TRuleItemProvider(this); } return tRuleItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.Transformation} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TransformationItemProvider transformationItemProvider; /** * This creates an adapter for a {@link tefkat.model.Transformation}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createTransformationAdapter() { if (transformationItemProvider == null) { transformationItemProvider = new TransformationItemProvider(this); } return transformationItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.PatternDefn} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PatternDefnItemProvider patternDefnItemProvider; /** * This creates an adapter for a {@link tefkat.model.PatternDefn}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createPatternDefnAdapter() { if (patternDefnItemProvider == null) { patternDefnItemProvider = new PatternDefnItemProvider(this); } return patternDefnItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.Query} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected QueryItemProvider queryItemProvider; /** * This creates an adapter for a {@link tefkat.model.Query}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createQueryAdapter() { if (queryItemProvider == null) { queryItemProvider = new QueryItemProvider(this); } return queryItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.InstanceRef} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected InstanceRefItemProvider instanceRefItemProvider; /** * This creates an adapter for a {@link tefkat.model.InstanceRef}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createInstanceRefAdapter() { if (instanceRefItemProvider == null) { instanceRefItemProvider = new InstanceRefItemProvider(this); } return instanceRefItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.AndTerm} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AndTermItemProvider andTermItemProvider; /** * This creates an adapter for a {@link tefkat.model.AndTerm}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createAndTermAdapter() { if (andTermItemProvider == null) { andTermItemProvider = new AndTermItemProvider(this); } return andTermItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.OrTerm} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected OrTermItemProvider orTermItemProvider; /** * This creates an adapter for a {@link tefkat.model.OrTerm}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createOrTermAdapter() { if (orTermItemProvider == null) { orTermItemProvider = new OrTermItemProvider(this); } return orTermItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.NotTerm} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected NotTermItemProvider notTermItemProvider; /** * This creates an adapter for a {@link tefkat.model.NotTerm}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createNotTermAdapter() { if (notTermItemProvider == null) { notTermItemProvider = new NotTermItemProvider(this); } return notTermItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.IfTerm} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IfTermItemProvider ifTermItemProvider; /** * This creates an adapter for a {@link tefkat.model.IfTerm}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createIfTermAdapter() { if (ifTermItemProvider == null) { ifTermItemProvider = new IfTermItemProvider(this); } return ifTermItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.TrackingUse} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TrackingUseItemProvider trackingUseItemProvider; /** * This creates an adapter for a {@link tefkat.model.TrackingUse}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createTrackingUseAdapter() { if (trackingUseItemProvider == null) { trackingUseItemProvider = new TrackingUseItemProvider(this); } return trackingUseItemProvider; } /** * This keeps track of the one adapter used for all {@link java.util.Map.Entry} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected FeatureValuePairItemProvider featureValuePairItemProvider; /** * This creates an adapter for a {@link java.util.Map.Entry}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createFeatureValuePairAdapter() { if (featureValuePairItemProvider == null) { featureValuePairItemProvider = new FeatureValuePairItemProvider(this); } return featureValuePairItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.PatternUse} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PatternUseItemProvider patternUseItemProvider; /** * This creates an adapter for a {@link tefkat.model.PatternUse}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createPatternUseAdapter() { if (patternUseItemProvider == null) { patternUseItemProvider = new PatternUseItemProvider(this); } return patternUseItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.Condition} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ConditionItemProvider conditionItemProvider; /** * This creates an adapter for a {@link tefkat.model.Condition}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createConditionAdapter() { if (conditionItemProvider == null) { conditionItemProvider = new ConditionItemProvider(this); } return conditionItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.MofInstance} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MofInstanceItemProvider mofInstanceItemProvider; /** * This creates an adapter for a {@link tefkat.model.MofInstance}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createMofInstanceAdapter() { if (mofInstanceItemProvider == null) { mofInstanceItemProvider = new MofInstanceItemProvider(this); } return mofInstanceItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.MofOrder} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MofOrderItemProvider mofOrderItemProvider; /** * This creates an adapter for a {@link tefkat.model.MofOrder}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createMofOrderAdapter() { if (mofOrderItemProvider == null) { mofOrderItemProvider = new MofOrderItemProvider(this); } return mofOrderItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.VarUse} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected VarUseItemProvider varUseItemProvider; /** * This creates an adapter for a {@link tefkat.model.VarUse}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createVarUseAdapter() { if (varUseItemProvider == null) { varUseItemProvider = new VarUseItemProvider(this); } return varUseItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.CollectionExpr} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CollectionExprItemProvider collectionExprItemProvider; /** * This creates an adapter for a {@link tefkat.model.CollectionExpr}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createCollectionExprAdapter() { if (collectionExprItemProvider == null) { collectionExprItemProvider = new CollectionExprItemProvider(this); } return collectionExprItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.FunctionExpr} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected FunctionExprItemProvider functionExprItemProvider; /** * This creates an adapter for a {@link tefkat.model.FunctionExpr}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createFunctionExprAdapter() { if (functionExprItemProvider == null) { functionExprItemProvider = new FunctionExprItemProvider(this); } return functionExprItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.FeatureExpr} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected FeatureExprItemProvider featureExprItemProvider; /** * This creates an adapter for a {@link tefkat.model.FeatureExpr}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createFeatureExprAdapter() { if (featureExprItemProvider == null) { featureExprItemProvider = new FeatureExprItemProvider(this); } return featureExprItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.StringConstant} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected StringConstantItemProvider stringConstantItemProvider; /** * This creates an adapter for a {@link tefkat.model.StringConstant}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createStringConstantAdapter() { if (stringConstantItemProvider == null) { stringConstantItemProvider = new StringConstantItemProvider(this); } return stringConstantItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.IntConstant} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IntConstantItemProvider intConstantItemProvider; /** * This creates an adapter for a {@link tefkat.model.IntConstant}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createIntConstantAdapter() { if (intConstantItemProvider == null) { intConstantItemProvider = new IntConstantItemProvider(this); } return intConstantItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.RealConstant} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected RealConstantItemProvider realConstantItemProvider; /** * This creates an adapter for a {@link tefkat.model.RealConstant}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createRealConstantAdapter() { if (realConstantItemProvider == null) { realConstantItemProvider = new RealConstantItemProvider(this); } return realConstantItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.BooleanConstant} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected BooleanConstantItemProvider booleanConstantItemProvider; /** * This creates an adapter for a {@link tefkat.model.BooleanConstant}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createBooleanConstantAdapter() { if (booleanConstantItemProvider == null) { booleanConstantItemProvider = new BooleanConstantItemProvider(this); } return booleanConstantItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.EnumConstant} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EnumConstantItemProvider enumConstantItemProvider; /** * This creates an adapter for a {@link tefkat.model.EnumConstant}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createEnumConstantAdapter() { if (enumConstantItemProvider == null) { enumConstantItemProvider = new EnumConstantItemProvider(this); } return enumConstantItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.Injection} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected InjectionItemProvider injectionItemProvider; /** * This creates an adapter for a {@link tefkat.model.Injection}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createInjectionAdapter() { if (injectionItemProvider == null) { injectionItemProvider = new InjectionItemProvider(this); } return injectionItemProvider; } /** * This keeps track of the one adapter used for all {@link tefkat.model.NamespaceDeclaration} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected NamespaceDeclarationItemProvider namespaceDeclarationItemProvider; /** * This creates an adapter for a {@link tefkat.model.NamespaceDeclaration}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Adapter createNamespaceDeclarationAdapter() { if (namespaceDeclarationItemProvider == null) { namespaceDeclarationItemProvider = new NamespaceDeclarationItemProvider(this); } return namespaceDeclarationItemProvider; } /** * 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 */ 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 */ public Adapter adapt(Notifier notifier, Object type) { return super.adapt(notifier, this); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ 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); } } }