Model Transformations are captured.

This commit is contained in:
Anish Bhobe 2024-07-31 10:45:36 +02:00
parent 3f8dd75427
commit ac72ac79d4
135 changed files with 8765 additions and 9161 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src-gen"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>

View File

@ -5,12 +5,16 @@ Bundle-SymbolicName: fr.tpt.mem4csd.loss.edit;singleton:=true
Automatic-Module-Name: fr.tpt.mem4csd.loss.edit Automatic-Module-Name: fr.tpt.mem4csd.loss.edit
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: . Bundle-ClassPath: .
Bundle-Activator: fr.tpt.mem4csd.loss.provider.LossEditPlugin$Implementation Bundle-Activator: fr.tpt.mem4csd.lossTransform.provider.LossTransformEditPlugin$Implementation
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17 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, Require-Bundle: org.eclipse.core.runtime,
fr.tpt.mem4csd.loss;visibility:=reexport, 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 Bundle-ActivationPolicy: lazy

View File

@ -6,5 +6,5 @@ bin.includes = .,\
plugin.xml,\ plugin.xml,\
plugin.properties plugin.properties
jars.compile.order = . jars.compile.order = .
source.. = src-gen/ source.. = src/
output.. = bin/ output.. = bin/

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

View File

@ -30,3 +30,121 @@ _UI_Unknown_feature = Unspecified
_UI_NamedObject_reference_feature = Reference _UI_NamedObject_reference_feature = Reference
_UI_NamedObject_className_feature = Class Name _UI_NamedObject_className_feature = Class Name
_UI_Complex_reference_feature = Reference _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

View File

@ -19,4 +19,30 @@
org.eclipse.emf.edit.provider.IItemPropertySource"/> org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension> </extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- @generated loss_transform -->
<factory
uri="http://mem4csd.telecom-paris.fr/loss_transform"
class="fr.tpt.mem4csd.loss_transform.provider.loss_transformItemProviderAdapterFactory"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- @generated lossTransform -->
<factory
uri="http://mem4csd.telecom-paris.fr/lossTransform"
class="fr.tpt.mem4csd.lossTransform.provider.LossTransformItemProviderAdapterFactory"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
</plugin> </plugin>

View File

@ -24,7 +24,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification;
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public class ComplexItemProvider extends NamedObjectItemProvider { public class ComplexItemProvider extends ModelElementItemProvider {
/** /**
* This constructs an instance from a factory and a notifier. * This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
@ -47,6 +47,7 @@ public class ComplexItemProvider extends NamedObjectItemProvider {
super.getPropertyDescriptors(object); super.getPropertyDescriptors(object);
addReferencePropertyDescriptor(object); addReferencePropertyDescriptor(object);
addObjectTypePropertyDescriptor(object);
} }
return itemPropertyDescriptors; return itemPropertyDescriptors;
} }
@ -66,6 +67,21 @@ public class ComplexItemProvider extends NamedObjectItemProvider {
LossPackage.Literals.COMPLEX__REFERENCE, true, false, true, null, null, null)); LossPackage.Literals.COMPLEX__REFERENCE, true, false, true, null, null, null));
} }
/**
* This adds a property descriptor for the Object Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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 * 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.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or

View File

@ -5,6 +5,7 @@ package fr.tpt.mem4csd.loss.provider;
import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
/** /**
* This is the central singleton for the Loss edit plugin. * This is the central singleton for the Loss edit plugin.
@ -36,7 +37,7 @@ public final class LossEditPlugin extends EMFPlugin {
* @generated * @generated
*/ */
public LossEditPlugin() { public LossEditPlugin() {
super(new ResourceLocator[] {}); super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
} }
/** /**

View File

@ -141,6 +141,29 @@ public class LossItemProviderAdapterFactory extends LossAdapterFactory
return complexItemProvider; return complexItemProvider;
} }
/**
* This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.loss.LossModel} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LossModelItemProvider lossModelItemProvider;
/**
* This creates an adapter for a {@link fr.tpt.mem4csd.loss.LossModel}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createLossModelAdapter() {
if (lossModelItemProvider == null) {
lossModelItemProvider = new LossModelItemProvider(this);
}
return lossModelItemProvider;
}
/** /**
* This returns the root adapter factory that contains this factory. * This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
@ -252,6 +275,8 @@ public class LossItemProviderAdapterFactory extends LossAdapterFactory
linkItemProvider.dispose(); linkItemProvider.dispose();
if (complexItemProvider != null) if (complexItemProvider != null)
complexItemProvider.dispose(); complexItemProvider.dispose();
if (lossModelItemProvider != null)
lossModelItemProvider.dispose();
} }
} }

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossModelItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LossModelItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addElementsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Elements feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/LossModel"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return LossEditPlugin.INSTANCE;
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ModelElementItemProvider extends NamedObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModelElementItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}

View File

@ -13,25 +13,19 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator; 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.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.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.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.emf.edit.provider.ViewerNotification;
/** /**
* This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.NamedObject} object. * This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.NamedObject} object.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated NOT * @generated
*/ */
public class NamedObjectItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, public class NamedObjectItemProvider extends EObjectItemProvider {
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/** /**
* This constructs an instance from a factory and a notifier. * This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->

View File

@ -14,6 +14,8 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EStructuralFeature; 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.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.emf.edit.provider.ViewerNotification;
@ -23,7 +25,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification;
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public class PrimitiveItemProvider extends NamedObjectItemProvider { public class PrimitiveItemProvider extends ModelElementItemProvider {
/** /**
* This constructs an instance from a factory and a notifier. * This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
@ -45,10 +47,26 @@ public class PrimitiveItemProvider extends NamedObjectItemProvider {
if (itemPropertyDescriptors == null) { if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object); super.getPropertyDescriptors(object);
addFeaturePropertyDescriptor(object);
} }
return itemPropertyDescriptors; return itemPropertyDescriptors;
} }
/**
* This adds a property descriptor for the Feature feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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 * 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.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
@ -151,6 +169,9 @@ public class PrimitiveItemProvider extends NamedObjectItemProvider {
newChildDescriptors newChildDescriptors
.add(createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createComplex())); .add(createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createComplex()));
newChildDescriptors.add(
createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, EcoreFactory.eINSTANCE.createEObject()));
} }
} }

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CorrNodeItemProvider extends CorrelationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CorrNodeItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> 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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/CorrNode"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CorrelationItemProvider extends NamedObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CorrelationItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return LossTransformEditPlugin.INSTANCE;
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public final class LossTransformEditPlugin extends EMFPlugin {
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final LossTransformEditPlugin INSTANCE = new LossTransformEditPlugin();
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static Implementation plugin;
/**
* Create the instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LossTransformEditPlugin() {
super
(new ResourceLocator [] {
EcoreEditPlugin.INSTANCE,
LossEditPlugin.INSTANCE,
});
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
@Override
public ResourceLocator getPluginResourceLocator() {
return plugin;
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
public static Implementation getPlugin() {
return plugin;
}
/**
* The actual implementation of the Eclipse <b>Plugin</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class Implementation extends EclipsePlugin {
/**
* Creates an instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Implementation() {
super();
// Remember the static instance.
//
plugin = this;
}
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossTransformItemProviderAdapterFactory extends LossTransformAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
/**
* This keeps track of the root adapter factory that delegates to this adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ComposedAdapterFactory parentAdapterFactory;
/**
* This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IChangeNotifier changeNotifier = new ChangeNotifier();
/**
* This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<Object> supportedTypes = new ArrayList<Object>();
/**
* This constructs an instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CorrNodeItemProvider corrNodeItemProvider;
/**
* This creates an adapter for a {@link fr.tpt.mem4csd.lossTransform.CorrNode}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RuleItemProvider ruleItemProvider;
/**
* This creates an adapter for a {@link fr.tpt.mem4csd.lossTransform.Rule}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createRuleAdapter() {
if (ruleItemProvider == null) {
ruleItemProvider = new RuleItemProvider(this);
}
return ruleItemProvider;
}
/**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ComposeableAdapterFactory getRootAdapterFactory() {
return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
}
/**
* This sets the composed adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
this.parentAdapterFactory = parentAdapterFactory;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter adapt(Notifier notifier, Object type) {
return super.adapt(notifier, this);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void addListener(INotifyChangedListener notifyChangedListener) {
changeNotifier.addListener(notifyChangedListener);
}
/**
* This removes a listener.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void removeListener(INotifyChangedListener notifyChangedListener) {
changeNotifier.removeListener(notifyChangedListener);
}
/**
* This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void dispose() {
if (corrNodeItemProvider != null) corrNodeItemProvider.dispose();
if (ruleItemProvider != null) ruleItemProvider.dispose();
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class RuleItemProvider
extends CorrelationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RuleItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> 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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Collection<? extends EStructuralFeature> 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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Rule"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> 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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src-gen"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>

View File

@ -5,15 +5,17 @@ Bundle-SymbolicName: fr.tpt.mem4csd.loss.editor;singleton:=true
Automatic-Module-Name: fr.tpt.mem4csd.loss.editor Automatic-Module-Name: fr.tpt.mem4csd.loss.editor
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: . Bundle-ClassPath: .
Bundle-Activator: fr.tpt.mem4csd.loss.presentation.LossEditorPlugin$Implementation Bundle-Activator: fr.tpt.mem4csd.lossTransform.presentation.LossTransformEditorPlugin$Implementation
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17 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, Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;visibility:=reexport, org.eclipse.core.resources;visibility:=reexport,
fr.tpt.mem4csd.loss.edit;visibility:=reexport, fr.tpt.mem4csd.loss.edit;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport, org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;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 Bundle-ActivationPolicy: lazy

View File

@ -6,5 +6,5 @@ bin.includes = .,\
plugin.xml,\ plugin.xml,\
plugin.properties plugin.properties
jars.compile.order = . jars.compile.order = .
source.. = src-gen/ source.. = src/
output.. = bin output.. = bin

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -51,3 +51,33 @@ _UI_Wizard_initial_object_description = Select a model object to create
_UI_FileConflict_label = File Conflict _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? _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

View File

@ -34,4 +34,59 @@
</editor> </editor>
</extension> </extension>
<extension point="org.eclipse.ui.newWizards">
<!-- @generated loss_transform -->
<category
id="org.eclipse.emf.ecore.Wizard.category.ID"
name="%_UI_Wizard_category"/>
<wizard
id="fr.tpt.mem4csd.loss_transform.presentation.loss_transformModelWizardID"
name="%_UI_loss_transformModelWizard_label"
class="fr.tpt.mem4csd.loss_transform.presentation.loss_transformModelWizard"
category="org.eclipse.emf.ecore.Wizard.category.ID"
icon="icons/full/obj16/loss_transformModelFile.gif">
<description>%_UI_loss_transformModelWizard_description</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
</extension>
<extension point="org.eclipse.ui.editors">
<!-- @generated loss_transform -->
<editor
id="fr.tpt.mem4csd.loss_transform.presentation.loss_transformEditorID"
name="%_UI_loss_transformEditor_label"
icon="icons/full/obj16/loss_transformModelFile.gif"
extensions="loss_transform"
class="fr.tpt.mem4csd.loss_transform.presentation.loss_transformEditor"
contributorClass="fr.tpt.mem4csd.loss_transform.presentation.loss_transformActionBarContributor">
</editor>
</extension>
<extension point="org.eclipse.ui.newWizards">
<!-- @generated lossTransform -->
<category
id="org.eclipse.emf.ecore.Wizard.category.ID"
name="%_UI_Wizard_category"/>
<wizard
id="fr.tpt.mem4csd.lossTransform.presentation.LossTransformModelWizardID"
name="%_UI_LossTransformModelWizard_label"
class="fr.tpt.mem4csd.lossTransform.presentation.LossTransformModelWizard"
category="org.eclipse.emf.ecore.Wizard.category.ID"
icon="icons/full/obj16/LossTransformModelFile.gif">
<description>%_UI_LossTransformModelWizard_description</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
</extension>
<extension point="org.eclipse.ui.editors">
<!-- @generated lossTransform -->
<editor
id="fr.tpt.mem4csd.lossTransform.presentation.LossTransformEditorID"
name="%_UI_LossTransformEditor_label"
icon="icons/full/obj16/LossTransformModelFile.gif"
extensions="losstransform"
class="fr.tpt.mem4csd.lossTransform.presentation.LossTransformEditor"
contributorClass="fr.tpt.mem4csd.lossTransform.presentation.LossTransformActionBarContributor">
</editor>
</extension>
</plugin> </plugin>

View File

@ -154,7 +154,7 @@ import org.eclipse.emf.edit.ui.util.EditUIUtil;
import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
import fr.tpt.mem4csd.loss.provider.LossItemProviderAdapterFactory; import fr.tpt.mem4csd.loss.provider.LossItemProviderAdapterFactory;
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.actions.WorkspaceModifyOperation;
/** /**
@ -686,6 +686,7 @@ public class LossEditor extends MultiPageEditorPart
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new LossItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new LossItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed. // Create the command stack that will notify this editor as commands are executed.

View File

@ -7,6 +7,7 @@ import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.ui.EclipseUIPlugin; import org.eclipse.emf.common.ui.EclipseUIPlugin;
import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
/** /**
* This is the central singleton for the Loss editor plugin. * This is the central singleton for the Loss editor plugin.
@ -38,7 +39,7 @@ public final class LossEditorPlugin extends EMFPlugin {
* @generated * @generated
*/ */
public LossEditorPlugin() { public LossEditorPlugin() {
super(new ResourceLocator[] {}); super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
} }
/** /**

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossTransformActionBarContributor
extends EditingDomainActionBarContributor
implements ISelectionChangedListener {
/**
* This keeps track of the active editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IEditorPart activeEditorPart;
/**
* This keeps track of the current selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ISelectionProvider selectionProvider;
/**
* This action opens the Properties view.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createChildActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateChild actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createSiblingActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateSibling actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createSiblingMenuManager;
/**
* This creates an instance of the contributor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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 <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
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 <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
* by inserting them before the specified contribution item <code>contributionID</code>.
* If <code>contributionID</code> is <code>null</code>, they are simply added.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void populateManager(IContributionManager manager, Collection<? extends IAction> 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 <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> 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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean removeAllReferencesOnDelete() {
return true;
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public final class LossTransformEditorPlugin extends EMFPlugin {
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final LossTransformEditorPlugin INSTANCE = new LossTransformEditorPlugin();
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static Implementation plugin;
/**
* Create the instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LossTransformEditorPlugin() {
super
(new ResourceLocator [] {
EcoreEditPlugin.INSTANCE,
LossEditPlugin.INSTANCE,
});
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
@Override
public ResourceLocator getPluginResourceLocator() {
return plugin;
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
public static Implementation getPlugin() {
return plugin;
}
/**
* The actual implementation of the Eclipse <b>Plugin</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class Implementation extends EclipseUIPlugin {
/**
* Creates an instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Implementation() {
super();
// Remember the static instance.
//
plugin = this;
}
}
}

View File

@ -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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossTransformModelWizard extends Wizard implements INewWizard {
/**
* The supported extensions for created files.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<String> FILE_EXTENSIONS =
Collections.unmodifiableList(Arrays.asList(LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameExtensions").split("\\s*,\\s*")));
/**
* A formatted list of supported file extensions, suitable for display.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String FORMATTED_FILE_EXTENSIONS =
LossTransformEditorPlugin.INSTANCE.getString("_UI_LossTransformEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
/**
* This caches an instance of the model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LossTransformPackage lossTransformPackage = LossTransformPackage.eINSTANCE;
/**
* This caches an instance of the model factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LossTransformFactory lossTransformFactory = lossTransformPackage.getLossTransformFactory();
/**
* This is the file creation page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LossTransformModelWizardNewFileCreationPage newFileCreationPage;
/**
* This is the initial object creation page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LossTransformModelWizardInitialObjectCreationPage initialObjectCreationPage;
/**
* Remember the selection during initialization for populating the default container.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IStructuredSelection selection;
/**
* Remember the workbench during initialization.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IWorkbench workbench;
/**
* Caches the names of the types that can be created as the root object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected List<String> initialObjectNames;
/**
* This just records the information.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<String> getInitialObjectNames() {
if (initialObjectNames == null) {
initialObjectNames = new ArrayList<String>();
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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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<Object, Object> options = new HashMap<Object, Object>();
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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossTransformModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
/**
* Pass in the selection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LossTransformModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
super(pageId, selection);
}
/**
* The framework calls this to see if the file is correct.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LossTransformModelWizardInitialObjectCreationPage extends WizardPage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Combo initialObjectField;
/**
* @generated
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*/
protected List<String> encodings;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Combo encodingField;
/**
* Pass in the selection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LossTransformModelWizardInitialObjectCreationPage(String pageId) {
super(pageId);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModifyListener validator =
new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setPageComplete(validatePage());
}
};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected boolean validatePage() {
return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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();
}
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getInitialObjectName() {
String label = initialObjectField.getText();
for (String name : getInitialObjectNames()) {
if (getLabel(name).equals(label)) {
return name;
}
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getEncoding() {
return encodingField.getText();
}
/**
* Returns the label for the specified type name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected String getLabel(String typeName) {
try {
return LossTransformEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
}
catch(MissingResourceException mre) {
LossTransformEditorPlugin.INSTANCE.log(mre);
}
return typeName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<String> getEncodings() {
if (encodings == null) {
encodings = new ArrayList<String>();
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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IFile getModelFile() {
return newFileCreationPage.getModelFile();
}
}

View File

@ -1,4 +0,0 @@
library faceConfig;
helper def : inname : String = 'mote';
helper def : packageNames : Set(String) = Set{ 'IN', 'MLTGG', 'ECORE' };

View File

@ -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'
)
}

View File

@ -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())
)
}

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View File

@ -10,7 +10,11 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: fr.tpt.mem4csd.loss, Export-Package: fr.tpt.mem4csd.loss,
fr.tpt.mem4csd.loss.impl, 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, Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
fr.tpt.mem4csd.loss;visibility:=reexport,
org.eclipse.core.runtime org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy

View File

@ -4,7 +4,8 @@ bin.includes = .,\
model/,\ model/,\
META-INF/,\ META-INF/,\
plugin.xml,\ plugin.xml,\
plugin.properties plugin.properties,\
src/
jars.compile.order = . jars.compile.order = .
source.. = src-gen/ source.. = src/
output.. = bin/ output.. = bin/

Some files were not shown because too many files have changed in this diff Show More