From 4161a5d730dc020558aea2aaaede7ffd3bd5e49d Mon Sep 17 00:00:00 2001 From: ptessier Date: Mon, 17 Mar 2014 23:41:34 +0100 Subject: 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--- .../META-INF/MANIFEST.MF | 6 +-- .../model/custom-0.2.0.ecore | 9 ++-- .../metamodel/v0_2_0/custom/CustomPackage.java | 32 +++++++++++-- .../metamodel/v0_2_0/custom/Customization.java | 28 +++++++++++ .../v0_2_0/custom/impl/CustomFactoryImpl.java | 2 +- .../v0_2_0/custom/impl/CustomPackageImpl.java | 11 +++++ .../v0_2_0/custom/impl/CustomizationImpl.java | 54 ++++++++++++++++++++++ 7 files changed, 131 insertions(+), 11 deletions(-) (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel') 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 @@ - +
@@ -14,6 +13,8 @@
+ 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 @@ -177,6 +177,15 @@ public interface CustomPackage extends EPackage { */ int CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT = EFacetPackage.FACET_SET_FEATURE_COUNT + 0; + /** + * The feature id for the 'Rank' attribute. + * + * + * @generated + * @ordered + */ + int CUSTOMIZATION__RANK = EFacetPackage.FACET_SET_FEATURE_COUNT + 1; + /** * The number of structural features of the 'Customization' class. * @@ -184,7 +193,7 @@ public interface CustomPackage extends EPackage { * @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 EClass Customization}' class. @@ -319,7 +328,6 @@ public interface CustomPackage extends EPackage { * * @generated * @ordered - * @since 0.2 */ int ECLASS_CUSTOMIZATION__EXTENDED_FACETS = EFacetPackage.FACET__EXTENDED_FACETS; @@ -465,7 +473,6 @@ public interface CustomPackage extends EPackage { * * @generated * @ordered - * @since 0.2 */ int FACET_CUSTOMIZATION__EXTENDED_FACETS = EFacetPackage.FACET__EXTENDED_FACETS; @@ -592,6 +599,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 Rank}'. + * + * + * @return the meta object for the attribute 'Rank'. + * @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 EClass Customization}'. * @@ -716,6 +734,14 @@ public interface CustomPackage extends EPackage { */ EAttribute CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT = eINSTANCE.getCustomization_MustBeLoadedByDefault(); + /** + * The meta object literal for the 'Rank' attribute feature. + * + * + * @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 EClass Customization}' 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/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: *
    *
  • {@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#isMustBeLoadedByDefault Must Be Loaded By Default}
  • + *
  • {@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization#getRank Rank}
  • *
*

* @@ -62,4 +63,31 @@ public interface Customization extends FacetSet { */ void setMustBeLoadedByDefault(boolean value); + /** + * Returns the value of the 'Rank' attribute. + * The default value is "1000". + * + *

+ * If the meaning of the 'Rank' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Rank' 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 Rank}' attribute. + * + * + * @param value the new value of the 'Rank' 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 @@ -152,6 +152,15 @@ public class CustomPackageImpl extends EPackageImpl implements CustomPackage { return (EAttribute)customizationEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EAttribute getCustomization_Rank() { + return (EAttribute)customizationEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -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: *
    *
  • {@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.CustomizationImpl#isMustBeLoadedByDefault Must Be Loaded By Default}
  • + *
  • {@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl.CustomizationImpl#getRank Rank}
  • *
*

* @@ -54,6 +55,26 @@ public class CustomizationImpl extends FacetSetImpl implements Customization { */ protected boolean mustBeLoadedByDefault = MUST_BE_LOADED_BY_DEFAULT_EDEFAULT; + /** + * The default value of the '{@link #getRank() Rank}' attribute. + * + * + * @see #getRank() + * @generated + * @ordered + */ + protected static final int RANK_EDEFAULT = 1000; + + /** + * The cached value of the '{@link #getRank() Rank}' attribute. + * + * + * @see #getRank() + * @generated + * @ordered + */ + protected int rank = RANK_EDEFAULT; + /** * * @@ -94,6 +115,27 @@ public class CustomizationImpl extends FacetSetImpl implements Customization { eNotify(new ENotificationImpl(this, Notification.SET, CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT, oldMustBeLoadedByDefault, mustBeLoadedByDefault)); } + /** + * + * + * @generated + */ + public int getRank() { + return rank; + } + + /** + * + * + * @generated + */ + public void setRank(int newRank) { + int oldRank = rank; + rank = newRank; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, CustomPackage.CUSTOMIZATION__RANK, oldRank, rank)); + } + /** * * @@ -104,6 +146,8 @@ public class CustomizationImpl extends FacetSetImpl implements Customization { 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(); } -- cgit v1.2.3