diff options
Diffstat (limited to 'plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java')
-rw-r--r-- | plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java | 154 |
1 files changed, 142 insertions, 12 deletions
diff --git a/plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java b/plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java index 71116318504..353cc194417 100644 --- a/plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java +++ b/plugins/infra/properties/org.eclipse.papyrus.infra.properties/src-gen/org/eclipse/papyrus/infra/properties/contexts/impl/ViewImpl.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2011, 2013 CEA LIST. + * Copyright (c) 2011, 2021 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -11,9 +11,11 @@ * Contributors: * CEA LIST - Initial API and implementation * Christian W. Damus - add prototype reference to Context (CDO) + * Christian W. Damus - bug 573986 *****************************************************************************/ package org.eclipse.papyrus.infra.properties.contexts.impl; +import java.lang.reflect.InvocationTargetException; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; @@ -22,14 +24,20 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.papyrus.infra.constraints.impl.DisplayUnitImpl; +import org.eclipse.papyrus.infra.properties.contexts.Annotatable; +import org.eclipse.papyrus.infra.properties.contexts.Annotation; import org.eclipse.papyrus.infra.properties.contexts.Context; import org.eclipse.papyrus.infra.properties.contexts.ContextsPackage; import org.eclipse.papyrus.infra.properties.contexts.DataContextElement; import org.eclipse.papyrus.infra.properties.contexts.Section; import org.eclipse.papyrus.infra.properties.contexts.View; +import org.eclipse.papyrus.infra.properties.contexts.operations.AnnotatableOperations; +import org.eclipse.uml2.common.util.CacheAdapter; /** * <!-- begin-user-doc --> @@ -39,17 +47,28 @@ import org.eclipse.papyrus.infra.properties.contexts.View; * The following features are implemented: * </p> * <ul> + * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getAnnotations <em>Annotations</em>}</li> * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getName <em>Name</em>}</li> * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getSections <em>Sections</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getContext <em>Context</em>}</li> * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#isAutomaticContext <em>Automatic Context</em>}</li> * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getDatacontexts <em>Datacontexts</em>}</li> - * <li>{@link org.eclipse.papyrus.infra.properties.contexts.impl.ViewImpl#getContext <em>Context</em>}</li> * </ul> * * @generated */ public class ViewImpl extends DisplayUnitImpl implements View { /** + * The cached value of the '{@link #getAnnotations() <em>Annotations</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAnnotations() + * @generated + * @ordered + */ + protected EList<Annotation> annotations; + + /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -134,6 +153,19 @@ public class ViewImpl extends DisplayUnitImpl implements View { * @generated */ @Override + public EList<Annotation> getAnnotations() { + if (annotations == null) { + annotations = new EObjectContainmentWithInverseEList<Annotation>(Annotation.class, this, ContextsPackage.VIEW__ANNOTATIONS, ContextsPackage.ANNOTATION__ELEMENT); + } + return annotations; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public String getName() { return name; } @@ -212,6 +244,15 @@ public class ViewImpl extends DisplayUnitImpl implements View { * <!-- end-user-doc --> * @generated */ + public Annotation getAnnotation(String source) { + return AnnotatableOperations.getAnnotation(this, source); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ @Override public boolean isAutomaticContext() { return automaticContext; @@ -248,9 +289,12 @@ public class ViewImpl extends DisplayUnitImpl implements View { * <!-- end-user-doc --> * @generated */ + @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getAnnotations()).basicAdd(otherEnd, msgs); case ContextsPackage.VIEW__CONTEXT: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); @@ -267,6 +311,8 @@ public class ViewImpl extends DisplayUnitImpl implements View { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + return ((InternalEList<?>)getAnnotations()).basicRemove(otherEnd, msgs); case ContextsPackage.VIEW__CONTEXT: return basicSetContext(null, msgs); } @@ -295,16 +341,18 @@ public class ViewImpl extends DisplayUnitImpl implements View { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + return getAnnotations(); case ContextsPackage.VIEW__NAME: return getName(); case ContextsPackage.VIEW__SECTIONS: return getSections(); + case ContextsPackage.VIEW__CONTEXT: + return getContext(); case ContextsPackage.VIEW__AUTOMATIC_CONTEXT: return isAutomaticContext(); case ContextsPackage.VIEW__DATACONTEXTS: return getDatacontexts(); - case ContextsPackage.VIEW__CONTEXT: - return getContext(); } return super.eGet(featureID, resolve, coreType); } @@ -318,6 +366,10 @@ public class ViewImpl extends DisplayUnitImpl implements View { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + getAnnotations().clear(); + getAnnotations().addAll((Collection<? extends Annotation>)newValue); + return; case ContextsPackage.VIEW__NAME: setName((String)newValue); return; @@ -325,6 +377,9 @@ public class ViewImpl extends DisplayUnitImpl implements View { getSections().clear(); getSections().addAll((Collection<? extends Section>)newValue); return; + case ContextsPackage.VIEW__CONTEXT: + setContext((Context)newValue); + return; case ContextsPackage.VIEW__AUTOMATIC_CONTEXT: setAutomaticContext((Boolean)newValue); return; @@ -332,9 +387,6 @@ public class ViewImpl extends DisplayUnitImpl implements View { getDatacontexts().clear(); getDatacontexts().addAll((Collection<? extends DataContextElement>)newValue); return; - case ContextsPackage.VIEW__CONTEXT: - setContext((Context)newValue); - return; } super.eSet(featureID, newValue); } @@ -347,21 +399,24 @@ public class ViewImpl extends DisplayUnitImpl implements View { @Override public void eUnset(int featureID) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + getAnnotations().clear(); + return; case ContextsPackage.VIEW__NAME: setName(NAME_EDEFAULT); return; case ContextsPackage.VIEW__SECTIONS: getSections().clear(); return; + case ContextsPackage.VIEW__CONTEXT: + setContext((Context)null); + return; case ContextsPackage.VIEW__AUTOMATIC_CONTEXT: setAutomaticContext(AUTOMATIC_CONTEXT_EDEFAULT); return; case ContextsPackage.VIEW__DATACONTEXTS: getDatacontexts().clear(); return; - case ContextsPackage.VIEW__CONTEXT: - setContext((Context)null); - return; } super.eUnset(featureID); } @@ -374,16 +429,18 @@ public class ViewImpl extends DisplayUnitImpl implements View { @Override public boolean eIsSet(int featureID) { switch (featureID) { + case ContextsPackage.VIEW__ANNOTATIONS: + return annotations != null && !annotations.isEmpty(); case ContextsPackage.VIEW__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case ContextsPackage.VIEW__SECTIONS: return sections != null && !sections.isEmpty(); + case ContextsPackage.VIEW__CONTEXT: + return getContext() != null; case ContextsPackage.VIEW__AUTOMATIC_CONTEXT: return automaticContext != AUTOMATIC_CONTEXT_EDEFAULT; case ContextsPackage.VIEW__DATACONTEXTS: return datacontexts != null && !datacontexts.isEmpty(); - case ContextsPackage.VIEW__CONTEXT: - return getContext() != null; } return super.eIsSet(featureID); } @@ -394,6 +451,68 @@ public class ViewImpl extends DisplayUnitImpl implements View { * @generated */ @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { + if (baseClass == Annotatable.class) { + switch (derivedFeatureID) { + case ContextsPackage.VIEW__ANNOTATIONS: return ContextsPackage.ANNOTATABLE__ANNOTATIONS; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { + if (baseClass == Annotatable.class) { + switch (baseFeatureID) { + case ContextsPackage.ANNOTATABLE__ANNOTATIONS: return ContextsPackage.VIEW__ANNOTATIONS; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) { + if (baseClass == Annotatable.class) { + switch (baseOperationID) { + case ContextsPackage.ANNOTATABLE___GET_ANNOTATION__STRING: return ContextsPackage.VIEW___GET_ANNOTATION__STRING; + default: return -1; + } + } + return super.eDerivedOperationID(baseOperationID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case ContextsPackage.VIEW___GET_ANNOTATION__STRING: + return getAnnotation((String)arguments.get(0)); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public String toString() { if (eIsProxy()) return super.toString(); @@ -406,4 +525,15 @@ public class ViewImpl extends DisplayUnitImpl implements View { return result.toString(); } + /** + * Retrieves the cache adapter for this '<em><b>View</b></em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return The cache adapter for this '<em><b>View</b></em>'. + * @generated + */ + protected CacheAdapter getCacheAdapter() { + return CacheAdapter.getInstance(); + } + } // ViewImpl |