Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-17 22:41:34 +0000
committerptessier2014-03-17 22:41:34 +0000
commit4161a5d730dc020558aea2aaaede7ffd3bd5e49d (patch)
treec0b150617cf3b4297e76f3d28382beee75dee0ee /plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel
parent94a6b86b468c7e9b095cb994d5ff205139fa008a (diff)
downloadorg.eclipse.papyrus-4161a5d730dc020558aea2aaaede7ffd3bd5e49d.tar.gz
org.eclipse.papyrus-4161a5d730dc020558aea2aaaede7ffd3bd5e49d.tar.xz
org.eclipse.papyrus-4161a5d730dc020558aea2aaaede7ffd3bd5e49d.zip
430562: [ModelExplorer] customization could have an order
https://bugs.eclipse.org/bugs/show_bug.cgi?id=430562 add an rank attribute and modify the method init of activator in infra.emf
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF6
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom-0.2.0.ecore9
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/CustomPackage.java32
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/Customization.java28
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomFactoryImpl.java2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomPackageImpl.java11
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomizationImpl.java54
7 files changed, 131 insertions, 11 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
index b1510a858d4..d5c42f4952e 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
- org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.efacet.metamodel;visibility:=reexport;bundle-version="1.0.0",
org.eclipse.papyrus.emf.facet.util.emf.catalog;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.custompt,
org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom,
@@ -13,12 +13,12 @@ Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.custompt,
org.eclipse.papyrus.emf.facet.custom.metamodel.v0_3_0.query,
org.eclipse.papyrus.emf.facet.custom.metamodel.v0_3_0.query.util;x-internal:=true
Bundle-Vendor: %providerName
+Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Version: 1.0.0.qualifier
Bundle-Name: %pluginName
Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel;si
- ngleton:=true
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel;singleton:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom-0.2.0.ecore b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom-0.2.0.ecore
index 6c6414476b6..c2780beee9e 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom-0.2.0.ecore
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom-0.2.0.ecore
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="custom"
- nsURI="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom" nsPrefix="custom">
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="custom" nsURI="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom"
+ nsPrefix="custom">
<eClassifiers xsi:type="ecore:EClass" name="Customization" eSuperTypes="../../org.eclipse.papyrus.emf.facet.efacet.metamodel/model/efacet-0.2.0.ecore#//FacetSet">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The customization model element is the root of a customization model. A customization is applied to only one ePackage and contains EClassCustomizations."/>
@@ -14,6 +13,8 @@
<details key="documentation" value="When Customization::mustBeloadedByDefault is true, the customization will be automatically loaded in the customizable model browsers."/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rank" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
+ defaultValueLiteral="1000"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EClassCustomization" eSuperTypes="../../org.eclipse.papyrus.emf.facet.efacet.metamodel/model/efacet-0.2.0.ecore#//Facet">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/CustomPackage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/CustomPackage.java
index 52c9d47992b..2634f5885c5 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/CustomPackage.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/CustomPackage.java
@@ -178,13 +178,22 @@ public interface CustomPackage extends EPackage {
int CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT = EFacetPackage.FACET_SET_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Rank</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CUSTOMIZATION__RANK = EFacetPackage.FACET_SET_FEATURE_COUNT + 1;
+
+ /**
* The number of structural features of the '<em>Customization</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int CUSTOMIZATION_FEATURE_COUNT = EFacetPackage.FACET_SET_FEATURE_COUNT + 1;
+ int CUSTOMIZATION_FEATURE_COUNT = EFacetPackage.FACET_SET_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.EClassCustomizationImpl <em>EClass Customization</em>}' class.
@@ -319,7 +328,6 @@ public interface CustomPackage extends EPackage {
* <!-- end-user-doc -->
* @generated
* @ordered
- * @since 0.2
*/
int ECLASS_CUSTOMIZATION__EXTENDED_FACETS = EFacetPackage.FACET__EXTENDED_FACETS;
@@ -465,7 +473,6 @@ public interface CustomPackage extends EPackage {
* <!-- end-user-doc -->
* @generated
* @ordered
- * @since 0.2
*/
int FACET_CUSTOMIZATION__EXTENDED_FACETS = EFacetPackage.FACET__EXTENDED_FACETS;
@@ -593,6 +600,17 @@ public interface CustomPackage extends EPackage {
EAttribute getCustomization_MustBeLoadedByDefault();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#getRank <em>Rank</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Rank</em>'.
+ * @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#getRank()
+ * @see #getCustomization()
+ * @generated
+ */
+ EAttribute getCustomization_Rank();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization <em>EClass Customization</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -717,6 +735,14 @@ public interface CustomPackage extends EPackage {
EAttribute CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT = eINSTANCE.getCustomization_MustBeLoadedByDefault();
/**
+ * The meta object literal for the '<em><b>Rank</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CUSTOMIZATION__RANK = eINSTANCE.getCustomization_Rank();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.EClassCustomizationImpl <em>EClass Customization</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/Customization.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/Customization.java
index 1f4b5265102..f1d7db33d5f 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/Customization.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/Customization.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#isMustBeLoadedByDefault <em>Must Be Loaded By Default</em>}</li>
+ * <li>{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#getRank <em>Rank</em>}</li>
* </ul>
* </p>
*
@@ -62,4 +63,31 @@ public interface Customization extends FacetSet {
*/
void setMustBeLoadedByDefault(boolean value);
+ /**
+ * Returns the value of the '<em><b>Rank</b></em>' attribute.
+ * The default value is <code>"1000"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Rank</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Rank</em>' attribute.
+ * @see #setRank(int)
+ * @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.CustomPackage#getCustomization_Rank()
+ * @model default="1000"
+ * @generated
+ */
+ int getRank();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#getRank <em>Rank</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Rank</em>' attribute.
+ * @see #getRank()
+ * @generated
+ */
+ void setRank(int value);
+
} // Customization
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomFactoryImpl.java
index 99c9d82afea..4f0384a103b 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomFactoryImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomFactoryImpl.java
@@ -35,7 +35,7 @@ public class CustomFactoryImpl extends EFactoryImpl implements CustomFactory {
*/
public static CustomFactory init() {
try {
- CustomFactory theCustomFactory = (CustomFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom");
+ CustomFactory theCustomFactory = (CustomFactory)EPackage.Registry.INSTANCE.getEFactory(CustomPackage.eNS_URI);
if (theCustomFactory != null) {
return theCustomFactory;
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomPackageImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomPackageImpl.java
index 329aee932f0..fbe157208a9 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomPackageImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomPackageImpl.java
@@ -157,6 +157,15 @@ public class CustomPackageImpl extends EPackageImpl implements CustomPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getCustomization_Rank() {
+ return (EAttribute)customizationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getEClassCustomization() {
return eClassCustomizationEClass;
}
@@ -254,6 +263,7 @@ public class CustomPackageImpl extends EPackageImpl implements CustomPackage {
// Create classes and their features
customizationEClass = createEClass(CUSTOMIZATION);
createEAttribute(customizationEClass, CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT);
+ createEAttribute(customizationEClass, CUSTOMIZATION__RANK);
eClassCustomizationEClass = createEClass(ECLASS_CUSTOMIZATION);
@@ -308,6 +318,7 @@ public class CustomPackageImpl extends EPackageImpl implements CustomPackage {
// Initialize classes and features; add operations and parameters
initEClass(customizationEClass, Customization.class, "Customization", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getCustomization_MustBeLoadedByDefault(), ecorePackage.getEBoolean(), "mustBeLoadedByDefault", "false", 1, 1, Customization.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCustomization_Rank(), ecorePackage.getEInt(), "rank", "1000", 0, 1, Customization.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(eClassCustomizationEClass, EClassCustomization.class, "EClassCustomization", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomizationImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomizationImpl.java
index 7e39de629df..45b2fbe3ec9 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomizationImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/impl/CustomizationImpl.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customizatio
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.CustomizationImpl#isMustBeLoadedByDefault <em>Must Be Loaded By Default</em>}</li>
+ * <li>{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.CustomizationImpl#getRank <em>Rank</em>}</li>
* </ul>
* </p>
*
@@ -55,6 +56,26 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
protected boolean mustBeLoadedByDefault = MUST_BE_LOADED_BY_DEFAULT_EDEFAULT;
/**
+ * The default value of the '{@link #getRank() <em>Rank</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRank()
+ * @generated
+ * @ordered
+ */
+ protected static final int RANK_EDEFAULT = 1000;
+
+ /**
+ * The cached value of the '{@link #getRank() <em>Rank</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRank()
+ * @generated
+ * @ordered
+ */
+ protected int rank = RANK_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -99,11 +120,34 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
* <!-- end-user-doc -->
* @generated
*/
+ public int getRank() {
+ return rank;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setRank(int newRank) {
+ int oldRank = rank;
+ rank = newRank;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CustomPackage.CUSTOMIZATION__RANK, oldRank, rank));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT:
return isMustBeLoadedByDefault();
+ case CustomPackage.CUSTOMIZATION__RANK:
+ return getRank();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -119,6 +163,9 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
case CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT:
setMustBeLoadedByDefault((Boolean)newValue);
return;
+ case CustomPackage.CUSTOMIZATION__RANK:
+ setRank((Integer)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -134,6 +181,9 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
case CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT:
setMustBeLoadedByDefault(MUST_BE_LOADED_BY_DEFAULT_EDEFAULT);
return;
+ case CustomPackage.CUSTOMIZATION__RANK:
+ setRank(RANK_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -148,6 +198,8 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
switch (featureID) {
case CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT:
return mustBeLoadedByDefault != MUST_BE_LOADED_BY_DEFAULT_EDEFAULT;
+ case CustomPackage.CUSTOMIZATION__RANK:
+ return rank != RANK_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -164,6 +216,8 @@ public class CustomizationImpl extends FacetSetImpl implements Customization {
StringBuffer result = new StringBuffer(super.toString());
result.append(" (mustBeLoadedByDefault: ");
result.append(mustBeLoadedByDefault);
+ result.append(", rank: ");
+ result.append(rank);
result.append(')');
return result.toString();
}

Back to the top