summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2012-10-31 17:02:04 (EDT)
committerSteffen Pingel2012-11-02 14:41:58 (EDT)
commita4f0305d12eef5ed12926235774971b2baca1ff5 (patch)
tree8d69cdfc5d37b61335b150c02637b766937e6746
parent0abe270aeaec36bf0fd215c9e8b9561634021709 (diff)
downloadorg.eclipse.mylyn.reviews-a4f0305d12eef5ed12926235774971b2baca1ff5.zip
org.eclipse.mylyn.reviews-a4f0305d12eef5ed12926235774971b2baca1ff5.tar.gz
org.eclipse.mylyn.reviews-a4f0305d12eef5ed12926235774971b2baca1ff5.tar.bz2
324327: Added model versioning supportrefs/changes/59/8459/5
This change provides generic support for R4E and other clients that need to provide generic versioning of model components. Change-Id: I06fb43fcfd354a31f1b381a65191542f22d42851 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389457
-rw-r--r--org.eclipse.mylyn.reviews.core/model/reviews.ecore4
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IModelVersioning.java55
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java19
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java89
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java22
5 files changed, 189 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.reviews.core/model/reviews.ecore b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
index 658fb7a..46314f5 100644
--- a/org.eclipse.mylyn.reviews.core/model/reviews.ecore
+++ b/org.eclipse.mylyn.reviews.core/model/reviews.ecore
@@ -103,4 +103,8 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="revision" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ModelVersioning" abstract="true" interface="true">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="fragmentVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral="1.0.0"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IModelVersioning.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IModelVersioning.java
new file mode 100644
index 0000000..f7d588b
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IModelVersioning.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2011 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ */
+package org.eclipse.mylyn.reviews.core.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Model Versioning</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning#getFragmentVersion <em>Fragment Version</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface IModelVersioning extends EObject {
+ /**
+ * Returns the value of the '<em><b>Fragment Version</b></em>' attribute.
+ * The default value is <code>"1.0.0"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Fragment Version</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Fragment Version</em>' attribute.
+ * @see #setFragmentVersion(String)
+ * @generated
+ */
+ String getFragmentVersion();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning#getFragmentVersion <em>Fragment Version</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Fragment Version</em>' attribute.
+ * @see #getFragmentVersion()
+ * @generated
+ */
+ void setFragmentVersion(String value);
+
+} // IModelVersioning
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
index fc92efd..31c1098 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsAdapterFactory.java
@@ -155,6 +155,11 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
}
@Override
+ public Adapter caseModelVersioning(IModelVersioning object) {
+ return createModelVersioningAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -398,6 +403,20 @@ public class ReviewsAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning <em>Model Versioning</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.mylyn.reviews.core.model.IModelVersioning
+ * @generated
+ */
+ public Adapter createModelVersioningAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
index a895292..0602b29 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.reviews.core.model.ILineLocation;
import org.eclipse.mylyn.reviews.core.model.ILineRange;
import org.eclipse.mylyn.reviews.core.model.IItem;
import org.eclipse.mylyn.reviews.core.model.ILocation;
+import org.eclipse.mylyn.reviews.core.model.IModelVersioning;
import org.eclipse.mylyn.reviews.core.model.IReview;
import org.eclipse.mylyn.reviews.core.model.IReviewComponent;
import org.eclipse.mylyn.reviews.core.model.IReviewGroup;
@@ -1056,6 +1057,34 @@ public class ReviewsPackage extends EPackageImpl {
public static final int FILE_REVISION_FEATURE_COUNT = REVIEW_ITEM_FEATURE_COUNT + 3;
/**
+ * The meta object id for the '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning <em>Model Versioning</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.mylyn.reviews.core.model.IModelVersioning
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getModelVersioning()
+ * @generated
+ */
+ public static final int MODEL_VERSIONING = 16;
+
+ /**
+ * The feature id for the '<em><b>Fragment Version</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int MODEL_VERSIONING__FRAGMENT_VERSION = 0;
+
+ /**
+ * The number of structural features of the '<em>Model Versioning</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int MODEL_VERSIONING_FEATURE_COUNT = 1;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1168,6 +1197,13 @@ public class ReviewsPackage extends EPackageImpl {
private EClass fileRevisionEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass modelVersioningEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -1969,6 +2005,31 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
+ * Returns the meta object for class '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning <em>Model Versioning</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Model Versioning</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IModelVersioning
+ * @generated
+ */
+ public EClass getModelVersioning() {
+ return modelVersioningEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning#getFragmentVersion <em>Fragment Version</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Fragment Version</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IModelVersioning#getFragmentVersion()
+ * @see #getModelVersioning()
+ * @generated
+ */
+ public EAttribute getModelVersioning_FragmentVersion() {
+ return (EAttribute) modelVersioningEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2072,6 +2133,9 @@ public class ReviewsPackage extends EPackageImpl {
createEAttribute(fileRevisionEClass, FILE_REVISION__PATH);
createEAttribute(fileRevisionEClass, FILE_REVISION__REVISION);
createEAttribute(fileRevisionEClass, FILE_REVISION__CONTENT);
+
+ modelVersioningEClass = createEClass(MODEL_VERSIONING);
+ createEAttribute(modelVersioningEClass, MODEL_VERSIONING__FRAGMENT_VERSION);
}
/**
@@ -2353,6 +2417,13 @@ public class ReviewsPackage extends EPackageImpl {
ecorePackage.getEString(),
"content", null, 0, 1, IFileRevision.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEClass(modelVersioningEClass, IModelVersioning.class,
+ "ModelVersioning", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(
+ getModelVersioning_FragmentVersion(),
+ ecorePackage.getEString(),
+ "fragmentVersion", "1.0.0", 0, 1, IModelVersioning.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$
+
// Create resource
createResource(eNS_URI);
@@ -2884,6 +2955,24 @@ public class ReviewsPackage extends EPackageImpl {
*/
public static final EAttribute FILE_REVISION__CONTENT = eINSTANCE.getFileRevision_Content();
+ /**
+ * The meta object literal for the '{@link org.eclipse.mylyn.reviews.core.model.IModelVersioning <em>Model Versioning</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.mylyn.reviews.core.model.IModelVersioning
+ * @see org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage#getModelVersioning()
+ * @generated
+ */
+ public static final EClass MODEL_VERSIONING = eINSTANCE.getModelVersioning();
+
+ /**
+ * The meta object literal for the '<em><b>Fragment Version</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute MODEL_VERSIONING__FRAGMENT_VERSION = eINSTANCE.getModelVersioning_FragmentVersion();
+
}
} //ReviewsPackage
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
index 603c4cf..08bb30f 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsSwitch.java
@@ -229,6 +229,13 @@ public class ReviewsSwitch<T> {
result = defaultCase(theEObject);
return result;
}
+ case ReviewsPackage.MODEL_VERSIONING: {
+ IModelVersioning modelVersioning = (IModelVersioning) theEObject;
+ T result = caseModelVersioning(modelVersioning);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -475,6 +482,21 @@ public class ReviewsSwitch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Model Versioning</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Model Versioning</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModelVersioning(IModelVersioning object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;