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 | 15 +++---
.../plugin.properties | 1 +
.../custom/provider/CustomizationItemProvider.java | 24 ++++++++++
.../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 ++++++++++++++++++++++
10 files changed, 162 insertions(+), 20 deletions(-)
(limited to 'plugins/facet')
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
index abc58223a7f..b8ae8c2cd3e 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
@@ -1,21 +1,18 @@
Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.
- custom.provider;x-internal:=true
+Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider;x-internal:=true
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.custom.metamodel;visibility:=reexport;bundle-version="1.0.0",
org.eclipse.emf.edit,
- org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.papyrus.emf.facet.efacet.metamodel.edit;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.efacet.metamodel.edit;visibility:=reexport;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-Version: 1.0.0.qualifier
Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_
- 0.custom.provider.CustomEditPlugin$Implementation
-Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel.ed
- it;singleton:=true
+Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin$Implementation
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel.edit;singleton:=true
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/plugin.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/plugin.properties
index 5d35921171f..a8f90ec7e97 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/plugin.properties
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/plugin.properties
@@ -45,3 +45,4 @@ _UI_ETypedElementCase_type = ETyped Element Case
_UI_ETypedElementSwitchQuery_cases_feature = Cases
_UI_ETypedElementCase_case_feature = Case
_UI_ETypedElementCase_value_feature = Value
+_UI_Customization_rank_feature = Rank
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/provider/CustomizationItemProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/provider/CustomizationItemProvider.java
index 67ef4ceaa6c..39b3cc97ca8 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/provider/CustomizationItemProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/provider/CustomizationItemProvider.java
@@ -71,6 +71,7 @@ public class CustomizationItemProvider
super.getPropertyDescriptors(object);
addMustBeLoadedByDefaultPropertyDescriptor(object);
+ addRankPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -97,6 +98,28 @@ public class CustomizationItemProvider
null));
}
+ /**
+ * This adds a property descriptor for the Rank feature.
+ *
+ *
+ * @generated
+ */
+ protected void addRankPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Customization_rank_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Customization_rank_feature", "_UI_Customization_type"),
+ CustomPackage.Literals.CUSTOMIZATION__RANK,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
+ null,
+ null));
+ }
+
/**
* This returns Customization.gif.
*
@@ -135,6 +158,7 @@ public class CustomizationItemProvider
switch (notification.getFeatureID(Customization.class)) {
case CustomPackage.CUSTOMIZATION__MUST_BE_LOADED_BY_DEFAULT:
+ case CustomPackage.CUSTOMIZATION__RANK:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 @@
-
*
*
"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: *