diff --git a/fr.tpt.mem4csd.loss.edit/.classpath b/fr.tpt.mem4csd.loss.edit/.classpath index 2377d85..1a82131 100644 --- a/fr.tpt.mem4csd.loss.edit/.classpath +++ b/fr.tpt.mem4csd.loss.edit/.classpath @@ -1,6 +1,6 @@ - + diff --git a/fr.tpt.mem4csd.loss.edit/META-INF/MANIFEST.MF b/fr.tpt.mem4csd.loss.edit/META-INF/MANIFEST.MF index cd199c1..ff1cbf4 100644 --- a/fr.tpt.mem4csd.loss.edit/META-INF/MANIFEST.MF +++ b/fr.tpt.mem4csd.loss.edit/META-INF/MANIFEST.MF @@ -5,12 +5,16 @@ Bundle-SymbolicName: fr.tpt.mem4csd.loss.edit;singleton:=true Automatic-Module-Name: fr.tpt.mem4csd.loss.edit Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.tpt.mem4csd.loss.provider.LossEditPlugin$Implementation +Bundle-Activator: fr.tpt.mem4csd.lossTransform.provider.LossTransformEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: fr.tpt.mem4csd.loss.provider +Export-Package: fr.tpt.mem4csd.loss.provider, + fr.tpt.mem4csd.lossTransform.provider Require-Bundle: org.eclipse.core.runtime, fr.tpt.mem4csd.loss;visibility:=reexport, - org.eclipse.emf.edit;visibility:=reexport + org.eclipse.emf.edit;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.edit;visibility:=reexport, + fr.tpt.mem4csd.loss.edit;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/fr.tpt.mem4csd.loss.edit/build.properties b/fr.tpt.mem4csd.loss.edit/build.properties index a3c4e32..6e3e902 100644 --- a/fr.tpt.mem4csd.loss.edit/build.properties +++ b/fr.tpt.mem4csd.loss.edit/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src-gen/ +source.. = src/ output.. = bin/ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Complex.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Complex.gif new file mode 100644 index 0000000..381214b Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Complex.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_CorrNode.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_CorrNode.gif new file mode 100644 index 0000000..affc324 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_CorrNode.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_EObject.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_EObject.gif new file mode 100644 index 0000000..86be5ba Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_EObject.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Link.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Link.gif new file mode 100644 index 0000000..d677d34 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Link.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Primitive.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Primitive.gif new file mode 100644 index 0000000..bf56763 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Primitive.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Rule.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Rule.gif new file mode 100644 index 0000000..a1607f9 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_contents_Rule.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_details_EStringToStringMapEntry.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_details_EStringToStringMapEntry.gif new file mode 100644 index 0000000..1e4e4b3 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEAnnotation_details_EStringToStringMapEntry.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eGenericSuperTypes_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eGenericSuperTypes_EGenericType.gif new file mode 100644 index 0000000..daddc87 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eGenericSuperTypes_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eOperations_EOperation.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eOperations_EOperation.gif new file mode 100644 index 0000000..9073955 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eOperations_EOperation.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EAttribute.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EAttribute.gif new file mode 100644 index 0000000..4ce1821 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EAttribute.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EReference.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EReference.gif new file mode 100644 index 0000000..464e623 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClass_eStructuralFeatures_EReference.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClassifier_eTypeParameters_ETypeParameter.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClassifier_eTypeParameters_ETypeParameter.gif new file mode 100644 index 0000000..698161b Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEClassifier_eTypeParameters_ETypeParameter.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEEnum_eLiterals_EEnumLiteral.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEEnum_eLiterals_EEnumLiteral.gif new file mode 100644 index 0000000..34b39c0 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEEnum_eLiterals_EEnumLiteral.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eLowerBound_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eLowerBound_EGenericType.gif new file mode 100644 index 0000000..7e23d6c Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eLowerBound_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eTypeArguments_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eTypeArguments_EGenericType.gif new file mode 100644 index 0000000..7e23d6c Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eTypeArguments_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eUpperBound_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eUpperBound_EGenericType.gif new file mode 100644 index 0000000..7e23d6c Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEGenericType_eUpperBound_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEModelElement_eAnnotations_EAnnotation.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEModelElement_eAnnotations_EAnnotation.gif new file mode 100644 index 0000000..392d0d1 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEModelElement_eAnnotations_EAnnotation.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eGenericExceptions_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eGenericExceptions_EGenericType.gif new file mode 100644 index 0000000..4303550 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eGenericExceptions_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eParameters_EParameter.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eParameters_EParameter.gif new file mode 100644 index 0000000..d31be0d Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eParameters_EParameter.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eTypeParameters_ETypeParameter.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eTypeParameters_ETypeParameter.gif new file mode 100644 index 0000000..b4a2918 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEOperation_eTypeParameters_ETypeParameter.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EClass.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EClass.gif new file mode 100644 index 0000000..a91d627 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EClass.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EDataType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EDataType.gif new file mode 100644 index 0000000..24670cf Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EDataType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EEnum.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EEnum.gif new file mode 100644 index 0000000..a651dda Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eClassifiers_EEnum.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eSubpackages_EPackage.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eSubpackages_EPackage.gif new file mode 100644 index 0000000..a651dda Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateEPackage_eSubpackages_EPackage.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypeParameter_eBounds_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypeParameter_eBounds_EGenericType.gif new file mode 100644 index 0000000..75f4427 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypeParameter_eBounds_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypedElement_eGenericType_EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypedElement_eGenericType_EGenericType.gif new file mode 100644 index 0000000..1cd7fa0 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateETypedElement_eGenericType_EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Complex.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Complex.gif new file mode 100644 index 0000000..381214b Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Complex.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Link.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Link.gif new file mode 100644 index 0000000..d677d34 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Link.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Primitive.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Primitive.gif new file mode 100644 index 0000000..bf56763 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_leftModel_Primitive.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Complex.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Complex.gif new file mode 100644 index 0000000..381214b Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Complex.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Link.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Link.gif new file mode 100644 index 0000000..d677d34 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Link.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Primitive.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Primitive.gif new file mode 100644 index 0000000..bf56763 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_rightModel_Primitive.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_transformations_CorrNode.gif b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_transformations_CorrNode.gif new file mode 100644 index 0000000..affc324 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/ctool16/CreateRule_transformations_CorrNode.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrLink.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrLink.gif new file mode 100644 index 0000000..90d10f9 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrLink.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrNode.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrNode.gif new file mode 100644 index 0000000..9041598 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/CorrNode.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAnnotation.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAnnotation.gif new file mode 100644 index 0000000..cdd3b76 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAnnotation.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAttribute.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAttribute.gif new file mode 100644 index 0000000..89ad5da Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EAttribute.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EClass.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EClass.gif new file mode 100644 index 0000000..739ebbf Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EClass.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EDataType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EDataType.gif new file mode 100644 index 0000000..2124f3e Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EDataType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnum.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnum.gif new file mode 100644 index 0000000..db7414e Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnum.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnumLiteral.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnumLiteral.gif new file mode 100644 index 0000000..2b69256 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EEnumLiteral.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EFactory.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EFactory.gif new file mode 100644 index 0000000..c4fb30e Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EFactory.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EGenericType.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EGenericType.gif new file mode 100644 index 0000000..498364f Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EGenericType.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EObject.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EObject.gif new file mode 100644 index 0000000..33854e9 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EObject.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EOperation.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EOperation.gif new file mode 100644 index 0000000..c3370c7 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EOperation.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EPackage.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EPackage.gif new file mode 100644 index 0000000..db7414e Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EPackage.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EParameter.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EParameter.gif new file mode 100644 index 0000000..c673a52 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EParameter.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EReference.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EReference.gif new file mode 100644 index 0000000..7b7c428 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EReference.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EStringToStringMapEntry.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EStringToStringMapEntry.gif new file mode 100644 index 0000000..e4bc22d Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/EStringToStringMapEntry.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/ETypeParameter.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/ETypeParameter.gif new file mode 100644 index 0000000..c4fb30e Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/ETypeParameter.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/LossModel.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/LossModel.gif new file mode 100644 index 0000000..98b351f Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/LossModel.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/icons/full/obj16/Rule.gif b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/Rule.gif new file mode 100644 index 0000000..cdd3b76 Binary files /dev/null and b/fr.tpt.mem4csd.loss.edit/icons/full/obj16/Rule.gif differ diff --git a/fr.tpt.mem4csd.loss.edit/plugin.properties b/fr.tpt.mem4csd.loss.edit/plugin.properties index f52f26c..d16ec44 100644 --- a/fr.tpt.mem4csd.loss.edit/plugin.properties +++ b/fr.tpt.mem4csd.loss.edit/plugin.properties @@ -30,3 +30,121 @@ _UI_Unknown_feature = Unspecified _UI_NamedObject_reference_feature = Reference _UI_NamedObject_className_feature = Class Name _UI_Complex_reference_feature = Reference +_UI_Correlation_type = Correlation +_UI_CorrLink_type = Corr Link +_UI_CorrNode_type = Corr Node +_UI_CorrLink_linkTo_feature = Link To +_UI_CorrNode_links_feature = Links +_UI_ModelElement_type = Model Element +_UI_LossModel_type = Model +_UI_LossModel_elements_feature = Elements +_UI_Rule_type = Rule +_UI_Rule_leftModel_feature = Left Model +_UI_Rule_rightModel_feature = Right Model +_UI_Rule_transformations_feature = Transformations +_UI_CorrNode_leftLinks_feature = Left Links +_UI_CorrNode_rightLinks_feature = Right Links +_UI_EAttribute_type = EAttribute +_UI_EAnnotation_type = EAnnotation +_UI_EClass_type = EClass +_UI_EClassifier_type = EClassifier +_UI_EDataType_type = EData Type +_UI_EEnum_type = EEnum +_UI_EEnumLiteral_type = EEnum Literal +_UI_EFactory_type = EFactory +_UI_EModelElement_type = EModel Element +_UI_ENamedElement_type = ENamed Element +_UI_EObject_type = EObject +_UI_EOperation_type = EOperation +_UI_EPackage_type = EPackage +_UI_EParameter_type = EParameter +_UI_EReference_type = EReference +_UI_EStructuralFeature_type = EStructural Feature +_UI_ETypedElement_type = ETyped Element +_UI_EStringToStringMapEntry_type = EString To String Map Entry +_UI_EGenericType_type = EGeneric Type +_UI_ETypeParameter_type = EType Parameter +_UI_EAttribute_iD_feature = ID +_UI_EAttribute_eAttributeType_feature = EAttribute Type +_UI_EAnnotation_source_feature = Source +_UI_EAnnotation_details_feature = Details +_UI_EAnnotation_eModelElement_feature = EModel Element +_UI_EAnnotation_contents_feature = Contents +_UI_EAnnotation_references_feature = References +_UI_EClass_abstract_feature = Abstract +_UI_EClass_interface_feature = Interface +_UI_EClass_eSuperTypes_feature = ESuper Types +_UI_EClass_eOperations_feature = EOperations +_UI_EClass_eAllAttributes_feature = EAll Attributes +_UI_EClass_eAllReferences_feature = EAll References +_UI_EClass_eReferences_feature = EReferences +_UI_EClass_eAttributes_feature = EAttributes +_UI_EClass_eAllContainments_feature = EAll Containments +_UI_EClass_eAllOperations_feature = EAll Operations +_UI_EClass_eAllStructuralFeatures_feature = EAll Structural Features +_UI_EClass_eAllSuperTypes_feature = EAll Super Types +_UI_EClass_eIDAttribute_feature = EID Attribute +_UI_EClass_eStructuralFeatures_feature = EStructural Features +_UI_EClass_eGenericSuperTypes_feature = EGeneric Super Types +_UI_EClass_eAllGenericSuperTypes_feature = EAll Generic Super Types +_UI_EClassifier_instanceClassName_feature = Instance Class Name +_UI_EClassifier_instanceClass_feature = Instance Class +_UI_EClassifier_defaultValue_feature = Default Value +_UI_EClassifier_instanceTypeName_feature = Instance Type Name +_UI_EClassifier_ePackage_feature = EPackage +_UI_EClassifier_eTypeParameters_feature = EType Parameters +_UI_EDataType_serializable_feature = Serializable +_UI_EEnum_eLiterals_feature = ELiterals +_UI_EEnumLiteral_value_feature = Value +_UI_EEnumLiteral_instance_feature = Instance +_UI_EEnumLiteral_literal_feature = Literal +_UI_EEnumLiteral_eEnum_feature = EEnum +_UI_EFactory_ePackage_feature = EPackage +_UI_EModelElement_eAnnotations_feature = EAnnotations +_UI_ENamedElement_name_feature = Name +_UI_EOperation_eContainingClass_feature = EContaining Class +_UI_EOperation_eTypeParameters_feature = EType Parameters +_UI_EOperation_eParameters_feature = EParameters +_UI_EOperation_eExceptions_feature = EExceptions +_UI_EOperation_eGenericExceptions_feature = EGeneric Exceptions +_UI_EPackage_nsURI_feature = Ns URI +_UI_EPackage_nsPrefix_feature = Ns Prefix +_UI_EPackage_eFactoryInstance_feature = EFactory Instance +_UI_EPackage_eClassifiers_feature = EClassifiers +_UI_EPackage_eSubpackages_feature = ESubpackages +_UI_EPackage_eSuperPackage_feature = ESuper Package +_UI_EParameter_eOperation_feature = EOperation +_UI_EReference_containment_feature = Containment +_UI_EReference_container_feature = Container +_UI_EReference_resolveProxies_feature = Resolve Proxies +_UI_EReference_eOpposite_feature = EOpposite +_UI_EReference_eReferenceType_feature = EReference Type +_UI_EReference_eKeys_feature = EKeys +_UI_EStructuralFeature_changeable_feature = Changeable +_UI_EStructuralFeature_volatile_feature = Volatile +_UI_EStructuralFeature_transient_feature = Transient +_UI_EStructuralFeature_defaultValueLiteral_feature = Default Value Literal +_UI_EStructuralFeature_defaultValue_feature = Default Value +_UI_EStructuralFeature_unsettable_feature = Unsettable +_UI_EStructuralFeature_derived_feature = Derived +_UI_EStructuralFeature_eContainingClass_feature = EContaining Class +_UI_ETypedElement_ordered_feature = Ordered +_UI_ETypedElement_unique_feature = Unique +_UI_ETypedElement_lowerBound_feature = Lower Bound +_UI_ETypedElement_upperBound_feature = Upper Bound +_UI_ETypedElement_many_feature = Many +_UI_ETypedElement_required_feature = Required +_UI_ETypedElement_eType_feature = EType +_UI_ETypedElement_eGenericType_feature = EGeneric Type +_UI_EStringToStringMapEntry_key_feature = Key +_UI_EStringToStringMapEntry_value_feature = Value +_UI_EGenericType_eUpperBound_feature = EUpper Bound +_UI_EGenericType_eTypeArguments_feature = EType Arguments +_UI_EGenericType_eRawType_feature = ERaw Type +_UI_EGenericType_eLowerBound_feature = ELower Bound +_UI_EGenericType_eTypeParameter_feature = EType Parameter +_UI_EGenericType_eClassifier_feature = EClassifier +_UI_ETypeParameter_eBounds_feature = EBounds +_UI_Primitive_feature_feature = Feature +_UI_NamedObject_objectType_feature = Object Type +_UI_Complex_objectType_feature = Object Type diff --git a/fr.tpt.mem4csd.loss.edit/plugin.xml b/fr.tpt.mem4csd.loss.edit/plugin.xml index 06a0684..947b9c1 100644 --- a/fr.tpt.mem4csd.loss.edit/plugin.xml +++ b/fr.tpt.mem4csd.loss.edit/plugin.xml @@ -19,4 +19,30 @@ org.eclipse.emf.edit.provider.IItemPropertySource"/> + + + + + + + + + + diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java similarity index 87% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java index 78a32b1..d72444e 100644 --- a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ComplexItemProvider.java @@ -24,7 +24,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification; * * @generated */ -public class ComplexItemProvider extends NamedObjectItemProvider { +public class ComplexItemProvider extends ModelElementItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -47,6 +47,7 @@ public class ComplexItemProvider extends NamedObjectItemProvider { super.getPropertyDescriptors(object); addReferencePropertyDescriptor(object); + addObjectTypePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -66,6 +67,21 @@ public class ComplexItemProvider extends NamedObjectItemProvider { LossPackage.Literals.COMPLEX__REFERENCE, true, false, true, null, null, null)); } + /** + * This adds a property descriptor for the Object Type feature. + * + * + * @generated + */ + protected void addObjectTypePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Complex_objectType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Complex_objectType_feature", + "_UI_Complex_type"), + LossPackage.Literals.COMPLEX__OBJECT_TYPE, true, false, true, null, null, null)); + } + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LinkItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LinkItemProvider.java similarity index 100% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LinkItemProvider.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LinkItemProvider.java diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java similarity index 93% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java index 50fd745..b5287cb 100644 --- a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossEditPlugin.java @@ -5,6 +5,7 @@ package fr.tpt.mem4csd.loss.provider; import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** * This is the central singleton for the Loss edit plugin. @@ -36,7 +37,7 @@ public final class LossEditPlugin extends EMFPlugin { * @generated */ public LossEditPlugin() { - super(new ResourceLocator[] {}); + super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, }); } /** diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java similarity index 91% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java index adecb7f..a606452 100644 --- a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossItemProviderAdapterFactory.java @@ -141,6 +141,29 @@ public class LossItemProviderAdapterFactory extends LossAdapterFactory return complexItemProvider; } + /** + * This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.loss.LossModel} instances. + * + * + * @generated + */ + protected LossModelItemProvider lossModelItemProvider; + + /** + * This creates an adapter for a {@link fr.tpt.mem4csd.loss.LossModel}. + * + * + * @generated + */ + @Override + public Adapter createLossModelAdapter() { + if (lossModelItemProvider == null) { + lossModelItemProvider = new LossModelItemProvider(this); + } + + return lossModelItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -252,6 +275,8 @@ public class LossItemProviderAdapterFactory extends LossAdapterFactory linkItemProvider.dispose(); if (complexItemProvider != null) complexItemProvider.dispose(); + if (lossModelItemProvider != null) + lossModelItemProvider.dispose(); } } diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossModelItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossModelItemProvider.java new file mode 100644 index 0000000..5a4b4e3 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/LossModelItemProvider.java @@ -0,0 +1,141 @@ +/** + */ +package fr.tpt.mem4csd.loss.provider; + +import fr.tpt.mem4csd.loss.LossPackage; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.LossModel} object. + * + * + * @generated + */ +public class LossModelItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, + IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public LossModelItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addElementsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Elements feature. + * + * + * @generated + */ + protected void addElementsPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_LossModel_elements_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_LossModel_elements_feature", + "_UI_LossModel_type"), + LossPackage.Literals.LOSS_MODEL__ELEMENTS, true, false, true, null, null, null)); + } + + /** + * This returns LossModel.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/LossModel")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_LossModel_type"); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return LossEditPlugin.INSTANCE; + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ModelElementItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ModelElementItemProvider.java new file mode 100644 index 0000000..009e625 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/ModelElementItemProvider.java @@ -0,0 +1,95 @@ +/** + */ +package fr.tpt.mem4csd.loss.provider; + +import fr.tpt.mem4csd.loss.ModelElement; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.ModelElement} object. + * + * + * @generated + */ +public class ModelElementItemProvider extends NamedObjectItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ModelElementItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ModelElement) object).getName(); + return label == null || label.length() == 0 ? getString("_UI_ModelElement_type") + : getString("_UI_ModelElement_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java similarity index 88% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java index 20d947f..55960df 100644 --- a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/NamedObjectItemProvider.java @@ -13,25 +13,19 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EObjectItemProvider; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.NamedObject} object. * * - * @generated NOT + * @generated */ -public class NamedObjectItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { +public class NamedObjectItemProvider extends EObjectItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java similarity index 82% rename from fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java rename to fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java index e4a11b2..dcb4258 100644 --- a/fr.tpt.mem4csd.loss.edit/src-gen/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/loss/provider/PrimitiveItemProvider.java @@ -14,6 +14,8 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; @@ -23,7 +25,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification; * * @generated */ -public class PrimitiveItemProvider extends NamedObjectItemProvider { +public class PrimitiveItemProvider extends ModelElementItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -45,10 +47,26 @@ public class PrimitiveItemProvider extends NamedObjectItemProvider { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addFeaturePropertyDescriptor(object); } return itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Feature feature. + * + * + * @generated + */ + protected void addFeaturePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Primitive_feature_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Primitive_feature_feature", + "_UI_Primitive_type"), + LossPackage.Literals.PRIMITIVE__FEATURE, true, false, true, null, null, null)); + } + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or @@ -151,6 +169,9 @@ public class PrimitiveItemProvider extends NamedObjectItemProvider { newChildDescriptors .add(createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createComplex())); + + newChildDescriptors.add( + createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, EcoreFactory.eINSTANCE.createEObject())); } } diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrNodeItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrNodeItemProvider.java new file mode 100644 index 0000000..a749f18 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrNodeItemProvider.java @@ -0,0 +1,147 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.provider; + + +import fr.tpt.mem4csd.lossTransform.CorrNode; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.tpt.mem4csd.lossTransform.CorrNode} object. + * + * + * @generated + */ +public class CorrNodeItemProvider extends CorrelationItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public CorrNodeItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addLeftLinksPropertyDescriptor(object); + addRightLinksPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Left Links feature. + * + * + * @generated + */ + protected void addLeftLinksPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_CorrNode_leftLinks_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_CorrNode_leftLinks_feature", "_UI_CorrNode_type"), + LossTransformPackage.Literals.CORR_NODE__LEFT_LINKS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Right Links feature. + * + * + * @generated + */ + protected void addRightLinksPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_CorrNode_rightLinks_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_CorrNode_rightLinks_feature", "_UI_CorrNode_type"), + LossTransformPackage.Literals.CORR_NODE__RIGHT_LINKS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns CorrNode.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/CorrNode")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((CorrNode)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_CorrNode_type") : + getString("_UI_CorrNode_type") + " " + label; + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrelationItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrelationItemProvider.java new file mode 100644 index 0000000..e8f394c --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/CorrelationItemProvider.java @@ -0,0 +1,103 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.provider; + + +import fr.tpt.mem4csd.loss.provider.NamedObjectItemProvider; + +import fr.tpt.mem4csd.lossTransform.Correlation; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.tpt.mem4csd.lossTransform.Correlation} object. + * + * + * @generated + */ +public class CorrelationItemProvider extends NamedObjectItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public CorrelationItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Correlation)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Correlation_type") : + getString("_UI_Correlation_type") + " " + label; + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return LossTransformEditPlugin.INSTANCE; + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformEditPlugin.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformEditPlugin.java new file mode 100644 index 0000000..633ecb6 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformEditPlugin.java @@ -0,0 +1,94 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.provider; + +import fr.tpt.mem4csd.loss.provider.LossEditPlugin; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the LossTransform edit plugin. + * + * + * @generated + */ +public final class LossTransformEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final LossTransformEditPlugin INSTANCE = new LossTransformEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public LossTransformEditPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + LossEditPlugin.INSTANCE, + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformItemProviderAdapterFactory.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformItemProviderAdapterFactory.java new file mode 100644 index 0000000..2b8ef97 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/LossTransformItemProviderAdapterFactory.java @@ -0,0 +1,229 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.provider; + +import fr.tpt.mem4csd.lossTransform.util.LossTransformAdapterFactory; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * + * + * @generated + */ +public class LossTransformItemProviderAdapterFactory extends LossTransformAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * @generated + */ + public LossTransformItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.lossTransform.CorrNode} instances. + * + * + * @generated + */ + protected CorrNodeItemProvider corrNodeItemProvider; + + /** + * This creates an adapter for a {@link fr.tpt.mem4csd.lossTransform.CorrNode}. + * + * + * @generated + */ + @Override + public Adapter createCorrNodeAdapter() { + if (corrNodeItemProvider == null) { + corrNodeItemProvider = new CorrNodeItemProvider(this); + } + + return corrNodeItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.lossTransform.Rule} instances. + * + * + * @generated + */ + protected RuleItemProvider ruleItemProvider; + + /** + * This creates an adapter for a {@link fr.tpt.mem4csd.lossTransform.Rule}. + * + * + * @generated + */ + @Override + public Adapter createRuleAdapter() { + if (ruleItemProvider == null) { + ruleItemProvider = new RuleItemProvider(this); + } + + return ruleItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + @Override + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + @Override + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class) || (((Class)type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * + * + * @generated + */ + @Override + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + @Override + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @generated + */ + @Override + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * + * + * @generated + */ + @Override + public void dispose() { + if (corrNodeItemProvider != null) corrNodeItemProvider.dispose(); + if (ruleItemProvider != null) ruleItemProvider.dispose(); + } + +} diff --git a/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/RuleItemProvider.java b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/RuleItemProvider.java new file mode 100644 index 0000000..478b489 --- /dev/null +++ b/fr.tpt.mem4csd.loss.edit/src/fr/tpt/mem4csd/lossTransform/provider/RuleItemProvider.java @@ -0,0 +1,263 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.provider; + + +import fr.tpt.mem4csd.loss.LossFactory; +import fr.tpt.mem4csd.lossTransform.LossTransformFactory; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; + +import fr.tpt.mem4csd.lossTransform.Rule; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.tpt.mem4csd.lossTransform.Rule} object. + * + * + * @generated + */ +public class RuleItemProvider + extends CorrelationItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public RuleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addLeftModelPropertyDescriptor(object); + addRightModelPropertyDescriptor(object); + addTransformationsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Left Model feature. + * + * + * @generated + */ + protected void addLeftModelPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Rule_leftModel_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Rule_leftModel_feature", "_UI_Rule_type"), + LossTransformPackage.Literals.RULE__LEFT_MODEL, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Right Model feature. + * + * + * @generated + */ + protected void addRightModelPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Rule_rightModel_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Rule_rightModel_feature", "_UI_Rule_type"), + LossTransformPackage.Literals.RULE__RIGHT_MODEL, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Transformations feature. + * + * + * @generated + */ + protected void addTransformationsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Rule_transformations_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Rule_transformations_feature", "_UI_Rule_type"), + LossTransformPackage.Literals.RULE__TRANSFORMATIONS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(LossTransformPackage.Literals.RULE__LEFT_MODEL); + childrenFeatures.add(LossTransformPackage.Literals.RULE__RIGHT_MODEL); + childrenFeatures.add(LossTransformPackage.Literals.RULE__TRANSFORMATIONS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns Rule.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Rule")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Rule)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Rule_type") : + getString("_UI_Rule_type") + " " + label; + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__LEFT_MODEL, + LossFactory.eINSTANCE.createPrimitive())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__LEFT_MODEL, + LossFactory.eINSTANCE.createLink())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__LEFT_MODEL, + LossFactory.eINSTANCE.createComplex())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__RIGHT_MODEL, + LossFactory.eINSTANCE.createPrimitive())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__RIGHT_MODEL, + LossFactory.eINSTANCE.createLink())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__RIGHT_MODEL, + LossFactory.eINSTANCE.createComplex())); + + newChildDescriptors.add + (createChildParameter + (LossTransformPackage.Literals.RULE__TRANSFORMATIONS, + LossTransformFactory.eINSTANCE.createCorrNode())); + } + + /** + * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. + * + * + * @generated + */ + @Override + public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { + Object childFeature = feature; + Object childObject = child; + + boolean qualify = + childFeature == LossTransformPackage.Literals.RULE__LEFT_MODEL || + childFeature == LossTransformPackage.Literals.RULE__RIGHT_MODEL; + + if (qualify) { + return getString + ("_UI_CreateChild_text2", + new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); + } + return super.getCreateChildText(owner, feature, child, selection); + } + +} diff --git a/fr.tpt.mem4csd.loss.editor/.classpath b/fr.tpt.mem4csd.loss.editor/.classpath index 2377d85..1a82131 100644 --- a/fr.tpt.mem4csd.loss.editor/.classpath +++ b/fr.tpt.mem4csd.loss.editor/.classpath @@ -1,6 +1,6 @@ - + diff --git a/fr.tpt.mem4csd.loss.editor/META-INF/MANIFEST.MF b/fr.tpt.mem4csd.loss.editor/META-INF/MANIFEST.MF index ec0d76f..4690516 100644 --- a/fr.tpt.mem4csd.loss.editor/META-INF/MANIFEST.MF +++ b/fr.tpt.mem4csd.loss.editor/META-INF/MANIFEST.MF @@ -5,15 +5,17 @@ Bundle-SymbolicName: fr.tpt.mem4csd.loss.editor;singleton:=true Automatic-Module-Name: fr.tpt.mem4csd.loss.editor Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.tpt.mem4csd.loss.presentation.LossEditorPlugin$Implementation +Bundle-Activator: fr.tpt.mem4csd.lossTransform.presentation.LossTransformEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: fr.tpt.mem4csd.loss.presentation +Export-Package: fr.tpt.mem4csd.loss.presentation, + fr.tpt.mem4csd.lossTransform.presentation Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources;visibility:=reexport, fr.tpt.mem4csd.loss.edit;visibility:=reexport, org.eclipse.emf.ecore.xmi;visibility:=reexport, org.eclipse.emf.edit.ui;visibility:=reexport, - org.eclipse.ui.ide;visibility:=reexport + org.eclipse.ui.ide;visibility:=reexport, + org.eclipse.emf.ecore.edit;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/fr.tpt.mem4csd.loss.editor/build.properties b/fr.tpt.mem4csd.loss.editor/build.properties index 11a5719..5fb0771 100644 --- a/fr.tpt.mem4csd.loss.editor/build.properties +++ b/fr.tpt.mem4csd.loss.editor/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src-gen/ +source.. = src/ output.. = bin diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/obj16/EcoreModelFile.gif b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/EcoreModelFile.gif new file mode 100644 index 0000000..feaa4ac Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/EcoreModelFile.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/obj16/LossTransformModelFile.gif b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/LossTransformModelFile.gif new file mode 100644 index 0000000..8a94410 Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/LossTransformModelFile.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/obj16/Loss_transformModelFile.gif b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/Loss_transformModelFile.gif new file mode 100644 index 0000000..366f9ff Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/Loss_transformModelFile.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss.transformModelFile.gif b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss.transformModelFile.gif new file mode 100644 index 0000000..22ec75b Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss.transformModelFile.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss_transformModelFile.gif b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss_transformModelFile.gif new file mode 100644 index 0000000..97061e3 Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/obj16/loss_transformModelFile.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewEcore.gif b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewEcore.gif new file mode 100644 index 0000000..a5c66c3 Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewEcore.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLossTransform.gif b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLossTransform.gif new file mode 100644 index 0000000..92c8b75 Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLossTransform.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLoss_transform.gif b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLoss_transform.gif new file mode 100644 index 0000000..e85f1da Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/NewLoss_transform.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss.transform.gif b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss.transform.gif new file mode 100644 index 0000000..259704c Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss.transform.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss_transform.gif b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss_transform.gif new file mode 100644 index 0000000..9c44c49 Binary files /dev/null and b/fr.tpt.mem4csd.loss.editor/icons/full/wizban/Newloss_transform.gif differ diff --git a/fr.tpt.mem4csd.loss.editor/plugin.properties b/fr.tpt.mem4csd.loss.editor/plugin.properties index 19c6d54..d7aafbb 100644 --- a/fr.tpt.mem4csd.loss.editor/plugin.properties +++ b/fr.tpt.mem4csd.loss.editor/plugin.properties @@ -51,3 +51,33 @@ _UI_Wizard_initial_object_description = Select a model object to create _UI_FileConflict_label = File Conflict _WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? +_UI_Loss_transformEditor_menu = &Loss_transform Editor +_UI_Loss_transformModelWizard_label = Loss_transform Model +_UI_Loss_transformModelWizard_description = Create a new Loss_transform model +_UI_Loss_transformEditor_label = Loss_transform Model Editor +_UI_Loss_transformEditorFilenameDefaultBase = My +_UI_Loss_transformEditorFilenameExtensions = loss_transform +_UI_loss.transformEditor_menu = &loss.transform Editor +_UI_loss.transformModelWizard_label = loss.transform Model +_UI_loss.transformModelWizard_description = Create a new loss.transform model +_UI_loss.transformEditor_label = loss.transform Model Editor +_UI_loss.transformEditorFilenameDefaultBase = My +_UI_loss.transformEditorFilenameExtensions = loss.transform +_UI_loss_transformEditor_menu = &loss_transform Editor +_UI_loss_transformModelWizard_label = loss_transform Model +_UI_loss_transformModelWizard_description = Create a new loss_transform model +_UI_loss_transformEditor_label = loss_transform Model Editor +_UI_loss_transformEditorFilenameDefaultBase = My +_UI_loss_transformEditorFilenameExtensions = loss_transform +_UI_LossTransformEditor_menu = &LossTransform Editor +_UI_LossTransformModelWizard_label = LossTransform Model +_UI_LossTransformModelWizard_description = Create a new LossTransform model +_UI_LossTransformEditor_label = LossTransform Model Editor +_UI_LossTransformEditorFilenameDefaultBase = My +_UI_LossTransformEditorFilenameExtensions = losstransform +_UI_EcoreEditor_menu = &Ecore Editor +_UI_EcoreModelWizard_label = Ecore Model +_UI_EcoreModelWizard_description = Create a new Ecore model +_UI_EcoreEditor_label = Ecore Model Editor +_UI_EcoreEditorFilenameDefaultBase = My +_UI_EcoreEditorFilenameExtensions = ecore diff --git a/fr.tpt.mem4csd.loss.editor/plugin.xml b/fr.tpt.mem4csd.loss.editor/plugin.xml index 04048ad..9e7b010 100644 --- a/fr.tpt.mem4csd.loss.editor/plugin.xml +++ b/fr.tpt.mem4csd.loss.editor/plugin.xml @@ -34,4 +34,59 @@ + + + + + %_UI_loss_transformModelWizard_description + + + + + + + + + + + + + + %_UI_LossTransformModelWizard_description + + + + + + + + + + diff --git a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossActionBarContributor.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossActionBarContributor.java similarity index 100% rename from fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossActionBarContributor.java rename to fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossActionBarContributor.java diff --git a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditor.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditor.java similarity index 99% rename from fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditor.java rename to fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditor.java index f7cc164..94c6426 100644 --- a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditor.java +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditor.java @@ -154,7 +154,7 @@ import org.eclipse.emf.edit.ui.util.EditUIUtil; import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; import fr.tpt.mem4csd.loss.provider.LossItemProviderAdapterFactory; - +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; import org.eclipse.ui.actions.WorkspaceModifyOperation; /** @@ -686,6 +686,7 @@ public class LossEditor extends MultiPageEditorPart adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new LossItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. diff --git a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java similarity index 93% rename from fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java rename to fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java index 36525ba..0541935 100644 --- a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossEditorPlugin.java @@ -7,6 +7,7 @@ import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.ui.EclipseUIPlugin; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** * This is the central singleton for the Loss editor plugin. @@ -38,7 +39,7 @@ public final class LossEditorPlugin extends EMFPlugin { * @generated */ public LossEditorPlugin() { - super(new ResourceLocator[] {}); + super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, }); } /** diff --git a/fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossModelWizard.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossModelWizard.java similarity index 100% rename from fr.tpt.mem4csd.loss.editor/src-gen/fr/tpt/mem4csd/loss/presentation/LossModelWizard.java rename to fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/loss/presentation/LossModelWizard.java diff --git a/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformActionBarContributor.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformActionBarContributor.java new file mode 100644 index 0000000..710f66d --- /dev/null +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformActionBarContributor.java @@ -0,0 +1,426 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.presentation; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; + +import org.eclipse.emf.edit.ui.action.ControlAction; +import org.eclipse.emf.edit.ui.action.CreateChildAction; +import org.eclipse.emf.edit.ui.action.CreateSiblingAction; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.ValidateAction; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.SubContributionItem; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; + +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; + +/** + * This is the action bar contributor for the LossTransform model editor. + * + * + * @generated + */ +public class LossTransformActionBarContributor + extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * @generated + */ + protected IAction showPropertiesViewAction = + new Action(LossTransformEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * @generated + */ + protected IAction refreshViewerAction = + new Action(LossTransformEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { + @Override + public boolean isEnabled() { + return activeEditorPart instanceof IViewerProvider; + } + + @Override + public void run() { + if (activeEditorPart instanceof IViewerProvider) { + Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer(); + if (viewer != null) { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * @generated + */ + public LossTransformActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); + toolBarManager.add(new Separator("losstransform-settings")); + toolBarManager.add(new Separator("losstransform-additions")); + } + + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditor_menu"), "fr.tpt.mem4csd.lossTransformMenuID"); + menuManager.insertAfter("additions", submenuManager); + submenuManager.add(new Separator("settings")); + submenuManager.add(new Separator("actions")); + submenuManager.add(new Separator("additions")); + submenuManager.add(new Separator("additions-end")); + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager(LossTransformEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(LossTransformEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } + + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * + * + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) { + selectionProvider = null; + } + else { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * + * + * @generated + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection newChildDescriptors = null; + Collection newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) { + Object object = ((IStructuredSelection)selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { + if (actions != null) { + for (IAction action : actions) { + if (contributionID != null) { + manager.insertBefore(contributionID, action); + } + else { + manager.add(action); + } + } + } + } + + /** + * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection actions) { + if (actions != null) { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) { + contributionItem = ((SubContributionItem)contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) { + IAction action = ((ActionContributionItem)contributionItem).getAction(); + if (actions.contains(action)) { + manager.remove(contributionItem); + } + } + } + } + } + + /** + * This populates the pop-up menu before it appears. + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager(LossTransformEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(LossTransformEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); + menuManager.insertAfter("ui-actions", showPropertiesViewAction); + + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); + + super.addGlobalActions(menuManager); + } + + /** + * This ensures that a delete action will clean up all references to deleted objects. + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} diff --git a/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditor.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditor.java new file mode 100644 index 0000000..c18946e --- /dev/null +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditor.java @@ -0,0 +1,1852 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.presentation; + + +import java.io.IOException; +import java.io.InputStream; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EventObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; + +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; + +import org.eclipse.jface.util.LocalSelectionTransfer; + +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.custom.CTabFolder; + +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.FileTransfer; +import org.eclipse.swt.dnd.Transfer; + +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; + +import org.eclipse.swt.layout.FillLayout; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; + +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; + +import org.eclipse.ui.dialogs.SaveAsDialog; + +import org.eclipse.ui.ide.IGotoMarker; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; + +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; + +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.ViewerPane; + +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; + +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; + +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; + +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; + +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; + +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; + +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; + +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; + +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; + +import fr.tpt.mem4csd.lossTransform.provider.LossTransformItemProviderAdapterFactory; +import fr.tpt.mem4csd.loss.provider.LossItemProviderAdapterFactory; + +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a LossTransform model editor. + * + * + * @generated + */ +public class LossTransformEditor + extends MultiPageEditorPart + implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * @generated + */ + protected List propertySheetPages = new ArrayList(); + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This inverts the roll of parent and child in the content provider and show parents as a tree. + * + * + * @generated + */ + protected TreeViewer parentViewer; + + /** + * This shows how a tree view works. + * + * + * @generated + */ + protected TreeViewer treeViewer; + + /** + * This shows how a list view works. + * A list viewer doesn't support icons. + * + * + * @generated + */ + protected ListViewer listViewer; + + /** + * This shows how a table view works. + * A table can be used as a list with icons. + * + * + * @generated + */ + protected TableViewer tableViewer; + + /** + * This shows how a tree view with columns works. + * + * + * @generated + */ + protected TreeViewer treeViewerWithColumns; + + /** + * This keeps track of the active viewer pane, in the book. + * + * + * @generated + */ + protected ViewerPane currentViewerPane; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * @generated + */ + protected IPartListener partListener = + new IPartListener() { + @Override + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(LossTransformEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(LossTransformEditor.this); + handleActivate(); + } + } + else if (p == LossTransformEditor.this) { + handleActivate(); + } + } + @Override + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + @Override + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + @Override + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + @Override + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * @generated + */ + protected Collection removedResources = new ArrayList(); + + /** + * Resources that have been changed since last activation. + * + * + * @generated + */ + protected Collection changedResources = new ArrayList(); + + /** + * Resources that have been saved. + * + * + * @generated + */ + protected Collection savedResources = new ArrayList(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap(); + + /** + * Controls whether the problem indication should be updated. + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = + new EContentAdapter() { + protected boolean dispatching; + + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource)notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } + else { + resourceToDiagnosticMap.remove(resource); + } + dispatchUpdateProblemIndication(); + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + dispatchUpdateProblemIndication(); + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + @Override + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList(); + protected Collection removedResources = new ArrayList(); + + @Override + public boolean visit(IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED || + delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { + Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } + else if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + return false; + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(LossTransformEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == LossTransformEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * Handles activation of the editor or it's associated views. + * + * + * @generated + */ + protected void handleActivate() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(LossTransformEditor.this, false); + } + else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } + else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (isDirty()) { + changedResources.addAll(resourceSet.getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(resourceSet.getLoadOptions()); + } + catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = + new BasicDiagnostic + (Diagnostic.OK, + "fr.tpt.mem4csd.loss.editor", + 0, + null, + new Object [] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } + else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } + catch (PartInitException exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + try { + markerHelper.updateMarkers(diagnostic); + } + catch (CoreException exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return + MessageDialog.openQuestion + (getSite().getShell(), + getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + /** + * This creates a model editor. + * + * + * @generated + */ + public LossTransformEditor() { + super(); + initializeEditingDomain(); + } + + /** + * This sets up the editing domain for the model editor. + * + * + * @generated + */ + protected void initializeEditingDomain() { + // Create an adapter factory that yields item providers. + // + adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + + adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new LossTransformItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new LossItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); + + // Create the command stack that will notify this editor as commands are executed. + // + BasicCommandStack commandStack = new BasicCommandStack(); + + // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. + // + commandStack.addCommandStackListener + (new CommandStackListener() { + @Override + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + for (Iterator i = propertySheetPages.iterator(); i.hasNext(); ) { + PropertySheetPage propertySheetPage = i.next(); + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { + i.remove(); + } + else { + propertySheetPage.refresh(); + } + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = + new Runnable() { + @Override + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} + * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * @generated + */ + @Override + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * @generated + */ + @Override + public Object [] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public Object [] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * + * + * @generated + */ + public void setCurrentViewerPane(ViewerPane viewerPane) { + if (currentViewerPane != viewerPane) { + if (currentViewerPane != null) { + currentViewerPane.showFocus(false); + } + currentViewerPane = viewerPane; + } + setCurrentViewer(currentViewerPane.getViewer()); + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = + new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + @Override + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * @generated + */ + @Override + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * @generated + */ + protected void createContextMenuFor(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu= contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } + catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * Returns a diagnostic describing the errors and warnings listed in the resource + * and the specified exception (if any). + * + * + * @generated + */ + public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "fr.tpt.mem4csd.loss.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object [] { exception == null ? (Object)resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } + else if (exception != null) { + return + new BasicDiagnostic + (Diagnostic.ERROR, + "fr.tpt.mem4csd.loss.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception }); + } + else { + return Diagnostic.OK_INSTANCE; + } + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * @generated + */ + @Override + public void createPages() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + selectionViewer = (TreeViewer)viewerPane.getViewer(); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + selectionViewer.setUseHashlookup(true); + + selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + viewerPane.setTitle(editingDomain.getResourceSet()); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + } + + // Create a page for the parent tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + parentViewer = (TreeViewer)viewerPane.getViewer(); + parentViewer.setAutoExpandLevel(30); + parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); + parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(parentViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ParentPage_label")); + } + + // This is the page for the list viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new ListViewer(composite); + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + listViewer = (ListViewer)viewerPane.getViewer(); + listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(listViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ListPage_label")); + } + + // This is the page for the tree viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + treeViewer = (TreeViewer)viewerPane.getViewer(); + treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + + createContextMenuFor(treeViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreePage_label")); + } + + // This is the page for the table viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TableViewer(composite); + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + tableViewer = (TableViewer)viewerPane.getViewer(); + + Table table = tableViewer.getTable(); + TableLayout layout = new TableLayout(); + table.setLayout(layout); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumn objectColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(3, 100, true)); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + + TableColumn selfColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(2, 100, true)); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + + tableViewer.setColumnProperties(new String [] {"a", "b"}); + tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(tableViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TablePage_label")); + } + + // This is the page for the table tree viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), LossTransformEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + treeViewerWithColumns = (TreeViewer)viewerPane.getViewer(); + + Tree tree = treeViewerWithColumns.getTree(); + tree.setLayoutData(new FillLayout()); + tree.setHeaderVisible(true); + tree.setLinesVisible(true); + + TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + objectColumn.setWidth(250); + + TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + selfColumn.setWidth(200); + + treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); + treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(treeViewerWithColumns); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); + } + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + if (!getContainer().isDisposed()) { + setActivePage(0); + } + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener + (new ControlAdapter() { + boolean guard = false; + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * @generated + */ + protected void hideTabs() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * @generated + */ + @Override + public T getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return key.cast(getPropertySheetPage()); + } + else if (key.equals(IGotoMarker.class)) { + return key.cast(this); + } + else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setUseHashlookup(true); + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener + (new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + PropertySheetPage propertySheetPage = + new ExtendedPropertySheetPage(editingDomain, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { + @Override + public void setSelectionToViewer(List selection) { + LossTransformEditor.this.setSelectionToViewer(selection); + LossTransformEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + propertySheetPages.add(propertySheetPage); + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection)selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + // If it's the selection viewer, then we want it to select the same selection as this selection. + // + if (currentViewerPane.getViewer() == selectionViewer) { + ArrayList selectionList = new ArrayList(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } + else { + // Set the input to the widget. + // + if (currentViewerPane.getViewer().getInput() != selectedElement) { + currentViewerPane.getViewer().setInput(selectedElement); + currentViewerPane.setTitle(selectedElement); + } + } + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); + + // Do the work within an operation because this is a long running activity that modifies the workbench. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + // This is the method that gets invoked when the operation runs. + // + @Override + public void execute(IProgressMonitor monitor) { + // Save the resources to the file system. + // + boolean first = true; + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } + catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } + catch (Exception exception) { + // Something went wrong that shouldn't. + // + LossTransformEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * This returns whether something has been persisted to the URI of the specified resource. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * + * + * @generated + */ + protected boolean isPersisted(Resource resource) { + boolean result = false; + try { + InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); + if (stream != null) { + result = true; + stream.close(); + } + } + catch (IOException e) { + // Ignore + } + return result; + } + + /** + * This always returns true because it is not currently supported. + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = + getActionBars().getStatusLineManager() != null ? + getActionBars().getStatusLineManager().getProgressMonitor() : + new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * @generated + */ + @Override + public void gotoMarker(IMarker marker) { + List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); + if (!targetObjects.isEmpty()) { + setSelectionToViewer(targetObjects); + } + } + + /** + * This is called during startup. + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * @generated + */ + @Override + public void setFocus() { + if (currentViewerPane != null) { + currentViewerPane.setFocus(); + } + else { + getControl(getActivePage()).setFocus(); + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + @Override + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * @generated + */ + @Override + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? + contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection)selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } + else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * @generated + */ + private static String getString(String key) { + return LossTransformEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return LossTransformEditorPlugin.INSTANCE.getString(key, new Object [] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + /** + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor(); + } + + /** + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + for (PropertySheetPage propertySheetPage : propertySheetPages) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * @generated + */ + protected boolean showOutlineView() { + return true; + } +} diff --git a/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditorPlugin.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditorPlugin.java new file mode 100644 index 0000000..a5a5684 --- /dev/null +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformEditorPlugin.java @@ -0,0 +1,96 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.presentation; + +import fr.tpt.mem4csd.loss.provider.LossEditPlugin; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.ui.EclipseUIPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the LossTransform editor plugin. + * + * + * @generated + */ +public final class LossTransformEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final LossTransformEditorPlugin INSTANCE = new LossTransformEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public LossTransformEditorPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + LossEditPlugin.INSTANCE, + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformModelWizard.java b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformModelWizard.java new file mode 100644 index 0000000..0af32ca --- /dev/null +++ b/fr.tpt.mem4csd.loss.editor/src/fr/tpt/mem4csd/lossTransform/presentation/LossTransformModelWizard.java @@ -0,0 +1,631 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.presentation; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.StringTokenizer; + +import org.eclipse.emf.common.CommonPlugin; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; + +import org.eclipse.core.runtime.IProgressMonitor; + +import org.eclipse.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; + +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import fr.tpt.mem4csd.lossTransform.LossTransformFactory; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; +import fr.tpt.mem4csd.lossTransform.provider.LossTransformEditPlugin; + + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class LossTransformModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected LossTransformPackage lossTransformPackage = LossTransformPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected LossTransformFactory lossTransformFactory = lossTransformPackage.getLossTransformFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected LossTransformModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected LossTransformModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * @generated + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(LossTransformEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(LossTransformEditorPlugin.INSTANCE.getImage("full/wizban/NewLossTransform"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList(); + for (EClassifier eClassifier : lossTransformPackage.getEClassifiers()) { + if (eClassifier instanceof EClass) { + EClass eClass = (EClass)eClassifier; + if (!eClass.isAbstract()) { + initialObjectNames.add(eClass.getName()); + } + } + } + Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); + } + return initialObjectNames; + } + + /** + * Create a new model. + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass)lossTransformPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = lossTransformFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * @generated + */ + @Override + public boolean performFinish() { + try { + // Remember the file. + // + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor progressMonitor) { + try { + // Create a resource set + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Get the URI of the model file. + // + URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + // Create a resource for this file. + // + Resource resource = resourceSet.createResource(fileURI); + + // Add the initial model object to the contents. + // + EObject rootObject = createInitialModel(); + if (rootObject != null) { + resource.getContents().add(rootObject); + } + + // Save the contents of the resource to the file system. + // + Map options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } + catch (Exception exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + } + finally { + progressMonitor.done(); + } + } + }; + + getContainer().run(false, false, operation); + + // Select the new file resource in the current view. + // + IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection(modelFile); + getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + ((ISetSelectionTarget)activePart).selectReveal(targetSelection); + } + }); + } + + // Open an editor on the new file. + // + try { + page.openEditor + (new FileEditorInput(modelFile), + workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); + } + catch (PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), LossTransformEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + LossTransformEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class LossTransformModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public LossTransformModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * @generated + */ + @Override + protected boolean validatePage() { + if (super.validatePage()) { + String extension = new Path(getFileName()).getFileExtension(); + if (extension == null || !FILE_EXTENSIONS.contains(extension)) { + String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; + setErrorMessage(LossTransformEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * @generated + */ + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); + } + } + + /** + * This is the page where the type of object to create is selected. + * + * + * @generated + */ + public class LossTransformModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public LossTransformModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.verticalSpacing = 12; + composite.setLayout(layout); + + GridData data = new GridData(); + data.verticalAlignment = GridData.FILL; + data.grabExcessVerticalSpace = true; + data.horizontalAlignment = GridData.FILL; + composite.setLayoutData(data); + } + + Label containerLabel = new Label(composite, SWT.LEFT); + { + containerLabel.setText(LossTransformEditorPlugin.INSTANCE.getString("_UI_ModelObject")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + containerLabel.setLayoutData(data); + } + + initialObjectField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + initialObjectField.setLayoutData(data); + } + + for (String objectName : getInitialObjectNames()) { + initialObjectField.add(getLabel(objectName)); + } + + if (initialObjectField.getItemCount() == 1) { + initialObjectField.select(0); + } + initialObjectField.addModifyListener(validator); + + Label encodingLabel = new Label(composite, SWT.LEFT); + { + encodingLabel.setText(LossTransformEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + encodingLabel.setLayoutData(data); + } + encodingField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + encodingField.setLayoutData(data); + } + + for (String encoding : getEncodings()) { + encodingField.add(encoding); + } + + encodingField.select(0); + encodingField.addModifyListener(validator); + + setPageComplete(validatePage()); + setControl(composite); + } + + /** + * + * + * @generated + */ + protected ModifyListener validator = + new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * @generated + */ + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + if (initialObjectField.getItemCount() == 1) { + initialObjectField.clearSelection(); + encodingField.setFocus(); + } + else { + encodingField.clearSelection(); + initialObjectField.setFocus(); + } + } + } + + /** + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return LossTransformEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + LossTransformEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(LossTransformEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new LossTransformModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformModelWizard_label")); + newFileCreationPage.setDescription(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformModelWizard_description")); + newFileCreationPage.setFileName(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); + addPage(newFileCreationPage); + + // Try and get the resource selection to determine a current directory for the file dialog. + // + if (selection != null && !selection.isEmpty()) { + // Get the resource... + // + Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + // + IResource selectedResource = (IResource)selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + + // This gives us a directory... + // + if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { + // Set this for the container. + // + newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); + + // Make up a unique new name here. + // + String defaultModelBaseFilename = LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameDefaultBase"); + String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); + String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; + for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) { + modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; + } + newFileCreationPage.setFileName(modelFilename); + } + } + } + initialObjectCreationPage = new LossTransformModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformModelWizard_label")); + initialObjectCreationPage.setDescription(LossTransformEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/fr.tpt.mem4csd.loss.mm2loss/configs/moteConfig.atl b/fr.tpt.mem4csd.loss.mm2loss/configs/moteConfig.atl deleted file mode 100644 index 6b2a4f8..0000000 --- a/fr.tpt.mem4csd.loss.mm2loss/configs/moteConfig.atl +++ /dev/null @@ -1,4 +0,0 @@ -library faceConfig; - -helper def : inname : String = 'mote'; -helper def : packageNames : Set(String) = Set{ 'IN', 'MLTGG', 'ECORE' }; diff --git a/fr.tpt.mem4csd.loss.mm2loss/resources/outputs/face_aadl.mltgg.loss b/fr.tpt.mem4csd.loss.mm2loss/resources/outputs/face_aadl.mltgg.loss index 3e9f319..f6f2863 100644 --- a/fr.tpt.mem4csd.loss.mm2loss/resources/outputs/face_aadl.mltgg.loss +++ b/fr.tpt.mem4csd.loss.mm2loss/resources/outputs/face_aadl.mltgg.loss @@ -1,8219 +1,1011 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fr.tpt.mem4csd.loss.mm2loss/transformations-gen/mote2loss.atl b/fr.tpt.mem4csd.loss.mm2loss/transformations-gen/mote2loss.atl deleted file mode 100644 index 4e99b98..0000000 --- a/fr.tpt.mem4csd.loss.mm2loss/transformations-gen/mote2loss.atl +++ /dev/null @@ -1,854 +0,0 @@ -module mote2loss; - -create LOSS : OUT from MM : IN; - -lazy rule ReferenceToLink { - from - refName : String, - source : OclAny - to - link : OUT!Link ( - name <- refName, - referenceTo <- source - ) -} - -lazy rule DTecore__EDouble2Prim { - from - attrName : String, - source : IN!"ecore::EDouble" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EDouble' - ) -} - -lazy rule DTecore__ECharacterObject2Prim { - from - attrName : String, - source : IN!"ecore::ECharacterObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::ECharacterObject' - ) -} - -rule CLecore__EOperation2Complex { - from - source : IN!"ecore::EOperation" in MM (source.oclIsTypeOf(IN!"ecore::EOperation")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EOperation', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ).union(Set{source.eContainingClass}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eContainingClass', it)) ).union(source.eTypeParameters->collect(it | thisModule.ReferenceToLink('eTypeParameters', it))).union(source.eParameters->collect(it | thisModule.ReferenceToLink('eParameters', it))).union(source.eExceptions->collect(it | thisModule.ReferenceToLink('eExceptions', it))).union(source.eGenericExceptions->collect(it | thisModule.ReferenceToLink('eGenericExceptions', it))) - ) -} - -rule CLmltgg__ModelDomain2Complex { - from - source : IN!"mltgg::ModelDomain" in MM (source.oclIsTypeOf(IN!"mltgg::ModelDomain")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::ModelDomain', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(source.modelObjects->collect(it | thisModule.ReferenceToLink('modelObjects', it))).union(source.modelLinks->collect(it | thisModule.ReferenceToLink('modelLinks', it))) - ) -} - -lazy rule DTecore__ELongObject2Prim { - from - attrName : String, - source : IN!"ecore::ELongObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::ELongObject' - ) -} - -rule CLecore__ETypeParameter2Complex { - from - source : IN!"ecore::ETypeParameter" in MM (source.oclIsTypeOf(IN!"ecore::ETypeParameter")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::ETypeParameter', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(source.eBounds->collect(it | thisModule.ReferenceToLink('eBounds', it))) - ) -} - -rule CLecore__EEnumLiteral2Complex { - from - source : IN!"ecore::EEnumLiteral" in MM (source.oclIsTypeOf(IN!"ecore::EEnumLiteral")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EEnumLiteral', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EInt2Prim('value', source.value)).including(thisModule.DTecore__EEnumerator2Prim('instance', source.instance)).including(thisModule.DTecore__EString2Prim('literal', source.literal)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eEnum}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eEnum', it)) ) - ) -} - -lazy rule DTmltgg__LinkOrderConstraintEnum2Prim { - from - attrName : String, - source : IN!"mltgg::LinkOrderConstraintEnum" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'mltgg::LinkOrderConstraintEnum' - ) -} - -lazy rule DTecore__EFloatObject2Prim { - from - attrName : String, - source : IN!"ecore::EFloatObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EFloatObject' - ) -} - -lazy rule DTecore__EBooleanObject2Prim { - from - attrName : String, - source : IN!"ecore::EBooleanObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EBooleanObject' - ) -} - -lazy rule DTecore__EShortObject2Prim { - from - attrName : String, - source : IN!"ecore::EShortObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EShortObject' - ) -} - -lazy rule DTecore__EEnumerator2Prim { - from - attrName : String, - source : IN!"ecore::EEnumerator" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EEnumerator' - ) -} - -lazy rule DTecore__EBigDecimal2Prim { - from - attrName : String, - source : IN!"ecore::EBigDecimal" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EBigDecimal' - ) -} - -rule CLmltgg__ModelElement2Complex { - from - source : IN!"mltgg::ModelElement" in MM (source.oclIsTypeOf(IN!"mltgg::ModelElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::ModelElement', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.incomingCorrespondenceLink}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('incomingCorrespondenceLink', it)) ) - ) -} - -rule CLmltgg__TGGRule2Complex { - from - source : IN!"mltgg::TGGRule" in MM (source.oclIsTypeOf(IN!"mltgg::TGGRule")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::TGGRule', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).including(thisModule.DTecore__EString2Prim('ruleID', source.ruleID)).including(thisModule.DTecore__EBoolean2Prim('enabled', source.enabled)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.leftModelDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('leftModelDomain', it)) ).union(Set{source.rightModelDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('rightModelDomain', it)) ).union(Set{source.correspondenceDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('correspondenceDomain', it)) ).union(source.attributeFormulas->collect(it | thisModule.ReferenceToLink('attributeFormulas', it))).union(source.ruleParameters->collect(it | thisModule.ReferenceToLink('ruleParameters', it))).union(Set{source.ruleGroup}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ruleGroup', it)) ).union(source.leftInputElements->collect(it | thisModule.ReferenceToLink('leftInputElements', it))).union(source.rightInputElements->collect(it | thisModule.ReferenceToLink('rightInputElements', it))) - ) -} - -lazy rule DTecore__EJavaClass2Prim { - from - attrName : String, - source : IN!"ecore::EJavaClass" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EJavaClass' - ) -} - -rule CLmltgg__TGGRuleGroup2Complex { - from - source : IN!"mltgg::TGGRuleGroup" in MM (source.oclIsTypeOf(IN!"mltgg::TGGRuleGroup")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::TGGRuleGroup', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).including(thisModule.DTecore__EString2Prim('ruleGroupID', source.ruleGroupID)).including(thisModule.DTecore__EBoolean2Prim('isAxiom', source.isAxiom)).including(thisModule.DTecore__EBoolean2Prim('enabled', source.enabled)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.tgg}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('tgg', it)) ).union(source.rules->collect(it | thisModule.ReferenceToLink('rules', it))) - ) -} - -rule CLecore__EModelElement2Complex { - from - source : IN!"ecore::EModelElement" in MM (source.oclIsTypeOf(IN!"ecore::EModelElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EModelElement', - primitives <- Set{}.union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))) - ) -} - -lazy rule DTecore__EBigInteger2Prim { - from - attrName : String, - source : IN!"ecore::EBigInteger" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EBigInteger' - ) -} - -lazy rule DTmltgg__TGGModifierEnum2Prim { - from - attrName : String, - source : IN!"mltgg::TGGModifierEnum" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'mltgg::TGGModifierEnum' - ) -} - -lazy rule DTecore__EInt2Prim { - from - attrName : String, - source : IN!"ecore::EInt" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EInt' - ) -} - -lazy rule DTecore__EIntegerObject2Prim { - from - attrName : String, - source : IN!"ecore::EIntegerObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EIntegerObject' - ) -} - -lazy rule DTecore__ELong2Prim { - from - attrName : String, - source : IN!"ecore::ELong" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::ELong' - ) -} - -lazy rule DTecore__EResource2Prim { - from - attrName : String, - source : IN!"ecore::EResource" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EResource' - ) -} - -lazy rule DTecore__EChar2Prim { - from - attrName : String, - source : IN!"ecore::EChar" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EChar' - ) -} - -lazy rule DTecore__EFloat2Prim { - from - attrName : String, - source : IN!"ecore::EFloat" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EFloat' - ) -} - -rule CLmltgg__RuleElement2Complex { - from - source : IN!"mltgg::RuleElement" in MM (source.oclIsTypeOf(IN!"mltgg::RuleElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::RuleElement', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))) - ) -} - -rule CLecore__EAttribute2Complex { - from - source : IN!"ecore::EAttribute" in MM (source.oclIsTypeOf(IN!"ecore::EAttribute")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EAttribute', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).including(thisModule.DTecore__EBoolean2Prim('changeable', source.changeable)).including(thisModule.DTecore__EBoolean2Prim('volatile', source.volatile)).including(thisModule.DTecore__EBoolean2Prim('transient', source.transient)).including(thisModule.DTecore__EString2Prim('defaultValueLiteral', source.defaultValueLiteral)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EBoolean2Prim('unsettable', source.unsettable)).including(thisModule.DTecore__EBoolean2Prim('derived', source.derived)).including(thisModule.DTecore__EBoolean2Prim('iD', source.iD)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ).union(Set{source.eContainingClass}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eContainingClass', it)) ).union(Set{source.eAttributeType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eAttributeType', it)) ) - ) -} - -rule CLecore__EObject2Complex { - from - source : IN!"ecore::EObject" in MM (source.oclIsTypeOf(IN!"ecore::EObject")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EObject', - primitives <- Set{} - ) -} - -lazy rule DTecore__EJavaObject2Prim { - from - attrName : String, - source : IN!"ecore::EJavaObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EJavaObject' - ) -} - -rule CLecore__EPackage2Complex { - from - source : IN!"ecore::EPackage" in MM (source.oclIsTypeOf(IN!"ecore::EPackage")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EPackage', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('nsURI', source.nsURI)).including(thisModule.DTecore__EString2Prim('nsPrefix', source.nsPrefix)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eFactoryInstance}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eFactoryInstance', it)) ).union(source.eClassifiers->collect(it | thisModule.ReferenceToLink('eClassifiers', it))).union(source.eSubpackages->collect(it | thisModule.ReferenceToLink('eSubpackages', it))).union(Set{source.eSuperPackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eSuperPackage', it)) ) - ) -} - -rule CLmltgg__AttributeAssignment2Complex { - from - source : IN!"mltgg::AttributeAssignment" in MM (source.oclIsTypeOf(IN!"mltgg::AttributeAssignment")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::AttributeAssignment', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTecore__EBoolean2Prim('initOnly', source.initOnly)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.modelObject}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('modelObject', it)) ).union(Set{source.assignmentExpression}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('assignmentExpression', it)) ).union(Set{source.feature}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('feature', it)) ) - ) -} - -rule CLecore__EGenericType2Complex { - from - source : IN!"ecore::EGenericType" in MM (source.oclIsTypeOf(IN!"ecore::EGenericType")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EGenericType', - primitives <- Set{}.union(Set{source.eUpperBound}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eUpperBound', it)) ).union(source.eTypeArguments->collect(it | thisModule.ReferenceToLink('eTypeArguments', it))).union(Set{source.eRawType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eRawType', it)) ).union(Set{source.eLowerBound}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eLowerBound', it)) ).union(Set{source.eTypeParameter}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eTypeParameter', it)) ).union(Set{source.eClassifier}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eClassifier', it)) ) - ) -} - -lazy rule DTecore__EDiagnosticChain2Prim { - from - attrName : String, - source : IN!"ecore::EDiagnosticChain" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EDiagnosticChain' - ) -} - -lazy rule DTecore__EFeatureMap2Prim { - from - attrName : String, - source : IN!"ecore::EFeatureMap" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EFeatureMap' - ) -} - -rule CLmltgg__ModelObject2Complex { - from - source : IN!"mltgg::ModelObject" in MM (source.oclIsTypeOf(IN!"mltgg::ModelObject")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::ModelObject', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.incomingCorrespondenceLink}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('incomingCorrespondenceLink', it)) ).union(Set{source.type}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('type', it)) ).union(source.outgoingLinks->collect(it | thisModule.ReferenceToLink('outgoingLinks', it))).union(source.incomingLinks->collect(it | thisModule.ReferenceToLink('incomingLinks', it))).union(source.constraints->collect(it | thisModule.ReferenceToLink('constraints', it))).union(source.attributeAssignments->collect(it | thisModule.ReferenceToLink('attributeAssignments', it))).union(Set{source.modelDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('modelDomain', it)) ).union(source.forwardConstraints->collect(it | thisModule.ReferenceToLink('forwardConstraints', it))).union(source.backwardConstraints->collect(it | thisModule.ReferenceToLink('backwardConstraints', it))) - ) -} - -rule CLmltgg__CorrespondenceDomain2Complex { - from - source : IN!"mltgg::CorrespondenceDomain" in MM (source.oclIsTypeOf(IN!"mltgg::CorrespondenceDomain")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::CorrespondenceDomain', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.rule}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('rule', it)) ).union(source.correspondenceNodes->collect(it | thisModule.ReferenceToLink('correspondenceNodes', it))).union(source.correspondenceLinks->collect(it | thisModule.ReferenceToLink('correspondenceLinks', it))) - ) -} - -rule CLmltgg__CorrespondenceNode2Complex { - from - source : IN!"mltgg::CorrespondenceNode" in MM (source.oclIsTypeOf(IN!"mltgg::CorrespondenceNode")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::CorrespondenceNode', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.type}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('type', it)) ).union(source.outgoingLinks->collect(it | thisModule.ReferenceToLink('outgoingLinks', it))).union(Set{source.correspondenceDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('correspondenceDomain', it)) ) - ) -} - -rule CLecore__EEnum2Complex { - from - source : IN!"ecore::EEnum" in MM (source.oclIsTypeOf(IN!"ecore::EEnum")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EEnum', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('instanceClassName', source.instanceClassName)).including(thisModule.DTecore__EJavaClass2Prim('instanceClass', source.instanceClass)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EString2Prim('instanceTypeName', source.instanceTypeName)).including(thisModule.DTecore__EBoolean2Prim('serializable', source.serializable)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.ePackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ePackage', it)) ).union(source.eTypeParameters->collect(it | thisModule.ReferenceToLink('eTypeParameters', it))).union(source.eLiterals->collect(it | thisModule.ReferenceToLink('eLiterals', it))) - ) -} - -rule CLmltgg__ModelLink2Complex { - from - source : IN!"mltgg::ModelLink" in MM (source.oclIsTypeOf(IN!"mltgg::ModelLink")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::ModelLink', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).including(thisModule.DTmltgg__LinkPositionConstraintEnum2Prim('linkPositionConstraint', source.linkPositionConstraint)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.incomingCorrespondenceLink}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('incomingCorrespondenceLink', it)) ).union(Set{source.source}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('source', it)) ).union(Set{source.target}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('target', it)) ).union(Set{source.feature}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('feature', it)) ).union(source.outgoingLinkOrderConstraints->collect(it | thisModule.ReferenceToLink('outgoingLinkOrderConstraints', it))).union(source.incomingLinkOrderConstraints->collect(it | thisModule.ReferenceToLink('incomingLinkOrderConstraints', it))).union(Set{source.modelDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('modelDomain', it)) ) - ) -} - -rule CLecore__EStructuralFeature2Complex { - from - source : IN!"ecore::EStructuralFeature" in MM (source.oclIsTypeOf(IN!"ecore::EStructuralFeature")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EStructuralFeature', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).including(thisModule.DTecore__EBoolean2Prim('changeable', source.changeable)).including(thisModule.DTecore__EBoolean2Prim('volatile', source.volatile)).including(thisModule.DTecore__EBoolean2Prim('transient', source.transient)).including(thisModule.DTecore__EString2Prim('defaultValueLiteral', source.defaultValueLiteral)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EBoolean2Prim('unsettable', source.unsettable)).including(thisModule.DTecore__EBoolean2Prim('derived', source.derived)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ).union(Set{source.eContainingClass}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eContainingClass', it)) ) - ) -} - -rule CLmltgg__LinkOrderConstraint2Complex { - from - source : IN!"mltgg::LinkOrderConstraint" in MM (source.oclIsTypeOf(IN!"mltgg::LinkOrderConstraint")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::LinkOrderConstraint', - primitives <- Set{}.including(thisModule.DTmltgg__LinkOrderConstraintEnum2Prim('kind', source.kind)).union(Set{source.predecessorLink}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('predecessorLink', it)) ).union(Set{source.successorLink}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('successorLink', it)) ) - ) -} - -rule CLecore__EDataType2Complex { - from - source : IN!"ecore::EDataType" in MM (source.oclIsTypeOf(IN!"ecore::EDataType")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EDataType', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('instanceClassName', source.instanceClassName)).including(thisModule.DTecore__EJavaClass2Prim('instanceClass', source.instanceClass)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EString2Prim('instanceTypeName', source.instanceTypeName)).including(thisModule.DTecore__EBoolean2Prim('serializable', source.serializable)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.ePackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ePackage', it)) ).union(source.eTypeParameters->collect(it | thisModule.ReferenceToLink('eTypeParameters', it))) - ) -} - -lazy rule DTecore__EByteObject2Prim { - from - attrName : String, - source : IN!"ecore::EByteObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EByteObject' - ) -} - -rule CLecore__EParameter2Complex { - from - source : IN!"ecore::EParameter" in MM (source.oclIsTypeOf(IN!"ecore::EParameter")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EParameter', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ).union(Set{source.eOperation}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eOperation', it)) ) - ) -} - -rule CLmltgg__RightModelDomain2Complex { - from - source : IN!"mltgg::RightModelDomain" in MM (source.oclIsTypeOf(IN!"mltgg::RightModelDomain")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::RightModelDomain', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(source.modelObjects->collect(it | thisModule.ReferenceToLink('modelObjects', it))).union(source.modelLinks->collect(it | thisModule.ReferenceToLink('modelLinks', it))).union(Set{source.rule}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('rule', it)) ) - ) -} - -lazy rule DTecore__EShort2Prim { - from - attrName : String, - source : IN!"ecore::EShort" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EShort' - ) -} - -rule CLecore__EClass2Complex { - from - source : IN!"ecore::EClass" in MM (source.oclIsTypeOf(IN!"ecore::EClass")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EClass', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('instanceClassName', source.instanceClassName)).including(thisModule.DTecore__EJavaClass2Prim('instanceClass', source.instanceClass)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EString2Prim('instanceTypeName', source.instanceTypeName)).including(thisModule.DTecore__EBoolean2Prim('abstract', source.abstract)).including(thisModule.DTecore__EBoolean2Prim('interface', source.interface)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.ePackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ePackage', it)) ).union(source.eTypeParameters->collect(it | thisModule.ReferenceToLink('eTypeParameters', it))).union(source.eSuperTypes->collect(it | thisModule.ReferenceToLink('eSuperTypes', it))).union(source.eOperations->collect(it | thisModule.ReferenceToLink('eOperations', it))).union(source.eAllAttributes->collect(it | thisModule.ReferenceToLink('eAllAttributes', it))).union(source.eAllReferences->collect(it | thisModule.ReferenceToLink('eAllReferences', it))).union(source.eReferences->collect(it | thisModule.ReferenceToLink('eReferences', it))).union(source.eAttributes->collect(it | thisModule.ReferenceToLink('eAttributes', it))).union(source.eAllContainments->collect(it | thisModule.ReferenceToLink('eAllContainments', it))).union(source.eAllOperations->collect(it | thisModule.ReferenceToLink('eAllOperations', it))).union(source.eAllStructuralFeatures->collect(it | thisModule.ReferenceToLink('eAllStructuralFeatures', it))).union(source.eAllSuperTypes->collect(it | thisModule.ReferenceToLink('eAllSuperTypes', it))).union(Set{source.eIDAttribute}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eIDAttribute', it)) ).union(source.eStructuralFeatures->collect(it | thisModule.ReferenceToLink('eStructuralFeatures', it))).union(source.eGenericSuperTypes->collect(it | thisModule.ReferenceToLink('eGenericSuperTypes', it))).union(source.eAllGenericSuperTypes->collect(it | thisModule.ReferenceToLink('eAllGenericSuperTypes', it))) - ) -} - -lazy rule DTecore__EInvocationTargetException2Prim { - from - attrName : String, - source : IN!"ecore::EInvocationTargetException" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EInvocationTargetException' - ) -} - -rule CLmltgg__TGG2Complex { - from - source : IN!"mltgg::TGG" in MM (source.oclIsTypeOf(IN!"mltgg::TGG")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::TGG', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).including(thisModule.DTecore__EString2Prim('tggID', source.tggID)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(source.ruleGroups->collect(it | thisModule.ReferenceToLink('ruleGroups', it))) - ) -} - -lazy rule DTmltgg__LinkPositionConstraintEnum2Prim { - from - attrName : String, - source : IN!"mltgg::LinkPositionConstraintEnum" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'mltgg::LinkPositionConstraintEnum' - ) -} - -rule CLecore__ENamedElement2Complex { - from - source : IN!"ecore::ENamedElement" in MM (source.oclIsTypeOf(IN!"ecore::ENamedElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::ENamedElement', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))) - ) -} - -rule CLmltgg__RuleParameter2Complex { - from - source : IN!"mltgg::RuleParameter" in MM (source.oclIsTypeOf(IN!"mltgg::RuleParameter")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'mltgg::RuleParameter', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('description', source.description)).including(thisModule.DTecore__EString2Prim('displayName', source.displayName)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.type}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('type', it)) ).union(Set{source.forwardCalculationExpression}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('forwardCalculationExpression', it)) ).union(Set{source.backwardCalculationExpression}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('backwardCalculationExpression', it)) ).union(Set{source.rule}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('rule', it)) ) - ) -} - -rule CLmltgg__LeftModelDomain2Complex { - from - source : IN!"mltgg::LeftModelDomain" in MM (source.oclIsTypeOf(IN!"mltgg::LeftModelDomain")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::LeftModelDomain', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(source.modelObjects->collect(it | thisModule.ReferenceToLink('modelObjects', it))).union(source.modelLinks->collect(it | thisModule.ReferenceToLink('modelLinks', it))).union(Set{source.rule}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('rule', it)) ) - ) -} - -lazy rule DTecore__EByte2Prim { - from - attrName : String, - source : IN!"ecore::EByte" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EByte' - ) -} - -rule CLmltgg__CorrespondenceLink2Complex { - from - source : IN!"mltgg::CorrespondenceLink" in MM (source.oclIsTypeOf(IN!"mltgg::CorrespondenceLink")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::CorrespondenceLink', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))).union(Set{source.source}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('source', it)) ).union(Set{source.target}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('target', it)) ).union(Set{source.correspondenceDomain}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('correspondenceDomain', it)) ) - ) -} - -lazy rule DTecore__EResourceSet2Prim { - from - attrName : String, - source : IN!"ecore::EResourceSet" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EResourceSet' - ) -} - -rule CLecore__EReference2Complex { - from - source : IN!"ecore::EReference" in MM (source.oclIsTypeOf(IN!"ecore::EReference")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EReference', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).including(thisModule.DTecore__EBoolean2Prim('changeable', source.changeable)).including(thisModule.DTecore__EBoolean2Prim('volatile', source.volatile)).including(thisModule.DTecore__EBoolean2Prim('transient', source.transient)).including(thisModule.DTecore__EString2Prim('defaultValueLiteral', source.defaultValueLiteral)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EBoolean2Prim('unsettable', source.unsettable)).including(thisModule.DTecore__EBoolean2Prim('derived', source.derived)).including(thisModule.DTecore__EBoolean2Prim('containment', source.containment)).including(thisModule.DTecore__EBoolean2Prim('container', source.container)).including(thisModule.DTecore__EBoolean2Prim('resolveProxies', source.resolveProxies)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ).union(Set{source.eContainingClass}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eContainingClass', it)) ).union(Set{source.eOpposite}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eOpposite', it)) ).union(Set{source.eReferenceType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eReferenceType', it)) ).union(source.eKeys->collect(it | thisModule.ReferenceToLink('eKeys', it))) - ) -} - -rule CLmltgg__CorrespondenceElement2Complex { - from - source : IN!"mltgg::CorrespondenceElement" in MM (source.oclIsTypeOf(IN!"mltgg::CorrespondenceElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'mltgg::CorrespondenceElement', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('uuid', source.uuid)).including(thisModule.DTmltgg__TGGModifierEnum2Prim('modifier', source.modifier)).union(source.annotations->collect(it | thisModule.ReferenceToLink('annotations', it))) - ) -} - -lazy rule DTecore__EFeatureMapEntry2Prim { - from - attrName : String, - source : IN!"ecore::EFeatureMapEntry" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EFeatureMapEntry' - ) -} - -lazy rule DTecore__ETreeIterator2Prim { - from - attrName : String, - source : IN!"ecore::ETreeIterator" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::ETreeIterator' - ) -} - -rule CLecore__EFactory2Complex { - from - source : IN!"ecore::EFactory" in MM (source.oclIsTypeOf(IN!"ecore::EFactory")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EFactory', - primitives <- Set{}.union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.ePackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ePackage', it)) ) - ) -} - -rule CLecore__EAnnotation2Complex { - from - source : IN!"ecore::EAnnotation" in MM (source.oclIsTypeOf(IN!"ecore::EAnnotation")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EAnnotation', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('source', source.source)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(source.details->collect(it | thisModule.ReferenceToLink('details', it))).union(Set{source.eModelElement}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eModelElement', it)) ).union(source.contents->collect(it | thisModule.ReferenceToLink('contents', it))).union(source.references->collect(it | thisModule.ReferenceToLink('references', it))) - ) -} - -lazy rule DTecore__EString2Prim { - from - attrName : String, - source : IN!"ecore::EString" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EString' - ) -} - -rule CLecore__EClassifier2Complex { - from - source : IN!"ecore::EClassifier" in MM (source.oclIsTypeOf(IN!"ecore::EClassifier")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::EClassifier', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EString2Prim('instanceClassName', source.instanceClassName)).including(thisModule.DTecore__EJavaClass2Prim('instanceClass', source.instanceClass)).including(thisModule.DTecore__EJavaObject2Prim('defaultValue', source.defaultValue)).including(thisModule.DTecore__EString2Prim('instanceTypeName', source.instanceTypeName)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.ePackage}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('ePackage', it)) ).union(source.eTypeParameters->collect(it | thisModule.ReferenceToLink('eTypeParameters', it))) - ) -} - -lazy rule DTecore__EByteArray2Prim { - from - attrName : String, - source : IN!"ecore::EByteArray" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EByteArray' - ) -} - -lazy rule DTecore__EDoubleObject2Prim { - from - attrName : String, - source : IN!"ecore::EDoubleObject" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EDoubleObject' - ) -} - -lazy rule DTecore__EMap2Prim { - from - attrName : String, - source : IN!"ecore::EMap" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EMap' - ) -} - -rule CLecore__EStringToStringMapEntry2Complex { - from - source : IN!"ecore::EStringToStringMapEntry" in MM (source.oclIsTypeOf(IN!"ecore::EStringToStringMapEntry")) - to - prim : OUT!Complex ( - reference <- source, - name <- 'NoName', - className <- 'ecore::EStringToStringMapEntry', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('key', source.key)).including(thisModule.DTecore__EString2Prim('value', source.value)) - ) -} - -lazy rule DTecore__EBoolean2Prim { - from - attrName : String, - source : IN!"ecore::EBoolean" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EBoolean' - ) -} - -rule CLecore__ETypedElement2Complex { - from - source : IN!"ecore::ETypedElement" in MM (source.oclIsTypeOf(IN!"ecore::ETypedElement")) - to - prim : OUT!Complex ( - reference <- source, - name <- source.name, - className <- 'ecore::ETypedElement', - primitives <- Set{}.including(thisModule.DTecore__EString2Prim('name', source.name)).including(thisModule.DTecore__EBoolean2Prim('ordered', source.ordered)).including(thisModule.DTecore__EBoolean2Prim('unique', source.unique)).including(thisModule.DTecore__EInt2Prim('lowerBound', source.lowerBound)).including(thisModule.DTecore__EInt2Prim('upperBound', source.upperBound)).including(thisModule.DTecore__EBoolean2Prim('many', source.many)).including(thisModule.DTecore__EBoolean2Prim('required', source.required)).union(source.eAnnotations->collect(it | thisModule.ReferenceToLink('eAnnotations', it))).union(Set{source.eType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eType', it)) ).union(Set{source.eGenericType}->select( e | not e.oclIsUndefined())->collect(it | thisModule.ReferenceToLink('eGenericType', it)) ) - ) -} - -lazy rule DTecore__EEList2Prim { - from - attrName : String, - source : IN!"ecore::EEList" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EEList' - ) -} - -lazy rule DTecore__EDate2Prim { - from - attrName : String, - source : IN!"ecore::EDate" in MM - to - prim : OUT!Primitive ( - name <- attrName, - className <- 'ecore::EDate' - ) -} diff --git a/fr.tpt.mem4csd.loss.mm2loss/transformations/tgg2loss.atl b/fr.tpt.mem4csd.loss.mm2loss/transformations/tgg2loss.atl new file mode 100644 index 0000000..46f3d4a --- /dev/null +++ b/fr.tpt.mem4csd.loss.mm2loss/transformations/tgg2loss.atl @@ -0,0 +1,80 @@ +module TGG2loss; + +-- LOSST: Loss Transformation +-- TGG: mltgg +create OUT : LOSS from IN : TGG; + +helper context LOSS!EClassifier def : qualifiedName : String = + self.ePackage.qualifiedName + '::' + self.name; + +helper context LOSS!EPackage def : qualifiedName : String = + if self.eSuperPackage.oclIsUndefined() + then self.name + else self.eSuperPackage.qualifiedName + '::' + self.name + endif; + +rule TGGRuleToLossRule { +from + s : TGG!TGGRule in IN +to + t : LOSS!Rule in OUT ( + name <- s.ruleGroup.name + '-' + s.ruleID, + leftModel <- s.leftModelDomain.modelObjects, + rightModel <- s.rightModelDomain.modelObjects, + transformations <- s.correspondenceDomain.correspondenceNodes + ) +} + +rule ModelObjectToLossElement { +from + s : TGG!ModelObject in IN +to + t : LOSS!Complex in OUT ( + -- TODO Attributes + -- TODO outgoingLinks + name <- s.name, + primitives <- s.outgoingLinks, + objectType <- s.type, + className <- s.type.qualifiedName + ) +} + +rule ModelLinkToLossCorrLink { +from + s : TGG!ModelLink in IN +to + t : LOSS!Link in OUT ( + -- TODO Attributes + -- TODO outgoingLinks + name <- s.toString(), + feature <- s.feature, + referenceTo <- s.target + ) +} + +helper context TGG!ModelLink def : isRightElement() : Boolean = + self.modelDomain.oclIsKindOf(TGG!RightModelDomain); + +helper context TGG!ModelObject def : isRightElement() : Boolean = + self.modelDomain.oclIsKindOf(TGG!RightModelDomain); + +helper context TGG!ModelLink def : isLeftElement() : Boolean = + self.modelDomain.oclIsKindOf(TGG!LeftModelDomain); + +helper context TGG!ModelObject def : isLeftElement() : Boolean = + self.modelDomain.oclIsKindOf(TGG!LeftModelDomain); + +rule CorrespondenceNodeToLossCorr { +from + s : TGG!CorrespondenceNode in IN +using { + links : Set(TGG!CorrespondenceLink) = s.outgoingLinks->collect(e | e.target); + assertion : OclAny = links->collect(it | it.isLeftElement() or it.isRightElement() or 1.0/0.0); -- validation. +} +to + t : LOSS!CorrNode in OUT ( + name <- s.toString(), + leftLinks <- links->select(it | it.isLeftElement()), + rightLinks <- links->select(it | it.isRightElement()) + ) +} diff --git a/fr.tpt.mem4csd.loss/.classpath b/fr.tpt.mem4csd.loss/.classpath index c3f9cf3..1a82131 100644 --- a/fr.tpt.mem4csd.loss/.classpath +++ b/fr.tpt.mem4csd.loss/.classpath @@ -1,6 +1,5 @@ - diff --git a/fr.tpt.mem4csd.loss/META-INF/MANIFEST.MF b/fr.tpt.mem4csd.loss/META-INF/MANIFEST.MF index 2707fc9..5a2ac77 100644 --- a/fr.tpt.mem4csd.loss/META-INF/MANIFEST.MF +++ b/fr.tpt.mem4csd.loss/META-INF/MANIFEST.MF @@ -10,7 +10,11 @@ Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-17 Export-Package: fr.tpt.mem4csd.loss, fr.tpt.mem4csd.loss.impl, - fr.tpt.mem4csd.loss.util + fr.tpt.mem4csd.loss.util, + fr.tpt.mem4csd.lossTransform, + fr.tpt.mem4csd.lossTransform.impl, + fr.tpt.mem4csd.lossTransform.util Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport, + fr.tpt.mem4csd.loss;visibility:=reexport, org.eclipse.core.runtime Bundle-ActivationPolicy: lazy diff --git a/fr.tpt.mem4csd.loss/build.properties b/fr.tpt.mem4csd.loss/build.properties index 697ca96..c9417dd 100644 --- a/fr.tpt.mem4csd.loss/build.properties +++ b/fr.tpt.mem4csd.loss/build.properties @@ -4,7 +4,8 @@ bin.includes = .,\ model/,\ META-INF/,\ plugin.xml,\ - plugin.properties + plugin.properties,\ + src/ jars.compile.order = . -source.. = src-gen/ +source.. = src/ output.. = bin/ diff --git a/fr.tpt.mem4csd.loss/model/loss.ecore b/fr.tpt.mem4csd.loss/model/loss.ecore index a9705e0..2cd004f 100644 --- a/fr.tpt.mem4csd.loss/model/loss.ecore +++ b/fr.tpt.mem4csd.loss/model/loss.ecore @@ -1,23 +1,32 @@ - + - - + + - + + eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"/> + + + + + diff --git a/fr.tpt.mem4csd.loss/model/loss.genmodel b/fr.tpt.mem4csd.loss/model/loss.genmodel index 183fd8e..2a1f71d 100644 --- a/fr.tpt.mem4csd.loss/model/loss.genmodel +++ b/fr.tpt.mem4csd.loss/model/loss.genmodel @@ -1,11 +1,12 @@ + copyrightFields="false" usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore" + operationReflection="true" importOrganizing="true"> loss.ecore + @@ -23,6 +25,11 @@ + + + + + diff --git a/fr.tpt.mem4csd.loss/model/lossTransform.ecore b/fr.tpt.mem4csd.loss/model/lossTransform.ecore new file mode 100644 index 0000000..eb0cbbb --- /dev/null +++ b/fr.tpt.mem4csd.loss/model/lossTransform.ecore @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/fr.tpt.mem4csd.loss/model/lossTransform.genmodel b/fr.tpt.mem4csd.loss/model/lossTransform.genmodel new file mode 100644 index 0000000..c24850a --- /dev/null +++ b/fr.tpt.mem4csd.loss/model/lossTransform.genmodel @@ -0,0 +1,26 @@ + + + lossTransform.ecore + + + + + + + + + + + + + diff --git a/fr.tpt.mem4csd.loss/plugin.xml b/fr.tpt.mem4csd.loss/plugin.xml index 7ca4d59..a9097d7 100644 --- a/fr.tpt.mem4csd.loss/plugin.xml +++ b/fr.tpt.mem4csd.loss/plugin.xml @@ -14,4 +14,12 @@ genModel="model/loss.genmodel"/> + + + + + diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Complex.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Complex.java similarity index 66% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Complex.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Complex.java index 89154f6..eb24797 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Complex.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Complex.java @@ -3,6 +3,7 @@ package fr.tpt.mem4csd.loss; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; /** @@ -16,13 +17,14 @@ import org.eclipse.emf.ecore.EObject; *
    *
  • {@link fr.tpt.mem4csd.loss.Complex#getPrimitives Primitives}
  • *
  • {@link fr.tpt.mem4csd.loss.Complex#getReference Reference}
  • + *
  • {@link fr.tpt.mem4csd.loss.Complex#getObjectType Object Type}
  • *
* * @see fr.tpt.mem4csd.loss.LossPackage#getComplex() * @model * @generated */ -public interface Complex extends NamedObject { +public interface Complex extends ModelElement { /** * Returns the value of the 'Primitives' containment reference list. * The list contents are of type {@link fr.tpt.mem4csd.loss.Primitive}. @@ -57,4 +59,26 @@ public interface Complex extends NamedObject { */ void setReference(EObject value); + /** + * Returns the value of the 'Object Type' reference. + * + * + * @return the value of the 'Object Type' reference. + * @see #setObjectType(EClass) + * @see fr.tpt.mem4csd.loss.LossPackage#getComplex_ObjectType() + * @model required="true" + * @generated + */ + EClass getObjectType(); + + /** + * Sets the value of the '{@link fr.tpt.mem4csd.loss.Complex#getObjectType Object Type}' reference. + * + * + * @param value the new value of the 'Object Type' reference. + * @see #getObjectType() + * @generated + */ + void setObjectType(EClass value); + } // Complex diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Link.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Link.java similarity index 100% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Link.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Link.java diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossFactory.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossFactory.java similarity index 86% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossFactory.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossFactory.java index b62cca4..a321bd8 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossFactory.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossFactory.java @@ -48,6 +48,15 @@ public interface LossFactory extends EFactory { */ Complex createComplex(); + /** + * Returns a new object of class 'Model'. + * + * + * @return a new object of class 'Model'. + * @generated + */ + LossModel createLossModel(); + /** * Returns the package supported by this factory. * diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossModel.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossModel.java new file mode 100644 index 0000000..cf0e124 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossModel.java @@ -0,0 +1,38 @@ +/** + */ +package fr.tpt.mem4csd.loss; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Model'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.loss.LossModel#getElements Elements}
  • + *
+ * + * @see fr.tpt.mem4csd.loss.LossPackage#getLossModel() + * @model + * @generated + */ +public interface LossModel extends EObject { + /** + * Returns the value of the 'Elements' reference list. + * The list contents are of type {@link fr.tpt.mem4csd.loss.ModelElement}. + * + * + * @return the value of the 'Elements' reference list. + * @see fr.tpt.mem4csd.loss.LossPackage#getLossModel_Elements() + * @model + * @generated + */ + EList getElements(); + +} // LossModel diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossPackage.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossPackage.java similarity index 67% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossPackage.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossPackage.java index 90522c4..17a75e5 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/LossPackage.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/LossPackage.java @@ -238,6 +238,187 @@ public interface LossPackage extends EPackage { */ int NAMED_OBJECT_OPERATION_COUNT = EcorePackage.EOBJECT_OPERATION_COUNT + 0; + /** + * The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.ModelElementImpl Model Element}' class. + * + * + * @see fr.tpt.mem4csd.loss.impl.ModelElementImpl + * @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getModelElement() + * @generated + */ + int MODEL_ELEMENT = 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT__NAME = NAMED_OBJECT__NAME; + + /** + * The feature id for the 'Class Name' attribute. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT__CLASS_NAME = NAMED_OBJECT__CLASS_NAME; + + /** + * The number of structural features of the 'Model Element' class. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT_FEATURE_COUNT = NAMED_OBJECT_FEATURE_COUNT + 0; + + /** + * The operation id for the 'EClass' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECLASS = NAMED_OBJECT___ECLASS; + + /** + * The operation id for the 'EIs Proxy' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EIS_PROXY = NAMED_OBJECT___EIS_PROXY; + + /** + * The operation id for the 'EResource' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ERESOURCE = NAMED_OBJECT___ERESOURCE; + + /** + * The operation id for the 'EContainer' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECONTAINER = NAMED_OBJECT___ECONTAINER; + + /** + * The operation id for the 'EContaining Feature' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECONTAINING_FEATURE = NAMED_OBJECT___ECONTAINING_FEATURE; + + /** + * The operation id for the 'EContainment Feature' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECONTAINMENT_FEATURE = NAMED_OBJECT___ECONTAINMENT_FEATURE; + + /** + * The operation id for the 'EContents' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECONTENTS = NAMED_OBJECT___ECONTENTS; + + /** + * The operation id for the 'EAll Contents' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EALL_CONTENTS = NAMED_OBJECT___EALL_CONTENTS; + + /** + * The operation id for the 'ECross References' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ECROSS_REFERENCES = NAMED_OBJECT___ECROSS_REFERENCES; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE_BOOLEAN = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE_BOOLEAN; + + /** + * The operation id for the 'ESet' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___ESET__ESTRUCTURALFEATURE_OBJECT = NAMED_OBJECT___ESET__ESTRUCTURALFEATURE_OBJECT; + + /** + * The operation id for the 'EIs Set' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EIS_SET__ESTRUCTURALFEATURE = NAMED_OBJECT___EIS_SET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EUnset' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EUNSET__ESTRUCTURALFEATURE = NAMED_OBJECT___EUNSET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EInvoke' operation. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT___EINVOKE__EOPERATION_ELIST = NAMED_OBJECT___EINVOKE__EOPERATION_ELIST; + + /** + * The number of operations of the 'Model Element' class. + * + * + * @generated + * @ordered + */ + int MODEL_ELEMENT_OPERATION_COUNT = NAMED_OBJECT_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl Primitive}' class. * @@ -255,7 +436,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE__NAME = NAMED_OBJECT__NAME; + int PRIMITIVE__NAME = MODEL_ELEMENT__NAME; /** * The feature id for the 'Class Name' attribute. @@ -264,7 +445,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE__CLASS_NAME = NAMED_OBJECT__CLASS_NAME; + int PRIMITIVE__CLASS_NAME = MODEL_ELEMENT__CLASS_NAME; /** * The feature id for the 'Type' containment reference. @@ -273,7 +454,16 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE__TYPE = NAMED_OBJECT_FEATURE_COUNT + 0; + int PRIMITIVE__TYPE = MODEL_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int PRIMITIVE__FEATURE = MODEL_ELEMENT_FEATURE_COUNT + 1; /** * The number of structural features of the 'Primitive' class. @@ -282,7 +472,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE_FEATURE_COUNT = NAMED_OBJECT_FEATURE_COUNT + 1; + int PRIMITIVE_FEATURE_COUNT = MODEL_ELEMENT_FEATURE_COUNT + 2; /** * The operation id for the 'EClass' operation. @@ -291,7 +481,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECLASS = NAMED_OBJECT___ECLASS; + int PRIMITIVE___ECLASS = MODEL_ELEMENT___ECLASS; /** * The operation id for the 'EIs Proxy' operation. @@ -300,7 +490,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EIS_PROXY = NAMED_OBJECT___EIS_PROXY; + int PRIMITIVE___EIS_PROXY = MODEL_ELEMENT___EIS_PROXY; /** * The operation id for the 'EResource' operation. @@ -309,7 +499,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ERESOURCE = NAMED_OBJECT___ERESOURCE; + int PRIMITIVE___ERESOURCE = MODEL_ELEMENT___ERESOURCE; /** * The operation id for the 'EContainer' operation. @@ -318,7 +508,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECONTAINER = NAMED_OBJECT___ECONTAINER; + int PRIMITIVE___ECONTAINER = MODEL_ELEMENT___ECONTAINER; /** * The operation id for the 'EContaining Feature' operation. @@ -327,7 +517,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECONTAINING_FEATURE = NAMED_OBJECT___ECONTAINING_FEATURE; + int PRIMITIVE___ECONTAINING_FEATURE = MODEL_ELEMENT___ECONTAINING_FEATURE; /** * The operation id for the 'EContainment Feature' operation. @@ -336,7 +526,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECONTAINMENT_FEATURE = NAMED_OBJECT___ECONTAINMENT_FEATURE; + int PRIMITIVE___ECONTAINMENT_FEATURE = MODEL_ELEMENT___ECONTAINMENT_FEATURE; /** * The operation id for the 'EContents' operation. @@ -345,7 +535,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECONTENTS = NAMED_OBJECT___ECONTENTS; + int PRIMITIVE___ECONTENTS = MODEL_ELEMENT___ECONTENTS; /** * The operation id for the 'EAll Contents' operation. @@ -354,7 +544,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EALL_CONTENTS = NAMED_OBJECT___EALL_CONTENTS; + int PRIMITIVE___EALL_CONTENTS = MODEL_ELEMENT___EALL_CONTENTS; /** * The operation id for the 'ECross References' operation. @@ -363,7 +553,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ECROSS_REFERENCES = NAMED_OBJECT___ECROSS_REFERENCES; + int PRIMITIVE___ECROSS_REFERENCES = MODEL_ELEMENT___ECROSS_REFERENCES; /** * The operation id for the 'EGet' operation. @@ -372,7 +562,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EGET__ESTRUCTURALFEATURE = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE; + int PRIMITIVE___EGET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE; /** * The operation id for the 'EGet' operation. @@ -381,7 +571,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EGET__ESTRUCTURALFEATURE_BOOLEAN = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE_BOOLEAN; + int PRIMITIVE___EGET__ESTRUCTURALFEATURE_BOOLEAN = MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE_BOOLEAN; /** * The operation id for the 'ESet' operation. @@ -390,7 +580,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___ESET__ESTRUCTURALFEATURE_OBJECT = NAMED_OBJECT___ESET__ESTRUCTURALFEATURE_OBJECT; + int PRIMITIVE___ESET__ESTRUCTURALFEATURE_OBJECT = MODEL_ELEMENT___ESET__ESTRUCTURALFEATURE_OBJECT; /** * The operation id for the 'EIs Set' operation. @@ -399,7 +589,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EIS_SET__ESTRUCTURALFEATURE = NAMED_OBJECT___EIS_SET__ESTRUCTURALFEATURE; + int PRIMITIVE___EIS_SET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EIS_SET__ESTRUCTURALFEATURE; /** * The operation id for the 'EUnset' operation. @@ -408,7 +598,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EUNSET__ESTRUCTURALFEATURE = NAMED_OBJECT___EUNSET__ESTRUCTURALFEATURE; + int PRIMITIVE___EUNSET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EUNSET__ESTRUCTURALFEATURE; /** * The operation id for the 'EInvoke' operation. @@ -417,7 +607,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE___EINVOKE__EOPERATION_ELIST = NAMED_OBJECT___EINVOKE__EOPERATION_ELIST; + int PRIMITIVE___EINVOKE__EOPERATION_ELIST = MODEL_ELEMENT___EINVOKE__EOPERATION_ELIST; /** * The number of operations of the 'Primitive' class. @@ -426,7 +616,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int PRIMITIVE_OPERATION_COUNT = NAMED_OBJECT_OPERATION_COUNT + 0; + int PRIMITIVE_OPERATION_COUNT = MODEL_ELEMENT_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.LinkImpl Link}' class. @@ -465,6 +655,15 @@ public interface LossPackage extends EPackage { */ int LINK__TYPE = PRIMITIVE__TYPE; + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int LINK__FEATURE = PRIMITIVE__FEATURE; + /** * The feature id for the 'Reference To' reference. * @@ -644,7 +843,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX__NAME = NAMED_OBJECT__NAME; + int COMPLEX__NAME = MODEL_ELEMENT__NAME; /** * The feature id for the 'Class Name' attribute. @@ -653,7 +852,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX__CLASS_NAME = NAMED_OBJECT__CLASS_NAME; + int COMPLEX__CLASS_NAME = MODEL_ELEMENT__CLASS_NAME; /** * The feature id for the 'Primitives' containment reference list. @@ -662,7 +861,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX__PRIMITIVES = NAMED_OBJECT_FEATURE_COUNT + 0; + int COMPLEX__PRIMITIVES = MODEL_ELEMENT_FEATURE_COUNT + 0; /** * The feature id for the 'Reference' reference. @@ -671,7 +870,16 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX__REFERENCE = NAMED_OBJECT_FEATURE_COUNT + 1; + int COMPLEX__REFERENCE = MODEL_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Object Type' reference. + * + * + * @generated + * @ordered + */ + int COMPLEX__OBJECT_TYPE = MODEL_ELEMENT_FEATURE_COUNT + 2; /** * The number of structural features of the 'Complex' class. @@ -680,7 +888,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX_FEATURE_COUNT = NAMED_OBJECT_FEATURE_COUNT + 2; + int COMPLEX_FEATURE_COUNT = MODEL_ELEMENT_FEATURE_COUNT + 3; /** * The operation id for the 'EClass' operation. @@ -689,7 +897,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECLASS = NAMED_OBJECT___ECLASS; + int COMPLEX___ECLASS = MODEL_ELEMENT___ECLASS; /** * The operation id for the 'EIs Proxy' operation. @@ -698,7 +906,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EIS_PROXY = NAMED_OBJECT___EIS_PROXY; + int COMPLEX___EIS_PROXY = MODEL_ELEMENT___EIS_PROXY; /** * The operation id for the 'EResource' operation. @@ -707,7 +915,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ERESOURCE = NAMED_OBJECT___ERESOURCE; + int COMPLEX___ERESOURCE = MODEL_ELEMENT___ERESOURCE; /** * The operation id for the 'EContainer' operation. @@ -716,7 +924,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECONTAINER = NAMED_OBJECT___ECONTAINER; + int COMPLEX___ECONTAINER = MODEL_ELEMENT___ECONTAINER; /** * The operation id for the 'EContaining Feature' operation. @@ -725,7 +933,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECONTAINING_FEATURE = NAMED_OBJECT___ECONTAINING_FEATURE; + int COMPLEX___ECONTAINING_FEATURE = MODEL_ELEMENT___ECONTAINING_FEATURE; /** * The operation id for the 'EContainment Feature' operation. @@ -734,7 +942,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECONTAINMENT_FEATURE = NAMED_OBJECT___ECONTAINMENT_FEATURE; + int COMPLEX___ECONTAINMENT_FEATURE = MODEL_ELEMENT___ECONTAINMENT_FEATURE; /** * The operation id for the 'EContents' operation. @@ -743,7 +951,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECONTENTS = NAMED_OBJECT___ECONTENTS; + int COMPLEX___ECONTENTS = MODEL_ELEMENT___ECONTENTS; /** * The operation id for the 'EAll Contents' operation. @@ -752,7 +960,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EALL_CONTENTS = NAMED_OBJECT___EALL_CONTENTS; + int COMPLEX___EALL_CONTENTS = MODEL_ELEMENT___EALL_CONTENTS; /** * The operation id for the 'ECross References' operation. @@ -761,7 +969,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ECROSS_REFERENCES = NAMED_OBJECT___ECROSS_REFERENCES; + int COMPLEX___ECROSS_REFERENCES = MODEL_ELEMENT___ECROSS_REFERENCES; /** * The operation id for the 'EGet' operation. @@ -770,7 +978,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EGET__ESTRUCTURALFEATURE = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE; + int COMPLEX___EGET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE; /** * The operation id for the 'EGet' operation. @@ -779,7 +987,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EGET__ESTRUCTURALFEATURE_BOOLEAN = NAMED_OBJECT___EGET__ESTRUCTURALFEATURE_BOOLEAN; + int COMPLEX___EGET__ESTRUCTURALFEATURE_BOOLEAN = MODEL_ELEMENT___EGET__ESTRUCTURALFEATURE_BOOLEAN; /** * The operation id for the 'ESet' operation. @@ -788,7 +996,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___ESET__ESTRUCTURALFEATURE_OBJECT = NAMED_OBJECT___ESET__ESTRUCTURALFEATURE_OBJECT; + int COMPLEX___ESET__ESTRUCTURALFEATURE_OBJECT = MODEL_ELEMENT___ESET__ESTRUCTURALFEATURE_OBJECT; /** * The operation id for the 'EIs Set' operation. @@ -797,7 +1005,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EIS_SET__ESTRUCTURALFEATURE = NAMED_OBJECT___EIS_SET__ESTRUCTURALFEATURE; + int COMPLEX___EIS_SET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EIS_SET__ESTRUCTURALFEATURE; /** * The operation id for the 'EUnset' operation. @@ -806,7 +1014,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EUNSET__ESTRUCTURALFEATURE = NAMED_OBJECT___EUNSET__ESTRUCTURALFEATURE; + int COMPLEX___EUNSET__ESTRUCTURALFEATURE = MODEL_ELEMENT___EUNSET__ESTRUCTURALFEATURE; /** * The operation id for the 'EInvoke' operation. @@ -815,7 +1023,7 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX___EINVOKE__EOPERATION_ELIST = NAMED_OBJECT___EINVOKE__EOPERATION_ELIST; + int COMPLEX___EINVOKE__EOPERATION_ELIST = MODEL_ELEMENT___EINVOKE__EOPERATION_ELIST; /** * The number of operations of the 'Complex' class. @@ -824,7 +1032,44 @@ public interface LossPackage extends EPackage { * @generated * @ordered */ - int COMPLEX_OPERATION_COUNT = NAMED_OBJECT_OPERATION_COUNT + 0; + int COMPLEX_OPERATION_COUNT = MODEL_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.LossModelImpl Model}' class. + * + * + * @see fr.tpt.mem4csd.loss.impl.LossModelImpl + * @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getLossModel() + * @generated + */ + int LOSS_MODEL = 5; + + /** + * The feature id for the 'Elements' reference list. + * + * + * @generated + * @ordered + */ + int LOSS_MODEL__ELEMENTS = 0; + + /** + * The number of structural features of the 'Model' class. + * + * + * @generated + * @ordered + */ + int LOSS_MODEL_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Model' class. + * + * + * @generated + * @ordered + */ + int LOSS_MODEL_OPERATION_COUNT = 0; /** * Returns the meta object for class '{@link fr.tpt.mem4csd.loss.NamedObject Named Object}'. @@ -879,6 +1124,17 @@ public interface LossPackage extends EPackage { */ EReference getPrimitive_Type(); + /** + * Returns the meta object for the reference '{@link fr.tpt.mem4csd.loss.Primitive#getFeature Feature}'. + * + * + * @return the meta object for the reference 'Feature'. + * @see fr.tpt.mem4csd.loss.Primitive#getFeature() + * @see #getPrimitive() + * @generated + */ + EReference getPrimitive_Feature(); + /** * Returns the meta object for class '{@link fr.tpt.mem4csd.loss.Link Link}'. * @@ -932,6 +1188,48 @@ public interface LossPackage extends EPackage { */ EReference getComplex_Reference(); + /** + * Returns the meta object for the reference '{@link fr.tpt.mem4csd.loss.Complex#getObjectType Object Type}'. + * + * + * @return the meta object for the reference 'Object Type'. + * @see fr.tpt.mem4csd.loss.Complex#getObjectType() + * @see #getComplex() + * @generated + */ + EReference getComplex_ObjectType(); + + /** + * Returns the meta object for class '{@link fr.tpt.mem4csd.loss.ModelElement Model Element}'. + * + * + * @return the meta object for class 'Model Element'. + * @see fr.tpt.mem4csd.loss.ModelElement + * @generated + */ + EClass getModelElement(); + + /** + * Returns the meta object for class '{@link fr.tpt.mem4csd.loss.LossModel Model}'. + * + * + * @return the meta object for class 'Model'. + * @see fr.tpt.mem4csd.loss.LossModel + * @generated + */ + EClass getLossModel(); + + /** + * Returns the meta object for the reference list '{@link fr.tpt.mem4csd.loss.LossModel#getElements Elements}'. + * + * + * @return the meta object for the reference list 'Elements'. + * @see fr.tpt.mem4csd.loss.LossModel#getElements() + * @see #getLossModel() + * @generated + */ + EReference getLossModel_Elements(); + /** * Returns the factory that creates the instances of the model. * @@ -999,6 +1297,14 @@ public interface LossPackage extends EPackage { */ EReference PRIMITIVE__TYPE = eINSTANCE.getPrimitive_Type(); + /** + * The meta object literal for the 'Feature' reference feature. + * + * + * @generated + */ + EReference PRIMITIVE__FEATURE = eINSTANCE.getPrimitive_Feature(); + /** * The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.LinkImpl Link}' class. * @@ -1043,6 +1349,42 @@ public interface LossPackage extends EPackage { */ EReference COMPLEX__REFERENCE = eINSTANCE.getComplex_Reference(); + /** + * The meta object literal for the 'Object Type' reference feature. + * + * + * @generated + */ + EReference COMPLEX__OBJECT_TYPE = eINSTANCE.getComplex_ObjectType(); + + /** + * The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.ModelElementImpl Model Element}' class. + * + * + * @see fr.tpt.mem4csd.loss.impl.ModelElementImpl + * @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getModelElement() + * @generated + */ + EClass MODEL_ELEMENT = eINSTANCE.getModelElement(); + + /** + * The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.LossModelImpl Model}' class. + * + * + * @see fr.tpt.mem4csd.loss.impl.LossModelImpl + * @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getLossModel() + * @generated + */ + EClass LOSS_MODEL = eINSTANCE.getLossModel(); + + /** + * The meta object literal for the 'Elements' reference list feature. + * + * + * @generated + */ + EReference LOSS_MODEL__ELEMENTS = eINSTANCE.getLossModel_Elements(); + } } //LossPackage diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/ModelElement.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/ModelElement.java new file mode 100644 index 0000000..5131fb3 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/ModelElement.java @@ -0,0 +1,16 @@ +/** + */ +package fr.tpt.mem4csd.loss; + +/** + * + * A representation of the model object 'Model Element'. + * + * + * + * @see fr.tpt.mem4csd.loss.LossPackage#getModelElement() + * @model abstract="true" + * @generated + */ +public interface ModelElement extends NamedObject { +} // ModelElement diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/NamedObject.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/NamedObject.java similarity index 100% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/NamedObject.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/NamedObject.java diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Primitive.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Primitive.java similarity index 56% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Primitive.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Primitive.java index df181da..c686a21 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/Primitive.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/Primitive.java @@ -3,6 +3,7 @@ package fr.tpt.mem4csd.loss; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; /** * @@ -14,13 +15,14 @@ import org.eclipse.emf.ecore.EObject; *

*
    *
  • {@link fr.tpt.mem4csd.loss.Primitive#getType Type}
  • + *
  • {@link fr.tpt.mem4csd.loss.Primitive#getFeature Feature}
  • *
* * @see fr.tpt.mem4csd.loss.LossPackage#getPrimitive() * @model * @generated */ -public interface Primitive extends NamedObject { +public interface Primitive extends ModelElement { /** * Returns the value of the 'Type' containment reference. * @@ -43,4 +45,26 @@ public interface Primitive extends NamedObject { */ void setType(EObject value); + /** + * Returns the value of the 'Feature' reference. + * + * + * @return the value of the 'Feature' reference. + * @see #setFeature(EStructuralFeature) + * @see fr.tpt.mem4csd.loss.LossPackage#getPrimitive_Feature() + * @model required="true" + * @generated + */ + EStructuralFeature getFeature(); + + /** + * Sets the value of the '{@link fr.tpt.mem4csd.loss.Primitive#getFeature Feature}' reference. + * + * + * @param value the new value of the 'Feature' reference. + * @see #getFeature() + * @generated + */ + void setFeature(EStructuralFeature value); + } // Primitive diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/ComplexImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ComplexImpl.java similarity index 74% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/ComplexImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ComplexImpl.java index 4bd9b3d..de91b9a 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/ComplexImpl.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ComplexImpl.java @@ -31,11 +31,12 @@ import org.eclipse.emf.ecore.util.InternalEList; *
    *
  • {@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getPrimitives Primitives}
  • *
  • {@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getReference Reference}
  • + *
  • {@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getObjectType Object Type}
  • *
* * @generated */ -public class ComplexImpl extends NamedObjectImpl implements Complex { +public class ComplexImpl extends ModelElementImpl implements Complex { /** * The cached value of the '{@link #getPrimitives() Primitives}' containment reference list. * @@ -56,6 +57,16 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { */ protected EObject reference; + /** + * The cached value of the '{@link #getObjectType() Object Type}' reference. + * + * + * @see #getObjectType() + * @generated + * @ordered + */ + protected EClass objectType; + /** * * @@ -130,6 +141,48 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { reference)); } + /** + * + * + * @generated + */ + @Override + public EClass getObjectType() { + if (objectType != null && objectType.eIsProxy()) { + InternalEObject oldObjectType = (InternalEObject) objectType; + objectType = (EClass) eResolveProxy(oldObjectType); + if (objectType != oldObjectType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, LossPackage.COMPLEX__OBJECT_TYPE, + oldObjectType, objectType)); + } + } + return objectType; + } + + /** + * + * + * @generated + */ + public EClass basicGetObjectType() { + return objectType; + } + + /** + * + * + * @generated + */ + @Override + public void setObjectType(EClass newObjectType) { + EClass oldObjectType = objectType; + objectType = newObjectType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.COMPLEX__OBJECT_TYPE, oldObjectType, + objectType)); + } + /** * * @@ -158,6 +211,10 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { if (resolve) return getReference(); return basicGetReference(); + case LossPackage.COMPLEX__OBJECT_TYPE: + if (resolve) + return getObjectType(); + return basicGetObjectType(); } return super.eGet(featureID, resolve, coreType); } @@ -178,6 +235,9 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { case LossPackage.COMPLEX__REFERENCE: setReference((EObject) newValue); return; + case LossPackage.COMPLEX__OBJECT_TYPE: + setObjectType((EClass) newValue); + return; } super.eSet(featureID, newValue); } @@ -196,6 +256,9 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { case LossPackage.COMPLEX__REFERENCE: setReference((EObject) null); return; + case LossPackage.COMPLEX__OBJECT_TYPE: + setObjectType((EClass) null); + return; } super.eUnset(featureID); } @@ -212,6 +275,8 @@ public class ComplexImpl extends NamedObjectImpl implements Complex { return primitives != null && !primitives.isEmpty(); case LossPackage.COMPLEX__REFERENCE: return reference != null; + case LossPackage.COMPLEX__OBJECT_TYPE: + return objectType != null; } return super.eIsSet(featureID); } diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LinkImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LinkImpl.java similarity index 100% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LinkImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LinkImpl.java diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java similarity index 90% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java index 008bc3b..ee512f9 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossFactoryImpl.java @@ -61,6 +61,8 @@ public class LossFactoryImpl extends EFactoryImpl implements LossFactory { return createLink(); case LossPackage.COMPLEX: return createComplex(); + case LossPackage.LOSS_MODEL: + return createLossModel(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -99,6 +101,17 @@ public class LossFactoryImpl extends EFactoryImpl implements LossFactory { return complex; } + /** + * + * + * @generated + */ + @Override + public LossModel createLossModel() { + LossModelImpl lossModel = new LossModelImpl(); + return lossModel; + } + /** * * diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossModelImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossModelImpl.java new file mode 100644 index 0000000..da62bd4 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossModelImpl.java @@ -0,0 +1,136 @@ +/** + */ +package fr.tpt.mem4csd.loss.impl; + +import fr.tpt.mem4csd.loss.LossModel; +import fr.tpt.mem4csd.loss.LossPackage; +import fr.tpt.mem4csd.loss.ModelElement; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Model'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.loss.impl.LossModelImpl#getElements Elements}
  • + *
+ * + * @generated + */ +public class LossModelImpl extends MinimalEObjectImpl.Container implements LossModel { + /** + * The cached value of the '{@link #getElements() Elements}' reference list. + * + * + * @see #getElements() + * @generated + * @ordered + */ + protected EList elements; + + /** + * + * + * @generated + */ + protected LossModelImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LossPackage.Literals.LOSS_MODEL; + } + + /** + * + * + * @generated + */ + @Override + public EList getElements() { + if (elements == null) { + elements = new EObjectResolvingEList(ModelElement.class, this, + LossPackage.LOSS_MODEL__ELEMENTS); + } + return elements; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case LossPackage.LOSS_MODEL__ELEMENTS: + return getElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case LossPackage.LOSS_MODEL__ELEMENTS: + getElements().clear(); + getElements().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case LossPackage.LOSS_MODEL__ELEMENTS: + getElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case LossPackage.LOSS_MODEL__ELEMENTS: + return elements != null && !elements.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //LossModelImpl diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java similarity index 72% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java index 49b2f28..360f8c6 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/LossPackageImpl.java @@ -5,7 +5,9 @@ package fr.tpt.mem4csd.loss.impl; import fr.tpt.mem4csd.loss.Complex; import fr.tpt.mem4csd.loss.Link; import fr.tpt.mem4csd.loss.LossFactory; +import fr.tpt.mem4csd.loss.LossModel; import fr.tpt.mem4csd.loss.LossPackage; +import fr.tpt.mem4csd.loss.ModelElement; import fr.tpt.mem4csd.loss.NamedObject; import fr.tpt.mem4csd.loss.Primitive; import org.eclipse.emf.ecore.EAttribute; @@ -13,6 +15,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; /** @@ -50,6 +53,20 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { */ private EClass complexEClass = null; + /** + * + * + * @generated + */ + private EClass modelElementEClass = null; + + /** + * + * + * @generated + */ + private EClass lossModelEClass = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -100,6 +117,9 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { isInited = true; + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + // Create package meta-data objects theLossPackage.createPackageContents(); @@ -164,6 +184,16 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { return (EReference) primitiveEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + @Override + public EReference getPrimitive_Feature() { + return (EReference) primitiveEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -214,6 +244,46 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { return (EReference) complexEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EReference getComplex_ObjectType() { + return (EReference) complexEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getModelElement() { + return modelElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getLossModel() { + return lossModelEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getLossModel_Elements() { + return (EReference) lossModelEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -250,6 +320,7 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { primitiveEClass = createEClass(PRIMITIVE); createEReference(primitiveEClass, PRIMITIVE__TYPE); + createEReference(primitiveEClass, PRIMITIVE__FEATURE); linkEClass = createEClass(LINK); createEReference(linkEClass, LINK__REFERENCE_TO); @@ -257,6 +328,12 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { complexEClass = createEClass(COMPLEX); createEReference(complexEClass, COMPLEX__PRIMITIVES); createEReference(complexEClass, COMPLEX__REFERENCE); + createEReference(complexEClass, COMPLEX__OBJECT_TYPE); + + modelElementEClass = createEClass(MODEL_ELEMENT); + + lossModelEClass = createEClass(LOSS_MODEL); + createEReference(lossModelEClass, LOSS_MODEL__ELEMENTS); } /** @@ -283,15 +360,19 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); + // Obtain other dependent packages + EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); + // Create type parameters // Set bounds for type parameters // Add supertypes to classes - namedObjectEClass.getESuperTypes().add(ecorePackage.getEObject()); - primitiveEClass.getESuperTypes().add(this.getNamedObject()); + namedObjectEClass.getESuperTypes().add(theEcorePackage.getEObject()); + primitiveEClass.getESuperTypes().add(this.getModelElement()); linkEClass.getESuperTypes().add(this.getPrimitive()); - complexEClass.getESuperTypes().add(this.getNamedObject()); + complexEClass.getESuperTypes().add(this.getModelElement()); + modelElementEClass.getESuperTypes().add(this.getNamedObject()); // Initialize classes, features, and operations; add parameters initEClass(namedObjectEClass, NamedObject.class, "NamedObject", IS_ABSTRACT, !IS_INTERFACE, @@ -304,9 +385,12 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { initEClass(primitiveEClass, Primitive.class, "Primitive", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPrimitive_Type(), ecorePackage.getEObject(), null, "type", null, 1, 1, Primitive.class, + initEReference(getPrimitive_Type(), theEcorePackage.getEObject(), null, "type", null, 1, 1, Primitive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPrimitive_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 1, 1, + Primitive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(linkEClass, Link.class, "Link", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLink_ReferenceTo(), this.getComplex(), null, "referenceTo", null, 1, 1, Link.class, @@ -317,7 +401,19 @@ public class LossPackageImpl extends EPackageImpl implements LossPackage { initEReference(getComplex_Primitives(), this.getPrimitive(), null, "primitives", null, 0, -1, Complex.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getComplex_Reference(), ecorePackage.getEObject(), null, "reference", null, 1, 1, Complex.class, + initEReference(getComplex_Reference(), theEcorePackage.getEObject(), null, "reference", null, 1, 1, + Complex.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getComplex_ObjectType(), theEcorePackage.getEClass(), null, "objectType", null, 1, 1, + Complex.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(modelElementEClass, ModelElement.class, "ModelElement", IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + + initEClass(lossModelEClass, LossModel.class, "LossModel", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getLossModel_Elements(), this.getModelElement(), null, "elements", null, 0, -1, LossModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ModelElementImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ModelElementImpl.java new file mode 100644 index 0000000..20b0f57 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/ModelElementImpl.java @@ -0,0 +1,37 @@ +/** + */ +package fr.tpt.mem4csd.loss.impl; + +import fr.tpt.mem4csd.loss.LossPackage; +import fr.tpt.mem4csd.loss.ModelElement; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Model Element'. + * + * + * @generated + */ +public abstract class ModelElementImpl extends NamedObjectImpl implements ModelElement { + /** + * + * + * @generated + */ + protected ModelElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LossPackage.Literals.MODEL_ELEMENT; + } + +} //ModelElementImpl diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/NamedObjectImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/NamedObjectImpl.java similarity index 100% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/NamedObjectImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/NamedObjectImpl.java diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java similarity index 68% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java index d978afd..b7bd3a0 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/impl/PrimitiveImpl.java @@ -10,6 +10,7 @@ import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -23,11 +24,12 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; *

*
    *
  • {@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl#getType Type}
  • + *
  • {@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl#getFeature Feature}
  • *
* * @generated */ -public class PrimitiveImpl extends NamedObjectImpl implements Primitive { +public class PrimitiveImpl extends ModelElementImpl implements Primitive { /** * The cached value of the '{@link #getType() Type}' containment reference. * @@ -38,6 +40,16 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { */ protected EObject type; + /** + * The cached value of the '{@link #getFeature() Feature}' reference. + * + * + * @see #getFeature() + * @generated + * @ordered + */ + protected EStructuralFeature feature; + /** * * @@ -108,6 +120,47 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.PRIMITIVE__TYPE, newType, newType)); } + /** + * + * + * @generated + */ + @Override + public EStructuralFeature getFeature() { + if (feature != null && feature.eIsProxy()) { + InternalEObject oldFeature = (InternalEObject) feature; + feature = (EStructuralFeature) eResolveProxy(oldFeature); + if (feature != oldFeature) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, LossPackage.PRIMITIVE__FEATURE, + oldFeature, feature)); + } + } + return feature; + } + + /** + * + * + * @generated + */ + public EStructuralFeature basicGetFeature() { + return feature; + } + + /** + * + * + * @generated + */ + @Override + public void setFeature(EStructuralFeature newFeature) { + EStructuralFeature oldFeature = feature; + feature = newFeature; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.PRIMITIVE__FEATURE, oldFeature, feature)); + } + /** * * @@ -132,6 +185,10 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { switch (featureID) { case LossPackage.PRIMITIVE__TYPE: return getType(); + case LossPackage.PRIMITIVE__FEATURE: + if (resolve) + return getFeature(); + return basicGetFeature(); } return super.eGet(featureID, resolve, coreType); } @@ -147,6 +204,9 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { case LossPackage.PRIMITIVE__TYPE: setType((EObject) newValue); return; + case LossPackage.PRIMITIVE__FEATURE: + setFeature((EStructuralFeature) newValue); + return; } super.eSet(featureID, newValue); } @@ -162,6 +222,9 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { case LossPackage.PRIMITIVE__TYPE: setType((EObject) null); return; + case LossPackage.PRIMITIVE__FEATURE: + setFeature((EStructuralFeature) null); + return; } super.eUnset(featureID); } @@ -176,6 +239,8 @@ public class PrimitiveImpl extends NamedObjectImpl implements Primitive { switch (featureID) { case LossPackage.PRIMITIVE__TYPE: return type != null; + case LossPackage.PRIMITIVE__FEATURE: + return feature != null; } return super.eIsSet(featureID); } diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java similarity index 80% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java index dc3d690..ee3ba0a 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossAdapterFactory.java @@ -86,6 +86,16 @@ public class LossAdapterFactory extends AdapterFactoryImpl { return createComplexAdapter(); } + @Override + public Adapter caseModelElement(ModelElement object) { + return createModelElementAdapter(); + } + + @Override + public Adapter caseLossModel(LossModel object) { + return createLossModelAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -161,6 +171,34 @@ public class LossAdapterFactory extends AdapterFactoryImpl { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.ModelElement Model Element}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.loss.ModelElement + * @generated + */ + public Adapter createModelElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.LossModel Model}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.loss.LossModel + * @generated + */ + public Adapter createLossModelAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossSwitch.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossSwitch.java similarity index 76% rename from fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossSwitch.java rename to fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossSwitch.java index e7f76aa..e91668a 100644 --- a/fr.tpt.mem4csd.loss/src-gen/fr/tpt/mem4csd/loss/util/LossSwitch.java +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/loss/util/LossSwitch.java @@ -76,6 +76,8 @@ public class LossSwitch extends Switch { case LossPackage.PRIMITIVE: { Primitive primitive = (Primitive) theEObject; T result = casePrimitive(primitive); + if (result == null) + result = caseModelElement(primitive); if (result == null) result = caseNamedObject(primitive); if (result == null) @@ -87,6 +89,8 @@ public class LossSwitch extends Switch { T result = caseLink(link); if (result == null) result = casePrimitive(link); + if (result == null) + result = caseModelElement(link); if (result == null) result = caseNamedObject(link); if (result == null) @@ -96,12 +100,30 @@ public class LossSwitch extends Switch { case LossPackage.COMPLEX: { Complex complex = (Complex) theEObject; T result = caseComplex(complex); + if (result == null) + result = caseModelElement(complex); if (result == null) result = caseNamedObject(complex); if (result == null) result = defaultCase(theEObject); return result; } + case LossPackage.MODEL_ELEMENT: { + ModelElement modelElement = (ModelElement) theEObject; + T result = caseModelElement(modelElement); + if (result == null) + result = caseNamedObject(modelElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case LossPackage.LOSS_MODEL: { + LossModel lossModel = (LossModel) theEObject; + T result = caseLossModel(lossModel); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -167,6 +189,36 @@ public class LossSwitch extends Switch { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Model Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Model Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModelElement(ModelElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Model'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Model'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLossModel(LossModel object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/CorrNode.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/CorrNode.java new file mode 100644 index 0000000..1999192 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/CorrNode.java @@ -0,0 +1,51 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform; + +import fr.tpt.mem4csd.loss.ModelElement; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Corr Node'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.lossTransform.CorrNode#getLeftLinks Left Links}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.CorrNode#getRightLinks Right Links}
  • + *
+ * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getCorrNode() + * @model + * @generated + */ +public interface CorrNode extends Correlation { + /** + * Returns the value of the 'Left Links' reference list. + * The list contents are of type {@link fr.tpt.mem4csd.loss.ModelElement}. + * + * + * @return the value of the 'Left Links' reference list. + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getCorrNode_LeftLinks() + * @model + * @generated + */ + EList getLeftLinks(); + + /** + * Returns the value of the 'Right Links' reference list. + * The list contents are of type {@link fr.tpt.mem4csd.loss.ModelElement}. + * + * + * @return the value of the 'Right Links' reference list. + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getCorrNode_RightLinks() + * @model + * @generated + */ + EList getRightLinks(); + +} // CorrNode diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Correlation.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Correlation.java new file mode 100644 index 0000000..4ab0e14 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Correlation.java @@ -0,0 +1,18 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform; + +import fr.tpt.mem4csd.loss.NamedObject; + +/** + * + * A representation of the model object 'Correlation'. + * + * + * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getCorrelation() + * @model abstract="true" + * @generated + */ +public interface Correlation extends NamedObject { +} // Correlation diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformFactory.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformFactory.java new file mode 100644 index 0000000..603b22b --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformFactory.java @@ -0,0 +1,51 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage + * @generated + */ +public interface LossTransformFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + LossTransformFactory eINSTANCE = fr.tpt.mem4csd.lossTransform.impl.LossTransformFactoryImpl.init(); + + /** + * Returns a new object of class 'Corr Node'. + * + * + * @return a new object of class 'Corr Node'. + * @generated + */ + CorrNode createCorrNode(); + + /** + * Returns a new object of class 'Rule'. + * + * + * @return a new object of class 'Rule'. + * @generated + */ + Rule createRule(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + LossTransformPackage getLossTransformPackage(); + +} //LossTransformFactory diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformPackage.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformPackage.java new file mode 100644 index 0000000..89a21c2 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/LossTransformPackage.java @@ -0,0 +1,829 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform; + +import fr.tpt.mem4csd.loss.LossPackage; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see fr.tpt.mem4csd.lossTransform.LossTransformFactory + * @model kind="package" + * @generated + */ +public interface LossTransformPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "lossTransform"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://mem4csd.telecom-paris.fr/lossTransform"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "lossTransform"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + LossTransformPackage eINSTANCE = fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.tpt.mem4csd.lossTransform.impl.CorrelationImpl Correlation}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.CorrelationImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getCorrelation() + * @generated + */ + int CORRELATION = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION__NAME = LossPackage.NAMED_OBJECT__NAME; + + /** + * The feature id for the 'Class Name' attribute. + * + * + * @generated + * @ordered + */ + int CORRELATION__CLASS_NAME = LossPackage.NAMED_OBJECT__CLASS_NAME; + + /** + * The number of structural features of the 'Correlation' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_FEATURE_COUNT = LossPackage.NAMED_OBJECT_FEATURE_COUNT + 0; + + /** + * The operation id for the 'EClass' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECLASS = LossPackage.NAMED_OBJECT___ECLASS; + + /** + * The operation id for the 'EIs Proxy' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EIS_PROXY = LossPackage.NAMED_OBJECT___EIS_PROXY; + + /** + * The operation id for the 'EResource' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ERESOURCE = LossPackage.NAMED_OBJECT___ERESOURCE; + + /** + * The operation id for the 'EContainer' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECONTAINER = LossPackage.NAMED_OBJECT___ECONTAINER; + + /** + * The operation id for the 'EContaining Feature' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECONTAINING_FEATURE = LossPackage.NAMED_OBJECT___ECONTAINING_FEATURE; + + /** + * The operation id for the 'EContainment Feature' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECONTAINMENT_FEATURE = LossPackage.NAMED_OBJECT___ECONTAINMENT_FEATURE; + + /** + * The operation id for the 'EContents' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECONTENTS = LossPackage.NAMED_OBJECT___ECONTENTS; + + /** + * The operation id for the 'EAll Contents' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EALL_CONTENTS = LossPackage.NAMED_OBJECT___EALL_CONTENTS; + + /** + * The operation id for the 'ECross References' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ECROSS_REFERENCES = LossPackage.NAMED_OBJECT___ECROSS_REFERENCES; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EGET__ESTRUCTURALFEATURE = LossPackage.NAMED_OBJECT___EGET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EGET__ESTRUCTURALFEATURE_BOOLEAN = LossPackage.NAMED_OBJECT___EGET__ESTRUCTURALFEATURE_BOOLEAN; + + /** + * The operation id for the 'ESet' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___ESET__ESTRUCTURALFEATURE_OBJECT = LossPackage.NAMED_OBJECT___ESET__ESTRUCTURALFEATURE_OBJECT; + + /** + * The operation id for the 'EIs Set' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EIS_SET__ESTRUCTURALFEATURE = LossPackage.NAMED_OBJECT___EIS_SET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EUnset' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EUNSET__ESTRUCTURALFEATURE = LossPackage.NAMED_OBJECT___EUNSET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EInvoke' operation. + * + * + * @generated + * @ordered + */ + int CORRELATION___EINVOKE__EOPERATION_ELIST = LossPackage.NAMED_OBJECT___EINVOKE__EOPERATION_ELIST; + + /** + * The number of operations of the 'Correlation' class. + * + * + * @generated + * @ordered + */ + int CORRELATION_OPERATION_COUNT = LossPackage.NAMED_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl Corr Node}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getCorrNode() + * @generated + */ + int CORR_NODE = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CORR_NODE__NAME = CORRELATION__NAME; + + /** + * The feature id for the 'Class Name' attribute. + * + * + * @generated + * @ordered + */ + int CORR_NODE__CLASS_NAME = CORRELATION__CLASS_NAME; + + /** + * The feature id for the 'Left Links' reference list. + * + * + * @generated + * @ordered + */ + int CORR_NODE__LEFT_LINKS = CORRELATION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Right Links' reference list. + * + * + * @generated + * @ordered + */ + int CORR_NODE__RIGHT_LINKS = CORRELATION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Corr Node' class. + * + * + * @generated + * @ordered + */ + int CORR_NODE_FEATURE_COUNT = CORRELATION_FEATURE_COUNT + 2; + + /** + * The operation id for the 'EClass' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECLASS = CORRELATION___ECLASS; + + /** + * The operation id for the 'EIs Proxy' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EIS_PROXY = CORRELATION___EIS_PROXY; + + /** + * The operation id for the 'EResource' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ERESOURCE = CORRELATION___ERESOURCE; + + /** + * The operation id for the 'EContainer' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECONTAINER = CORRELATION___ECONTAINER; + + /** + * The operation id for the 'EContaining Feature' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECONTAINING_FEATURE = CORRELATION___ECONTAINING_FEATURE; + + /** + * The operation id for the 'EContainment Feature' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECONTAINMENT_FEATURE = CORRELATION___ECONTAINMENT_FEATURE; + + /** + * The operation id for the 'EContents' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECONTENTS = CORRELATION___ECONTENTS; + + /** + * The operation id for the 'EAll Contents' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EALL_CONTENTS = CORRELATION___EALL_CONTENTS; + + /** + * The operation id for the 'ECross References' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ECROSS_REFERENCES = CORRELATION___ECROSS_REFERENCES; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EGET__ESTRUCTURALFEATURE = CORRELATION___EGET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EGET__ESTRUCTURALFEATURE_BOOLEAN = CORRELATION___EGET__ESTRUCTURALFEATURE_BOOLEAN; + + /** + * The operation id for the 'ESet' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___ESET__ESTRUCTURALFEATURE_OBJECT = CORRELATION___ESET__ESTRUCTURALFEATURE_OBJECT; + + /** + * The operation id for the 'EIs Set' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EIS_SET__ESTRUCTURALFEATURE = CORRELATION___EIS_SET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EUnset' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EUNSET__ESTRUCTURALFEATURE = CORRELATION___EUNSET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EInvoke' operation. + * + * + * @generated + * @ordered + */ + int CORR_NODE___EINVOKE__EOPERATION_ELIST = CORRELATION___EINVOKE__EOPERATION_ELIST; + + /** + * The number of operations of the 'Corr Node' class. + * + * + * @generated + * @ordered + */ + int CORR_NODE_OPERATION_COUNT = CORRELATION_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.tpt.mem4csd.lossTransform.impl.RuleImpl Rule}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.RuleImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getRule() + * @generated + */ + int RULE = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RULE__NAME = CORRELATION__NAME; + + /** + * The feature id for the 'Class Name' attribute. + * + * + * @generated + * @ordered + */ + int RULE__CLASS_NAME = CORRELATION__CLASS_NAME; + + /** + * The feature id for the 'Left Model' containment reference list. + * + * + * @generated + * @ordered + */ + int RULE__LEFT_MODEL = CORRELATION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Right Model' containment reference list. + * + * + * @generated + * @ordered + */ + int RULE__RIGHT_MODEL = CORRELATION_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Transformations' containment reference list. + * + * + * @generated + * @ordered + */ + int RULE__TRANSFORMATIONS = CORRELATION_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Rule' class. + * + * + * @generated + * @ordered + */ + int RULE_FEATURE_COUNT = CORRELATION_FEATURE_COUNT + 3; + + /** + * The operation id for the 'EClass' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECLASS = CORRELATION___ECLASS; + + /** + * The operation id for the 'EIs Proxy' operation. + * + * + * @generated + * @ordered + */ + int RULE___EIS_PROXY = CORRELATION___EIS_PROXY; + + /** + * The operation id for the 'EResource' operation. + * + * + * @generated + * @ordered + */ + int RULE___ERESOURCE = CORRELATION___ERESOURCE; + + /** + * The operation id for the 'EContainer' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECONTAINER = CORRELATION___ECONTAINER; + + /** + * The operation id for the 'EContaining Feature' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECONTAINING_FEATURE = CORRELATION___ECONTAINING_FEATURE; + + /** + * The operation id for the 'EContainment Feature' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECONTAINMENT_FEATURE = CORRELATION___ECONTAINMENT_FEATURE; + + /** + * The operation id for the 'EContents' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECONTENTS = CORRELATION___ECONTENTS; + + /** + * The operation id for the 'EAll Contents' operation. + * + * + * @generated + * @ordered + */ + int RULE___EALL_CONTENTS = CORRELATION___EALL_CONTENTS; + + /** + * The operation id for the 'ECross References' operation. + * + * + * @generated + * @ordered + */ + int RULE___ECROSS_REFERENCES = CORRELATION___ECROSS_REFERENCES; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int RULE___EGET__ESTRUCTURALFEATURE = CORRELATION___EGET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EGet' operation. + * + * + * @generated + * @ordered + */ + int RULE___EGET__ESTRUCTURALFEATURE_BOOLEAN = CORRELATION___EGET__ESTRUCTURALFEATURE_BOOLEAN; + + /** + * The operation id for the 'ESet' operation. + * + * + * @generated + * @ordered + */ + int RULE___ESET__ESTRUCTURALFEATURE_OBJECT = CORRELATION___ESET__ESTRUCTURALFEATURE_OBJECT; + + /** + * The operation id for the 'EIs Set' operation. + * + * + * @generated + * @ordered + */ + int RULE___EIS_SET__ESTRUCTURALFEATURE = CORRELATION___EIS_SET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EUnset' operation. + * + * + * @generated + * @ordered + */ + int RULE___EUNSET__ESTRUCTURALFEATURE = CORRELATION___EUNSET__ESTRUCTURALFEATURE; + + /** + * The operation id for the 'EInvoke' operation. + * + * + * @generated + * @ordered + */ + int RULE___EINVOKE__EOPERATION_ELIST = CORRELATION___EINVOKE__EOPERATION_ELIST; + + /** + * The number of operations of the 'Rule' class. + * + * + * @generated + * @ordered + */ + int RULE_OPERATION_COUNT = CORRELATION_OPERATION_COUNT + 0; + + + /** + * Returns the meta object for class '{@link fr.tpt.mem4csd.lossTransform.Correlation Correlation}'. + * + * + * @return the meta object for class 'Correlation'. + * @see fr.tpt.mem4csd.lossTransform.Correlation + * @generated + */ + EClass getCorrelation(); + + /** + * Returns the meta object for class '{@link fr.tpt.mem4csd.lossTransform.CorrNode Corr Node}'. + * + * + * @return the meta object for class 'Corr Node'. + * @see fr.tpt.mem4csd.lossTransform.CorrNode + * @generated + */ + EClass getCorrNode(); + + /** + * Returns the meta object for the reference list '{@link fr.tpt.mem4csd.lossTransform.CorrNode#getLeftLinks Left Links}'. + * + * + * @return the meta object for the reference list 'Left Links'. + * @see fr.tpt.mem4csd.lossTransform.CorrNode#getLeftLinks() + * @see #getCorrNode() + * @generated + */ + EReference getCorrNode_LeftLinks(); + + /** + * Returns the meta object for the reference list '{@link fr.tpt.mem4csd.lossTransform.CorrNode#getRightLinks Right Links}'. + * + * + * @return the meta object for the reference list 'Right Links'. + * @see fr.tpt.mem4csd.lossTransform.CorrNode#getRightLinks() + * @see #getCorrNode() + * @generated + */ + EReference getCorrNode_RightLinks(); + + /** + * Returns the meta object for class '{@link fr.tpt.mem4csd.lossTransform.Rule Rule}'. + * + * + * @return the meta object for class 'Rule'. + * @see fr.tpt.mem4csd.lossTransform.Rule + * @generated + */ + EClass getRule(); + + /** + * Returns the meta object for the containment reference list '{@link fr.tpt.mem4csd.lossTransform.Rule#getLeftModel Left Model}'. + * + * + * @return the meta object for the containment reference list 'Left Model'. + * @see fr.tpt.mem4csd.lossTransform.Rule#getLeftModel() + * @see #getRule() + * @generated + */ + EReference getRule_LeftModel(); + + /** + * Returns the meta object for the containment reference list '{@link fr.tpt.mem4csd.lossTransform.Rule#getRightModel Right Model}'. + * + * + * @return the meta object for the containment reference list 'Right Model'. + * @see fr.tpt.mem4csd.lossTransform.Rule#getRightModel() + * @see #getRule() + * @generated + */ + EReference getRule_RightModel(); + + /** + * Returns the meta object for the containment reference list '{@link fr.tpt.mem4csd.lossTransform.Rule#getTransformations Transformations}'. + * + * + * @return the meta object for the containment reference list 'Transformations'. + * @see fr.tpt.mem4csd.lossTransform.Rule#getTransformations() + * @see #getRule() + * @generated + */ + EReference getRule_Transformations(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + LossTransformFactory getLossTransformFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link fr.tpt.mem4csd.lossTransform.impl.CorrelationImpl Correlation}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.CorrelationImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getCorrelation() + * @generated + */ + EClass CORRELATION = eINSTANCE.getCorrelation(); + + /** + * The meta object literal for the '{@link fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl Corr Node}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getCorrNode() + * @generated + */ + EClass CORR_NODE = eINSTANCE.getCorrNode(); + + /** + * The meta object literal for the 'Left Links' reference list feature. + * + * + * @generated + */ + EReference CORR_NODE__LEFT_LINKS = eINSTANCE.getCorrNode_LeftLinks(); + + /** + * The meta object literal for the 'Right Links' reference list feature. + * + * + * @generated + */ + EReference CORR_NODE__RIGHT_LINKS = eINSTANCE.getCorrNode_RightLinks(); + + /** + * The meta object literal for the '{@link fr.tpt.mem4csd.lossTransform.impl.RuleImpl Rule}' class. + * + * + * @see fr.tpt.mem4csd.lossTransform.impl.RuleImpl + * @see fr.tpt.mem4csd.lossTransform.impl.LossTransformPackageImpl#getRule() + * @generated + */ + EClass RULE = eINSTANCE.getRule(); + + /** + * The meta object literal for the 'Left Model' containment reference list feature. + * + * + * @generated + */ + EReference RULE__LEFT_MODEL = eINSTANCE.getRule_LeftModel(); + + /** + * The meta object literal for the 'Right Model' containment reference list feature. + * + * + * @generated + */ + EReference RULE__RIGHT_MODEL = eINSTANCE.getRule_RightModel(); + + /** + * The meta object literal for the 'Transformations' containment reference list feature. + * + * + * @generated + */ + EReference RULE__TRANSFORMATIONS = eINSTANCE.getRule_Transformations(); + + } + +} //LossTransformPackage diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Rule.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Rule.java new file mode 100644 index 0000000..4ba39bd --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/Rule.java @@ -0,0 +1,64 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform; + +import fr.tpt.mem4csd.loss.ModelElement; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Rule'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.lossTransform.Rule#getLeftModel Left Model}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.Rule#getRightModel Right Model}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.Rule#getTransformations Transformations}
  • + *
+ * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getRule() + * @model + * @generated + */ +public interface Rule extends Correlation { + /** + * Returns the value of the 'Left Model' containment reference list. + * The list contents are of type {@link fr.tpt.mem4csd.loss.ModelElement}. + * + * + * @return the value of the 'Left Model' containment reference list. + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getRule_LeftModel() + * @model containment="true" + * @generated + */ + EList getLeftModel(); + + /** + * Returns the value of the 'Right Model' containment reference list. + * The list contents are of type {@link fr.tpt.mem4csd.loss.ModelElement}. + * + * + * @return the value of the 'Right Model' containment reference list. + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getRule_RightModel() + * @model containment="true" + * @generated + */ + EList getRightModel(); + + /** + * Returns the value of the 'Transformations' containment reference list. + * The list contents are of type {@link fr.tpt.mem4csd.lossTransform.CorrNode}. + * + * + * @return the value of the 'Transformations' containment reference list. + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#getRule_Transformations() + * @model containment="true" + * @generated + */ + EList getTransformations(); + +} // Rule diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrNodeImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrNodeImpl.java new file mode 100644 index 0000000..1365cf6 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrNodeImpl.java @@ -0,0 +1,169 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.impl; + +import fr.tpt.mem4csd.loss.ModelElement; + +import fr.tpt.mem4csd.lossTransform.CorrNode; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Corr Node'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl#getLeftLinks Left Links}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.impl.CorrNodeImpl#getRightLinks Right Links}
  • + *
+ * + * @generated + */ +public class CorrNodeImpl extends CorrelationImpl implements CorrNode { + /** + * The cached value of the '{@link #getLeftLinks() Left Links}' reference list. + * + * + * @see #getLeftLinks() + * @generated + * @ordered + */ + protected EList leftLinks; + + /** + * The cached value of the '{@link #getRightLinks() Right Links}' reference list. + * + * + * @see #getRightLinks() + * @generated + * @ordered + */ + protected EList rightLinks; + + /** + * + * + * @generated + */ + protected CorrNodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LossTransformPackage.Literals.CORR_NODE; + } + + /** + * + * + * @generated + */ + @Override + public EList getLeftLinks() { + if (leftLinks == null) { + leftLinks = new EObjectResolvingEList(ModelElement.class, this, LossTransformPackage.CORR_NODE__LEFT_LINKS); + } + return leftLinks; + } + + /** + * + * + * @generated + */ + @Override + public EList getRightLinks() { + if (rightLinks == null) { + rightLinks = new EObjectResolvingEList(ModelElement.class, this, LossTransformPackage.CORR_NODE__RIGHT_LINKS); + } + return rightLinks; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case LossTransformPackage.CORR_NODE__LEFT_LINKS: + return getLeftLinks(); + case LossTransformPackage.CORR_NODE__RIGHT_LINKS: + return getRightLinks(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case LossTransformPackage.CORR_NODE__LEFT_LINKS: + getLeftLinks().clear(); + getLeftLinks().addAll((Collection)newValue); + return; + case LossTransformPackage.CORR_NODE__RIGHT_LINKS: + getRightLinks().clear(); + getRightLinks().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case LossTransformPackage.CORR_NODE__LEFT_LINKS: + getLeftLinks().clear(); + return; + case LossTransformPackage.CORR_NODE__RIGHT_LINKS: + getRightLinks().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case LossTransformPackage.CORR_NODE__LEFT_LINKS: + return leftLinks != null && !leftLinks.isEmpty(); + case LossTransformPackage.CORR_NODE__RIGHT_LINKS: + return rightLinks != null && !rightLinks.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //CorrNodeImpl diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrelationImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrelationImpl.java new file mode 100644 index 0000000..50550d1 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/CorrelationImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.impl; + +import fr.tpt.mem4csd.loss.impl.NamedObjectImpl; + +import fr.tpt.mem4csd.lossTransform.Correlation; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Correlation'. + * + * + * @generated + */ +public abstract class CorrelationImpl extends NamedObjectImpl implements Correlation { + /** + * + * + * @generated + */ + protected CorrelationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LossTransformPackage.Literals.CORRELATION; + } + +} //CorrelationImpl diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformFactoryImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformFactoryImpl.java new file mode 100644 index 0000000..47a58b6 --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformFactoryImpl.java @@ -0,0 +1,109 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.impl; + +import fr.tpt.mem4csd.lossTransform.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class LossTransformFactoryImpl extends EFactoryImpl implements LossTransformFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static LossTransformFactory init() { + try { + LossTransformFactory theLossTransformFactory = (LossTransformFactory)EPackage.Registry.INSTANCE.getEFactory(LossTransformPackage.eNS_URI); + if (theLossTransformFactory != null) { + return theLossTransformFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new LossTransformFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public LossTransformFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case LossTransformPackage.CORR_NODE: return createCorrNode(); + case LossTransformPackage.RULE: return createRule(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public CorrNode createCorrNode() { + CorrNodeImpl corrNode = new CorrNodeImpl(); + return corrNode; + } + + /** + * + * + * @generated + */ + @Override + public Rule createRule() { + RuleImpl rule = new RuleImpl(); + return rule; + } + + /** + * + * + * @generated + */ + @Override + public LossTransformPackage getLossTransformPackage() { + return (LossTransformPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static LossTransformPackage getPackage() { + return LossTransformPackage.eINSTANCE; + } + +} //LossTransformFactoryImpl diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformPackageImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformPackageImpl.java new file mode 100644 index 0000000..aa3c00e --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/LossTransformPackageImpl.java @@ -0,0 +1,284 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.impl; + +import fr.tpt.mem4csd.loss.LossPackage; + +import fr.tpt.mem4csd.lossTransform.CorrNode; +import fr.tpt.mem4csd.lossTransform.Correlation; +import fr.tpt.mem4csd.lossTransform.LossTransformFactory; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; +import fr.tpt.mem4csd.lossTransform.Rule; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class LossTransformPackageImpl extends EPackageImpl implements LossTransformPackage { + /** + * + * + * @generated + */ + private EClass correlationEClass = null; + + /** + * + * + * @generated + */ + private EClass corrNodeEClass = null; + + /** + * + * + * @generated + */ + private EClass ruleEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage#eNS_URI + * @see #init() + * @generated + */ + private LossTransformPackageImpl() { + super(eNS_URI, LossTransformFactory.eINSTANCE); + } + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link LossTransformPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static LossTransformPackage init() { + if (isInited) return (LossTransformPackage)EPackage.Registry.INSTANCE.getEPackage(LossTransformPackage.eNS_URI); + + // Obtain or create and register package + Object registeredLossTransformPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + LossTransformPackageImpl theLossTransformPackage = registeredLossTransformPackage instanceof LossTransformPackageImpl ? (LossTransformPackageImpl)registeredLossTransformPackage : new LossTransformPackageImpl(); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + LossPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theLossTransformPackage.createPackageContents(); + + // Initialize created meta-data + theLossTransformPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theLossTransformPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(LossTransformPackage.eNS_URI, theLossTransformPackage); + return theLossTransformPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrelation() { + return correlationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getCorrNode() { + return corrNodeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrNode_LeftLinks() { + return (EReference)corrNodeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCorrNode_RightLinks() { + return (EReference)corrNodeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRule() { + return ruleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRule_LeftModel() { + return (EReference)ruleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRule_RightModel() { + return (EReference)ruleEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRule_Transformations() { + return (EReference)ruleEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public LossTransformFactory getLossTransformFactory() { + return (LossTransformFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + correlationEClass = createEClass(CORRELATION); + + corrNodeEClass = createEClass(CORR_NODE); + createEReference(corrNodeEClass, CORR_NODE__LEFT_LINKS); + createEReference(corrNodeEClass, CORR_NODE__RIGHT_LINKS); + + ruleEClass = createEClass(RULE); + createEReference(ruleEClass, RULE__LEFT_MODEL); + createEReference(ruleEClass, RULE__RIGHT_MODEL); + createEReference(ruleEClass, RULE__TRANSFORMATIONS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + LossPackage theLossPackage = (LossPackage)EPackage.Registry.INSTANCE.getEPackage(LossPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + correlationEClass.getESuperTypes().add(theLossPackage.getNamedObject()); + corrNodeEClass.getESuperTypes().add(this.getCorrelation()); + ruleEClass.getESuperTypes().add(this.getCorrelation()); + + // Initialize classes, features, and operations; add parameters + initEClass(correlationEClass, Correlation.class, "Correlation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(corrNodeEClass, CorrNode.class, "CorrNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCorrNode_LeftLinks(), theLossPackage.getModelElement(), null, "leftLinks", null, 0, -1, CorrNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCorrNode_RightLinks(), theLossPackage.getModelElement(), null, "rightLinks", null, 0, -1, CorrNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(ruleEClass, Rule.class, "Rule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRule_LeftModel(), theLossPackage.getModelElement(), null, "leftModel", null, 0, -1, Rule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRule_RightModel(), theLossPackage.getModelElement(), null, "rightModel", null, 0, -1, Rule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRule_Transformations(), this.getCorrNode(), null, "transformations", null, 0, -1, Rule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //LossTransformPackageImpl diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/RuleImpl.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/RuleImpl.java new file mode 100644 index 0000000..5a78c4a --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/impl/RuleImpl.java @@ -0,0 +1,226 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.impl; + +import fr.tpt.mem4csd.loss.ModelElement; + +import fr.tpt.mem4csd.lossTransform.CorrNode; +import fr.tpt.mem4csd.lossTransform.LossTransformPackage; +import fr.tpt.mem4csd.lossTransform.Rule; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Rule'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.tpt.mem4csd.lossTransform.impl.RuleImpl#getLeftModel Left Model}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.impl.RuleImpl#getRightModel Right Model}
  • + *
  • {@link fr.tpt.mem4csd.lossTransform.impl.RuleImpl#getTransformations Transformations}
  • + *
+ * + * @generated + */ +public class RuleImpl extends CorrelationImpl implements Rule { + /** + * The cached value of the '{@link #getLeftModel() Left Model}' containment reference list. + * + * + * @see #getLeftModel() + * @generated + * @ordered + */ + protected EList leftModel; + + /** + * The cached value of the '{@link #getRightModel() Right Model}' containment reference list. + * + * + * @see #getRightModel() + * @generated + * @ordered + */ + protected EList rightModel; + + /** + * The cached value of the '{@link #getTransformations() Transformations}' containment reference list. + * + * + * @see #getTransformations() + * @generated + * @ordered + */ + protected EList transformations; + + /** + * + * + * @generated + */ + protected RuleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LossTransformPackage.Literals.RULE; + } + + /** + * + * + * @generated + */ + @Override + public EList getLeftModel() { + if (leftModel == null) { + leftModel = new EObjectContainmentEList(ModelElement.class, this, LossTransformPackage.RULE__LEFT_MODEL); + } + return leftModel; + } + + /** + * + * + * @generated + */ + @Override + public EList getRightModel() { + if (rightModel == null) { + rightModel = new EObjectContainmentEList(ModelElement.class, this, LossTransformPackage.RULE__RIGHT_MODEL); + } + return rightModel; + } + + /** + * + * + * @generated + */ + @Override + public EList getTransformations() { + if (transformations == null) { + transformations = new EObjectContainmentEList(CorrNode.class, this, LossTransformPackage.RULE__TRANSFORMATIONS); + } + return transformations; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case LossTransformPackage.RULE__LEFT_MODEL: + return ((InternalEList)getLeftModel()).basicRemove(otherEnd, msgs); + case LossTransformPackage.RULE__RIGHT_MODEL: + return ((InternalEList)getRightModel()).basicRemove(otherEnd, msgs); + case LossTransformPackage.RULE__TRANSFORMATIONS: + return ((InternalEList)getTransformations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case LossTransformPackage.RULE__LEFT_MODEL: + return getLeftModel(); + case LossTransformPackage.RULE__RIGHT_MODEL: + return getRightModel(); + case LossTransformPackage.RULE__TRANSFORMATIONS: + return getTransformations(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case LossTransformPackage.RULE__LEFT_MODEL: + getLeftModel().clear(); + getLeftModel().addAll((Collection)newValue); + return; + case LossTransformPackage.RULE__RIGHT_MODEL: + getRightModel().clear(); + getRightModel().addAll((Collection)newValue); + return; + case LossTransformPackage.RULE__TRANSFORMATIONS: + getTransformations().clear(); + getTransformations().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case LossTransformPackage.RULE__LEFT_MODEL: + getLeftModel().clear(); + return; + case LossTransformPackage.RULE__RIGHT_MODEL: + getRightModel().clear(); + return; + case LossTransformPackage.RULE__TRANSFORMATIONS: + getTransformations().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case LossTransformPackage.RULE__LEFT_MODEL: + return leftModel != null && !leftModel.isEmpty(); + case LossTransformPackage.RULE__RIGHT_MODEL: + return rightModel != null && !rightModel.isEmpty(); + case LossTransformPackage.RULE__TRANSFORMATIONS: + return transformations != null && !transformations.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //RuleImpl diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformAdapterFactory.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformAdapterFactory.java new file mode 100644 index 0000000..fd6719d --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformAdapterFactory.java @@ -0,0 +1,176 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.util; + +import fr.tpt.mem4csd.loss.NamedObject; + +import fr.tpt.mem4csd.lossTransform.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage + * @generated + */ +public class LossTransformAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static LossTransformPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public LossTransformAdapterFactory() { + if (modelPackage == null) { + modelPackage = LossTransformPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected LossTransformSwitch modelSwitch = + new LossTransformSwitch() { + @Override + public Adapter caseCorrelation(Correlation object) { + return createCorrelationAdapter(); + } + @Override + public Adapter caseCorrNode(CorrNode object) { + return createCorrNodeAdapter(); + } + @Override + public Adapter caseRule(Rule object) { + return createRuleAdapter(); + } + @Override + public Adapter caseNamedObject(NamedObject object) { + return createNamedObjectAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.lossTransform.Correlation Correlation}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.lossTransform.Correlation + * @generated + */ + public Adapter createCorrelationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.lossTransform.CorrNode Corr Node}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.lossTransform.CorrNode + * @generated + */ + public Adapter createCorrNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.lossTransform.Rule Rule}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.lossTransform.Rule + * @generated + */ + public Adapter createRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.NamedObject Named Object}'. + * + * 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. + * + * @return the new adapter. + * @see fr.tpt.mem4csd.loss.NamedObject + * @generated + */ + public Adapter createNamedObjectAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //LossTransformAdapterFactory diff --git a/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformSwitch.java b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformSwitch.java new file mode 100644 index 0000000..31ce0ac --- /dev/null +++ b/fr.tpt.mem4csd.loss/src/fr/tpt/mem4csd/lossTransform/util/LossTransformSwitch.java @@ -0,0 +1,174 @@ +/** + */ +package fr.tpt.mem4csd.lossTransform.util; + +import fr.tpt.mem4csd.loss.NamedObject; + +import fr.tpt.mem4csd.lossTransform.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see fr.tpt.mem4csd.lossTransform.LossTransformPackage + * @generated + */ +public class LossTransformSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static LossTransformPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public LossTransformSwitch() { + if (modelPackage == null) { + modelPackage = LossTransformPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case LossTransformPackage.CORRELATION: { + Correlation correlation = (Correlation)theEObject; + T result = caseCorrelation(correlation); + if (result == null) result = caseNamedObject(correlation); + if (result == null) result = defaultCase(theEObject); + return result; + } + case LossTransformPackage.CORR_NODE: { + CorrNode corrNode = (CorrNode)theEObject; + T result = caseCorrNode(corrNode); + if (result == null) result = caseCorrelation(corrNode); + if (result == null) result = caseNamedObject(corrNode); + if (result == null) result = defaultCase(theEObject); + return result; + } + case LossTransformPackage.RULE: { + Rule rule = (Rule)theEObject; + T result = caseRule(rule); + if (result == null) result = caseCorrelation(rule); + if (result == null) result = caseNamedObject(rule); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Correlation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Correlation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrelation(Correlation object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Corr Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Corr Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCorrNode(CorrNode object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Rule'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Rule'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRule(Rule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Named Object'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Named Object'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNamedObject(NamedObject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //LossTransformSwitch