Initial Commit
This commit is contained in:
commit
3a0df538a6
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src-gen"/>
|
||||||
|
<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="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>fr.tpt.mem4csd.loss.edit</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: %pluginName
|
||||||
|
Bundle-SymbolicName: fr.tpt.mem4csd.loss.edit;singleton:=true
|
||||||
|
Automatic-Module-Name: fr.tpt.mem4csd.loss.edit
|
||||||
|
Bundle-Version: 1.0.0.qualifier
|
||||||
|
Bundle-ClassPath: .
|
||||||
|
Bundle-Activator: fr.tpt.mem4csd.loss.provider.LossEditPlugin$Implementation
|
||||||
|
Bundle-Vendor: %providerName
|
||||||
|
Bundle-Localization: plugin
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
|
Export-Package: fr.tpt.mem4csd.loss.provider
|
||||||
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
fr.tpt.mem4csd.loss;visibility:=reexport,
|
||||||
|
org.eclipse.emf.edit;visibility:=reexport
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
/ComplexItemProvider.class
|
||||||
|
/LinkItemProvider.class
|
||||||
|
/LossEditPlugin$Implementation.class
|
||||||
|
/LossEditPlugin.class
|
||||||
|
/LossItemProviderAdapterFactory.class
|
||||||
|
/NamedObjectItemProvider.class
|
||||||
|
/PrimitiveItemProvider.class
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
bin.includes = .,\
|
||||||
|
icons/,\
|
||||||
|
META-INF/,\
|
||||||
|
plugin.xml,\
|
||||||
|
plugin.properties
|
||||||
|
jars.compile.order = .
|
||||||
|
source.. = src-gen/
|
||||||
|
output.. = bin/
|
||||||
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 |
|
|
@ -0,0 +1,29 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
pluginName = fr.tpt.mem4csd.loss Edit Support
|
||||||
|
providerName = www.example.org
|
||||||
|
|
||||||
|
_UI_CreateChild_text = {0}
|
||||||
|
_UI_CreateChild_text2 = {1} {0}
|
||||||
|
_UI_CreateChild_text3 = {1}
|
||||||
|
_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
|
||||||
|
_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
|
||||||
|
_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
|
||||||
|
|
||||||
|
_UI_PropertyDescriptor_description = The {0} of the {1}
|
||||||
|
|
||||||
|
_UI_NamedObject_type = Named Object
|
||||||
|
_UI_Primitive_type = Primitive
|
||||||
|
_UI_Link_type = Link
|
||||||
|
_UI_Complex_type = Complex
|
||||||
|
_UI_Unknown_type = Object
|
||||||
|
|
||||||
|
_UI_Unknown_datatype= Value
|
||||||
|
|
||||||
|
_UI_NamedObject_name_feature = Name
|
||||||
|
_UI_NamedObject_qname_feature = Qname
|
||||||
|
_UI_Primitive_type_feature = Type
|
||||||
|
_UI_Link_referenceTo_feature = Reference To
|
||||||
|
_UI_Complex_primitives_feature = Primitives
|
||||||
|
_UI_Unknown_feature = Unspecified
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse version="3.0"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
|
||||||
|
<!-- @generated loss -->
|
||||||
|
<factory
|
||||||
|
uri="http://mem4csd.telecom-paris.fr/loss"
|
||||||
|
class="fr.tpt.mem4csd.loss.provider.LossItemProviderAdapterFactory"
|
||||||
|
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>
|
||||||
|
|
@ -0,0 +1,153 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.Complex;
|
||||||
|
import fr.tpt.mem4csd.loss.LossFactory;
|
||||||
|
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.ecore.EStructuralFeature;
|
||||||
|
|
||||||
|
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
|
||||||
|
import org.eclipse.emf.edit.provider.ViewerNotification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.Complex} object.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class ComplexItemProvider extends NamedObjectItemProvider {
|
||||||
|
/**
|
||||||
|
* This constructs an instance from a factory and a notifier.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public ComplexItemProvider(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 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(LossPackage.Literals.COMPLEX__PRIMITIVES);
|
||||||
|
}
|
||||||
|
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 Complex.gif.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getImage(Object object) {
|
||||||
|
return overlayImage(object, getResourceLocator().getImage("full/obj16/Complex"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- 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 = ((Complex) object).getName();
|
||||||
|
return label == null || label.length() == 0 ? getString("_UI_Complex_type")
|
||||||
|
: getString("_UI_Complex_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);
|
||||||
|
|
||||||
|
switch (notification.getFeatureID(Complex.class)) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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(LossPackage.Literals.COMPLEX__PRIMITIVES,
|
||||||
|
LossFactory.eINSTANCE.createPrimitive()));
|
||||||
|
|
||||||
|
newChildDescriptors.add(
|
||||||
|
createChildParameter(LossPackage.Literals.COMPLEX__PRIMITIVES, LossFactory.eINSTANCE.createLink()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.Link;
|
||||||
|
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.edit.provider.ComposeableAdapterFactory;
|
||||||
|
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.Link} object.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LinkItemProvider extends PrimitiveItemProvider {
|
||||||
|
/**
|
||||||
|
* This constructs an instance from a factory and a notifier.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public LinkItemProvider(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);
|
||||||
|
|
||||||
|
addReferenceToPropertyDescriptor(object);
|
||||||
|
}
|
||||||
|
return itemPropertyDescriptors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This adds a property descriptor for the Reference To feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected void addReferenceToPropertyDescriptor(Object object) {
|
||||||
|
itemPropertyDescriptors
|
||||||
|
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||||
|
getResourceLocator(), getString("_UI_Link_referenceTo_feature"),
|
||||||
|
getString("_UI_PropertyDescriptor_description", "_UI_Link_referenceTo_feature",
|
||||||
|
"_UI_Link_type"),
|
||||||
|
LossPackage.Literals.LINK__REFERENCE_TO, true, false, true, null, null, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This returns Link.gif.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getImage(Object object) {
|
||||||
|
return overlayImage(object, getResourceLocator().getImage("full/obj16/Link"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- 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 = ((Link) object).getName();
|
||||||
|
return label == null || label.length() == 0 ? getString("_UI_Link_type")
|
||||||
|
: getString("_UI_Link_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.EMFPlugin;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.util.ResourceLocator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the central singleton for the Loss edit plugin.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public final class LossEditPlugin extends EMFPlugin {
|
||||||
|
/**
|
||||||
|
* Keep track of the singleton.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public static final LossEditPlugin INSTANCE = new LossEditPlugin();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 LossEditPlugin() {
|
||||||
|
super(new ResourceLocator[] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,257 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.util.LossAdapterFactory;
|
||||||
|
|
||||||
|
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 LossItemProviderAdapterFactory extends LossAdapterFactory
|
||||||
|
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 LossItemProviderAdapterFactory() {
|
||||||
|
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.loss.Primitive} instances.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected PrimitiveItemProvider primitiveItemProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This creates an adapter for a {@link fr.tpt.mem4csd.loss.Primitive}.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Adapter createPrimitiveAdapter() {
|
||||||
|
if (primitiveItemProvider == null) {
|
||||||
|
primitiveItemProvider = new PrimitiveItemProvider(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return primitiveItemProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.loss.Link} instances.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LinkItemProvider linkItemProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This creates an adapter for a {@link fr.tpt.mem4csd.loss.Link}.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Adapter createLinkAdapter() {
|
||||||
|
if (linkItemProvider == null) {
|
||||||
|
linkItemProvider = new LinkItemProvider(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return linkItemProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This keeps track of the one adapter used for all {@link fr.tpt.mem4csd.loss.Complex} instances.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected ComplexItemProvider complexItemProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This creates an adapter for a {@link fr.tpt.mem4csd.loss.Complex}.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Adapter createComplexAdapter() {
|
||||||
|
if (complexItemProvider == null) {
|
||||||
|
complexItemProvider = new ComplexItemProvider(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return complexItemProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 (primitiveItemProvider != null)
|
||||||
|
primitiveItemProvider.dispose();
|
||||||
|
if (linkItemProvider != null)
|
||||||
|
linkItemProvider.dispose();
|
||||||
|
if (complexItemProvider != null)
|
||||||
|
complexItemProvider.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.NamedObject;
|
||||||
|
|
||||||
|
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.ItemPropertyDescriptor;
|
||||||
|
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
|
||||||
|
import org.eclipse.emf.edit.provider.ViewerNotification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.NamedObject} object.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class NamedObjectItemProvider 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 NamedObjectItemProvider(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);
|
||||||
|
|
||||||
|
addNamePropertyDescriptor(object);
|
||||||
|
addQnamePropertyDescriptor(object);
|
||||||
|
}
|
||||||
|
return itemPropertyDescriptors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This adds a property descriptor for the Name feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected void addNamePropertyDescriptor(Object object) {
|
||||||
|
itemPropertyDescriptors
|
||||||
|
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||||
|
getResourceLocator(), getString("_UI_NamedObject_name_feature"),
|
||||||
|
getString("_UI_PropertyDescriptor_description", "_UI_NamedObject_name_feature",
|
||||||
|
"_UI_NamedObject_type"),
|
||||||
|
LossPackage.Literals.NAMED_OBJECT__NAME, true, false, false,
|
||||||
|
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This adds a property descriptor for the Qname feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected void addQnamePropertyDescriptor(Object object) {
|
||||||
|
itemPropertyDescriptors
|
||||||
|
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||||
|
getResourceLocator(), getString("_UI_NamedObject_qname_feature"),
|
||||||
|
getString("_UI_PropertyDescriptor_description", "_UI_NamedObject_qname_feature",
|
||||||
|
"_UI_NamedObject_type"),
|
||||||
|
LossPackage.Literals.NAMED_OBJECT__QNAME, false, false, false,
|
||||||
|
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- 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 = ((NamedObject) object).getName();
|
||||||
|
return label == null || label.length() == 0 ? getString("_UI_NamedObject_type")
|
||||||
|
: getString("_UI_NamedObject_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);
|
||||||
|
|
||||||
|
switch (notification.getFeatureID(NamedObject.class)) {
|
||||||
|
case LossPackage.NAMED_OBJECT__NAME:
|
||||||
|
case LossPackage.NAMED_OBJECT__QNAME:
|
||||||
|
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.provider;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.LossFactory;
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.Primitive;
|
||||||
|
|
||||||
|
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.IItemPropertyDescriptor;
|
||||||
|
import org.eclipse.emf.edit.provider.ViewerNotification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the item provider adapter for a {@link fr.tpt.mem4csd.loss.Primitive} object.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class PrimitiveItemProvider extends NamedObjectItemProvider {
|
||||||
|
/**
|
||||||
|
* This constructs an instance from a factory and a notifier.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public PrimitiveItemProvider(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 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(LossPackage.Literals.PRIMITIVE__TYPE);
|
||||||
|
}
|
||||||
|
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 Primitive.gif.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getImage(Object object) {
|
||||||
|
return overlayImage(object, getResourceLocator().getImage("full/obj16/Primitive"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- 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 = ((Primitive) object).getName();
|
||||||
|
return label == null || label.length() == 0 ? getString("_UI_Primitive_type")
|
||||||
|
: getString("_UI_Primitive_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);
|
||||||
|
|
||||||
|
switch (notification.getFeatureID(Primitive.class)) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createPrimitive()));
|
||||||
|
|
||||||
|
newChildDescriptors
|
||||||
|
.add(createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createLink()));
|
||||||
|
|
||||||
|
newChildDescriptors
|
||||||
|
.add(createChildParameter(LossPackage.Literals.PRIMITIVE__TYPE, LossFactory.eINSTANCE.createComplex()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src-gen"/>
|
||||||
|
<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="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>fr.tpt.mem4csd.loss.editor</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: %pluginName
|
||||||
|
Bundle-SymbolicName: fr.tpt.mem4csd.loss.editor;singleton:=true
|
||||||
|
Automatic-Module-Name: fr.tpt.mem4csd.loss.editor
|
||||||
|
Bundle-Version: 1.0.0.qualifier
|
||||||
|
Bundle-ClassPath: .
|
||||||
|
Bundle-Activator: fr.tpt.mem4csd.loss.presentation.LossEditorPlugin$Implementation
|
||||||
|
Bundle-Vendor: %providerName
|
||||||
|
Bundle-Localization: plugin
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
|
Export-Package: fr.tpt.mem4csd.loss.presentation
|
||||||
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
org.eclipse.core.resources;visibility:=reexport,
|
||||||
|
fr.tpt.mem4csd.loss.edit;visibility:=reexport,
|
||||||
|
org.eclipse.emf.ecore.xmi;visibility:=reexport,
|
||||||
|
org.eclipse.emf.edit.ui;visibility:=reexport,
|
||||||
|
org.eclipse.ui.ide;visibility:=reexport
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
*.class
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
bin.includes = .,\
|
||||||
|
icons/,\
|
||||||
|
META-INF/,\
|
||||||
|
plugin.xml,\
|
||||||
|
plugin.properties
|
||||||
|
jars.compile.order = .
|
||||||
|
source.. = src-gen/
|
||||||
|
output.. = bin
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 346 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
|
|
@ -0,0 +1,53 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
pluginName = fr.tpt.mem4csd.loss Editor
|
||||||
|
providerName = www.example.org
|
||||||
|
|
||||||
|
_UI_LossEditor_menu = &Loss Editor
|
||||||
|
|
||||||
|
_UI_CreateChild_menu_item = &New Child
|
||||||
|
_UI_CreateSibling_menu_item = N&ew Sibling
|
||||||
|
|
||||||
|
_UI_ShowPropertiesView_menu_item = Show &Properties View
|
||||||
|
_UI_RefreshViewer_menu_item = &Refresh
|
||||||
|
|
||||||
|
_UI_SelectionPage_label = Selection
|
||||||
|
_UI_ParentPage_label = Parent
|
||||||
|
_UI_ListPage_label = List
|
||||||
|
_UI_TreePage_label = Tree
|
||||||
|
_UI_TablePage_label = Table
|
||||||
|
_UI_TreeWithColumnsPage_label = Tree with Columns
|
||||||
|
_UI_ObjectColumn_label = Object
|
||||||
|
_UI_SelfColumn_label = Self
|
||||||
|
|
||||||
|
_UI_NoObjectSelected = Selected Nothing
|
||||||
|
_UI_SingleObjectSelected = Selected Object: {0}
|
||||||
|
_UI_MultiObjectSelected = Selected {0} Objects
|
||||||
|
|
||||||
|
_UI_OpenEditorError_label = Open Editor
|
||||||
|
|
||||||
|
_UI_Wizard_category = Example EMF Model Creation Wizards
|
||||||
|
|
||||||
|
_UI_CreateModelError_message = Problems encountered in file "{0}"
|
||||||
|
|
||||||
|
_UI_LossModelWizard_label = Loss Model
|
||||||
|
_UI_LossModelWizard_description = Create a new Loss model
|
||||||
|
|
||||||
|
_UI_LossEditor_label = Loss Model Editor
|
||||||
|
|
||||||
|
_UI_LossEditorFilenameDefaultBase = My
|
||||||
|
_UI_LossEditorFilenameExtensions = loss
|
||||||
|
|
||||||
|
_UI_Wizard_label = New
|
||||||
|
|
||||||
|
_WARN_FilenameExtension = The file name must end in ''.{0}''
|
||||||
|
_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
|
||||||
|
|
||||||
|
_UI_ModelObject = &Model Object
|
||||||
|
_UI_XMLEncoding = &XML Encoding
|
||||||
|
_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
|
||||||
|
_UI_Wizard_initial_object_description = Select a model object to create
|
||||||
|
|
||||||
|
_UI_FileConflict_label = File Conflict
|
||||||
|
_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse version="3.0"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.ui.newWizards">
|
||||||
|
<!-- @generated loss -->
|
||||||
|
<category
|
||||||
|
id="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||||
|
name="%_UI_Wizard_category"/>
|
||||||
|
<wizard
|
||||||
|
id="fr.tpt.mem4csd.loss.presentation.LossModelWizardID"
|
||||||
|
name="%_UI_LossModelWizard_label"
|
||||||
|
class="fr.tpt.mem4csd.loss.presentation.LossModelWizard"
|
||||||
|
category="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||||
|
icon="icons/full/obj16/LossModelFile.gif">
|
||||||
|
<description>%_UI_LossModelWizard_description</description>
|
||||||
|
<selection class="org.eclipse.core.resources.IResource"/>
|
||||||
|
</wizard>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.ui.editors">
|
||||||
|
<!-- @generated loss -->
|
||||||
|
<editor
|
||||||
|
id="fr.tpt.mem4csd.loss.presentation.LossEditorID"
|
||||||
|
name="%_UI_LossEditor_label"
|
||||||
|
icon="icons/full/obj16/LossModelFile.gif"
|
||||||
|
extensions="loss"
|
||||||
|
class="fr.tpt.mem4csd.loss.presentation.LossEditor"
|
||||||
|
contributorClass="fr.tpt.mem4csd.loss.presentation.LossActionBarContributor">
|
||||||
|
</editor>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
</plugin>
|
||||||
|
|
@ -0,0 +1,422 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.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 Loss model editor.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossActionBarContributor 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(
|
||||||
|
LossEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
getPage().showView("org.eclipse.ui.views.PropertySheet");
|
||||||
|
} catch (PartInitException exception) {
|
||||||
|
LossEditorPlugin.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(
|
||||||
|
LossEditorPlugin.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 LossActionBarContributor() {
|
||||||
|
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("loss-settings"));
|
||||||
|
toolBarManager.add(new Separator("loss-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(LossEditorPlugin.INSTANCE.getString("_UI_LossEditor_menu"),
|
||||||
|
"fr.tpt.mem4csd.lossMenuID");
|
||||||
|
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(LossEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||||
|
submenuManager.insertBefore("additions", createChildMenuManager);
|
||||||
|
|
||||||
|
// Prepare for CreateSibling item addition or removal.
|
||||||
|
//
|
||||||
|
createSiblingMenuManager = new MenuManager(LossEditorPlugin.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(LossEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||||
|
populateManager(submenuManager, createChildActions, null);
|
||||||
|
menuManager.insertBefore("edit", submenuManager);
|
||||||
|
|
||||||
|
submenuManager = new MenuManager(LossEditorPlugin.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,89 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.presentation;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.EMFPlugin;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.ui.EclipseUIPlugin;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.util.ResourceLocator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the central singleton for the Loss editor plugin.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public final class LossEditorPlugin extends EMFPlugin {
|
||||||
|
/**
|
||||||
|
* Keep track of the singleton.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public static final LossEditorPlugin INSTANCE = new LossEditorPlugin();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 LossEditorPlugin() {
|
||||||
|
super(new ResourceLocator[] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,627 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.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.loss.LossFactory;
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.provider.LossEditPlugin;
|
||||||
|
|
||||||
|
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 LossModelWizard 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(LossEditorPlugin.INSTANCE.getString("_UI_LossEditorFilenameExtensions").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 = LossEditorPlugin.INSTANCE
|
||||||
|
.getString("_UI_LossEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This caches an instance of the model package.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LossPackage lossPackage = LossPackage.eINSTANCE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This caches an instance of the model factory.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LossFactory lossFactory = lossPackage.getLossFactory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the file creation page.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LossModelWizardNewFileCreationPage newFileCreationPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the initial object creation page.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LossModelWizardInitialObjectCreationPage 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(LossEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
|
||||||
|
setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE
|
||||||
|
.getImageDescriptor(LossEditorPlugin.INSTANCE.getImage("full/wizban/NewLoss")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 : lossPackage.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) lossPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
|
||||||
|
EObject rootObject = lossFactory.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) {
|
||||||
|
LossEditorPlugin.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(),
|
||||||
|
LossEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (Exception exception) {
|
||||||
|
LossEditorPlugin.INSTANCE.log(exception);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the one page of the wizard.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
|
||||||
|
/**
|
||||||
|
* Pass in the selection.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public LossModelWizardNewFileCreationPage(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(
|
||||||
|
LossEditorPlugin.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 LossModelWizardInitialObjectCreationPage 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 LossModelWizardInitialObjectCreationPage(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(LossEditorPlugin.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(LossEditorPlugin.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 LossEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
|
||||||
|
} catch (MissingResourceException mre) {
|
||||||
|
LossEditorPlugin.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(
|
||||||
|
LossEditorPlugin.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 LossModelWizardNewFileCreationPage("Whatever", selection);
|
||||||
|
newFileCreationPage.setTitle(LossEditorPlugin.INSTANCE.getString("_UI_LossModelWizard_label"));
|
||||||
|
newFileCreationPage.setDescription(LossEditorPlugin.INSTANCE.getString("_UI_LossModelWizard_description"));
|
||||||
|
newFileCreationPage.setFileName(LossEditorPlugin.INSTANCE.getString("_UI_LossEditorFilenameDefaultBase") + "."
|
||||||
|
+ 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 = LossEditorPlugin.INSTANCE
|
||||||
|
.getString("_UI_LossEditorFilenameDefaultBase");
|
||||||
|
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 LossModelWizardInitialObjectCreationPage("Whatever2");
|
||||||
|
initialObjectCreationPage.setTitle(LossEditorPlugin.INSTANCE.getString("_UI_LossModelWizard_label"));
|
||||||
|
initialObjectCreationPage
|
||||||
|
.setDescription(LossEditorPlugin.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
/face2loss.asm
|
||||||
|
/mm2loss.asm
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>fr.tpt.mem4csd.loss.mm2loss</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2m.atl.adt.builder.atlBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.m2m.atl.adt.builder.atlNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
query mm2loss =
|
||||||
|
let modulename : String = 'face2loss' in
|
||||||
|
let classifiers : Sequence(String) = ECORE!EClassifier.allInstancesFrom('IN').asSet()->collect(item | item.toRule()) in
|
||||||
|
let linkRules : Sequence(String) = ECORE!EClass.allInstancesFrom('IN').asSet()->collect(cl | cl.toLink()) in
|
||||||
|
('module ' + modulename + ';\n\ncreate LOSS : OUT from MM : IN;\n\n' + thisModule.join(classifiers.union(linkRules), '\n').toString()).writeTo((modulename + '.atl').path);
|
||||||
|
|
||||||
|
helper def : join(seq : Sequence(String), separator : String) : String =
|
||||||
|
seq->iterate(el ; acc : String = '' | if acc = '' then el else acc + separator + el endif);
|
||||||
|
|
||||||
|
helper context String def : path : String =
|
||||||
|
('/fr.tpt.mem4csd.loss.mm2loss/' + self);
|
||||||
|
|
||||||
|
helper context ECORE!EClassifier def : qualifiedName : String =
|
||||||
|
self.ePackage.qualifiedName + '::' + self.name;
|
||||||
|
|
||||||
|
helper context ECORE!EPackage def : qualifiedName : String =
|
||||||
|
if self.eSuperPackage.oclIsUndefined()
|
||||||
|
then self.name
|
||||||
|
else self.eSuperPackage.qualifiedName + '::' + self.name
|
||||||
|
endif;
|
||||||
|
|
||||||
|
helper context ECORE!EClassifier def : sanitizedFullName : String = self.qualifiedName.replaceAll('::', '_');
|
||||||
|
|
||||||
|
helper context ECORE!EDataType def : toRule() : String =
|
||||||
|
'lazy rule DT' + self.sanitizedFullName + '2Prim {\n' +
|
||||||
|
'\t' + 'from' + '\n' +
|
||||||
|
'\t' + 'source : IN!"' + self.qualifiedName + '" in MM\n' + -- NOTE: DataTypes don't inherit'" (source.oclIsTypeOf(IN!"' + self.qualifiedName + '"))\n' +
|
||||||
|
'\t' + 'to' + '\n' +
|
||||||
|
'\t' + 'prim : OUT!Primitive (' + '\n' +
|
||||||
|
'\t\t' + 'name <- source.toString()' + '\n' +
|
||||||
|
'\t' + ')' + '\n' +
|
||||||
|
'}\n';
|
||||||
|
|
||||||
|
helper context ECORE!EClass def : toLink(source: ECORE!EClass) : String =
|
||||||
|
'lazy rule ' + self.sanitizedFullName + 'ReferenceToLink {' + '\n' +
|
||||||
|
'\t' + 'from' + '\n' +
|
||||||
|
'\t' + 'source : IN!"' + self.qualifiedName + '" in MM (source.oclIsTypeOf(IN!"' + self.qualifiedName + '"))\n' +
|
||||||
|
'\t' + 'to' + '\n' +
|
||||||
|
'\t' + 'link : OUT!Link ('+ '\n' +
|
||||||
|
'\t\t' + 'referenceTo <- source' + '\n' +
|
||||||
|
'\t' + ')' + '\n' +
|
||||||
|
'}\n';
|
||||||
|
|
||||||
|
helper def : referenceToPrimitive ( ref : ECORE!EReference ) : String =
|
||||||
|
if ref.many
|
||||||
|
then '.union(source.' + ref.name + '->collect(it | thisModule.ReferenceToLink(it)))'
|
||||||
|
else '.add(thisModule.ReferenceToLink(source.' + ref.name + '))'
|
||||||
|
endif;
|
||||||
|
|
||||||
|
helper context ECORE!EClass def : toRule() : String =
|
||||||
|
'rule CL' + self.sanitizedFullName.debug('class: ') + '2Complex {\n' +
|
||||||
|
'\t' + 'from' + '\n' +
|
||||||
|
'\t' + 'source : IN!"' + self.qualifiedName + '" in MM (source.oclIsTypeOf(IN!"' + self.qualifiedName + '"))\n' +
|
||||||
|
'\t' + 'to' + '\n' +
|
||||||
|
'\t' + 'prim : OUT!Complex (' + '\n' +
|
||||||
|
'\t\t' + 'name <- source.toString(),' + '\n' +
|
||||||
|
'\t\t' + 'primitives <- Set{}' + thisModule.join(self.eAllReferences->collect(ref | thisModule.referenceToPrimitive(ref)), '') + '\n' +
|
||||||
|
'\t' + ')' + '\n' +
|
||||||
|
'}\n';
|
||||||
|
|
||||||
|
-- toString().writeTo(output)
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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.pde.core.requiredPlugins"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>fr.tpt.mem4csd.loss</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.sirius.nature.modelingproject</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: %pluginName
|
||||||
|
Bundle-SymbolicName: fr.tpt.mem4csd.loss;singleton:=true
|
||||||
|
Automatic-Module-Name: fr.tpt.mem4csd.loss
|
||||||
|
Bundle-Version: 0.1.0.qualifier
|
||||||
|
Bundle-ClassPath: .
|
||||||
|
Bundle-Vendor: %providerName
|
||||||
|
Bundle-Localization: plugin
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
|
Export-Package: fr.tpt.mem4csd.loss,
|
||||||
|
fr.tpt.mem4csd.loss.impl,
|
||||||
|
fr.tpt.mem4csd.loss.util
|
||||||
|
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
|
||||||
|
org.eclipse.core.runtime
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
/Complex.class
|
||||||
|
/Link.class
|
||||||
|
/LossFactory.class
|
||||||
|
/LossPackage$Literals.class
|
||||||
|
/LossPackage.class
|
||||||
|
/NamedObject.class
|
||||||
|
/Primitive.class
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
/ComplexImpl.class
|
||||||
|
/LinkImpl.class
|
||||||
|
/LossFactoryImpl.class
|
||||||
|
/LossPackageImpl.class
|
||||||
|
/NamedObjectImpl.class
|
||||||
|
/PrimitiveImpl.class
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
/LossAdapterFactory$1.class
|
||||||
|
/LossAdapterFactory.class
|
||||||
|
/LossSwitch.class
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
bin.includes = .,\
|
||||||
|
model/,\
|
||||||
|
META-INF/,\
|
||||||
|
plugin.xml,\
|
||||||
|
plugin.properties
|
||||||
|
jars.compile.order = .
|
||||||
|
source.. = src-gen/
|
||||||
|
output.. = bin/
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.3/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
|
||||||
|
<viewpoint:DAnalysis uid="_yKtS0AbQEe-Qz_3m5UGyUg" selectedViews="_y-dD8AbQEe-Qz_3m5UGyUg" version="15.2.0.202303281325">
|
||||||
|
<semanticResources>loss.ecore</semanticResources>
|
||||||
|
<semanticResources>loss.genmodel</semanticResources>
|
||||||
|
<ownedViews xmi:type="viewpoint:DView" uid="_y-dD8AbQEe-Qz_3m5UGyUg">
|
||||||
|
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
|
||||||
|
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_y__VAAbQEe-Qz_3m5UGyUg" name="loss" repPath="#_y_dJgAbQEe-Qz_3m5UGyUg" changeId="1714467967040">
|
||||||
|
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
|
||||||
|
<target xmi:type="ecore:EPackage" href="loss.ecore#/"/>
|
||||||
|
</ownedRepresentationDescriptors>
|
||||||
|
</ownedViews>
|
||||||
|
</viewpoint:DAnalysis>
|
||||||
|
<diagram:DSemanticDiagram uid="_y_dJgAbQEe-Qz_3m5UGyUg">
|
||||||
|
<ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_zAdPEAbQEe-Qz_3m5UGyUg" source="GMF_DIAGRAMS">
|
||||||
|
<data xmi:type="notation:Diagram" xmi:id="_zAdPEQbQEe-Qz_3m5UGyUg" type="Sirius" element="_y_dJgAbQEe-Qz_3m5UGyUg" measurementUnit="Pixel">
|
||||||
|
<children xmi:type="notation:Node" xmi:id="_4RdOoAbQEe-Qz_3m5UGyUg" type="2001" element="_4Pe4sAbQEe-Qz_3m5UGyUg">
|
||||||
|
<children xmi:type="notation:Node" xmi:id="_4RgR8AbQEe-Qz_3m5UGyUg" type="5002">
|
||||||
|
<layoutConstraint xmi:type="notation:Location" xmi:id="_4RgR8QbQEe-Qz_3m5UGyUg" y="5"/>
|
||||||
|
</children>
|
||||||
|
<children xmi:type="notation:Node" xmi:id="_4bi-wAbQEe-Qz_3m5UGyUg" type="3005" element="_4PmNcAbQEe-Qz_3m5UGyUg">
|
||||||
|
<styles xmi:type="notation:ShapeStyle" xmi:id="_4bi-wQbQEe-Qz_3m5UGyUg" fontName="Noto Sans"/>
|
||||||
|
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_4bi-wgbQEe-Qz_3m5UGyUg"/>
|
||||||
|
</children>
|
||||||
|
<styles xmi:type="notation:ShapeStyle" xmi:id="_4RdOoQbQEe-Qz_3m5UGyUg" fontName="Noto Sans" fontHeight="8"/>
|
||||||
|
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_4RdOogbQEe-Qz_3m5UGyUg" width="500" height="90"/>
|
||||||
|
</children>
|
||||||
|
<styles xmi:type="notation:DiagramStyle" xmi:id="_zAdPEgbQEe-Qz_3m5UGyUg"/>
|
||||||
|
</data>
|
||||||
|
</ownedAnnotationEntries>
|
||||||
|
<ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_zCG04AbQEe-Qz_3m5UGyUg" source="DANNOTATION_CUSTOMIZATION_KEY">
|
||||||
|
<data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_zCG04QbQEe-Qz_3m5UGyUg"/>
|
||||||
|
</ownedAnnotationEntries>
|
||||||
|
<ownedDiagramElements xmi:type="diagram:DNode" uid="_4Pe4sAbQEe-Qz_3m5UGyUg" width="-1" height="-1">
|
||||||
|
<target xmi:type="ecore:EPackage" href="loss.ecore#/"/>
|
||||||
|
<semanticElements xmi:type="ecore:EPackage" href="loss.ecore#/"/>
|
||||||
|
<ownedStyle xmi:type="diagram:WorkspaceImage" uid="_4PmNcAbQEe-Qz_3m5UGyUg" showIcon="false" labelPosition="node" workspacePath="/org.eclipse.emf.ecoretools.design/icons/full/back/empty.svg">
|
||||||
|
<description xmi:type="style:WorkspaceImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@nodeMappings[name='Empty%20Diagram']/@style"/>
|
||||||
|
</ownedStyle>
|
||||||
|
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@nodeMappings[name='Empty%20Diagram']"/>
|
||||||
|
</ownedDiagramElements>
|
||||||
|
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
|
||||||
|
<filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_y_1kAAbQEe-Qz_3m5UGyUg"/>
|
||||||
|
<activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>
|
||||||
|
<activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Package']"/>
|
||||||
|
<activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Validation']"/>
|
||||||
|
<target xmi:type="ecore:EPackage" href="loss.ecore#/"/>
|
||||||
|
</diagram:DSemanticDiagram>
|
||||||
|
</xmi:XMI>
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="loss" nsURI="http://mem4csd.telecom-paris.fr/loss" nsPrefix="loss">
|
||||||
|
<eClassifiers xsi:type="ecore:EClass" name="NamedObject" abstract="true">
|
||||||
|
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||||
|
<eStructuralFeatures xsi:type="ecore:EAttribute" name="qname" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
|
||||||
|
changeable="false" derived="true" iD="true"/>
|
||||||
|
</eClassifiers>
|
||||||
|
<eClassifiers xsi:type="ecore:EClass" name="Primitive" eSuperTypes="#//NamedObject">
|
||||||
|
<eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"
|
||||||
|
containment="true"/>
|
||||||
|
</eClassifiers>
|
||||||
|
<eClassifiers xsi:type="ecore:EClass" name="Link" eSuperTypes="#//Primitive">
|
||||||
|
<eStructuralFeatures xsi:type="ecore:EReference" name="referenceTo" lowerBound="1"
|
||||||
|
eType="#//Complex"/>
|
||||||
|
</eClassifiers>
|
||||||
|
<eClassifiers xsi:type="ecore:EClass" name="Complex" eSuperTypes="#//NamedObject">
|
||||||
|
<eStructuralFeatures xsi:type="ecore:EReference" name="primitives" upperBound="-1"
|
||||||
|
eType="#//Primitive" containment="true"/>
|
||||||
|
</eClassifiers>
|
||||||
|
</ecore:EPackage>
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
|
||||||
|
modelDirectory="/fr.tpt.mem4csd.loss/src-gen" creationIcons="false"
|
||||||
|
editDirectory="/fr.tpt.mem4csd.loss.edit/src-gen" editorDirectory="/fr.tpt.mem4csd.loss.editor/src-gen"
|
||||||
|
modelPluginID="fr.tpt.mem4csd.loss" modelName="Loss" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
|
||||||
|
codeFormatting="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="17.0"
|
||||||
|
copyrightFields="false" operationReflection="true" importOrganizing="true">
|
||||||
|
<foreignModel>loss.ecore</foreignModel>
|
||||||
|
<testsDirectory xsi:nil="true"/>
|
||||||
|
<genPackages prefix="Loss" basePackage="fr.tpt.mem4csd" disposableProviderFactory="true"
|
||||||
|
ecorePackage="loss.ecore#/">
|
||||||
|
<genClasses image="false" ecoreClass="loss.ecore#//NamedObject">
|
||||||
|
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute loss.ecore#//NamedObject/name"/>
|
||||||
|
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute loss.ecore#//NamedObject/qname"/>
|
||||||
|
</genClasses>
|
||||||
|
<genClasses ecoreClass="loss.ecore#//Primitive">
|
||||||
|
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference loss.ecore#//Primitive/type"/>
|
||||||
|
</genClasses>
|
||||||
|
<genClasses ecoreClass="loss.ecore#//Link">
|
||||||
|
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference loss.ecore#//Link/referenceTo"/>
|
||||||
|
</genClasses>
|
||||||
|
<genClasses ecoreClass="loss.ecore#//Complex">
|
||||||
|
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference loss.ecore#//Complex/primitives"/>
|
||||||
|
</genClasses>
|
||||||
|
</genPackages>
|
||||||
|
</genmodel:GenModel>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
pluginName = fr.tpt.mem4csd.loss
|
||||||
|
providerName = www.example.org
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse version="3.0"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||||
|
<!-- @generated loss -->
|
||||||
|
<package
|
||||||
|
uri="http://mem4csd.telecom-paris.fr/loss"
|
||||||
|
class="fr.tpt.mem4csd.loss.LossPackage"
|
||||||
|
genModel="model/loss.genmodel"/>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
</plugin>
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.util.EList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* A representation of the model object '<em><b>Complex</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* The following features are supported:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.Complex#getPrimitives <em>Primitives</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getComplex()
|
||||||
|
* @model
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface Complex extends NamedObject {
|
||||||
|
/**
|
||||||
|
* Returns the value of the '<em><b>Primitives</b></em>' containment reference list.
|
||||||
|
* The list contents are of type {@link fr.tpt.mem4csd.loss.Primitive}.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the value of the '<em>Primitives</em>' containment reference list.
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getComplex_Primitives()
|
||||||
|
* @model containment="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EList<Primitive> getPrimitives();
|
||||||
|
|
||||||
|
} // Complex
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* A representation of the model object '<em><b>Link</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* The following features are supported:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.Link#getReferenceTo <em>Reference To</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getLink()
|
||||||
|
* @model
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface Link extends Primitive {
|
||||||
|
/**
|
||||||
|
* Returns the value of the '<em><b>Reference To</b></em>' reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the value of the '<em>Reference To</em>' reference.
|
||||||
|
* @see #setReferenceTo(Complex)
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getLink_ReferenceTo()
|
||||||
|
* @model required="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
Complex getReferenceTo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the '{@link fr.tpt.mem4csd.loss.Link#getReferenceTo <em>Reference To</em>}' reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param value the new value of the '<em>Reference To</em>' reference.
|
||||||
|
* @see #getReferenceTo()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
void setReferenceTo(Complex value);
|
||||||
|
|
||||||
|
} // Link
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* The <b>Factory</b> for the model.
|
||||||
|
* It provides a create method for each non-abstract class of the model.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface LossFactory extends EFactory {
|
||||||
|
/**
|
||||||
|
* The singleton instance of the factory.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
LossFactory eINSTANCE = fr.tpt.mem4csd.loss.impl.LossFactoryImpl.init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new object of class '<em>Primitive</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return a new object of class '<em>Primitive</em>'.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
Primitive createPrimitive();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new object of class '<em>Link</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return a new object of class '<em>Link</em>'.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
Link createLink();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new object of class '<em>Complex</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return a new object of class '<em>Complex</em>'.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
Complex createComplex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the package supported by this factory.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the package supported by this factory.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
LossPackage getLossPackage();
|
||||||
|
|
||||||
|
} //LossFactory
|
||||||
|
|
@ -0,0 +1,479 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EAttribute;
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.EPackage;
|
||||||
|
import org.eclipse.emf.ecore.EReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* The <b>Package</b> for the model.
|
||||||
|
* It contains accessors for the meta objects to represent
|
||||||
|
* <ul>
|
||||||
|
* <li>each class,</li>
|
||||||
|
* <li>each feature of each class,</li>
|
||||||
|
* <li>each operation of each class,</li>
|
||||||
|
* <li>each enum,</li>
|
||||||
|
* <li>and each data type</li>
|
||||||
|
* </ul>
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossFactory
|
||||||
|
* @model kind="package"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface LossPackage extends EPackage {
|
||||||
|
/**
|
||||||
|
* The package name.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
String eNAME = "loss";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package namespace URI.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
String eNS_URI = "http://mem4csd.telecom-paris.fr/loss";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package namespace name.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
String eNS_PREFIX = "loss";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The singleton instance of the package.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
LossPackage eINSTANCE = fr.tpt.mem4csd.loss.impl.LossPackageImpl.init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.NamedObjectImpl <em>Named Object</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.NamedObjectImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getNamedObject()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
int NAMED_OBJECT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int NAMED_OBJECT__NAME = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Qname</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int NAMED_OBJECT__QNAME = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of structural features of the '<em>Named Object</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int NAMED_OBJECT_FEATURE_COUNT = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of operations of the '<em>Named Object</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int NAMED_OBJECT_OPERATION_COUNT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl <em>Primitive</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.PrimitiveImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getPrimitive()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
int PRIMITIVE = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int PRIMITIVE__NAME = NAMED_OBJECT__NAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Qname</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int PRIMITIVE__QNAME = NAMED_OBJECT__QNAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Type</b></em>' containment reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int PRIMITIVE__TYPE = NAMED_OBJECT_FEATURE_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of structural features of the '<em>Primitive</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int PRIMITIVE_FEATURE_COUNT = NAMED_OBJECT_FEATURE_COUNT + 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of operations of the '<em>Primitive</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int PRIMITIVE_OPERATION_COUNT = NAMED_OBJECT_OPERATION_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.LinkImpl <em>Link</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LinkImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getLink()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
int LINK = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK__NAME = PRIMITIVE__NAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Qname</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK__QNAME = PRIMITIVE__QNAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Type</b></em>' containment reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK__TYPE = PRIMITIVE__TYPE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Reference To</b></em>' reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK__REFERENCE_TO = PRIMITIVE_FEATURE_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of structural features of the '<em>Link</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK_FEATURE_COUNT = PRIMITIVE_FEATURE_COUNT + 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of operations of the '<em>Link</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int LINK_OPERATION_COUNT = PRIMITIVE_OPERATION_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object id for the '{@link fr.tpt.mem4csd.loss.impl.ComplexImpl <em>Complex</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.ComplexImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getComplex()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
int COMPLEX = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int COMPLEX__NAME = NAMED_OBJECT__NAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Qname</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int COMPLEX__QNAME = NAMED_OBJECT__QNAME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The feature id for the '<em><b>Primitives</b></em>' containment reference list.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int COMPLEX__PRIMITIVES = NAMED_OBJECT_FEATURE_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of structural features of the '<em>Complex</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int COMPLEX_FEATURE_COUNT = NAMED_OBJECT_FEATURE_COUNT + 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of operations of the '<em>Complex</em>' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
int COMPLEX_OPERATION_COUNT = NAMED_OBJECT_OPERATION_COUNT + 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for class '{@link fr.tpt.mem4csd.loss.NamedObject <em>Named Object</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for class '<em>Named Object</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.NamedObject
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass getNamedObject();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for the attribute '{@link fr.tpt.mem4csd.loss.NamedObject#getName <em>Name</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for the attribute '<em>Name</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.NamedObject#getName()
|
||||||
|
* @see #getNamedObject()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EAttribute getNamedObject_Name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for the attribute '{@link fr.tpt.mem4csd.loss.NamedObject#getQname <em>Qname</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for the attribute '<em>Qname</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.NamedObject#getQname()
|
||||||
|
* @see #getNamedObject()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EAttribute getNamedObject_Qname();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for class '{@link fr.tpt.mem4csd.loss.Primitive <em>Primitive</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for class '<em>Primitive</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Primitive
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass getPrimitive();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for the containment reference '{@link fr.tpt.mem4csd.loss.Primitive#getType <em>Type</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for the containment reference '<em>Type</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Primitive#getType()
|
||||||
|
* @see #getPrimitive()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference getPrimitive_Type();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for class '{@link fr.tpt.mem4csd.loss.Link <em>Link</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for class '<em>Link</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Link
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass getLink();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for the reference '{@link fr.tpt.mem4csd.loss.Link#getReferenceTo <em>Reference To</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for the reference '<em>Reference To</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Link#getReferenceTo()
|
||||||
|
* @see #getLink()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference getLink_ReferenceTo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for class '{@link fr.tpt.mem4csd.loss.Complex <em>Complex</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for class '<em>Complex</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Complex
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass getComplex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the meta object for the containment reference list '{@link fr.tpt.mem4csd.loss.Complex#getPrimitives <em>Primitives</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the meta object for the containment reference list '<em>Primitives</em>'.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Complex#getPrimitives()
|
||||||
|
* @see #getComplex()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference getComplex_Primitives();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the factory that creates the instances of the model.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the factory that creates the instances of the model.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
LossFactory getLossFactory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* Defines literals for the meta objects that represent
|
||||||
|
* <ul>
|
||||||
|
* <li>each class,</li>
|
||||||
|
* <li>each feature of each class,</li>
|
||||||
|
* <li>each operation of each class,</li>
|
||||||
|
* <li>each enum,</li>
|
||||||
|
* <li>and each data type</li>
|
||||||
|
* </ul>
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
interface Literals {
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.NamedObjectImpl <em>Named Object</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.NamedObjectImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getNamedObject()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass NAMED_OBJECT = eINSTANCE.getNamedObject();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EAttribute NAMED_OBJECT__NAME = eINSTANCE.getNamedObject_Name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '<em><b>Qname</b></em>' attribute feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EAttribute NAMED_OBJECT__QNAME = eINSTANCE.getNamedObject_Qname();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl <em>Primitive</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.PrimitiveImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getPrimitive()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass PRIMITIVE = eINSTANCE.getPrimitive();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '<em><b>Type</b></em>' containment reference feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference PRIMITIVE__TYPE = eINSTANCE.getPrimitive_Type();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.LinkImpl <em>Link</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LinkImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getLink()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass LINK = eINSTANCE.getLink();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '<em><b>Reference To</b></em>' reference feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference LINK__REFERENCE_TO = eINSTANCE.getLink_ReferenceTo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '{@link fr.tpt.mem4csd.loss.impl.ComplexImpl <em>Complex</em>}' class.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.ComplexImpl
|
||||||
|
* @see fr.tpt.mem4csd.loss.impl.LossPackageImpl#getComplex()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EClass COMPLEX = eINSTANCE.getComplex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The meta object literal for the '<em><b>Primitives</b></em>' containment reference list feature.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EReference COMPLEX__PRIMITIVES = eINSTANCE.getComplex_Primitives();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LossPackage
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* A representation of the model object '<em><b>Named Object</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* The following features are supported:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.NamedObject#getName <em>Name</em>}</li>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.NamedObject#getQname <em>Qname</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getNamedObject()
|
||||||
|
* @model abstract="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface NamedObject extends EObject {
|
||||||
|
/**
|
||||||
|
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the value of the '<em>Name</em>' attribute.
|
||||||
|
* @see #setName(String)
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getNamedObject_Name()
|
||||||
|
* @model required="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the '{@link fr.tpt.mem4csd.loss.NamedObject#getName <em>Name</em>}' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param value the new value of the '<em>Name</em>' attribute.
|
||||||
|
* @see #getName()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
void setName(String value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the '<em><b>Qname</b></em>' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the value of the '<em>Qname</em>' attribute.
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getNamedObject_Qname()
|
||||||
|
* @model id="true" required="true" changeable="false" derived="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
String getQname();
|
||||||
|
|
||||||
|
} // NamedObject
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* A representation of the model object '<em><b>Primitive</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* The following features are supported:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.Primitive#getType <em>Type</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getPrimitive()
|
||||||
|
* @model
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public interface Primitive extends NamedObject {
|
||||||
|
/**
|
||||||
|
* Returns the value of the '<em><b>Type</b></em>' containment reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the value of the '<em>Type</em>' containment reference.
|
||||||
|
* @see #setType(EObject)
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#getPrimitive_Type()
|
||||||
|
* @model containment="true" required="true"
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
EObject getType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the '{@link fr.tpt.mem4csd.loss.Primitive#getType <em>Type</em>}' containment reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param value the new value of the '<em>Type</em>' containment reference.
|
||||||
|
* @see #getType()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
void setType(EObject value);
|
||||||
|
|
||||||
|
} // Primitive
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.Complex;
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.Primitive;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.NotificationChain;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.util.EList;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.InternalEObject;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||||
|
import org.eclipse.emf.ecore.util.InternalEList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model object '<em><b>Complex</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* <p>
|
||||||
|
* The following features are implemented:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getPrimitives <em>Primitives</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class ComplexImpl extends NamedObjectImpl implements Complex {
|
||||||
|
/**
|
||||||
|
* The cached value of the '{@link #getPrimitives() <em>Primitives</em>}' containment reference list.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getPrimitives()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected EList<Primitive> primitives;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected ComplexImpl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected EClass eStaticClass() {
|
||||||
|
return LossPackage.Literals.COMPLEX;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EList<Primitive> getPrimitives() {
|
||||||
|
if (primitives == null) {
|
||||||
|
primitives = new EObjectContainmentEList<Primitive>(Primitive.class, this, LossPackage.COMPLEX__PRIMITIVES);
|
||||||
|
}
|
||||||
|
return primitives;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
return ((InternalEList<?>) getPrimitives()).basicRemove(otherEnd, msgs);
|
||||||
|
}
|
||||||
|
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
return getPrimitives();
|
||||||
|
}
|
||||||
|
return super.eGet(featureID, resolve, coreType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void eSet(int featureID, Object newValue) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
getPrimitives().clear();
|
||||||
|
getPrimitives().addAll((Collection<? extends Primitive>) newValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eSet(featureID, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eUnset(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
getPrimitives().clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eUnset(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean eIsSet(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.COMPLEX__PRIMITIVES:
|
||||||
|
return primitives != null && !primitives.isEmpty();
|
||||||
|
}
|
||||||
|
return super.eIsSet(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
} //ComplexImpl
|
||||||
|
|
@ -0,0 +1,161 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.Complex;
|
||||||
|
import fr.tpt.mem4csd.loss.Link;
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.Notification;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.InternalEObject;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model object '<em><b>Link</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* <p>
|
||||||
|
* The following features are implemented:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.impl.LinkImpl#getReferenceTo <em>Reference To</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LinkImpl extends PrimitiveImpl implements Link {
|
||||||
|
/**
|
||||||
|
* The cached value of the '{@link #getReferenceTo() <em>Reference To</em>}' reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getReferenceTo()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected Complex referenceTo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LinkImpl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected EClass eStaticClass() {
|
||||||
|
return LossPackage.Literals.LINK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Complex getReferenceTo() {
|
||||||
|
if (referenceTo != null && referenceTo.eIsProxy()) {
|
||||||
|
InternalEObject oldReferenceTo = (InternalEObject) referenceTo;
|
||||||
|
referenceTo = (Complex) eResolveProxy(oldReferenceTo);
|
||||||
|
if (referenceTo != oldReferenceTo) {
|
||||||
|
if (eNotificationRequired())
|
||||||
|
eNotify(new ENotificationImpl(this, Notification.RESOLVE, LossPackage.LINK__REFERENCE_TO,
|
||||||
|
oldReferenceTo, referenceTo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return referenceTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Complex basicGetReferenceTo() {
|
||||||
|
return referenceTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setReferenceTo(Complex newReferenceTo) {
|
||||||
|
Complex oldReferenceTo = referenceTo;
|
||||||
|
referenceTo = newReferenceTo;
|
||||||
|
if (eNotificationRequired())
|
||||||
|
eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.LINK__REFERENCE_TO, oldReferenceTo,
|
||||||
|
referenceTo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.LINK__REFERENCE_TO:
|
||||||
|
if (resolve)
|
||||||
|
return getReferenceTo();
|
||||||
|
return basicGetReferenceTo();
|
||||||
|
}
|
||||||
|
return super.eGet(featureID, resolve, coreType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eSet(int featureID, Object newValue) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.LINK__REFERENCE_TO:
|
||||||
|
setReferenceTo((Complex) newValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eSet(featureID, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eUnset(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.LINK__REFERENCE_TO:
|
||||||
|
setReferenceTo((Complex) null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eUnset(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean eIsSet(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.LINK__REFERENCE_TO:
|
||||||
|
return referenceTo != null;
|
||||||
|
}
|
||||||
|
return super.eIsSet(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LinkImpl
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.*;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
import org.eclipse.emf.ecore.EPackage;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model <b>Factory</b>.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossFactoryImpl extends EFactoryImpl implements LossFactory {
|
||||||
|
/**
|
||||||
|
* Creates the default factory implementation.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public static LossFactory init() {
|
||||||
|
try {
|
||||||
|
LossFactory theLossFactory = (LossFactory) EPackage.Registry.INSTANCE.getEFactory(LossPackage.eNS_URI);
|
||||||
|
if (theLossFactory != null) {
|
||||||
|
return theLossFactory;
|
||||||
|
}
|
||||||
|
} catch (Exception exception) {
|
||||||
|
EcorePlugin.INSTANCE.log(exception);
|
||||||
|
}
|
||||||
|
return new LossFactoryImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of the factory.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public LossFactoryImpl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EObject create(EClass eClass) {
|
||||||
|
switch (eClass.getClassifierID()) {
|
||||||
|
case LossPackage.PRIMITIVE:
|
||||||
|
return createPrimitive();
|
||||||
|
case LossPackage.LINK:
|
||||||
|
return createLink();
|
||||||
|
case LossPackage.COMPLEX:
|
||||||
|
return createComplex();
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Primitive createPrimitive() {
|
||||||
|
PrimitiveImpl primitive = new PrimitiveImpl();
|
||||||
|
return primitive;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Link createLink() {
|
||||||
|
LinkImpl link = new LinkImpl();
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Complex createComplex() {
|
||||||
|
ComplexImpl complex = new ComplexImpl();
|
||||||
|
return complex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LossPackage getLossPackage() {
|
||||||
|
return (LossPackage) getEPackage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @deprecated
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public static LossPackage getPackage() {
|
||||||
|
return LossPackage.eINSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LossFactoryImpl
|
||||||
|
|
@ -0,0 +1,313 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.Complex;
|
||||||
|
import fr.tpt.mem4csd.loss.Link;
|
||||||
|
import fr.tpt.mem4csd.loss.LossFactory;
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.NamedObject;
|
||||||
|
import fr.tpt.mem4csd.loss.Primitive;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EAttribute;
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.EPackage;
|
||||||
|
import org.eclipse.emf.ecore.EReference;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model <b>Package</b>.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossPackageImpl extends EPackageImpl implements LossPackage {
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private EClass namedObjectEClass = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private EClass primitiveEClass = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private EClass linkEClass = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private EClass complexEClass = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of the model <b>Package</b>, registered with
|
||||||
|
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||||
|
* package URI value.
|
||||||
|
* <p>Note: the correct way to create the package is via the static
|
||||||
|
* factory method {@link #init init()}, which also performs
|
||||||
|
* initialization of the package, or returns the registered package,
|
||||||
|
* if one already exists.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage#eNS_URI
|
||||||
|
* @see #init()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private LossPackageImpl() {
|
||||||
|
super(eNS_URI, LossFactory.eINSTANCE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private static boolean isInited = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||||
|
*
|
||||||
|
* <p>This method is used to initialize {@link LossPackage#eINSTANCE} when that field is accessed.
|
||||||
|
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #eNS_URI
|
||||||
|
* @see #createPackageContents()
|
||||||
|
* @see #initializePackageContents()
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public static LossPackage init() {
|
||||||
|
if (isInited)
|
||||||
|
return (LossPackage) EPackage.Registry.INSTANCE.getEPackage(LossPackage.eNS_URI);
|
||||||
|
|
||||||
|
// Obtain or create and register package
|
||||||
|
Object registeredLossPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
|
||||||
|
LossPackageImpl theLossPackage = registeredLossPackage instanceof LossPackageImpl
|
||||||
|
? (LossPackageImpl) registeredLossPackage
|
||||||
|
: new LossPackageImpl();
|
||||||
|
|
||||||
|
isInited = true;
|
||||||
|
|
||||||
|
// Create package meta-data objects
|
||||||
|
theLossPackage.createPackageContents();
|
||||||
|
|
||||||
|
// Initialize created meta-data
|
||||||
|
theLossPackage.initializePackageContents();
|
||||||
|
|
||||||
|
// Mark meta-data to indicate it can't be changed
|
||||||
|
theLossPackage.freeze();
|
||||||
|
|
||||||
|
// Update the registry and return the package
|
||||||
|
EPackage.Registry.INSTANCE.put(LossPackage.eNS_URI, theLossPackage);
|
||||||
|
return theLossPackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EClass getNamedObject() {
|
||||||
|
return namedObjectEClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EAttribute getNamedObject_Name() {
|
||||||
|
return (EAttribute) namedObjectEClass.getEStructuralFeatures().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EAttribute getNamedObject_Qname() {
|
||||||
|
return (EAttribute) namedObjectEClass.getEStructuralFeatures().get(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EClass getPrimitive() {
|
||||||
|
return primitiveEClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EReference getPrimitive_Type() {
|
||||||
|
return (EReference) primitiveEClass.getEStructuralFeatures().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EClass getLink() {
|
||||||
|
return linkEClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EReference getLink_ReferenceTo() {
|
||||||
|
return (EReference) linkEClass.getEStructuralFeatures().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EClass getComplex() {
|
||||||
|
return complexEClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EReference getComplex_Primitives() {
|
||||||
|
return (EReference) complexEClass.getEStructuralFeatures().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LossFactory getLossFactory() {
|
||||||
|
return (LossFactory) getEFactoryInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private boolean isCreated = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the meta-model objects for the package. This method is
|
||||||
|
* guarded to have no affect on any invocation but its first.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public void createPackageContents() {
|
||||||
|
if (isCreated)
|
||||||
|
return;
|
||||||
|
isCreated = true;
|
||||||
|
|
||||||
|
// Create classes and their features
|
||||||
|
namedObjectEClass = createEClass(NAMED_OBJECT);
|
||||||
|
createEAttribute(namedObjectEClass, NAMED_OBJECT__NAME);
|
||||||
|
createEAttribute(namedObjectEClass, NAMED_OBJECT__QNAME);
|
||||||
|
|
||||||
|
primitiveEClass = createEClass(PRIMITIVE);
|
||||||
|
createEReference(primitiveEClass, PRIMITIVE__TYPE);
|
||||||
|
|
||||||
|
linkEClass = createEClass(LINK);
|
||||||
|
createEReference(linkEClass, LINK__REFERENCE_TO);
|
||||||
|
|
||||||
|
complexEClass = createEClass(COMPLEX);
|
||||||
|
createEReference(complexEClass, COMPLEX__PRIMITIVES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
private boolean isInitialized = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Complete the initialization of the package and its meta-model. This
|
||||||
|
* method is guarded to have no affect on any invocation but its first.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public void initializePackageContents() {
|
||||||
|
if (isInitialized)
|
||||||
|
return;
|
||||||
|
isInitialized = true;
|
||||||
|
|
||||||
|
// Initialize package
|
||||||
|
setName(eNAME);
|
||||||
|
setNsPrefix(eNS_PREFIX);
|
||||||
|
setNsURI(eNS_URI);
|
||||||
|
|
||||||
|
// Create type parameters
|
||||||
|
|
||||||
|
// Set bounds for type parameters
|
||||||
|
|
||||||
|
// Add supertypes to classes
|
||||||
|
primitiveEClass.getESuperTypes().add(this.getNamedObject());
|
||||||
|
linkEClass.getESuperTypes().add(this.getPrimitive());
|
||||||
|
complexEClass.getESuperTypes().add(this.getNamedObject());
|
||||||
|
|
||||||
|
// Initialize classes, features, and operations; add parameters
|
||||||
|
initEClass(namedObjectEClass, NamedObject.class, "NamedObject", IS_ABSTRACT, !IS_INTERFACE,
|
||||||
|
IS_GENERATED_INSTANCE_CLASS);
|
||||||
|
initEAttribute(getNamedObject_Name(), ecorePackage.getEString(), "name", null, 1, 1, NamedObject.class,
|
||||||
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||||
|
initEAttribute(getNamedObject_Qname(), ecorePackage.getEString(), "qname", null, 1, 1, NamedObject.class,
|
||||||
|
!IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
|
||||||
|
|
||||||
|
initEClass(primitiveEClass, Primitive.class, "Primitive", !IS_ABSTRACT, !IS_INTERFACE,
|
||||||
|
IS_GENERATED_INSTANCE_CLASS);
|
||||||
|
initEReference(getPrimitive_Type(), ecorePackage.getEObject(), null, "type", null, 1, 1, Primitive.class,
|
||||||
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
||||||
|
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||||
|
|
||||||
|
initEClass(linkEClass, Link.class, "Link", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||||
|
initEReference(getLink_ReferenceTo(), this.getComplex(), null, "referenceTo", null, 1, 1, Link.class,
|
||||||
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
||||||
|
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||||
|
|
||||||
|
initEClass(complexEClass, Complex.class, "Complex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||||
|
initEReference(getComplex_Primitives(), this.getPrimitive(), null, "primitives", null, 0, -1, Complex.class,
|
||||||
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
||||||
|
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||||
|
|
||||||
|
// Create resource
|
||||||
|
createResource(eNS_URI);
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LossPackageImpl
|
||||||
|
|
@ -0,0 +1,203 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.NamedObject;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.Notification;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||||
|
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model object '<em><b>Named Object</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* <p>
|
||||||
|
* The following features are implemented:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.impl.NamedObjectImpl#getName <em>Name</em>}</li>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.impl.NamedObjectImpl#getQname <em>Qname</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public abstract class NamedObjectImpl extends MinimalEObjectImpl.Container implements NamedObject {
|
||||||
|
/**
|
||||||
|
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getName()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected static final String NAME_EDEFAULT = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getName()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected String name = NAME_EDEFAULT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default value of the '{@link #getQname() <em>Qname</em>}' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getQname()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected static final String QNAME_EDEFAULT = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cached value of the '{@link #getQname() <em>Qname</em>}' attribute.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getQname()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected String qname = QNAME_EDEFAULT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected NamedObjectImpl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected EClass eStaticClass() {
|
||||||
|
return LossPackage.Literals.NAMED_OBJECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setName(String newName) {
|
||||||
|
String oldName = name;
|
||||||
|
name = newName;
|
||||||
|
if (eNotificationRequired())
|
||||||
|
eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.NAMED_OBJECT__NAME, oldName, name));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getQname() {
|
||||||
|
return qname;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.NAMED_OBJECT__NAME:
|
||||||
|
return getName();
|
||||||
|
case LossPackage.NAMED_OBJECT__QNAME:
|
||||||
|
return getQname();
|
||||||
|
}
|
||||||
|
return super.eGet(featureID, resolve, coreType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eSet(int featureID, Object newValue) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.NAMED_OBJECT__NAME:
|
||||||
|
setName((String) newValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eSet(featureID, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eUnset(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.NAMED_OBJECT__NAME:
|
||||||
|
setName(NAME_EDEFAULT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eUnset(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean eIsSet(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.NAMED_OBJECT__NAME:
|
||||||
|
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||||
|
case LossPackage.NAMED_OBJECT__QNAME:
|
||||||
|
return QNAME_EDEFAULT == null ? qname != null : !QNAME_EDEFAULT.equals(qname);
|
||||||
|
}
|
||||||
|
return super.eIsSet(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
if (eIsProxy())
|
||||||
|
return super.toString();
|
||||||
|
|
||||||
|
StringBuilder result = new StringBuilder(super.toString());
|
||||||
|
result.append(" (name: ");
|
||||||
|
result.append(name);
|
||||||
|
result.append(", qname: ");
|
||||||
|
result.append(qname);
|
||||||
|
result.append(')');
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
} //NamedObjectImpl
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.impl;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.LossPackage;
|
||||||
|
import fr.tpt.mem4csd.loss.Primitive;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.Notification;
|
||||||
|
import org.eclipse.emf.common.notify.NotificationChain;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EClass;
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
import org.eclipse.emf.ecore.InternalEObject;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* An implementation of the model object '<em><b>Primitive</b></em>'.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* <p>
|
||||||
|
* The following features are implemented:
|
||||||
|
* </p>
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link fr.tpt.mem4csd.loss.impl.PrimitiveImpl#getType <em>Type</em>}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class PrimitiveImpl extends NamedObjectImpl implements Primitive {
|
||||||
|
/**
|
||||||
|
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see #getType()
|
||||||
|
* @generated
|
||||||
|
* @ordered
|
||||||
|
*/
|
||||||
|
protected EObject type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected PrimitiveImpl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected EClass eStaticClass() {
|
||||||
|
return LossPackage.Literals.PRIMITIVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EObject getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public NotificationChain basicSetType(EObject newType, NotificationChain msgs) {
|
||||||
|
EObject oldType = type;
|
||||||
|
type = newType;
|
||||||
|
if (eNotificationRequired()) {
|
||||||
|
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LossPackage.PRIMITIVE__TYPE,
|
||||||
|
oldType, newType);
|
||||||
|
if (msgs == null)
|
||||||
|
msgs = notification;
|
||||||
|
else
|
||||||
|
msgs.add(notification);
|
||||||
|
}
|
||||||
|
return msgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setType(EObject newType) {
|
||||||
|
if (newType != type) {
|
||||||
|
NotificationChain msgs = null;
|
||||||
|
if (type != null)
|
||||||
|
msgs = ((InternalEObject) type).eInverseRemove(this,
|
||||||
|
EOPPOSITE_FEATURE_BASE - LossPackage.PRIMITIVE__TYPE, null, msgs);
|
||||||
|
if (newType != null)
|
||||||
|
msgs = ((InternalEObject) newType).eInverseAdd(this,
|
||||||
|
EOPPOSITE_FEATURE_BASE - LossPackage.PRIMITIVE__TYPE, null, msgs);
|
||||||
|
msgs = basicSetType(newType, msgs);
|
||||||
|
if (msgs != null)
|
||||||
|
msgs.dispatch();
|
||||||
|
} else if (eNotificationRequired())
|
||||||
|
eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.PRIMITIVE__TYPE, newType, newType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
return basicSetType(null, msgs);
|
||||||
|
}
|
||||||
|
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
return getType();
|
||||||
|
}
|
||||||
|
return super.eGet(featureID, resolve, coreType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eSet(int featureID, Object newValue) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
setType((EObject) newValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eSet(featureID, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void eUnset(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
setType((EObject) null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.eUnset(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean eIsSet(int featureID) {
|
||||||
|
switch (featureID) {
|
||||||
|
case LossPackage.PRIMITIVE__TYPE:
|
||||||
|
return type != null;
|
||||||
|
}
|
||||||
|
return super.eIsSet(featureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
} //PrimitiveImpl
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.util;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.*;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.Adapter;
|
||||||
|
import org.eclipse.emf.common.notify.Notifier;
|
||||||
|
|
||||||
|
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* The <b>Adapter Factory</b> for the model.
|
||||||
|
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossAdapterFactory extends AdapterFactoryImpl {
|
||||||
|
/**
|
||||||
|
* The cached model package.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected static LossPackage modelPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of the adapter factory.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public LossAdapterFactory() {
|
||||||
|
if (modelPackage == null) {
|
||||||
|
modelPackage = LossPackage.eINSTANCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this factory is applicable for the type of the object.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return whether this factory is applicable for the type of the object.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isFactoryForType(Object object) {
|
||||||
|
if (object == modelPackage) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (object instanceof EObject) {
|
||||||
|
return ((EObject) object).eClass().getEPackage() == modelPackage;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The switch that delegates to the <code>createXXX</code> methods.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected LossSwitch<Adapter> modelSwitch = new LossSwitch<Adapter>() {
|
||||||
|
@Override
|
||||||
|
public Adapter caseNamedObject(NamedObject object) {
|
||||||
|
return createNamedObjectAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Adapter casePrimitive(Primitive object) {
|
||||||
|
return createPrimitiveAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Adapter caseLink(Link object) {
|
||||||
|
return createLinkAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Adapter caseComplex(Complex object) {
|
||||||
|
return createComplexAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Adapter defaultCase(EObject object) {
|
||||||
|
return createEObjectAdapter();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an adapter for the <code>target</code>.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param target the object to adapt.
|
||||||
|
* @return the adapter for the <code>target</code>.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Adapter createAdapter(Notifier target) {
|
||||||
|
return modelSwitch.doSwitch((EObject) target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.NamedObject <em>Named Object</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This default implementation returns null so that we can easily ignore cases;
|
||||||
|
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the new adapter.
|
||||||
|
* @see fr.tpt.mem4csd.loss.NamedObject
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Adapter createNamedObjectAdapter() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.Primitive <em>Primitive</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This default implementation returns null so that we can easily ignore cases;
|
||||||
|
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the new adapter.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Primitive
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Adapter createPrimitiveAdapter() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.Link <em>Link</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This default implementation returns null so that we can easily ignore cases;
|
||||||
|
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the new adapter.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Link
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Adapter createLinkAdapter() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new adapter for an object of class '{@link fr.tpt.mem4csd.loss.Complex <em>Complex</em>}'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This default implementation returns null so that we can easily ignore cases;
|
||||||
|
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the new adapter.
|
||||||
|
* @see fr.tpt.mem4csd.loss.Complex
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Adapter createComplexAdapter() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new adapter for the default case.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This default implementation returns null.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the new adapter.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public Adapter createEObjectAdapter() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LossAdapterFactory
|
||||||
|
|
@ -0,0 +1,186 @@
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
package fr.tpt.mem4csd.loss.util;
|
||||||
|
|
||||||
|
import fr.tpt.mem4csd.loss.*;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.EObject;
|
||||||
|
import org.eclipse.emf.ecore.EPackage;
|
||||||
|
|
||||||
|
import org.eclipse.emf.ecore.util.Switch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||||
|
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||||
|
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||||
|
* starting with the actual class of the object
|
||||||
|
* and proceeding up the inheritance hierarchy
|
||||||
|
* until a non-null result is returned,
|
||||||
|
* which is the result of the switch.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @see fr.tpt.mem4csd.loss.LossPackage
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public class LossSwitch<T> extends Switch<T> {
|
||||||
|
/**
|
||||||
|
* The cached model package
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
protected static LossPackage modelPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of the switch.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public LossSwitch() {
|
||||||
|
if (modelPackage == null) {
|
||||||
|
modelPackage = LossPackage.eINSTANCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this is a switch for the given package.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param ePackage the package in question.
|
||||||
|
* @return whether this is a switch for the given package.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isSwitchFor(EPackage ePackage) {
|
||||||
|
return ePackage == modelPackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected T doSwitch(int classifierID, EObject theEObject) {
|
||||||
|
switch (classifierID) {
|
||||||
|
case LossPackage.NAMED_OBJECT: {
|
||||||
|
NamedObject namedObject = (NamedObject) theEObject;
|
||||||
|
T result = caseNamedObject(namedObject);
|
||||||
|
if (result == null)
|
||||||
|
result = defaultCase(theEObject);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
case LossPackage.PRIMITIVE: {
|
||||||
|
Primitive primitive = (Primitive) theEObject;
|
||||||
|
T result = casePrimitive(primitive);
|
||||||
|
if (result == null)
|
||||||
|
result = caseNamedObject(primitive);
|
||||||
|
if (result == null)
|
||||||
|
result = defaultCase(theEObject);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
case LossPackage.LINK: {
|
||||||
|
Link link = (Link) theEObject;
|
||||||
|
T result = caseLink(link);
|
||||||
|
if (result == null)
|
||||||
|
result = casePrimitive(link);
|
||||||
|
if (result == null)
|
||||||
|
result = caseNamedObject(link);
|
||||||
|
if (result == null)
|
||||||
|
result = defaultCase(theEObject);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
case LossPackage.COMPLEX: {
|
||||||
|
Complex complex = (Complex) theEObject;
|
||||||
|
T result = caseComplex(complex);
|
||||||
|
if (result == null)
|
||||||
|
result = caseNamedObject(complex);
|
||||||
|
if (result == null)
|
||||||
|
result = defaultCase(theEObject);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return defaultCase(theEObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of interpreting the object as an instance of '<em>Named Object</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns null;
|
||||||
|
* returning a non-null result will terminate the switch.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param object the target of the switch.
|
||||||
|
* @return the result of interpreting the object as an instance of '<em>Named Object</em>'.
|
||||||
|
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public T caseNamedObject(NamedObject object) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of interpreting the object as an instance of '<em>Primitive</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns null;
|
||||||
|
* returning a non-null result will terminate the switch.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param object the target of the switch.
|
||||||
|
* @return the result of interpreting the object as an instance of '<em>Primitive</em>'.
|
||||||
|
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public T casePrimitive(Primitive object) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of interpreting the object as an instance of '<em>Link</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns null;
|
||||||
|
* returning a non-null result will terminate the switch.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param object the target of the switch.
|
||||||
|
* @return the result of interpreting the object as an instance of '<em>Link</em>'.
|
||||||
|
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public T caseLink(Link object) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of interpreting the object as an instance of '<em>Complex</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns null;
|
||||||
|
* returning a non-null result will terminate the switch.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param object the target of the switch.
|
||||||
|
* @return the result of interpreting the object as an instance of '<em>Complex</em>'.
|
||||||
|
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
public T caseComplex(Complex object) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||||
|
* <!-- begin-user-doc -->
|
||||||
|
* This implementation returns null;
|
||||||
|
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||||
|
* <!-- end-user-doc -->
|
||||||
|
* @param object the target of the switch.
|
||||||
|
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||||
|
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public T defaultCase(EObject object) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
} //LossSwitch
|
||||||
Loading…
Reference in New Issue