Initial commit.
@@ -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-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
28
eclipse/plugins/com.irtsaintexupery.pseim.edit/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.irtsaintexupery.pseim.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,17 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.irtsaintexupery.pseim.edit;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Activator: com.irtsaintexupery.pseim.pseim.provider.PseimEditPlugin$Implementation
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.irtsaintexupery.pseim.seim.provider,
|
||||
com.irtsaintexupery.pseim.pseim.provider
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.irtsaintexupery.pseim;visibility:=reexport,
|
||||
org.eclipse.emf.edit;visibility:=reexport,
|
||||
com.irtsaintexupery.pseim.edit;visibility:=reexport
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
|
||||
bin.includes = .,\
|
||||
icons/,\
|
||||
META-INF/,\
|
||||
plugin.xml,\
|
||||
plugin.properties
|
||||
jars.compile.order = .
|
||||
source.. = src-gen/
|
||||
output.. = bin/
|
||||
|
After Width: | Height: | Size: 223 B |
|
After Width: | Height: | Size: 223 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 882 B |
|
After Width: | Height: | Size: 882 B |
|
After Width: | Height: | Size: 900 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 898 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 889 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 878 B |
105
eclipse/plugins/com.irtsaintexupery.pseim.edit/plugin.properties
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
|
||||
pluginName = PSEIM Edit Support
|
||||
providerName = IRT AESE (IRT Saint Exup<75>ry)
|
||||
|
||||
_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_Component_type = Component
|
||||
_UI_Port_type = Port
|
||||
_UI_Link_type = Link
|
||||
_UI_GraphElement_type = Graph Element
|
||||
_UI_Property_type = Property
|
||||
_UI_BasicProperty_type = Basic Property
|
||||
_UI_IntegerProperty_type = Integer Property
|
||||
_UI_StringProperty_type = String Property
|
||||
_UI_BooleanProperty_type = Boolean Property
|
||||
_UI_ReferenceProperty_type = Reference Property
|
||||
_UI_PropertyHolder_type = Property Holder
|
||||
_UI_NamedElement_type = Named Element
|
||||
_UI_IdentifiedElement_type = Identified Element
|
||||
_UI_Model_type = Model
|
||||
_UI_BorderElement_type = Border Element
|
||||
_UI_Element_type = Element
|
||||
_UI_Unknown_type = Object
|
||||
|
||||
_UI_Unknown_datatype= Value
|
||||
|
||||
_UI_Component_content_feature = Content
|
||||
_UI_Port_direction_feature = Direction
|
||||
_UI_Link_src_feature = Src
|
||||
_UI_Link_dst_feature = Dst
|
||||
_UI_Property_key_feature = Key
|
||||
_UI_IntegerProperty_value_feature = Value
|
||||
_UI_StringProperty_value_feature = Value
|
||||
_UI_BooleanProperty_value_feature = Value
|
||||
_UI_ReferenceProperty_ref_feature = Ref
|
||||
_UI_PropertyHolder_properties_feature = Properties
|
||||
_UI_NamedElement_name_feature = Name
|
||||
_UI_IdentifiedElement_uid_feature = Uid
|
||||
_UI_Model_modelElements_feature = Model Elements
|
||||
_UI_Unknown_feature = Unspecified
|
||||
|
||||
_UI_PortDirection_UNSPECIFIED_literal = UNSPECIFIED
|
||||
_UI_PortDirection_IN_literal = IN
|
||||
_UI_PortDirection_OUT_literal = OUT
|
||||
_UI_PortDirection_INOUT_literal = INOUT
|
||||
_UI_Library_type = Library
|
||||
_UI_Pattern_type = Pattern
|
||||
_UI_CardinalityElement_type = Cardinality Element
|
||||
_UI_PatternComponent_type = Pattern Component
|
||||
_UI_PatternPort_type = Pattern Port
|
||||
_UI_PatternLink_type = Pattern Link
|
||||
_UI_MultiplicityElement_type = Multiplicity Element
|
||||
_UI_Library_name_feature = Name
|
||||
_UI_Library_patterns_feature = Patterns
|
||||
_UI_Pattern_typeHS_feature = Type HS
|
||||
_UI_Pattern_typeFailure_feature = Type Failure
|
||||
_UI_Pattern_alsoKnownAs_feature = Also Known As
|
||||
_UI_Pattern_usedTactics_feature = Used Tactics
|
||||
_UI_Pattern_context_feature = Context
|
||||
_UI_Pattern_domain_feature = Domain
|
||||
_UI_Pattern_isSingleChannel_feature = Is Single Channel
|
||||
_UI_Pattern_interfaceElements_feature = Interface Elements
|
||||
_UI_Pattern_cardinalityElements_feature = Cardinality Elements
|
||||
_UI_CardinalityElement_calculatedVia_feature = Calculated Via
|
||||
_UI_PatternComponent_mergeContent_feature = Merge Content
|
||||
_UI_PatternPort_dir_feature = Dir
|
||||
_UI_PatternLink_linkType_feature = Link Type
|
||||
_UI_PatternLink_element_feature = Element
|
||||
_UI_MultiplicityElement_multiplicityValue_feature = Multiplicity Value
|
||||
_UI_MultiplicityElement_cardinalityElement_feature = Cardinality Element
|
||||
_UI_IdentifiedElement_identifiedAs_feature = Identified As
|
||||
_UI_PatternTypeHS_Hardware_literal = Hardware
|
||||
_UI_PatternTypeHS_Software_literal = Software
|
||||
_UI_PatternTypeFailureMode_Fail_safe_literal = Fail_safe
|
||||
_UI_PatternTypeFailureMode_Fail_over_literal = Fail_over
|
||||
_UI_SafetyTactic_Simplicity_literal = Simplicity
|
||||
_UI_SafetyTactic_Substitution_literal = Substitution
|
||||
_UI_SafetyTactic_Sanity_Check_literal = Sanity_Check
|
||||
_UI_SafetyTactic_Condition_Monitoring_literal = Condition_Monitoring
|
||||
_UI_SafetyTactic_Comparison_literal = Comparison
|
||||
_UI_SafetyTactic_Diverse_Redundancy_literal = Diverse_Redundancy
|
||||
_UI_SafetyTactic_Replication_Redundancy_literal = Replication_Redundancy
|
||||
_UI_SafetyTactic_Repair_literal = Repair
|
||||
_UI_SafetyTactic_Degradation_literal = Degradation
|
||||
_UI_SafetyTactic_Voting_literal = Voting
|
||||
_UI_SafetyTactic_Override_literal = Override
|
||||
_UI_SafetyTactic_Barrier_literal = Barrier
|
||||
_UI_SafetyTactic_Heartbeat_literal = Heartbeat
|
||||
_UI_LinkType_TRANSPOSE_literal = TRANSPOSE
|
||||
_UI_LinkType_IDENTITY_literal = IDENTITY
|
||||
_UI_LinkType_SHIFT_literal = SHIFT
|
||||
_UI_LinkType_FIRST_literal = FIRST
|
||||
_UI_LinkType_ROTATE_literal = ROTATE
|
||||
_UI_PatternPortDirection_UNSPECIFIED_literal = UNSPECIFIED
|
||||
_UI_PatternPortDirection_IN_literal = IN
|
||||
_UI_PatternPortDirection_OUT_literal = OUT
|
||||
_UI_PatternPortDirection_INOUT_literal = INOUT
|
||||
35
eclipse/plugins/com.irtsaintexupery.pseim.edit/plugin.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
|
||||
<!--
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
|
||||
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
|
||||
<!-- @generated seim -->
|
||||
<factory
|
||||
uri="http://www.irt-saintexupery.com/seim/0.1"
|
||||
class="com.irtsaintexupery.pseim.seim.provider.SeimItemProviderAdapterFactory"
|
||||
supportedTypes=
|
||||
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
|
||||
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
|
||||
org.eclipse.emf.edit.provider.ITreeItemContentProvider
|
||||
org.eclipse.emf.edit.provider.IItemLabelProvider
|
||||
org.eclipse.emf.edit.provider.IItemPropertySource"/>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
|
||||
<!-- @generated pseim -->
|
||||
<factory
|
||||
uri="http://www.irt-saintexupery.com/pseim/0.1"
|
||||
class="com.irtsaintexupery.pseim.pseim.provider.PseimItemProviderAdapterFactory"
|
||||
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,237 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.CardinalityElement} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class CardinalityElementItemProvider 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 CardinalityElementItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addCalculatedViaPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Calculated Via feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addCalculatedViaPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors.add(createItemPropertyDescriptor(
|
||||
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
|
||||
getString("_UI_CardinalityElement_calculatedVia_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_CardinalityElement_calculatedVia_feature",
|
||||
"_UI_CardinalityElement_type"),
|
||||
PseimPackage.Literals.CARDINALITY_ELEMENT__CALCULATED_VIA, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
}
|
||||
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 CardinalityElement.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/CardinalityElement"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((CardinalityElement) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_CardinalityElement_type")
|
||||
: getString("_UI_CardinalityElement_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(CardinalityElement.class)) {
|
||||
case PseimPackage.CARDINALITY_ELEMENT__UID:
|
||||
case PseimPackage.CARDINALITY_ELEMENT__NAME:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.Library;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimFactory;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.Library} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class LibraryItemProvider 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 LibraryItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(PseimPackage.Literals.LIBRARY__PATTERNS);
|
||||
}
|
||||
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 Library.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/Library"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((Library) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_Library_type")
|
||||
: getString("_UI_Library_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(Library.class)) {
|
||||
case PseimPackage.LIBRARY__UID:
|
||||
case PseimPackage.LIBRARY__NAME:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
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(PseimPackage.Literals.LIBRARY__PATTERNS, PseimFactory.eINSTANCE.createPattern()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.PatternComponent;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimFactory;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PatternComponent} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PatternComponentItemProvider 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 PatternComponentItemProvider(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);
|
||||
|
||||
addMultiplicityValuePropertyDescriptor(object);
|
||||
addCardinalityElementPropertyDescriptor(object);
|
||||
addIdentifiedAsPropertyDescriptor(object);
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addMergeContentPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Multiplicity Value feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addMultiplicityValuePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors.add(createItemPropertyDescriptor(
|
||||
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
|
||||
getString("_UI_MultiplicityElement_multiplicityValue_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_MultiplicityElement_multiplicityValue_feature",
|
||||
"_UI_MultiplicityElement_type"),
|
||||
PseimPackage.Literals.MULTIPLICITY_ELEMENT__MULTIPLICITY_VALUE, true, false, false,
|
||||
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Cardinality Element feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addCardinalityElementPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors.add(createItemPropertyDescriptor(
|
||||
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
|
||||
getString("_UI_MultiplicityElement_cardinalityElement_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_MultiplicityElement_cardinalityElement_feature",
|
||||
"_UI_MultiplicityElement_type"),
|
||||
PseimPackage.Literals.MULTIPLICITY_ELEMENT__CARDINALITY_ELEMENT, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Identified As feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addIdentifiedAsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_identifiedAs_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_identifiedAs_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
PseimPackage.Literals.IDENTIFIED_ELEMENT__IDENTIFIED_AS, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Merge Content feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addMergeContentPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_PatternComponent_mergeContent_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_PatternComponent_mergeContent_feature",
|
||||
"_UI_PatternComponent_type"),
|
||||
PseimPackage.Literals.PATTERN_COMPONENT__MERGE_CONTENT, true, false, false,
|
||||
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
childrenFeatures.add(SeimPackage.Literals.COMPONENT__CONTENT);
|
||||
}
|
||||
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 PatternComponent.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/PatternComponent"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((PatternComponent) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_PatternComponent_type")
|
||||
: getString("_UI_PatternComponent_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(PatternComponent.class)) {
|
||||
case PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE:
|
||||
case PseimPackage.PATTERN_COMPONENT__UID:
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
case PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT,
|
||||
PseimFactory.eINSTANCE.createPatternComponent()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT,
|
||||
PseimFactory.eINSTANCE.createPatternPort()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT,
|
||||
PseimFactory.eINSTANCE.createPatternLink()));
|
||||
|
||||
newChildDescriptors.add(
|
||||
createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createComponent()));
|
||||
|
||||
newChildDescriptors
|
||||
.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createPort()));
|
||||
|
||||
newChildDescriptors
|
||||
.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createLink()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.Pattern;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimFactory;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.provider.ModelItemProvider;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
|
||||
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
|
||||
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
|
||||
import org.eclipse.emf.edit.provider.ViewerNotification;
|
||||
|
||||
/**
|
||||
* This is the item provider adapter for a {@link com.irtsaintexupery.pseim.pseim.Pattern} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PatternItemProvider extends ModelItemProvider {
|
||||
/**
|
||||
* This constructs an instance from a factory and a notifier.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternItemProvider(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);
|
||||
|
||||
addTypeHSPropertyDescriptor(object);
|
||||
addTypeFailurePropertyDescriptor(object);
|
||||
addAlsoKnownAsPropertyDescriptor(object);
|
||||
addUsedTacticsPropertyDescriptor(object);
|
||||
addContextPropertyDescriptor(object);
|
||||
addDomainPropertyDescriptor(object);
|
||||
addIsSingleChannelPropertyDescriptor(object);
|
||||
addInterfaceElementsPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Type HS feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addTypeHSPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_typeHS_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_typeHS_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__TYPE_HS, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Type Failure feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addTypeFailurePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_typeFailure_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_typeFailure_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__TYPE_FAILURE, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Also Known As feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addAlsoKnownAsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_alsoKnownAs_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_alsoKnownAs_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__ALSO_KNOWN_AS, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Used Tactics feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUsedTacticsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_usedTactics_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_usedTactics_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__USED_TACTICS, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Context feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addContextPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_context_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_context_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__CONTEXT, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Domain feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDomainPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_domain_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_domain_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__DOMAIN, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Is Single Channel feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addIsSingleChannelPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_isSingleChannel_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_isSingleChannel_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__IS_SINGLE_CHANNEL, true, false, false,
|
||||
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Interface Elements feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addInterfaceElementsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Pattern_interfaceElements_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_interfaceElements_feature",
|
||||
"_UI_Pattern_type"),
|
||||
PseimPackage.Literals.PATTERN__INTERFACE_ELEMENTS, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(PseimPackage.Literals.PATTERN__CARDINALITY_ELEMENTS);
|
||||
}
|
||||
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 Pattern.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/Pattern"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((Pattern) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_Pattern_type")
|
||||
: getString("_UI_Pattern_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(Pattern.class)) {
|
||||
case PseimPackage.PATTERN__TYPE_HS:
|
||||
case PseimPackage.PATTERN__TYPE_FAILURE:
|
||||
case PseimPackage.PATTERN__ALSO_KNOWN_AS:
|
||||
case PseimPackage.PATTERN__USED_TACTICS:
|
||||
case PseimPackage.PATTERN__CONTEXT:
|
||||
case PseimPackage.PATTERN__DOMAIN:
|
||||
case PseimPackage.PATTERN__IS_SINGLE_CHANNEL:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
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(SeimPackage.Literals.MODEL__MODEL_ELEMENTS,
|
||||
PseimFactory.eINSTANCE.createPatternComponent()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.MODEL__MODEL_ELEMENTS,
|
||||
PseimFactory.eINSTANCE.createPatternLink()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(PseimPackage.Literals.PATTERN__CARDINALITY_ELEMENTS,
|
||||
PseimFactory.eINSTANCE.createCardinalityElement()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.PatternLink;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PatternLink} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PatternLinkItemProvider 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 PatternLinkItemProvider(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);
|
||||
|
||||
addIdentifiedAsPropertyDescriptor(object);
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addSrcPropertyDescriptor(object);
|
||||
addDstPropertyDescriptor(object);
|
||||
addLinkTypePropertyDescriptor(object);
|
||||
addElementPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Identified As feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addIdentifiedAsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_identifiedAs_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_identifiedAs_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
PseimPackage.Literals.IDENTIFIED_ELEMENT__IDENTIFIED_AS, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Src feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addSrcPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Link_src_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Link_src_feature", "_UI_Link_type"),
|
||||
SeimPackage.Literals.LINK__SRC, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Dst feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDstPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Link_dst_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Link_dst_feature", "_UI_Link_type"),
|
||||
SeimPackage.Literals.LINK__DST, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Link Type feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addLinkTypePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_PatternLink_linkType_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_PatternLink_linkType_feature",
|
||||
"_UI_PatternLink_type"),
|
||||
PseimPackage.Literals.PATTERN_LINK__LINK_TYPE, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Element feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addElementPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_PatternLink_element_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_PatternLink_element_feature",
|
||||
"_UI_PatternLink_type"),
|
||||
PseimPackage.Literals.PATTERN_LINK__ELEMENT, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
}
|
||||
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 PatternLink.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/PatternLink"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((PatternLink) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_PatternLink_type")
|
||||
: getString("_UI_PatternLink_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(PatternLink.class)) {
|
||||
case PseimPackage.PATTERN_LINK__UID:
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
case PseimPackage.PATTERN_LINK__LINK_TYPE:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.PatternPort;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
import com.irtsaintexupery.pseim.seim.PortDirection;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PatternPort} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PatternPortItemProvider 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 PatternPortItemProvider(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);
|
||||
|
||||
addMultiplicityValuePropertyDescriptor(object);
|
||||
addCardinalityElementPropertyDescriptor(object);
|
||||
addIdentifiedAsPropertyDescriptor(object);
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addDirectionPropertyDescriptor(object);
|
||||
addDirPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Multiplicity Value feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addMultiplicityValuePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors.add(createItemPropertyDescriptor(
|
||||
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
|
||||
getString("_UI_MultiplicityElement_multiplicityValue_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_MultiplicityElement_multiplicityValue_feature",
|
||||
"_UI_MultiplicityElement_type"),
|
||||
PseimPackage.Literals.MULTIPLICITY_ELEMENT__MULTIPLICITY_VALUE, true, false, false,
|
||||
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Cardinality Element feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addCardinalityElementPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors.add(createItemPropertyDescriptor(
|
||||
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
|
||||
getString("_UI_MultiplicityElement_cardinalityElement_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_MultiplicityElement_cardinalityElement_feature",
|
||||
"_UI_MultiplicityElement_type"),
|
||||
PseimPackage.Literals.MULTIPLICITY_ELEMENT__CARDINALITY_ELEMENT, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Identified As feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addIdentifiedAsPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_identifiedAs_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_identifiedAs_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
PseimPackage.Literals.IDENTIFIED_ELEMENT__IDENTIFIED_AS, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Direction feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDirectionPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Port_direction_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Port_direction_feature", "_UI_Port_type"),
|
||||
SeimPackage.Literals.PORT__DIRECTION, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Dir feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDirPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_PatternPort_dir_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_PatternPort_dir_feature",
|
||||
"_UI_PatternPort_type"),
|
||||
PseimPackage.Literals.PATTERN_PORT__DIR, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
}
|
||||
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 PatternPort.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
PatternPort port = (PatternPort) object;
|
||||
if (port.getDirection() == PortDirection.IN) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/IPort"));
|
||||
} else if (port.getDirection() == PortDirection.OUT) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/OPort"));
|
||||
} else if (port.getDirection() == PortDirection.INOUT) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/IOPort"));
|
||||
} else if (port.getDirection() == PortDirection.UNSPECIFIED) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/UndefPort"));
|
||||
}
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/PatternPort"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the label text for the adapted class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getText(Object object) {
|
||||
String label = ((PatternPort) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_PatternPort_type")
|
||||
: getString("_UI_PatternPort_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(PatternPort.class)) {
|
||||
case PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE:
|
||||
case PseimPackage.PATTERN_PORT__UID:
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
case PseimPackage.PATTERN_PORT__DIR:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return PseimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.provider.SeimEditPlugin;
|
||||
|
||||
import org.eclipse.emf.common.EMFPlugin;
|
||||
|
||||
import org.eclipse.emf.common.util.ResourceLocator;
|
||||
|
||||
/**
|
||||
* This is the central singleton for the Pseim edit plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public final class PseimEditPlugin extends EMFPlugin {
|
||||
/**
|
||||
* Keep track of the singleton.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final PseimEditPlugin INSTANCE = new PseimEditPlugin();
|
||||
|
||||
/**
|
||||
* 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 PseimEditPlugin() {
|
||||
super(new ResourceLocator[] { SeimEditPlugin.INSTANCE, });
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of the Eclipse plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the singleton instance.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getPluginResourceLocator() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of the Eclipse plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the singleton instance.
|
||||
* @generated
|
||||
*/
|
||||
public static Implementation getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual implementation of the Eclipse <b>Plugin</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static class Implementation extends EclipsePlugin {
|
||||
/**
|
||||
* Creates an instance.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Implementation() {
|
||||
super();
|
||||
|
||||
// Remember the static instance.
|
||||
//
|
||||
plugin = this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.util.PseimAdapterFactory;
|
||||
|
||||
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 PseimItemProviderAdapterFactory extends PseimAdapterFactory
|
||||
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 PseimItemProviderAdapterFactory() {
|
||||
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 com.irtsaintexupery.pseim.pseim.Library} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected LibraryItemProvider libraryItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.Library}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createLibraryAdapter() {
|
||||
if (libraryItemProvider == null) {
|
||||
libraryItemProvider = new LibraryItemProvider(this);
|
||||
}
|
||||
|
||||
return libraryItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.pseim.Pattern} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternItemProvider patternItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.Pattern}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createPatternAdapter() {
|
||||
if (patternItemProvider == null) {
|
||||
patternItemProvider = new PatternItemProvider(this);
|
||||
}
|
||||
|
||||
return patternItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.pseim.CardinalityElement} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected CardinalityElementItemProvider cardinalityElementItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.CardinalityElement}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createCardinalityElementAdapter() {
|
||||
if (cardinalityElementItemProvider == null) {
|
||||
cardinalityElementItemProvider = new CardinalityElementItemProvider(this);
|
||||
}
|
||||
|
||||
return cardinalityElementItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.pseim.PatternComponent} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternComponentItemProvider patternComponentItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.PatternComponent}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createPatternComponentAdapter() {
|
||||
if (patternComponentItemProvider == null) {
|
||||
patternComponentItemProvider = new PatternComponentItemProvider(this);
|
||||
}
|
||||
|
||||
return patternComponentItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.pseim.PatternPort} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternPortItemProvider patternPortItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.PatternPort}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createPatternPortAdapter() {
|
||||
if (patternPortItemProvider == null) {
|
||||
patternPortItemProvider = new PatternPortItemProvider(this);
|
||||
}
|
||||
|
||||
return patternPortItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.pseim.PatternLink} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternLinkItemProvider patternLinkItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.pseim.PatternLink}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createPatternLinkAdapter() {
|
||||
if (patternLinkItemProvider == null) {
|
||||
patternLinkItemProvider = new PatternLinkItemProvider(this);
|
||||
}
|
||||
|
||||
return patternLinkItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the root adapter factory that contains this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void addListener(INotifyChangedListener notifyChangedListener) {
|
||||
changeNotifier.addListener(notifyChangedListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This removes a listener.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void removeListener(INotifyChangedListener notifyChangedListener) {
|
||||
changeNotifier.removeListener(notifyChangedListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void dispose() {
|
||||
if (libraryItemProvider != null)
|
||||
libraryItemProvider.dispose();
|
||||
if (patternItemProvider != null)
|
||||
patternItemProvider.dispose();
|
||||
if (cardinalityElementItemProvider != null)
|
||||
cardinalityElementItemProvider.dispose();
|
||||
if (patternComponentItemProvider != null)
|
||||
patternComponentItemProvider.dispose();
|
||||
if (patternPortItemProvider != null)
|
||||
patternPortItemProvider.dispose();
|
||||
if (patternLinkItemProvider != null)
|
||||
patternLinkItemProvider.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BooleanProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.BooleanProperty} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class BooleanPropertyItemProvider 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 BooleanPropertyItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addKeyPropertyDescriptor(object);
|
||||
addValuePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Key feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addKeyPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Property_key_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Property_key_feature",
|
||||
"_UI_Property_type"),
|
||||
SeimPackage.Literals.PROPERTY__KEY, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Value feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addValuePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_BooleanProperty_value_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_BooleanProperty_value_feature",
|
||||
"_UI_BooleanProperty_type"),
|
||||
SeimPackage.Literals.BOOLEAN_PROPERTY__VALUE, true, false, false,
|
||||
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns BooleanProperty.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/BooleanProperty"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((BooleanProperty) object).getUid();
|
||||
return label == null || label.length() == 0 ? getString("_UI_BooleanProperty_type")
|
||||
: getString("_UI_BooleanProperty_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(BooleanProperty.class)) {
|
||||
case SeimPackage.BOOLEAN_PROPERTY__UID:
|
||||
case SeimPackage.BOOLEAN_PROPERTY__KEY:
|
||||
case SeimPackage.BOOLEAN_PROPERTY__VALUE:
|
||||
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 SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.Component} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class ComponentItemProvider 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 ComponentItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
childrenFeatures.add(SeimPackage.Literals.COMPONENT__CONTENT);
|
||||
}
|
||||
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 Component.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/Component"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((Component) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_Component_type")
|
||||
: getString("_UI_Component_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(Component.class)) {
|
||||
case SeimPackage.COMPONENT__UID:
|
||||
case SeimPackage.COMPONENT__NAME:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
|
||||
newChildDescriptors.add(
|
||||
createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createComponent()));
|
||||
|
||||
newChildDescriptors
|
||||
.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createPort()));
|
||||
|
||||
newChildDescriptors
|
||||
.add(createChildParameter(SeimPackage.Literals.COMPONENT__CONTENT, SeimFactory.eINSTANCE.createLink()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.IntegerProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.IntegerProperty} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class IntegerPropertyItemProvider 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 IntegerPropertyItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addKeyPropertyDescriptor(object);
|
||||
addValuePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Key feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addKeyPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Property_key_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Property_key_feature",
|
||||
"_UI_Property_type"),
|
||||
SeimPackage.Literals.PROPERTY__KEY, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Value feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addValuePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IntegerProperty_value_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IntegerProperty_value_feature",
|
||||
"_UI_IntegerProperty_type"),
|
||||
SeimPackage.Literals.INTEGER_PROPERTY__VALUE, true, false, false,
|
||||
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns IntegerProperty.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/IntegerProperty"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((IntegerProperty) object).getUid();
|
||||
return label == null || label.length() == 0 ? getString("_UI_IntegerProperty_type")
|
||||
: getString("_UI_IntegerProperty_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(IntegerProperty.class)) {
|
||||
case SeimPackage.INTEGER_PROPERTY__UID:
|
||||
case SeimPackage.INTEGER_PROPERTY__KEY:
|
||||
case SeimPackage.INTEGER_PROPERTY__VALUE:
|
||||
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 SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.Link} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class LinkItemProvider 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 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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addSrcPropertyDescriptor(object);
|
||||
addDstPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Src feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addSrcPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Link_src_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Link_src_feature", "_UI_Link_type"),
|
||||
SeimPackage.Literals.LINK__SRC, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Dst feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDstPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Link_dst_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Link_dst_feature", "_UI_Link_type"),
|
||||
SeimPackage.Literals.LINK__DST, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
}
|
||||
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 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);
|
||||
|
||||
switch (notification.getFeatureID(Link.class)) {
|
||||
case SeimPackage.LINK__UID:
|
||||
case SeimPackage.LINK__NAME:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.Model} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class ModelItemProvider 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 ModelItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
childrenFeatures.add(SeimPackage.Literals.MODEL__MODEL_ELEMENTS);
|
||||
}
|
||||
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 Model.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/Model"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((Model) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_Model_type")
|
||||
: getString("_UI_Model_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(Model.class)) {
|
||||
case SeimPackage.MODEL__UID:
|
||||
case SeimPackage.MODEL__NAME:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.MODEL__MODEL_ELEMENTS,
|
||||
SeimFactory.eINSTANCE.createComponent()));
|
||||
|
||||
newChildDescriptors.add(
|
||||
createChildParameter(SeimPackage.Literals.MODEL__MODEL_ELEMENTS, SeimFactory.eINSTANCE.createLink()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PortDirection;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.ecore.EStructuralFeature;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.Port} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PortItemProvider 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 PortItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addNamePropertyDescriptor(object);
|
||||
addDirectionPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_NamedElement_name_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature",
|
||||
"_UI_NamedElement_type"),
|
||||
SeimPackage.Literals.NAMED_ELEMENT__NAME, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Direction feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addDirectionPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Port_direction_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Port_direction_feature", "_UI_Port_type"),
|
||||
SeimPackage.Literals.PORT__DIRECTION, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
|
||||
if (childrenFeatures == null) {
|
||||
super.getChildrenFeatures(object);
|
||||
childrenFeatures.add(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES);
|
||||
}
|
||||
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 Port.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
Port port = (Port) object;
|
||||
if (port.getDirection() == PortDirection.IN) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/IPort"));
|
||||
} else if (port.getDirection() == PortDirection.OUT) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/OPort"));
|
||||
} else if (port.getDirection() == PortDirection.INOUT) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/IOPort"));
|
||||
} else if (port.getDirection() == PortDirection.UNSPECIFIED) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/UndefPort"));
|
||||
}
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/Port"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((Port) object).getName();
|
||||
return label == null || label.length() == 0 ? getString("_UI_Port_type")
|
||||
: getString("_UI_Port_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(Port.class)) {
|
||||
case SeimPackage.PORT__UID:
|
||||
case SeimPackage.PORT__NAME:
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
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(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createIntegerProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createStringProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createBooleanProperty()));
|
||||
|
||||
newChildDescriptors.add(createChildParameter(SeimPackage.Literals.PROPERTY_HOLDER__PROPERTIES,
|
||||
SeimFactory.eINSTANCE.createReferenceProperty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resource locator for this item provider's resources.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
return SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.ReferenceProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.ReferenceProperty} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class ReferencePropertyItemProvider 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 ReferencePropertyItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addKeyPropertyDescriptor(object);
|
||||
addRefPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Key feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addKeyPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Property_key_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Property_key_feature",
|
||||
"_UI_Property_type"),
|
||||
SeimPackage.Literals.PROPERTY__KEY, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Ref feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addRefPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_ReferenceProperty_ref_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_ReferenceProperty_ref_feature",
|
||||
"_UI_ReferenceProperty_type"),
|
||||
SeimPackage.Literals.REFERENCE_PROPERTY__REF, true, false, true, null, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns ReferenceProperty.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/ReferenceProperty"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((ReferenceProperty) object).getUid();
|
||||
return label == null || label.length() == 0 ? getString("_UI_ReferenceProperty_type")
|
||||
: getString("_UI_ReferenceProperty_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(ReferenceProperty.class)) {
|
||||
case SeimPackage.REFERENCE_PROPERTY__UID:
|
||||
case SeimPackage.REFERENCE_PROPERTY__KEY:
|
||||
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 SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import org.eclipse.emf.common.EMFPlugin;
|
||||
|
||||
import org.eclipse.emf.common.util.ResourceLocator;
|
||||
|
||||
/**
|
||||
* This is the central singleton for the Seim edit plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public final class SeimEditPlugin extends EMFPlugin {
|
||||
/**
|
||||
* Keep track of the singleton.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final SeimEditPlugin INSTANCE = new SeimEditPlugin();
|
||||
|
||||
/**
|
||||
* 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 SeimEditPlugin() {
|
||||
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,389 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.util.SeimAdapterFactory;
|
||||
|
||||
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 SeimItemProviderAdapterFactory extends SeimAdapterFactory
|
||||
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 SeimItemProviderAdapterFactory() {
|
||||
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 com.irtsaintexupery.pseim.seim.Component} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ComponentItemProvider componentItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.Component}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createComponentAdapter() {
|
||||
if (componentItemProvider == null) {
|
||||
componentItemProvider = new ComponentItemProvider(this);
|
||||
}
|
||||
|
||||
return componentItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.Port} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PortItemProvider portItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.Port}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createPortAdapter() {
|
||||
if (portItemProvider == null) {
|
||||
portItemProvider = new PortItemProvider(this);
|
||||
}
|
||||
|
||||
return portItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.Link} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected LinkItemProvider linkItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.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 com.irtsaintexupery.pseim.seim.IntegerProperty} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected IntegerPropertyItemProvider integerPropertyItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.IntegerProperty}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createIntegerPropertyAdapter() {
|
||||
if (integerPropertyItemProvider == null) {
|
||||
integerPropertyItemProvider = new IntegerPropertyItemProvider(this);
|
||||
}
|
||||
|
||||
return integerPropertyItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.StringProperty} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected StringPropertyItemProvider stringPropertyItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.StringProperty}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createStringPropertyAdapter() {
|
||||
if (stringPropertyItemProvider == null) {
|
||||
stringPropertyItemProvider = new StringPropertyItemProvider(this);
|
||||
}
|
||||
|
||||
return stringPropertyItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.BooleanProperty} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected BooleanPropertyItemProvider booleanPropertyItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.BooleanProperty}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createBooleanPropertyAdapter() {
|
||||
if (booleanPropertyItemProvider == null) {
|
||||
booleanPropertyItemProvider = new BooleanPropertyItemProvider(this);
|
||||
}
|
||||
|
||||
return booleanPropertyItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.ReferenceProperty} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ReferencePropertyItemProvider referencePropertyItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.ReferenceProperty}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createReferencePropertyAdapter() {
|
||||
if (referencePropertyItemProvider == null) {
|
||||
referencePropertyItemProvider = new ReferencePropertyItemProvider(this);
|
||||
}
|
||||
|
||||
return referencePropertyItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This keeps track of the one adapter used for all {@link com.irtsaintexupery.pseim.seim.Model} instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelItemProvider modelItemProvider;
|
||||
|
||||
/**
|
||||
* This creates an adapter for a {@link com.irtsaintexupery.pseim.seim.Model}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createModelAdapter() {
|
||||
if (modelItemProvider == null) {
|
||||
modelItemProvider = new ModelItemProvider(this);
|
||||
}
|
||||
|
||||
return modelItemProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the root adapter factory that contains this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void addListener(INotifyChangedListener notifyChangedListener) {
|
||||
changeNotifier.addListener(notifyChangedListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This removes a listener.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void removeListener(INotifyChangedListener notifyChangedListener) {
|
||||
changeNotifier.removeListener(notifyChangedListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void dispose() {
|
||||
if (componentItemProvider != null)
|
||||
componentItemProvider.dispose();
|
||||
if (portItemProvider != null)
|
||||
portItemProvider.dispose();
|
||||
if (linkItemProvider != null)
|
||||
linkItemProvider.dispose();
|
||||
if (integerPropertyItemProvider != null)
|
||||
integerPropertyItemProvider.dispose();
|
||||
if (stringPropertyItemProvider != null)
|
||||
stringPropertyItemProvider.dispose();
|
||||
if (booleanPropertyItemProvider != null)
|
||||
booleanPropertyItemProvider.dispose();
|
||||
if (referencePropertyItemProvider != null)
|
||||
referencePropertyItemProvider.dispose();
|
||||
if (modelItemProvider != null)
|
||||
modelItemProvider.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.provider;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
import com.irtsaintexupery.pseim.seim.StringProperty;
|
||||
|
||||
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 com.irtsaintexupery.pseim.seim.StringProperty} object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class StringPropertyItemProvider 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 StringPropertyItemProvider(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);
|
||||
|
||||
addUidPropertyDescriptor(object);
|
||||
addKeyPropertyDescriptor(object);
|
||||
addValuePropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Uid feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addUidPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_IdentifiedElement_uid_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_uid_feature",
|
||||
"_UI_IdentifiedElement_type"),
|
||||
SeimPackage.Literals.IDENTIFIED_ELEMENT__UID, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Key feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addKeyPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_Property_key_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_Property_key_feature",
|
||||
"_UI_Property_type"),
|
||||
SeimPackage.Literals.PROPERTY__KEY, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Value feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addValuePropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_StringProperty_value_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_StringProperty_value_feature",
|
||||
"_UI_StringProperty_type"),
|
||||
SeimPackage.Literals.STRING_PROPERTY__VALUE, true, false, false,
|
||||
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns StringProperty.gif.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object getImage(Object object) {
|
||||
return overlayImage(object, getResourceLocator().getImage("full/obj16/StringProperty"));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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 = ((StringProperty) object).getUid();
|
||||
return label == null || label.length() == 0 ? getString("_UI_StringProperty_type")
|
||||
: getString("_UI_StringProperty_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(StringProperty.class)) {
|
||||
case SeimPackage.STRING_PROPERTY__UID:
|
||||
case SeimPackage.STRING_PROPERTY__KEY:
|
||||
case SeimPackage.STRING_PROPERTY__VALUE:
|
||||
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 SeimEditPlugin.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
28
eclipse/plugins/com.irtsaintexupery.pseim.editor/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.irtsaintexupery.pseim.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,19 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.irtsaintexupery.pseim.editor;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Activator: com.irtsaintexupery.pseim.pseim.presentation.PseimEditorPlugin$Implementation
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.irtsaintexupery.pseim.seim.presentation,
|
||||
com.irtsaintexupery.pseim.pseim.presentation
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources;visibility:=reexport,
|
||||
com.irtsaintexupery.pseim.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,10 @@
|
||||
#
|
||||
|
||||
bin.includes = .,\
|
||||
icons/,\
|
||||
META-INF/,\
|
||||
plugin.xml,\
|
||||
plugin.properties
|
||||
jars.compile.order = .
|
||||
source.. = src-gen/
|
||||
output.. = bin
|
||||
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,60 @@
|
||||
#
|
||||
|
||||
pluginName = PSEIM Editor
|
||||
providerName = IRT AESE (IRT Saint Exup<75>ry)
|
||||
|
||||
_UI_SeimEditor_menu = &Seim 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_SeimModelWizard_label = Seim Model
|
||||
_UI_SeimModelWizard_description = Create a new Seim model
|
||||
|
||||
_UI_SeimEditor_label = Seim Model Editor
|
||||
|
||||
_UI_SeimEditorFilenameDefaultBase = My
|
||||
_UI_SeimEditorFilenameExtensions = seim
|
||||
|
||||
_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?
|
||||
|
||||
_UI_PseimEditor_menu = &Pseim Editor
|
||||
|
||||
_UI_PseimModelWizard_label = Pseim Model
|
||||
_UI_PseimModelWizard_description = Create a new Pseim model
|
||||
|
||||
_UI_PseimEditor_label = Pseim Model Editor
|
||||
|
||||
64
eclipse/plugins/com.irtsaintexupery.pseim.editor/plugin.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
|
||||
<!--
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
|
||||
<extension point="org.eclipse.ui.newWizards">
|
||||
<!-- @generated seim -->
|
||||
<category
|
||||
id="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||
name="%_UI_Wizard_category"/>
|
||||
<wizard
|
||||
id="com.irtsaintexupery.pseim.seim.presentation.SeimModelWizardID"
|
||||
name="%_UI_SeimModelWizard_label"
|
||||
class="com.irtsaintexupery.pseim.seim.presentation.SeimModelWizard"
|
||||
category="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||
icon="icons/full/obj16/SeimModelFile.gif">
|
||||
<description>%_UI_SeimModelWizard_description</description>
|
||||
<selection class="org.eclipse.core.resources.IResource"/>
|
||||
</wizard>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.editors">
|
||||
<!-- @generated seim -->
|
||||
<editor
|
||||
id="com.irtsaintexupery.pseim.seim.presentation.SeimEditorID"
|
||||
name="%_UI_SeimEditor_label"
|
||||
icon="icons/full/obj16/SeimModelFile.gif"
|
||||
extensions="seim"
|
||||
class="com.irtsaintexupery.pseim.seim.presentation.SeimEditor"
|
||||
contributorClass="com.irtsaintexupery.pseim.seim.presentation.SeimActionBarContributor">
|
||||
</editor>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.newWizards">
|
||||
<!-- @generated pseim -->
|
||||
<category
|
||||
id="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||
name="%_UI_Wizard_category"/>
|
||||
<wizard
|
||||
id="com.irtsaintexupery.pseim.pseim.presentation.PseimModelWizardID"
|
||||
name="%_UI_PseimModelWizard_label"
|
||||
class="com.irtsaintexupery.pseim.pseim.presentation.PseimModelWizard"
|
||||
category="org.eclipse.emf.ecore.Wizard.category.ID"
|
||||
icon="icons/full/obj16/PseimModelFile.gif">
|
||||
<description>%_UI_PseimModelWizard_description</description>
|
||||
<selection class="org.eclipse.core.resources.IResource"/>
|
||||
</wizard>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.editors">
|
||||
<!-- @generated pseim -->
|
||||
<editor
|
||||
id="com.irtsaintexupery.pseim.pseim.presentation.PseimEditorID"
|
||||
name="%_UI_PseimEditor_label"
|
||||
icon="icons/full/obj16/PseimModelFile.gif"
|
||||
extensions="pseim"
|
||||
class="com.irtsaintexupery.pseim.pseim.presentation.PseimEditor"
|
||||
contributorClass="com.irtsaintexupery.pseim.pseim.presentation.PseimActionBarContributor">
|
||||
</editor>
|
||||
</extension>
|
||||
</plugin>
|
||||
@@ -0,0 +1,429 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.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 Pseim model editor.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PseimActionBarContributor 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(
|
||||
PseimEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
getPage().showView("org.eclipse.ui.views.PropertySheet");
|
||||
} catch (PartInitException exception) {
|
||||
PseimEditorPlugin.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(
|
||||
PseimEditorPlugin.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 PseimActionBarContributor() {
|
||||
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) {
|
||||
toolBarManager.add(new Separator("pseim-settings"));
|
||||
toolBarManager.add(new Separator("pseim-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(PseimEditorPlugin.INSTANCE.getString("_UI_PseimEditor_menu"),
|
||||
"com.irtsaintexupery.pseim.pseimMenuID");
|
||||
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(PseimEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||
submenuManager.insertBefore("additions", createChildMenuManager);
|
||||
|
||||
// Prepare for CreateSibling item addition or removal.
|
||||
//
|
||||
createSiblingMenuManager = new MenuManager(PseimEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
|
||||
submenuManager.insertBefore("additions", createSiblingMenuManager);
|
||||
|
||||
// Force an update because Eclipse hides empty menus now.
|
||||
//
|
||||
submenuManager.addMenuListener(new IMenuListener() {
|
||||
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
|
||||
*/
|
||||
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(PseimEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||
populateManager(submenuManager, createChildActions, null);
|
||||
menuManager.insertBefore("edit", submenuManager);
|
||||
|
||||
submenuManager = new MenuManager(PseimEditorPlugin.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.presentation;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.provider.SeimEditPlugin;
|
||||
|
||||
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 Pseim editor plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public final class PseimEditorPlugin extends EMFPlugin {
|
||||
/**
|
||||
* Keep track of the singleton.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final PseimEditorPlugin INSTANCE = new PseimEditorPlugin();
|
||||
|
||||
/**
|
||||
* 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 PseimEditorPlugin() {
|
||||
super(new ResourceLocator[] { SeimEditPlugin.INSTANCE, });
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of the Eclipse plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the singleton instance.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getPluginResourceLocator() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of the Eclipse plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the singleton instance.
|
||||
* @generated
|
||||
*/
|
||||
public static Implementation getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual implementation of the Eclipse <b>Plugin</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static class Implementation extends EclipseUIPlugin {
|
||||
/**
|
||||
* Creates an instance.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Implementation() {
|
||||
super();
|
||||
|
||||
// Remember the static instance.
|
||||
//
|
||||
plugin = this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,633 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.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 com.irtsaintexupery.pseim.pseim.PseimFactory;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
import com.irtsaintexupery.pseim.pseim.provider.PseimEditPlugin;
|
||||
|
||||
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 PseimModelWizard 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(PseimEditorPlugin.INSTANCE.getString("_UI_PseimEditorFilenameExtensions").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 = PseimEditorPlugin.INSTANCE
|
||||
.getString("_UI_PseimEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
|
||||
|
||||
/**
|
||||
* This caches an instance of the model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PseimPackage pseimPackage = PseimPackage.eINSTANCE;
|
||||
|
||||
/**
|
||||
* This caches an instance of the model factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PseimFactory pseimFactory = pseimPackage.getPseimFactory();
|
||||
|
||||
/**
|
||||
* This is the file creation page.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PseimModelWizardNewFileCreationPage newFileCreationPage;
|
||||
|
||||
/**
|
||||
* This is the initial object creation page.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PseimModelWizardInitialObjectCreationPage 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
|
||||
*/
|
||||
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
||||
this.workbench = workbench;
|
||||
this.selection = selection;
|
||||
setWindowTitle(PseimEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
|
||||
setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE
|
||||
.getImageDescriptor(PseimEditorPlugin.INSTANCE.getImage("full/wizban/NewPseim")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 : pseimPackage.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) pseimPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
|
||||
EObject rootObject = pseimFactory.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) {
|
||||
PseimEditorPlugin.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() {
|
||||
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(),
|
||||
PseimEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception exception) {
|
||||
PseimEditorPlugin.INSTANCE.log(exception);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the one page of the wizard.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PseimModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
|
||||
/**
|
||||
* Pass in the selection.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimModelWizardNewFileCreationPage(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(
|
||||
PseimEditorPlugin.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 PseimModelWizardInitialObjectCreationPage 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 PseimModelWizardInitialObjectCreationPage(String pageId) {
|
||||
super(pageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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(PseimEditorPlugin.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(PseimEditorPlugin.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() {
|
||||
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 PseimEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
|
||||
} catch (MissingResourceException mre) {
|
||||
PseimEditorPlugin.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(
|
||||
PseimEditorPlugin.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 PseimModelWizardNewFileCreationPage("Whatever", selection);
|
||||
newFileCreationPage.setTitle(PseimEditorPlugin.INSTANCE.getString("_UI_PseimModelWizard_label"));
|
||||
newFileCreationPage.setDescription(PseimEditorPlugin.INSTANCE.getString("_UI_PseimModelWizard_description"));
|
||||
newFileCreationPage.setFileName(PseimEditorPlugin.INSTANCE.getString("_UI_PseimEditorFilenameDefaultBase") + "."
|
||||
+ 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 = PseimEditorPlugin.INSTANCE
|
||||
.getString("_UI_PseimEditorFilenameDefaultBase");
|
||||
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 PseimModelWizardInitialObjectCreationPage("Whatever2");
|
||||
initialObjectCreationPage.setTitle(PseimEditorPlugin.INSTANCE.getString("_UI_PseimModelWizard_label"));
|
||||
initialObjectCreationPage
|
||||
.setDescription(PseimEditorPlugin.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,432 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.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 Seim model editor.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class SeimActionBarContributor 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(
|
||||
SeimEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
getPage().showView("org.eclipse.ui.views.PropertySheet");
|
||||
} catch (PartInitException exception) {
|
||||
SeimEditorPlugin.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(
|
||||
SeimEditorPlugin.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 SeimActionBarContributor() {
|
||||
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) {
|
||||
toolBarManager.add(new Separator("seim-settings"));
|
||||
toolBarManager.add(new Separator("seim-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(SeimEditorPlugin.INSTANCE.getString("_UI_SeimEditor_menu"),
|
||||
"com.irtsaintexupery.pseim.seimMenuID");
|
||||
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(SeimEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||
submenuManager.insertBefore("additions", createChildMenuManager);
|
||||
|
||||
// Prepare for CreateSibling item addition or removal.
|
||||
//
|
||||
createSiblingMenuManager = new MenuManager(SeimEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
|
||||
submenuManager.insertBefore("additions", createSiblingMenuManager);
|
||||
|
||||
// Force an update because Eclipse hides empty menus now.
|
||||
//
|
||||
submenuManager.addMenuListener(new IMenuListener() {
|
||||
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
|
||||
*/
|
||||
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(SeimEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
|
||||
populateManager(submenuManager, createChildActions, null);
|
||||
menuManager.insertBefore("edit", submenuManager);
|
||||
|
||||
submenuManager = new MenuManager(SeimEditorPlugin.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.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 Seim editor plugin.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public final class SeimEditorPlugin extends EMFPlugin {
|
||||
/**
|
||||
* Keep track of the singleton.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final SeimEditorPlugin INSTANCE = new SeimEditorPlugin();
|
||||
|
||||
/**
|
||||
* 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 SeimEditorPlugin() {
|
||||
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,636 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.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 com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
import com.irtsaintexupery.pseim.seim.provider.SeimEditPlugin;
|
||||
|
||||
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 SeimModelWizard 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(SeimEditorPlugin.INSTANCE.getString("_UI_SeimEditorFilenameExtensions").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 = SeimEditorPlugin.INSTANCE
|
||||
.getString("_UI_SeimEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
|
||||
|
||||
/**
|
||||
* This caches an instance of the model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SeimPackage seimPackage = SeimPackage.eINSTANCE;
|
||||
|
||||
/**
|
||||
* This caches an instance of the model factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SeimFactory seimFactory = seimPackage.getSeimFactory();
|
||||
|
||||
/**
|
||||
* This is the file creation page.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SeimModelWizardNewFileCreationPage newFileCreationPage;
|
||||
|
||||
/**
|
||||
* This is the initial object creation page.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SeimModelWizardInitialObjectCreationPage 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
|
||||
*/
|
||||
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
||||
this.workbench = workbench;
|
||||
this.selection = selection;
|
||||
setWindowTitle(SeimEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
|
||||
setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE
|
||||
.getImageDescriptor(SeimEditorPlugin.INSTANCE.getImage("full/wizban/NewSeim")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 : seimPackage.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) seimPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
|
||||
EObject rootObject = seimFactory.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) {
|
||||
SeimEditorPlugin.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() {
|
||||
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(),
|
||||
SeimEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception exception) {
|
||||
SeimEditorPlugin.INSTANCE.log(exception);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the one page of the wizard.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class SeimModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
|
||||
/**
|
||||
* Pass in the selection.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SeimModelWizardNewFileCreationPage(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(
|
||||
SeimEditorPlugin.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 SeimModelWizardInitialObjectCreationPage 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 SeimModelWizardInitialObjectCreationPage(String pageId) {
|
||||
super(pageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
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(SeimEditorPlugin.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(SeimEditorPlugin.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() {
|
||||
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 SeimEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
|
||||
} catch (MissingResourceException mre) {
|
||||
SeimEditorPlugin.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(
|
||||
SeimEditorPlugin.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 SeimModelWizardNewFileCreationPage("Whatever", selection);
|
||||
newFileCreationPage.setTitle(SeimEditorPlugin.INSTANCE.getString("_UI_SeimModelWizard_label"));
|
||||
newFileCreationPage.setDescription(SeimEditorPlugin.INSTANCE.getString("_UI_SeimModelWizard_description"));
|
||||
newFileCreationPage.setFileName(SeimEditorPlugin.INSTANCE.getString("_UI_SeimEditorFilenameDefaultBase") + "."
|
||||
+ 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 = SeimEditorPlugin.INSTANCE
|
||||
.getString("_UI_SeimEditorFilenameDefaultBase");
|
||||
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 SeimModelWizardInitialObjectCreationPage("Whatever2");
|
||||
initialObjectCreationPage.setTitle(SeimEditorPlugin.INSTANCE.getString("_UI_SeimModelWizard_label"));
|
||||
initialObjectCreationPage
|
||||
.setDescription(SeimEditorPlugin.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();
|
||||
}
|
||||
|
||||
}
|
||||
7
eclipse/plugins/com.irtsaintexupery.pseim/.classpath
Normal file
@@ -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-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
29
eclipse/plugins/com.irtsaintexupery.pseim/.project
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.irtsaintexupery.pseim</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,19 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.irtsaintexupery.pseim;singleton:=true
|
||||
Bundle-Version: 0.1.0.qualifier
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.irtsaintexupery.pseim.seim,
|
||||
com.irtsaintexupery.pseim.seim.impl,
|
||||
com.irtsaintexupery.pseim.seim.util,
|
||||
com.irtsaintexupery.pseim.pseim,
|
||||
com.irtsaintexupery.pseim.pseim.impl,
|
||||
com.irtsaintexupery.pseim.pseim.util
|
||||
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
|
||||
com.irtsaintexupery.pseim;visibility:=reexport,
|
||||
org.eclipse.core.runtime
|
||||
Bundle-ActivationPolicy: lazy
|
||||
10
eclipse/plugins/com.irtsaintexupery.pseim/build.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
|
||||
bin.includes = .,\
|
||||
model/,\
|
||||
META-INF/,\
|
||||
plugin.xml,\
|
||||
plugin.properties
|
||||
jars.compile.order = .
|
||||
source.. = src-gen/
|
||||
output.. = bin/
|
||||
122
eclipse/plugins/com.irtsaintexupery.pseim/model/pseim.ecore
Normal file
@@ -0,0 +1,122 @@
|
||||
<?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="pseim" nsURI="http://www.irt-saintexupery.com/pseim/0.1" nsPrefix="pseim">
|
||||
<eAnnotations source="http://www.eclipse.org/OCL/Import">
|
||||
<details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
|
||||
<details key="seim" value="seim.ecore#/"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
<details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
<details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
</eAnnotations>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Library" eSuperTypes="seim.ecore#//NamedElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="patterns" upperBound="-1"
|
||||
eType="#//Pattern" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Pattern" eSuperTypes="seim.ecore#//Model">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="typeHS" ordered="false"
|
||||
upperBound="-1" eType="#//PatternTypeHS"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="typeFailure" eType="#//PatternTypeFailureMode"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="alsoKnownAs" ordered="false"
|
||||
upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
|
||||
<eAnnotations source="http://www.eclipse.org/OCL/Collection">
|
||||
<details key="nullFree" value="false"/>
|
||||
</eAnnotations>
|
||||
</eStructuralFeatures>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="usedTactics" ordered="false"
|
||||
upperBound="-1" eType="#//SafetyTactic">
|
||||
<eAnnotations source="http://www.eclipse.org/OCL/Collection">
|
||||
<details key="nullFree" value="false"/>
|
||||
</eAnnotations>
|
||||
</eStructuralFeatures>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="context" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="domain" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isSingleChannel" lowerBound="1"
|
||||
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="interfaceElements" upperBound="-1"
|
||||
eType="ecore:EClass seim.ecore#//PropertyHolder"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="cardinalityElements" upperBound="-1"
|
||||
eType="#//CardinalityElement" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="PatternTypeHS">
|
||||
<eLiterals name="Hardware"/>
|
||||
<eLiterals name="Software" value="1"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="PatternTypeFailureMode">
|
||||
<eLiterals name="Fail_safe"/>
|
||||
<eLiterals name="Fail_over" value="1"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="SafetyTactic">
|
||||
<eLiterals name="Simplicity"/>
|
||||
<eLiterals name="Substitution" value="1"/>
|
||||
<eLiterals name="Sanity_Check" value="2"/>
|
||||
<eLiterals name="Condition_Monitoring" value="3"/>
|
||||
<eLiterals name="Comparison" value="4"/>
|
||||
<eLiterals name="Diverse_Redundancy" value="5"/>
|
||||
<eLiterals name="Replication_Redundancy" value="6"/>
|
||||
<eLiterals name="Repair" value="7"/>
|
||||
<eLiterals name="Degradation" value="8"/>
|
||||
<eLiterals name="Voting" value="9"/>
|
||||
<eLiterals name="Override" value="10"/>
|
||||
<eLiterals name="Barrier" value="11"/>
|
||||
<eLiterals name="Heartbeat" value="12"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="CardinalityElement" eSuperTypes="seim.ecore#//PropertyHolder">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="calculatedVia" upperBound="-1"
|
||||
eType="ecore:EClass seim.ecore#//PropertyHolder"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="LinkType">
|
||||
<eLiterals name="TRANSPOSE"/>
|
||||
<eLiterals name="IDENTITY" value="1"/>
|
||||
<eLiterals name="SHIFT" value="2"/>
|
||||
<eLiterals name="FIRST" value="3"/>
|
||||
<eLiterals name="ROTATE" value="4"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="PatternComponent" eSuperTypes="#//MultiplicityElement #//IdentifiedElement seim.ecore#//Component">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="contentIsPatternContent"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="contentIsPatternContent" value="content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mergeContent" lowerBound="1"
|
||||
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="PatternPort" eSuperTypes="#//MultiplicityElement #//IdentifiedElement seim.ecore#//Port">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="dir" lowerBound="1" eType="#//PatternPortDirection"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="PatternLink" eSuperTypes="#//IdentifiedElement seim.ecore#//Link">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="srcIsPatternPort dstIsPatternPort"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="srcIsPatternPort" value="src.oclIsTypeOf(PatternLink)"/>
|
||||
<details key="dstIsPatternPort" value="dst.oclIsTypeOf(PatternLink)"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="linkType" lowerBound="1"
|
||||
eType="#//LinkType"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="#//CardinalityElement"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="MultiplicityElement" abstract="true"
|
||||
interface="true">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="cardinalityAsElementOrMult"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="cardinalityAsElementOrMult" value="(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicityValue" lowerBound="1"
|
||||
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="1"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="cardinalityElement" eType="#//CardinalityElement"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="IdentifiedElement" abstract="true" interface="true">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="identifiedAs" eType="ecore:EClass seim.ecore#//PropertyHolder"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="PatternPortDirection">
|
||||
<eLiterals name="UNSPECIFIED" value="3"/>
|
||||
<eLiterals name="IN"/>
|
||||
<eLiterals name="OUT" value="1"/>
|
||||
<eLiterals name="INOUT" value="2"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0"
|
||||
modelDirectory="/com.irtsaintexupery.pseim/src-gen" editDirectory="/com.irtsaintexupery.pseim.edit/src-gen"
|
||||
editorDirectory="/com.irtsaintexupery.pseim.editor/src-gen" modelPluginID="com.irtsaintexupery.pseim"
|
||||
modelName="Pseim" editPluginClass="com.irtsaintexupery.pseim.pseim.provider.PseimEditPlugin"
|
||||
editorPluginClass="com.irtsaintexupery.pseim.pseim.presentation.PseimEditorPlugin"
|
||||
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" codeFormatting="true"
|
||||
testsDirectory="/com.irtsaintexupery.pseim.tests/src-gen" testSuiteClass="com.irtsaintexupery.pseim.pseim.tests.PseimAllTests"
|
||||
importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
|
||||
editPluginID="com.irtsaintexupery.pseim.edit" editorPluginID="com.irtsaintexupery.pseim.editor"
|
||||
usedGenPackages="seim.genmodel#//seim" operationReflection="true" importOrganizing="true">
|
||||
<foreignModel>pseim.ecore</foreignModel>
|
||||
<genPackages prefix="Pseim" basePackage="com.irtsaintexupery.pseim" disposableProviderFactory="true"
|
||||
ecorePackage="pseim.ecore#/">
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="pseim.ecore#//PatternTypeHS">
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternTypeHS/Hardware"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternTypeHS/Software"/>
|
||||
</genEnums>
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="pseim.ecore#//PatternTypeFailureMode">
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternTypeFailureMode/Fail_safe"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternTypeFailureMode/Fail_over"/>
|
||||
</genEnums>
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="pseim.ecore#//SafetyTactic">
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Simplicity"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Substitution"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Sanity_Check"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Condition_Monitoring"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Comparison"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Diverse_Redundancy"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Replication_Redundancy"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Repair"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Degradation"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Voting"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Override"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Barrier"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//SafetyTactic/Heartbeat"/>
|
||||
</genEnums>
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="pseim.ecore#//LinkType">
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//LinkType/TRANSPOSE"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//LinkType/IDENTITY"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//LinkType/SHIFT"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//LinkType/FIRST"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//LinkType/ROTATE"/>
|
||||
</genEnums>
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="pseim.ecore#//PatternPortDirection">
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternPortDirection/UNSPECIFIED"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternPortDirection/IN"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternPortDirection/OUT"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="pseim.ecore#//PatternPortDirection/INOUT"/>
|
||||
</genEnums>
|
||||
<genClasses ecoreClass="pseim.ecore#//Library">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pseim.ecore#//Library/patterns"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="pseim.ecore#//Pattern">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/typeHS"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/typeFailure"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/alsoKnownAs"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/usedTactics"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/context"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/domain"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//Pattern/isSingleChannel"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pseim.ecore#//Pattern/interfaceElements"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pseim.ecore#//Pattern/cardinalityElements"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="pseim.ecore#//CardinalityElement">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pseim.ecore#//CardinalityElement/calculatedVia"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="pseim.ecore#//PatternComponent">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//PatternComponent/mergeContent"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="pseim.ecore#//PatternPort">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//PatternPort/dir"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="pseim.ecore#//PatternLink">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//PatternLink/linkType"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pseim.ecore#//PatternLink/element"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="pseim.ecore#//MultiplicityElement">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute pseim.ecore#//MultiplicityElement/multiplicityValue"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pseim.ecore#//MultiplicityElement/cardinalityElement"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="pseim.ecore#//IdentifiedElement">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pseim.ecore#//IdentifiedElement/identifiedAs"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
||||
8772
eclipse/plugins/com.irtsaintexupery.pseim/model/seim.aird
Normal file
98
eclipse/plugins/com.irtsaintexupery.pseim/model/seim.ecore
Normal file
@@ -0,0 +1,98 @@
|
||||
<?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="seim" nsURI="http://www.irt-saintexupery.com/seim/0.1" nsPrefix="seim">
|
||||
<eAnnotations source="http://www.eclipse.org/OCL/Import">
|
||||
<details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
<details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
<details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
|
||||
</eAnnotations>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Component" eSuperTypes="#//GraphElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="content" upperBound="-1"
|
||||
eType="#//Element" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Port" eSuperTypes="#//BorderElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="direction" lowerBound="1"
|
||||
eType="#//PortDirection"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Link" eSuperTypes="#//GraphElement">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="src" eType="#//Port"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="dst" eType="#//Port"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="GraphElement" abstract="true" interface="true"
|
||||
eSuperTypes="#//Element"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Property" abstract="true" interface="true"
|
||||
eSuperTypes="#//IdentifiedElement">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="keyNotNull"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="keyNotNull" value="key <> ''"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="BasicProperty" abstract="true" interface="true"
|
||||
eSuperTypes="#//Property"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="IntegerProperty" eSuperTypes="#//BasicProperty">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
|
||||
defaultValueLiteral="0"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="StringProperty" eSuperTypes="#//BasicProperty">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
|
||||
defaultValueLiteral="''"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="BooleanProperty" eSuperTypes="#//BasicProperty">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
|
||||
defaultValueLiteral="false"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="ReferenceProperty" eSuperTypes="#//Property">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="ref" lowerBound="1" eType="#//PropertyHolder"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="PropertyHolder" abstract="true" interface="true"
|
||||
eSuperTypes="#//NamedElement">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="uniqueKeys"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="uniqueKeys" value="properties->forAll(p1, p2 | p1 <> p2 implies p1.key <> p2.key)"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
|
||||
eType="#//Property" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true" interface="true"
|
||||
eSuperTypes="#//IdentifiedElement">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="nameNotEmpty"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="nameNotEmpty" value="name <> ''"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="IdentifiedElement" abstract="true" interface="true">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
|
||||
<details key="constraints" value="uidNotEmpty"/>
|
||||
</eAnnotations>
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
|
||||
<details key="uidNotEmpty" value="uid <> ''"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="uid" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
|
||||
changeable="false" unsettable="true" iD="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="PortDirection">
|
||||
<eLiterals name="UNSPECIFIED" value="3"/>
|
||||
<eLiterals name="IN"/>
|
||||
<eLiterals name="OUT" value="1"/>
|
||||
<eLiterals name="INOUT" value="2"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Model" eSuperTypes="#//PropertyHolder">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="modelElements" upperBound="-1"
|
||||
eType="#//GraphElement" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="BorderElement" abstract="true" interface="true"
|
||||
eSuperTypes="#//Element"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Element" abstract="true" interface="true"
|
||||
eSuperTypes="#//PropertyHolder"/>
|
||||
</ecore:EPackage>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/com.irtsaintexupery.pseim/src-gen" creationIcons="false"
|
||||
editDirectory="/com.irtsaintexupery.pseim.edit/src-gen" editorDirectory="/com.irtsaintexupery.pseim.editor/src-gen"
|
||||
modelPluginID="com.irtsaintexupery.pseim" modelName="Seim" editPluginClass="com.irtsaintexupery.pseim.seim.provider.SeimEditPlugin"
|
||||
editorPluginClass="com.irtsaintexupery.pseim.seim.presentation.SeimEditorPlugin"
|
||||
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" codeFormatting="true"
|
||||
testsDirectory="/com.irtsaintexupery.pseim.tests/src" testSuiteClass="com.irtsaintexupery.pseim.seim.tests.SeimAllTests"
|
||||
importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
|
||||
editPluginID="com.irtsaintexupery.pseim.edit" editorPluginID="com.irtsaintexupery.pseim.editor"
|
||||
operationReflection="true" importOrganizing="true">
|
||||
<foreignModel>seim.ecore</foreignModel>
|
||||
<genPackages prefix="Seim" basePackage="com.irtsaintexupery.pseim" disposableProviderFactory="true"
|
||||
ecorePackage="seim.ecore#/">
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="seim.ecore#//PortDirection">
|
||||
<genEnumLiterals ecoreEnumLiteral="seim.ecore#//PortDirection/UNSPECIFIED"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="seim.ecore#//PortDirection/IN"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="seim.ecore#//PortDirection/OUT"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="seim.ecore#//PortDirection/INOUT"/>
|
||||
</genEnums>
|
||||
<genClasses ecoreClass="seim.ecore#//Component">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference seim.ecore#//Component/content"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//Port">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//Port/direction"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//Link">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference seim.ecore#//Link/src"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference seim.ecore#//Link/dst"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//GraphElement"/>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//Property">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//Property/key"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//BasicProperty"/>
|
||||
<genClasses ecoreClass="seim.ecore#//IntegerProperty">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//IntegerProperty/value"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//StringProperty">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//StringProperty/value"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//BooleanProperty">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//BooleanProperty/value"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//ReferenceProperty">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference seim.ecore#//ReferenceProperty/ref"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//PropertyHolder">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference seim.ecore#//PropertyHolder/properties"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//NamedElement">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//NamedElement/name"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//IdentifiedElement">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute seim.ecore#//IdentifiedElement/uid"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="seim.ecore#//Model">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference seim.ecore#//Model/modelElements"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//BorderElement"/>
|
||||
<genClasses image="false" ecoreClass="seim.ecore#//Element"/>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
||||
@@ -0,0 +1,4 @@
|
||||
#
|
||||
|
||||
pluginName = PSEIM Model
|
||||
providerName = IRT AESE (IRT Saint Exup<75>ry)
|
||||
25
eclipse/plugins/com.irtsaintexupery.pseim/plugin.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
|
||||
<!--
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
|
||||
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||
<!-- @generated seim -->
|
||||
<package
|
||||
uri="http://www.irt-saintexupery.com/seim/0.1"
|
||||
class="com.irtsaintexupery.pseim.seim.SeimPackage"
|
||||
genModel="model/seim.genmodel"/>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||
<!-- @generated pseim -->
|
||||
<package
|
||||
uri="http://www.irt-saintexupery.com/pseim/0.1"
|
||||
class="com.irtsaintexupery.pseim.pseim.PseimPackage"
|
||||
genModel="model/pseim.genmodel"/>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
@@ -0,0 +1,52 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Cardinality Element</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.CardinalityElement#getCalculatedVia <em>Calculated Via</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getCardinalityElement()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface CardinalityElement extends PropertyHolder {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Calculated Via</b></em>' reference list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.seim.PropertyHolder}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Calculated Via</em>' reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Calculated Via</em>' reference list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getCardinalityElement_CalculatedVia()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
EList<PropertyHolder> getCalculatedVia();
|
||||
|
||||
} // CardinalityElement
|
||||
@@ -0,0 +1,62 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Identified Element</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.IdentifiedElement#getIdentifiedAs <em>Identified As</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getIdentifiedElement()
|
||||
* @model interface="true" abstract="true"
|
||||
* @generated
|
||||
*/
|
||||
public interface IdentifiedElement extends EObject {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Identified As</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Identified As</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Identified As</em>' reference.
|
||||
* @see #setIdentifiedAs(PropertyHolder)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getIdentifiedElement_IdentifiedAs()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
PropertyHolder getIdentifiedAs();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.IdentifiedElement#getIdentifiedAs <em>Identified As</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Identified As</em>' reference.
|
||||
* @see #getIdentifiedAs()
|
||||
* @generated
|
||||
*/
|
||||
void setIdentifiedAs(PropertyHolder value);
|
||||
|
||||
} // IdentifiedElement
|
||||
@@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Library</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Library#getPatterns <em>Patterns</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getLibrary()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Library extends NamedElement {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Patterns</b></em>' containment reference list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.pseim.Pattern}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Patterns</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Patterns</em>' containment reference list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getLibrary_Patterns()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Pattern> getPatterns();
|
||||
|
||||
} // Library
|
||||
@@ -0,0 +1,303 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Link Type</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getLinkType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum LinkType implements Enumerator {
|
||||
/**
|
||||
* The '<em><b>TRANSPOSE</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #TRANSPOSE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
TRANSPOSE(0, "TRANSPOSE", "TRANSPOSE"),
|
||||
|
||||
/**
|
||||
* The '<em><b>IDENTITY</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #IDENTITY_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
IDENTITY(1, "IDENTITY", "IDENTITY"),
|
||||
|
||||
/**
|
||||
* The '<em><b>SHIFT</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SHIFT_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
SHIFT(2, "SHIFT", "SHIFT"),
|
||||
|
||||
/**
|
||||
* The '<em><b>FIRST</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FIRST_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
FIRST(3, "FIRST", "FIRST"),
|
||||
|
||||
/**
|
||||
* The '<em><b>ROTATE</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #ROTATE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
ROTATE(4, "ROTATE", "ROTATE");
|
||||
|
||||
/**
|
||||
* The '<em><b>TRANSPOSE</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>TRANSPOSE</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #TRANSPOSE
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int TRANSPOSE_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>IDENTITY</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>IDENTITY</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #IDENTITY
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int IDENTITY_VALUE = 1;
|
||||
|
||||
/**
|
||||
* The '<em><b>SHIFT</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>SHIFT</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SHIFT
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int SHIFT_VALUE = 2;
|
||||
|
||||
/**
|
||||
* The '<em><b>FIRST</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>FIRST</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FIRST
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int FIRST_VALUE = 3;
|
||||
|
||||
/**
|
||||
* The '<em><b>ROTATE</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>ROTATE</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #ROTATE
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int ROTATE_VALUE = 4;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Link Type</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final LinkType[] VALUES_ARRAY = new LinkType[] { TRANSPOSE, IDENTITY, SHIFT, FIRST, ROTATE, };
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Link Type</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<LinkType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Link Type</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static LinkType get(String literal) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
LinkType result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Link Type</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static LinkType getByName(String name) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
LinkType result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Link Type</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static LinkType get(int value) {
|
||||
switch (value) {
|
||||
case TRANSPOSE_VALUE:
|
||||
return TRANSPOSE;
|
||||
case IDENTITY_VALUE:
|
||||
return IDENTITY;
|
||||
case SHIFT_VALUE:
|
||||
return SHIFT;
|
||||
case FIRST_VALUE:
|
||||
return FIRST;
|
||||
case ROTATE_VALUE:
|
||||
return ROTATE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private LinkType(int value, String name, String literal) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //LinkType
|
||||
@@ -0,0 +1,90 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Multiplicity Element</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.MultiplicityElement#getMultiplicityValue <em>Multiplicity Value</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.MultiplicityElement#getCardinalityElement <em>Cardinality Element</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getMultiplicityElement()
|
||||
* @model interface="true" abstract="true"
|
||||
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='cardinalityAsElementOrMult'"
|
||||
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot cardinalityAsElementOrMult='(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1'"
|
||||
* @generated
|
||||
*/
|
||||
public interface MultiplicityElement extends EObject {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Multiplicity Value</b></em>' attribute.
|
||||
* The default value is <code>"1"</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Multiplicity Value</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Multiplicity Value</em>' attribute.
|
||||
* @see #setMultiplicityValue(int)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getMultiplicityElement_MultiplicityValue()
|
||||
* @model default="1" required="true"
|
||||
* @generated
|
||||
*/
|
||||
int getMultiplicityValue();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.MultiplicityElement#getMultiplicityValue <em>Multiplicity Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Multiplicity Value</em>' attribute.
|
||||
* @see #getMultiplicityValue()
|
||||
* @generated
|
||||
*/
|
||||
void setMultiplicityValue(int value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Cardinality Element</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Cardinality Element</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Cardinality Element</em>' reference.
|
||||
* @see #setCardinalityElement(CardinalityElement)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getMultiplicityElement_CardinalityElement()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
CardinalityElement getCardinalityElement();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.MultiplicityElement#getCardinalityElement <em>Cardinality Element</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Cardinality Element</em>' reference.
|
||||
* @see #getCardinalityElement()
|
||||
* @generated
|
||||
*/
|
||||
void setCardinalityElement(CardinalityElement value);
|
||||
|
||||
} // MultiplicityElement
|
||||
@@ -0,0 +1,238 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Pattern</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getTypeHS <em>Type HS</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getTypeFailure <em>Type Failure</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getAlsoKnownAs <em>Also Known As</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getUsedTactics <em>Used Tactics</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getContext <em>Context</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getDomain <em>Domain</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#isIsSingleChannel <em>Is Single Channel</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getInterfaceElements <em>Interface Elements</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.Pattern#getCardinalityElements <em>Cardinality Elements</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Pattern extends Model {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type HS</b></em>' attribute list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.pseim.PatternTypeHS}.
|
||||
* The literals are from the enumeration {@link com.irtsaintexupery.pseim.pseim.PatternTypeHS}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type HS</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type HS</em>' attribute list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PatternTypeHS
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_TypeHS()
|
||||
* @model ordered="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<PatternTypeHS> getTypeHS();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type Failure</b></em>' attribute.
|
||||
* The literals are from the enumeration {@link com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type Failure</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type Failure</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode
|
||||
* @see #setTypeFailure(PatternTypeFailureMode)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_TypeFailure()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
PatternTypeFailureMode getTypeFailure();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.Pattern#getTypeFailure <em>Type Failure</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Type Failure</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode
|
||||
* @see #getTypeFailure()
|
||||
* @generated
|
||||
*/
|
||||
void setTypeFailure(PatternTypeFailureMode value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Also Known As</b></em>' attribute list.
|
||||
* The list contents are of type {@link java.lang.String}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Also Known As</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Also Known As</em>' attribute list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_AlsoKnownAs()
|
||||
* @model ordered="false"
|
||||
* annotation="http://www.eclipse.org/OCL/Collection nullFree='false'"
|
||||
* @generated
|
||||
*/
|
||||
EList<String> getAlsoKnownAs();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Used Tactics</b></em>' attribute list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.pseim.SafetyTactic}.
|
||||
* The literals are from the enumeration {@link com.irtsaintexupery.pseim.pseim.SafetyTactic}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Used Tactics</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Used Tactics</em>' attribute list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.SafetyTactic
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_UsedTactics()
|
||||
* @model ordered="false"
|
||||
* annotation="http://www.eclipse.org/OCL/Collection nullFree='false'"
|
||||
* @generated
|
||||
*/
|
||||
EList<SafetyTactic> getUsedTactics();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Context</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Context</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Context</em>' attribute.
|
||||
* @see #setContext(String)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_Context()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getContext();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.Pattern#getContext <em>Context</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Context</em>' attribute.
|
||||
* @see #getContext()
|
||||
* @generated
|
||||
*/
|
||||
void setContext(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Domain</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Domain</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Domain</em>' attribute.
|
||||
* @see #setDomain(String)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_Domain()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getDomain();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.Pattern#getDomain <em>Domain</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Domain</em>' attribute.
|
||||
* @see #getDomain()
|
||||
* @generated
|
||||
*/
|
||||
void setDomain(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Is Single Channel</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Is Single Channel</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Is Single Channel</em>' attribute.
|
||||
* @see #setIsSingleChannel(boolean)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_IsSingleChannel()
|
||||
* @model required="true"
|
||||
* @generated
|
||||
*/
|
||||
boolean isIsSingleChannel();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.Pattern#isIsSingleChannel <em>Is Single Channel</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Is Single Channel</em>' attribute.
|
||||
* @see #isIsSingleChannel()
|
||||
* @generated
|
||||
*/
|
||||
void setIsSingleChannel(boolean value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Interface Elements</b></em>' reference list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.seim.PropertyHolder}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Interface Elements</em>' reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Interface Elements</em>' reference list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_InterfaceElements()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
EList<PropertyHolder> getInterfaceElements();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Cardinality Elements</b></em>' containment reference list.
|
||||
* The list contents are of type {@link com.irtsaintexupery.pseim.pseim.CardinalityElement}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Cardinality Elements</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Cardinality Elements</em>' containment reference list.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPattern_CardinalityElements()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<CardinalityElement> getCardinalityElements();
|
||||
|
||||
} // Pattern
|
||||
@@ -0,0 +1,61 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Pattern Component</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.PatternComponent#isMergeContent <em>Merge Content</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternComponent()
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='contentIsPatternContent'"
|
||||
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot contentIsPatternContent='content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))'"
|
||||
* @generated
|
||||
*/
|
||||
public interface PatternComponent extends MultiplicityElement, IdentifiedElement, Component {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Merge Content</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Merge Content</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Merge Content</em>' attribute.
|
||||
* @see #setMergeContent(boolean)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternComponent_MergeContent()
|
||||
* @model required="true"
|
||||
* @generated
|
||||
*/
|
||||
boolean isMergeContent();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.PatternComponent#isMergeContent <em>Merge Content</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Merge Content</em>' attribute.
|
||||
* @see #isMergeContent()
|
||||
* @generated
|
||||
*/
|
||||
void setMergeContent(boolean value);
|
||||
|
||||
} // PatternComponent
|
||||
@@ -0,0 +1,91 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Pattern Link</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.PatternLink#getLinkType <em>Link Type</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.PatternLink#getElement <em>Element</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternLink()
|
||||
* @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='srcIsPatternPort dstIsPatternPort'"
|
||||
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot srcIsPatternPort='src.oclIsTypeOf(PatternLink)' dstIsPatternPort='dst.oclIsTypeOf(PatternLink)'"
|
||||
* @generated
|
||||
*/
|
||||
public interface PatternLink extends IdentifiedElement, Link {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Link Type</b></em>' attribute.
|
||||
* The literals are from the enumeration {@link com.irtsaintexupery.pseim.pseim.LinkType}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Link Type</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Link Type</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.LinkType
|
||||
* @see #setLinkType(LinkType)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternLink_LinkType()
|
||||
* @model required="true"
|
||||
* @generated
|
||||
*/
|
||||
LinkType getLinkType();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.PatternLink#getLinkType <em>Link Type</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Link Type</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.LinkType
|
||||
* @see #getLinkType()
|
||||
* @generated
|
||||
*/
|
||||
void setLinkType(LinkType value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Element</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Element</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Element</em>' reference.
|
||||
* @see #setElement(CardinalityElement)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternLink_Element()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
CardinalityElement getElement();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.PatternLink#getElement <em>Element</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Element</em>' reference.
|
||||
* @see #getElement()
|
||||
* @generated
|
||||
*/
|
||||
void setElement(CardinalityElement value);
|
||||
|
||||
} // PatternLink
|
||||
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Pattern Port</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.PatternPort#getDir <em>Dir</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternPort()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface PatternPort extends MultiplicityElement, IdentifiedElement, Port {
|
||||
/**
|
||||
* Returns the value of the '<em><b>Dir</b></em>' attribute.
|
||||
* The literals are from the enumeration {@link com.irtsaintexupery.pseim.pseim.PatternPortDirection}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Dir</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Dir</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PatternPortDirection
|
||||
* @see #setDir(PatternPortDirection)
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternPort_Dir()
|
||||
* @model required="true"
|
||||
* @generated
|
||||
*/
|
||||
PatternPortDirection getDir();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link com.irtsaintexupery.pseim.pseim.PatternPort#getDir <em>Dir</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Dir</em>' attribute.
|
||||
* @see com.irtsaintexupery.pseim.pseim.PatternPortDirection
|
||||
* @see #getDir()
|
||||
* @generated
|
||||
*/
|
||||
void setDir(PatternPortDirection value);
|
||||
|
||||
} // PatternPort
|
||||
@@ -0,0 +1,277 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Pattern Port Direction</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternPortDirection()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum PatternPortDirection implements Enumerator {
|
||||
/**
|
||||
* The '<em><b>UNSPECIFIED</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #UNSPECIFIED_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
UNSPECIFIED(3, "UNSPECIFIED", "UNSPECIFIED"),
|
||||
|
||||
/**
|
||||
* The '<em><b>IN</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #IN_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
IN(0, "IN", "IN"),
|
||||
|
||||
/**
|
||||
* The '<em><b>OUT</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #OUT_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
OUT(1, "OUT", "OUT"),
|
||||
|
||||
/**
|
||||
* The '<em><b>INOUT</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #INOUT_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
INOUT(2, "INOUT", "INOUT");
|
||||
|
||||
/**
|
||||
* The '<em><b>UNSPECIFIED</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>UNSPECIFIED</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #UNSPECIFIED
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int UNSPECIFIED_VALUE = 3;
|
||||
|
||||
/**
|
||||
* The '<em><b>IN</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>IN</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #IN
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int IN_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>OUT</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>OUT</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #OUT
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int OUT_VALUE = 1;
|
||||
|
||||
/**
|
||||
* The '<em><b>INOUT</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>INOUT</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #INOUT
|
||||
* @model
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int INOUT_VALUE = 2;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Pattern Port Direction</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final PatternPortDirection[] VALUES_ARRAY = new PatternPortDirection[] { UNSPECIFIED, IN, OUT,
|
||||
INOUT, };
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Pattern Port Direction</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<PatternPortDirection> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Port Direction</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternPortDirection get(String literal) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternPortDirection result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Port Direction</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternPortDirection getByName(String name) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternPortDirection result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Port Direction</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternPortDirection get(int value) {
|
||||
switch (value) {
|
||||
case UNSPECIFIED_VALUE:
|
||||
return UNSPECIFIED;
|
||||
case IN_VALUE:
|
||||
return IN;
|
||||
case OUT_VALUE:
|
||||
return OUT;
|
||||
case INOUT_VALUE:
|
||||
return INOUT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private PatternPortDirection(int value, String name, String literal) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //PatternPortDirection
|
||||
@@ -0,0 +1,222 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Pattern Type Failure Mode</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternTypeFailureMode()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum PatternTypeFailureMode implements Enumerator {
|
||||
/**
|
||||
* The '<em><b>Fail safe</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FAIL_SAFE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
FAIL_SAFE(0, "Fail_safe", "Fail_safe"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Fail over</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FAIL_OVER_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
FAIL_OVER(1, "Fail_over", "Fail_over");
|
||||
|
||||
/**
|
||||
* The '<em><b>Fail safe</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Fail safe</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FAIL_SAFE
|
||||
* @model name="Fail_safe"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int FAIL_SAFE_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>Fail over</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Fail over</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #FAIL_OVER
|
||||
* @model name="Fail_over"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int FAIL_OVER_VALUE = 1;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Pattern Type Failure Mode</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final PatternTypeFailureMode[] VALUES_ARRAY = new PatternTypeFailureMode[] { FAIL_SAFE, FAIL_OVER, };
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Pattern Type Failure Mode</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<PatternTypeFailureMode> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type Failure Mode</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeFailureMode get(String literal) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternTypeFailureMode result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type Failure Mode</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeFailureMode getByName(String name) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternTypeFailureMode result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type Failure Mode</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeFailureMode get(int value) {
|
||||
switch (value) {
|
||||
case FAIL_SAFE_VALUE:
|
||||
return FAIL_SAFE;
|
||||
case FAIL_OVER_VALUE:
|
||||
return FAIL_OVER;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private PatternTypeFailureMode(int value, String name, String literal) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //PatternTypeFailureMode
|
||||
@@ -0,0 +1,222 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Pattern Type HS</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternTypeHS()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum PatternTypeHS implements Enumerator {
|
||||
/**
|
||||
* The '<em><b>Hardware</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #HARDWARE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
HARDWARE(0, "Hardware", "Hardware"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Software</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SOFTWARE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
SOFTWARE(1, "Software", "Software");
|
||||
|
||||
/**
|
||||
* The '<em><b>Hardware</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Hardware</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #HARDWARE
|
||||
* @model name="Hardware"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int HARDWARE_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>Software</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Software</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SOFTWARE
|
||||
* @model name="Software"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int SOFTWARE_VALUE = 1;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Pattern Type HS</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final PatternTypeHS[] VALUES_ARRAY = new PatternTypeHS[] { HARDWARE, SOFTWARE, };
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Pattern Type HS</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<PatternTypeHS> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type HS</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeHS get(String literal) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternTypeHS result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type HS</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeHS getByName(String name) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
PatternTypeHS result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Pattern Type HS</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static PatternTypeHS get(int value) {
|
||||
switch (value) {
|
||||
case HARDWARE_VALUE:
|
||||
return HARDWARE;
|
||||
case SOFTWARE_VALUE:
|
||||
return SOFTWARE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private PatternTypeHS(int value, String name, String literal) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //PatternTypeHS
|
||||
@@ -0,0 +1,97 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PseimPackage
|
||||
* @generated
|
||||
*/
|
||||
public interface PseimFactory extends EFactory {
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
PseimFactory eINSTANCE = com.irtsaintexupery.pseim.pseim.impl.PseimFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Library</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Library</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Library createLibrary();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Pattern</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Pattern</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Pattern createPattern();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Cardinality Element</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Cardinality Element</em>'.
|
||||
* @generated
|
||||
*/
|
||||
CardinalityElement createCardinalityElement();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Pattern Component</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Pattern Component</em>'.
|
||||
* @generated
|
||||
*/
|
||||
PatternComponent createPatternComponent();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Pattern Port</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Pattern Port</em>'.
|
||||
* @generated
|
||||
*/
|
||||
PatternPort createPatternPort();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Pattern Link</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Pattern Link</em>'.
|
||||
* @generated
|
||||
*/
|
||||
PatternLink createPatternLink();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
PseimPackage getPseimPackage();
|
||||
|
||||
} //PseimFactory
|
||||
@@ -0,0 +1,521 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Safety Tactic</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getSafetyTactic()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum SafetyTactic implements Enumerator {
|
||||
/**
|
||||
* The '<em><b>Simplicity</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SIMPLICITY_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
SIMPLICITY(0, "Simplicity", "Simplicity"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Substitution</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SUBSTITUTION_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
SUBSTITUTION(1, "Substitution", "Substitution"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Sanity Check</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SANITY_CHECK_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
SANITY_CHECK(2, "Sanity_Check", "Sanity_Check"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Condition Monitoring</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #CONDITION_MONITORING_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
CONDITION_MONITORING(3, "Condition_Monitoring", "Condition_Monitoring"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Comparison</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #COMPARISON_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
COMPARISON(4, "Comparison", "Comparison"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Diverse Redundancy</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #DIVERSE_REDUNDANCY_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
DIVERSE_REDUNDANCY(5, "Diverse_Redundancy", "Diverse_Redundancy"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Replication Redundancy</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #REPLICATION_REDUNDANCY_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
REPLICATION_REDUNDANCY(6, "Replication_Redundancy", "Replication_Redundancy"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Repair</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #REPAIR_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
REPAIR(7, "Repair", "Repair"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Degradation</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #DEGRADATION_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
DEGRADATION(8, "Degradation", "Degradation"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Voting</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #VOTING_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
VOTING(9, "Voting", "Voting"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Override</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #OVERRIDE_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
OVERRIDE(10, "Override", "Override"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Barrier</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #BARRIER_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
BARRIER(11, "Barrier", "Barrier"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Heartbeat</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #HEARTBEAT_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
HEARTBEAT(12, "Heartbeat", "Heartbeat");
|
||||
|
||||
/**
|
||||
* The '<em><b>Simplicity</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Simplicity</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SIMPLICITY
|
||||
* @model name="Simplicity"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int SIMPLICITY_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>Substitution</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Substitution</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SUBSTITUTION
|
||||
* @model name="Substitution"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int SUBSTITUTION_VALUE = 1;
|
||||
|
||||
/**
|
||||
* The '<em><b>Sanity Check</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Sanity Check</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #SANITY_CHECK
|
||||
* @model name="Sanity_Check"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int SANITY_CHECK_VALUE = 2;
|
||||
|
||||
/**
|
||||
* The '<em><b>Condition Monitoring</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Condition Monitoring</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #CONDITION_MONITORING
|
||||
* @model name="Condition_Monitoring"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int CONDITION_MONITORING_VALUE = 3;
|
||||
|
||||
/**
|
||||
* The '<em><b>Comparison</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Comparison</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #COMPARISON
|
||||
* @model name="Comparison"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int COMPARISON_VALUE = 4;
|
||||
|
||||
/**
|
||||
* The '<em><b>Diverse Redundancy</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Diverse Redundancy</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #DIVERSE_REDUNDANCY
|
||||
* @model name="Diverse_Redundancy"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int DIVERSE_REDUNDANCY_VALUE = 5;
|
||||
|
||||
/**
|
||||
* The '<em><b>Replication Redundancy</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Replication Redundancy</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #REPLICATION_REDUNDANCY
|
||||
* @model name="Replication_Redundancy"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int REPLICATION_REDUNDANCY_VALUE = 6;
|
||||
|
||||
/**
|
||||
* The '<em><b>Repair</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Repair</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #REPAIR
|
||||
* @model name="Repair"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int REPAIR_VALUE = 7;
|
||||
|
||||
/**
|
||||
* The '<em><b>Degradation</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Degradation</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #DEGRADATION
|
||||
* @model name="Degradation"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int DEGRADATION_VALUE = 8;
|
||||
|
||||
/**
|
||||
* The '<em><b>Voting</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Voting</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #VOTING
|
||||
* @model name="Voting"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int VOTING_VALUE = 9;
|
||||
|
||||
/**
|
||||
* The '<em><b>Override</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Override</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #OVERRIDE
|
||||
* @model name="Override"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int OVERRIDE_VALUE = 10;
|
||||
|
||||
/**
|
||||
* The '<em><b>Barrier</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Barrier</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #BARRIER
|
||||
* @model name="Barrier"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int BARRIER_VALUE = 11;
|
||||
|
||||
/**
|
||||
* The '<em><b>Heartbeat</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Heartbeat</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #HEARTBEAT
|
||||
* @model name="Heartbeat"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int HEARTBEAT_VALUE = 12;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Safety Tactic</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final SafetyTactic[] VALUES_ARRAY = new SafetyTactic[] { SIMPLICITY, SUBSTITUTION, SANITY_CHECK,
|
||||
CONDITION_MONITORING, COMPARISON, DIVERSE_REDUNDANCY, REPLICATION_REDUNDANCY, REPAIR, DEGRADATION, VOTING,
|
||||
OVERRIDE, BARRIER, HEARTBEAT, };
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Safety Tactic</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<SafetyTactic> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Safety Tactic</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static SafetyTactic get(String literal) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
SafetyTactic result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Safety Tactic</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static SafetyTactic getByName(String name) {
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
||||
SafetyTactic result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Safety Tactic</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static SafetyTactic get(int value) {
|
||||
switch (value) {
|
||||
case SIMPLICITY_VALUE:
|
||||
return SIMPLICITY;
|
||||
case SUBSTITUTION_VALUE:
|
||||
return SUBSTITUTION;
|
||||
case SANITY_CHECK_VALUE:
|
||||
return SANITY_CHECK;
|
||||
case CONDITION_MONITORING_VALUE:
|
||||
return CONDITION_MONITORING;
|
||||
case COMPARISON_VALUE:
|
||||
return COMPARISON;
|
||||
case DIVERSE_REDUNDANCY_VALUE:
|
||||
return DIVERSE_REDUNDANCY;
|
||||
case REPLICATION_REDUNDANCY_VALUE:
|
||||
return REPLICATION_REDUNDANCY;
|
||||
case REPAIR_VALUE:
|
||||
return REPAIR;
|
||||
case DEGRADATION_VALUE:
|
||||
return DEGRADATION;
|
||||
case VOTING_VALUE:
|
||||
return VOTING;
|
||||
case OVERRIDE_VALUE:
|
||||
return OVERRIDE;
|
||||
case BARRIER_VALUE:
|
||||
return BARRIER;
|
||||
case HEARTBEAT_VALUE:
|
||||
return HEARTBEAT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private SafetyTactic(int value, String name, String literal) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //SafetyTactic
|
||||
@@ -0,0 +1,330 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Cardinality Element</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.CardinalityElementImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.CardinalityElementImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.CardinalityElementImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.CardinalityElementImpl#getCalculatedVia <em>Calculated Via</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class CardinalityElementImpl extends MinimalEObjectImpl.Container implements CardinalityElement {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* 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 cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getCalculatedVia() <em>Calculated Via</em>}' reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getCalculatedVia()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<PropertyHolder> calculatedVia;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected CardinalityElementImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.CARDINALITY_ELEMENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.CARDINALITY_ELEMENT__NAME, oldName,
|
||||
name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this,
|
||||
PseimPackage.CARDINALITY_ELEMENT__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<PropertyHolder> getCalculatedVia() {
|
||||
if (calculatedVia == null) {
|
||||
calculatedVia = new EObjectResolvingEList<PropertyHolder>(PropertyHolder.class, this,
|
||||
PseimPackage.CARDINALITY_ELEMENT__CALCULATED_VIA);
|
||||
}
|
||||
return calculatedVia;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).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 PseimPackage.CARDINALITY_ELEMENT__UID:
|
||||
return getUid();
|
||||
case PseimPackage.CARDINALITY_ELEMENT__NAME:
|
||||
return getName();
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
return getProperties();
|
||||
case PseimPackage.CARDINALITY_ELEMENT__CALCULATED_VIA:
|
||||
return getCalculatedVia();
|
||||
}
|
||||
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 PseimPackage.CARDINALITY_ELEMENT__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case PseimPackage.CARDINALITY_ELEMENT__CALCULATED_VIA:
|
||||
getCalculatedVia().clear();
|
||||
getCalculatedVia().addAll((Collection<? extends PropertyHolder>) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.CARDINALITY_ELEMENT__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case PseimPackage.CARDINALITY_ELEMENT__CALCULATED_VIA:
|
||||
getCalculatedVia().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.CARDINALITY_ELEMENT__UID:
|
||||
return isSetUid();
|
||||
case PseimPackage.CARDINALITY_ELEMENT__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case PseimPackage.CARDINALITY_ELEMENT__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case PseimPackage.CARDINALITY_ELEMENT__CALCULATED_VIA:
|
||||
return calculatedVia != null && !calculatedVia.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //CardinalityElementImpl
|
||||
@@ -0,0 +1,290 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.Library;
|
||||
import com.irtsaintexupery.pseim.pseim.Pattern;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
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>Library</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.LibraryImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.LibraryImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.LibraryImpl#getPatterns <em>Patterns</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class LibraryImpl extends MinimalEObjectImpl.Container implements Library {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* 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 cached value of the '{@link #getPatterns() <em>Patterns</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getPatterns()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Pattern> patterns;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected LibraryImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.LIBRARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.LIBRARY__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Pattern> getPatterns() {
|
||||
if (patterns == null) {
|
||||
patterns = new EObjectContainmentEList<Pattern>(Pattern.class, this, PseimPackage.LIBRARY__PATTERNS);
|
||||
}
|
||||
return patterns;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
return ((InternalEList<?>) getPatterns()).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 PseimPackage.LIBRARY__UID:
|
||||
return getUid();
|
||||
case PseimPackage.LIBRARY__NAME:
|
||||
return getName();
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
return getPatterns();
|
||||
}
|
||||
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 PseimPackage.LIBRARY__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
getPatterns().clear();
|
||||
getPatterns().addAll((Collection<? extends Pattern>) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.LIBRARY__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
getPatterns().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.LIBRARY__UID:
|
||||
return isSetUid();
|
||||
case PseimPackage.LIBRARY__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case PseimPackage.LIBRARY__PATTERNS:
|
||||
return patterns != null && !patterns.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //LibraryImpl
|
||||
@@ -0,0 +1,698 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.IdentifiedElement;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternComponent;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
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>Pattern Component</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getMultiplicityValue <em>Multiplicity Value</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getCardinalityElement <em>Cardinality Element</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getIdentifiedAs <em>Identified As</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#getContent <em>Content</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternComponentImpl#isMergeContent <em>Merge Content</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PatternComponentImpl extends MinimalEObjectImpl.Container implements PatternComponent {
|
||||
/**
|
||||
* The default value of the '{@link #getMultiplicityValue() <em>Multiplicity Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getMultiplicityValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final int MULTIPLICITY_VALUE_EDEFAULT = 1;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getMultiplicityValue() <em>Multiplicity Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getMultiplicityValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected int multiplicityValue = MULTIPLICITY_VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getCardinalityElement() <em>Cardinality Element</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getCardinalityElement()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected CardinalityElement cardinalityElement;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getIdentifiedAs() <em>Identified As</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getIdentifiedAs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PropertyHolder identifiedAs;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* 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 cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getContent() <em>Content</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getContent()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Element> content;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #isMergeContent() <em>Merge Content</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMergeContent()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final boolean MERGE_CONTENT_EDEFAULT = false;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #isMergeContent() <em>Merge Content</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMergeContent()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean mergeContent = MERGE_CONTENT_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternComponentImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.PATTERN_COMPONENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getMultiplicityValue() {
|
||||
return multiplicityValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setMultiplicityValue(int newMultiplicityValue) {
|
||||
int oldMultiplicityValue = multiplicityValue;
|
||||
multiplicityValue = newMultiplicityValue;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE,
|
||||
oldMultiplicityValue, multiplicityValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement getCardinalityElement() {
|
||||
if (cardinalityElement != null && cardinalityElement.eIsProxy()) {
|
||||
InternalEObject oldCardinalityElement = (InternalEObject) cardinalityElement;
|
||||
cardinalityElement = (CardinalityElement) eResolveProxy(oldCardinalityElement);
|
||||
if (cardinalityElement != oldCardinalityElement) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
|
||||
PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT, oldCardinalityElement,
|
||||
cardinalityElement));
|
||||
}
|
||||
}
|
||||
return cardinalityElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement basicGetCardinalityElement() {
|
||||
return cardinalityElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setCardinalityElement(CardinalityElement newCardinalityElement) {
|
||||
CardinalityElement oldCardinalityElement = cardinalityElement;
|
||||
cardinalityElement = newCardinalityElement;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT,
|
||||
oldCardinalityElement, cardinalityElement));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder getIdentifiedAs() {
|
||||
if (identifiedAs != null && identifiedAs.eIsProxy()) {
|
||||
InternalEObject oldIdentifiedAs = (InternalEObject) identifiedAs;
|
||||
identifiedAs = (PropertyHolder) eResolveProxy(oldIdentifiedAs);
|
||||
if (identifiedAs != oldIdentifiedAs) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
|
||||
PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS, oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
}
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder basicGetIdentifiedAs() {
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setIdentifiedAs(PropertyHolder newIdentifiedAs) {
|
||||
PropertyHolder oldIdentifiedAs = identifiedAs;
|
||||
identifiedAs = newIdentifiedAs;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS,
|
||||
oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_COMPONENT__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this,
|
||||
PseimPackage.PATTERN_COMPONENT__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Element> getContent() {
|
||||
if (content == null) {
|
||||
content = new EObjectContainmentEList<Element>(Element.class, this,
|
||||
PseimPackage.PATTERN_COMPONENT__CONTENT);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isMergeContent() {
|
||||
return mergeContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setMergeContent(boolean newMergeContent) {
|
||||
boolean oldMergeContent = mergeContent;
|
||||
mergeContent = newMergeContent;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT,
|
||||
oldMergeContent, mergeContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).basicRemove(otherEnd, msgs);
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
return ((InternalEList<?>) getContent()).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 PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE:
|
||||
return getMultiplicityValue();
|
||||
case PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT:
|
||||
if (resolve)
|
||||
return getCardinalityElement();
|
||||
return basicGetCardinalityElement();
|
||||
case PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS:
|
||||
if (resolve)
|
||||
return getIdentifiedAs();
|
||||
return basicGetIdentifiedAs();
|
||||
case PseimPackage.PATTERN_COMPONENT__UID:
|
||||
return getUid();
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
return getName();
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
return getProperties();
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
return getContent();
|
||||
case PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT:
|
||||
return isMergeContent();
|
||||
}
|
||||
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 PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE:
|
||||
setMultiplicityValue((Integer) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT:
|
||||
setCardinalityElement((CardinalityElement) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
getContent().clear();
|
||||
getContent().addAll((Collection<? extends Element>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT:
|
||||
setMergeContent((Boolean) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE:
|
||||
setMultiplicityValue(MULTIPLICITY_VALUE_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT:
|
||||
setCardinalityElement((CardinalityElement) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
getContent().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT:
|
||||
setMergeContent(MERGE_CONTENT_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__MULTIPLICITY_VALUE:
|
||||
return multiplicityValue != MULTIPLICITY_VALUE_EDEFAULT;
|
||||
case PseimPackage.PATTERN_COMPONENT__CARDINALITY_ELEMENT:
|
||||
return cardinalityElement != null;
|
||||
case PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS:
|
||||
return identifiedAs != null;
|
||||
case PseimPackage.PATTERN_COMPONENT__UID:
|
||||
return isSetUid();
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
return content != null && !content.isEmpty();
|
||||
case PseimPackage.PATTERN_COMPONENT__MERGE_CONTENT:
|
||||
return mergeContent != MERGE_CONTENT_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS:
|
||||
return PseimPackage.IDENTIFIED_ELEMENT__IDENTIFIED_AS;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == com.irtsaintexupery.pseim.seim.IdentifiedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__UID:
|
||||
return SeimPackage.IDENTIFIED_ELEMENT__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__NAME:
|
||||
return SeimPackage.NAMED_ELEMENT__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__PROPERTIES:
|
||||
return SeimPackage.PROPERTY_HOLDER__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == GraphElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Component.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_COMPONENT__CONTENT:
|
||||
return SeimPackage.COMPONENT__CONTENT;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case PseimPackage.IDENTIFIED_ELEMENT__IDENTIFIED_AS:
|
||||
return PseimPackage.PATTERN_COMPONENT__IDENTIFIED_AS;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == com.irtsaintexupery.pseim.seim.IdentifiedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.IDENTIFIED_ELEMENT__UID:
|
||||
return PseimPackage.PATTERN_COMPONENT__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.NAMED_ELEMENT__NAME:
|
||||
return PseimPackage.PATTERN_COMPONENT__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.PROPERTY_HOLDER__PROPERTIES:
|
||||
return PseimPackage.PATTERN_COMPONENT__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == GraphElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Component.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
return PseimPackage.PATTERN_COMPONENT__CONTENT;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (multiplicityValue: ");
|
||||
result.append(multiplicityValue);
|
||||
result.append(", uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(", mergeContent: ");
|
||||
result.append(mergeContent);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PatternComponentImpl
|
||||
@@ -0,0 +1,550 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.Pattern;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternTypeHS;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
import com.irtsaintexupery.pseim.pseim.SafetyTactic;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.impl.ModelImpl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Pattern</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getTypeHS <em>Type HS</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getTypeFailure <em>Type Failure</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getAlsoKnownAs <em>Also Known As</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getUsedTactics <em>Used Tactics</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getContext <em>Context</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getDomain <em>Domain</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#isIsSingleChannel <em>Is Single Channel</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getInterfaceElements <em>Interface Elements</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternImpl#getCardinalityElements <em>Cardinality Elements</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PatternImpl extends ModelImpl implements Pattern {
|
||||
/**
|
||||
* The cached value of the '{@link #getTypeHS() <em>Type HS</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getTypeHS()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<PatternTypeHS> typeHS;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getTypeFailure() <em>Type Failure</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getTypeFailure()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final PatternTypeFailureMode TYPE_FAILURE_EDEFAULT = PatternTypeFailureMode.FAIL_SAFE;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getTypeFailure() <em>Type Failure</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getTypeFailure()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PatternTypeFailureMode typeFailure = TYPE_FAILURE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getAlsoKnownAs() <em>Also Known As</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getAlsoKnownAs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<String> alsoKnownAs;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUsedTactics() <em>Used Tactics</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUsedTactics()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<SafetyTactic> usedTactics;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getContext() <em>Context</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getContext()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String CONTEXT_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getContext() <em>Context</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getContext()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String context = CONTEXT_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getDomain() <em>Domain</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDomain()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String DOMAIN_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDomain() <em>Domain</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDomain()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String domain = DOMAIN_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #isIsSingleChannel() <em>Is Single Channel</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isIsSingleChannel()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final boolean IS_SINGLE_CHANNEL_EDEFAULT = false;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #isIsSingleChannel() <em>Is Single Channel</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isIsSingleChannel()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean isSingleChannel = IS_SINGLE_CHANNEL_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getInterfaceElements() <em>Interface Elements</em>}' reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getInterfaceElements()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<PropertyHolder> interfaceElements;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getCardinalityElements() <em>Cardinality Elements</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getCardinalityElements()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<CardinalityElement> cardinalityElements;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.PATTERN;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<PatternTypeHS> getTypeHS() {
|
||||
if (typeHS == null) {
|
||||
typeHS = new EDataTypeUniqueEList<PatternTypeHS>(PatternTypeHS.class, this, PseimPackage.PATTERN__TYPE_HS);
|
||||
}
|
||||
return typeHS;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternTypeFailureMode getTypeFailure() {
|
||||
return typeFailure;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setTypeFailure(PatternTypeFailureMode newTypeFailure) {
|
||||
PatternTypeFailureMode oldTypeFailure = typeFailure;
|
||||
typeFailure = newTypeFailure == null ? TYPE_FAILURE_EDEFAULT : newTypeFailure;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN__TYPE_FAILURE, oldTypeFailure,
|
||||
typeFailure));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<String> getAlsoKnownAs() {
|
||||
if (alsoKnownAs == null) {
|
||||
alsoKnownAs = new EDataTypeUniqueEList<String>(String.class, this, PseimPackage.PATTERN__ALSO_KNOWN_AS);
|
||||
}
|
||||
return alsoKnownAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<SafetyTactic> getUsedTactics() {
|
||||
if (usedTactics == null) {
|
||||
usedTactics = new EDataTypeUniqueEList<SafetyTactic>(SafetyTactic.class, this,
|
||||
PseimPackage.PATTERN__USED_TACTICS);
|
||||
}
|
||||
return usedTactics;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setContext(String newContext) {
|
||||
String oldContext = context;
|
||||
context = newContext;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN__CONTEXT, oldContext, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDomain(String newDomain) {
|
||||
String oldDomain = domain;
|
||||
domain = newDomain;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN__DOMAIN, oldDomain, domain));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isIsSingleChannel() {
|
||||
return isSingleChannel;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setIsSingleChannel(boolean newIsSingleChannel) {
|
||||
boolean oldIsSingleChannel = isSingleChannel;
|
||||
isSingleChannel = newIsSingleChannel;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN__IS_SINGLE_CHANNEL,
|
||||
oldIsSingleChannel, isSingleChannel));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<PropertyHolder> getInterfaceElements() {
|
||||
if (interfaceElements == null) {
|
||||
interfaceElements = new EObjectResolvingEList<PropertyHolder>(PropertyHolder.class, this,
|
||||
PseimPackage.PATTERN__INTERFACE_ELEMENTS);
|
||||
}
|
||||
return interfaceElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<CardinalityElement> getCardinalityElements() {
|
||||
if (cardinalityElements == null) {
|
||||
cardinalityElements = new EObjectContainmentEList<CardinalityElement>(CardinalityElement.class, this,
|
||||
PseimPackage.PATTERN__CARDINALITY_ELEMENTS);
|
||||
}
|
||||
return cardinalityElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
return ((InternalEList<?>) getCardinalityElements()).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 PseimPackage.PATTERN__TYPE_HS:
|
||||
return getTypeHS();
|
||||
case PseimPackage.PATTERN__TYPE_FAILURE:
|
||||
return getTypeFailure();
|
||||
case PseimPackage.PATTERN__ALSO_KNOWN_AS:
|
||||
return getAlsoKnownAs();
|
||||
case PseimPackage.PATTERN__USED_TACTICS:
|
||||
return getUsedTactics();
|
||||
case PseimPackage.PATTERN__CONTEXT:
|
||||
return getContext();
|
||||
case PseimPackage.PATTERN__DOMAIN:
|
||||
return getDomain();
|
||||
case PseimPackage.PATTERN__IS_SINGLE_CHANNEL:
|
||||
return isIsSingleChannel();
|
||||
case PseimPackage.PATTERN__INTERFACE_ELEMENTS:
|
||||
return getInterfaceElements();
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
return getCardinalityElements();
|
||||
}
|
||||
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 PseimPackage.PATTERN__TYPE_HS:
|
||||
getTypeHS().clear();
|
||||
getTypeHS().addAll((Collection<? extends PatternTypeHS>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__TYPE_FAILURE:
|
||||
setTypeFailure((PatternTypeFailureMode) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__ALSO_KNOWN_AS:
|
||||
getAlsoKnownAs().clear();
|
||||
getAlsoKnownAs().addAll((Collection<? extends String>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__USED_TACTICS:
|
||||
getUsedTactics().clear();
|
||||
getUsedTactics().addAll((Collection<? extends SafetyTactic>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__CONTEXT:
|
||||
setContext((String) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__DOMAIN:
|
||||
setDomain((String) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__IS_SINGLE_CHANNEL:
|
||||
setIsSingleChannel((Boolean) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__INTERFACE_ELEMENTS:
|
||||
getInterfaceElements().clear();
|
||||
getInterfaceElements().addAll((Collection<? extends PropertyHolder>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
getCardinalityElements().clear();
|
||||
getCardinalityElements().addAll((Collection<? extends CardinalityElement>) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN__TYPE_HS:
|
||||
getTypeHS().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN__TYPE_FAILURE:
|
||||
setTypeFailure(TYPE_FAILURE_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN__ALSO_KNOWN_AS:
|
||||
getAlsoKnownAs().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN__USED_TACTICS:
|
||||
getUsedTactics().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN__CONTEXT:
|
||||
setContext(CONTEXT_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN__DOMAIN:
|
||||
setDomain(DOMAIN_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN__IS_SINGLE_CHANNEL:
|
||||
setIsSingleChannel(IS_SINGLE_CHANNEL_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN__INTERFACE_ELEMENTS:
|
||||
getInterfaceElements().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
getCardinalityElements().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN__TYPE_HS:
|
||||
return typeHS != null && !typeHS.isEmpty();
|
||||
case PseimPackage.PATTERN__TYPE_FAILURE:
|
||||
return typeFailure != TYPE_FAILURE_EDEFAULT;
|
||||
case PseimPackage.PATTERN__ALSO_KNOWN_AS:
|
||||
return alsoKnownAs != null && !alsoKnownAs.isEmpty();
|
||||
case PseimPackage.PATTERN__USED_TACTICS:
|
||||
return usedTactics != null && !usedTactics.isEmpty();
|
||||
case PseimPackage.PATTERN__CONTEXT:
|
||||
return CONTEXT_EDEFAULT == null ? context != null : !CONTEXT_EDEFAULT.equals(context);
|
||||
case PseimPackage.PATTERN__DOMAIN:
|
||||
return DOMAIN_EDEFAULT == null ? domain != null : !DOMAIN_EDEFAULT.equals(domain);
|
||||
case PseimPackage.PATTERN__IS_SINGLE_CHANNEL:
|
||||
return isSingleChannel != IS_SINGLE_CHANNEL_EDEFAULT;
|
||||
case PseimPackage.PATTERN__INTERFACE_ELEMENTS:
|
||||
return interfaceElements != null && !interfaceElements.isEmpty();
|
||||
case PseimPackage.PATTERN__CARDINALITY_ELEMENTS:
|
||||
return cardinalityElements != null && !cardinalityElements.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (typeHS: ");
|
||||
result.append(typeHS);
|
||||
result.append(", typeFailure: ");
|
||||
result.append(typeFailure);
|
||||
result.append(", alsoKnownAs: ");
|
||||
result.append(alsoKnownAs);
|
||||
result.append(", usedTactics: ");
|
||||
result.append(usedTactics);
|
||||
result.append(", context: ");
|
||||
result.append(context);
|
||||
result.append(", domain: ");
|
||||
result.append(domain);
|
||||
result.append(", isSingleChannel: ");
|
||||
result.append(isSingleChannel);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PatternImpl
|
||||
@@ -0,0 +1,719 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.LinkType;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternLink;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.IdentifiedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
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>Pattern Link</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getIdentifiedAs <em>Identified As</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getSrc <em>Src</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getDst <em>Dst</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getLinkType <em>Link Type</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternLinkImpl#getElement <em>Element</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PatternLinkImpl extends MinimalEObjectImpl.Container implements PatternLink {
|
||||
/**
|
||||
* The cached value of the '{@link #getIdentifiedAs() <em>Identified As</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getIdentifiedAs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PropertyHolder identifiedAs;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* 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 cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getSrc() <em>Src</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getSrc()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Port src;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDst() <em>Dst</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDst()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Port dst;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getLinkType() <em>Link Type</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getLinkType()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final LinkType LINK_TYPE_EDEFAULT = LinkType.TRANSPOSE;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getLinkType() <em>Link Type</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getLinkType()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected LinkType linkType = LINK_TYPE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getElement() <em>Element</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getElement()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected CardinalityElement element;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternLinkImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.PATTERN_LINK;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder getIdentifiedAs() {
|
||||
if (identifiedAs != null && identifiedAs.eIsProxy()) {
|
||||
InternalEObject oldIdentifiedAs = (InternalEObject) identifiedAs;
|
||||
identifiedAs = (PropertyHolder) eResolveProxy(oldIdentifiedAs);
|
||||
if (identifiedAs != oldIdentifiedAs) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PseimPackage.PATTERN_LINK__IDENTIFIED_AS,
|
||||
oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
}
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder basicGetIdentifiedAs() {
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setIdentifiedAs(PropertyHolder newIdentifiedAs) {
|
||||
PropertyHolder oldIdentifiedAs = identifiedAs;
|
||||
identifiedAs = newIdentifiedAs;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__IDENTIFIED_AS,
|
||||
oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this,
|
||||
PseimPackage.PATTERN_LINK__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port getSrc() {
|
||||
if (src != null && src.eIsProxy()) {
|
||||
InternalEObject oldSrc = (InternalEObject) src;
|
||||
src = (Port) eResolveProxy(oldSrc);
|
||||
if (src != oldSrc) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PseimPackage.PATTERN_LINK__SRC, oldSrc,
|
||||
src));
|
||||
}
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port basicGetSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setSrc(Port newSrc) {
|
||||
Port oldSrc = src;
|
||||
src = newSrc;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__SRC, oldSrc, src));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port getDst() {
|
||||
if (dst != null && dst.eIsProxy()) {
|
||||
InternalEObject oldDst = (InternalEObject) dst;
|
||||
dst = (Port) eResolveProxy(oldDst);
|
||||
if (dst != oldDst) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PseimPackage.PATTERN_LINK__DST, oldDst,
|
||||
dst));
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port basicGetDst() {
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDst(Port newDst) {
|
||||
Port oldDst = dst;
|
||||
dst = newDst;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__DST, oldDst, dst));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public LinkType getLinkType() {
|
||||
return linkType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setLinkType(LinkType newLinkType) {
|
||||
LinkType oldLinkType = linkType;
|
||||
linkType = newLinkType == null ? LINK_TYPE_EDEFAULT : newLinkType;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__LINK_TYPE, oldLinkType,
|
||||
linkType));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement getElement() {
|
||||
if (element != null && element.eIsProxy()) {
|
||||
InternalEObject oldElement = (InternalEObject) element;
|
||||
element = (CardinalityElement) eResolveProxy(oldElement);
|
||||
if (element != oldElement) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PseimPackage.PATTERN_LINK__ELEMENT,
|
||||
oldElement, element));
|
||||
}
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement basicGetElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setElement(CardinalityElement newElement) {
|
||||
CardinalityElement oldElement = element;
|
||||
element = newElement;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_LINK__ELEMENT, oldElement,
|
||||
element));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).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 PseimPackage.PATTERN_LINK__IDENTIFIED_AS:
|
||||
if (resolve)
|
||||
return getIdentifiedAs();
|
||||
return basicGetIdentifiedAs();
|
||||
case PseimPackage.PATTERN_LINK__UID:
|
||||
return getUid();
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
return getName();
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
return getProperties();
|
||||
case PseimPackage.PATTERN_LINK__SRC:
|
||||
if (resolve)
|
||||
return getSrc();
|
||||
return basicGetSrc();
|
||||
case PseimPackage.PATTERN_LINK__DST:
|
||||
if (resolve)
|
||||
return getDst();
|
||||
return basicGetDst();
|
||||
case PseimPackage.PATTERN_LINK__LINK_TYPE:
|
||||
return getLinkType();
|
||||
case PseimPackage.PATTERN_LINK__ELEMENT:
|
||||
if (resolve)
|
||||
return getElement();
|
||||
return basicGetElement();
|
||||
}
|
||||
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 PseimPackage.PATTERN_LINK__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__SRC:
|
||||
setSrc((Port) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__DST:
|
||||
setDst((Port) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__LINK_TYPE:
|
||||
setLinkType((LinkType) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__ELEMENT:
|
||||
setElement((CardinalityElement) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_LINK__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__SRC:
|
||||
setSrc((Port) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__DST:
|
||||
setDst((Port) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__LINK_TYPE:
|
||||
setLinkType(LINK_TYPE_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_LINK__ELEMENT:
|
||||
setElement((CardinalityElement) null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_LINK__IDENTIFIED_AS:
|
||||
return identifiedAs != null;
|
||||
case PseimPackage.PATTERN_LINK__UID:
|
||||
return isSetUid();
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case PseimPackage.PATTERN_LINK__SRC:
|
||||
return src != null;
|
||||
case PseimPackage.PATTERN_LINK__DST:
|
||||
return dst != null;
|
||||
case PseimPackage.PATTERN_LINK__LINK_TYPE:
|
||||
return linkType != LINK_TYPE_EDEFAULT;
|
||||
case PseimPackage.PATTERN_LINK__ELEMENT:
|
||||
return element != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_LINK__UID:
|
||||
return SeimPackage.IDENTIFIED_ELEMENT__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_LINK__NAME:
|
||||
return SeimPackage.NAMED_ELEMENT__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_LINK__PROPERTIES:
|
||||
return SeimPackage.PROPERTY_HOLDER__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == GraphElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Link.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_LINK__SRC:
|
||||
return SeimPackage.LINK__SRC;
|
||||
case PseimPackage.PATTERN_LINK__DST:
|
||||
return SeimPackage.LINK__DST;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.IDENTIFIED_ELEMENT__UID:
|
||||
return PseimPackage.PATTERN_LINK__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.NAMED_ELEMENT__NAME:
|
||||
return PseimPackage.PATTERN_LINK__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.PROPERTY_HOLDER__PROPERTIES:
|
||||
return PseimPackage.PATTERN_LINK__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == GraphElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Link.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.LINK__SRC:
|
||||
return PseimPackage.PATTERN_LINK__SRC;
|
||||
case SeimPackage.LINK__DST:
|
||||
return PseimPackage.PATTERN_LINK__DST;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(", linkType: ");
|
||||
result.append(linkType);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PatternLinkImpl
|
||||
@@ -0,0 +1,716 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.IdentifiedElement;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternPort;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternPortDirection;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BorderElement;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PortDirection;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
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.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
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>Pattern Port</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getMultiplicityValue <em>Multiplicity Value</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getCardinalityElement <em>Cardinality Element</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getIdentifiedAs <em>Identified As</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getDirection <em>Direction</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.pseim.impl.PatternPortImpl#getDir <em>Dir</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PatternPortImpl extends MinimalEObjectImpl.Container implements PatternPort {
|
||||
/**
|
||||
* The default value of the '{@link #getMultiplicityValue() <em>Multiplicity Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getMultiplicityValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final int MULTIPLICITY_VALUE_EDEFAULT = 1;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getMultiplicityValue() <em>Multiplicity Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getMultiplicityValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected int multiplicityValue = MULTIPLICITY_VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getCardinalityElement() <em>Cardinality Element</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getCardinalityElement()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected CardinalityElement cardinalityElement;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getIdentifiedAs() <em>Identified As</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getIdentifiedAs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PropertyHolder identifiedAs;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* 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 cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getDirection() <em>Direction</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDirection()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final PortDirection DIRECTION_EDEFAULT = PortDirection.UNSPECIFIED;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDirection()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PortDirection direction = DIRECTION_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getDir() <em>Dir</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDir()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final PatternPortDirection DIR_EDEFAULT = PatternPortDirection.UNSPECIFIED;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDir() <em>Dir</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDir()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PatternPortDirection dir = DIR_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PatternPortImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return PseimPackage.Literals.PATTERN_PORT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getMultiplicityValue() {
|
||||
return multiplicityValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setMultiplicityValue(int newMultiplicityValue) {
|
||||
int oldMultiplicityValue = multiplicityValue;
|
||||
multiplicityValue = newMultiplicityValue;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE,
|
||||
oldMultiplicityValue, multiplicityValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement getCardinalityElement() {
|
||||
if (cardinalityElement != null && cardinalityElement.eIsProxy()) {
|
||||
InternalEObject oldCardinalityElement = (InternalEObject) cardinalityElement;
|
||||
cardinalityElement = (CardinalityElement) eResolveProxy(oldCardinalityElement);
|
||||
if (cardinalityElement != oldCardinalityElement) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
|
||||
PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT, oldCardinalityElement, cardinalityElement));
|
||||
}
|
||||
}
|
||||
return cardinalityElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CardinalityElement basicGetCardinalityElement() {
|
||||
return cardinalityElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setCardinalityElement(CardinalityElement newCardinalityElement) {
|
||||
CardinalityElement oldCardinalityElement = cardinalityElement;
|
||||
cardinalityElement = newCardinalityElement;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT,
|
||||
oldCardinalityElement, cardinalityElement));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder getIdentifiedAs() {
|
||||
if (identifiedAs != null && identifiedAs.eIsProxy()) {
|
||||
InternalEObject oldIdentifiedAs = (InternalEObject) identifiedAs;
|
||||
identifiedAs = (PropertyHolder) eResolveProxy(oldIdentifiedAs);
|
||||
if (identifiedAs != oldIdentifiedAs) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PseimPackage.PATTERN_PORT__IDENTIFIED_AS,
|
||||
oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
}
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder basicGetIdentifiedAs() {
|
||||
return identifiedAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setIdentifiedAs(PropertyHolder newIdentifiedAs) {
|
||||
PropertyHolder oldIdentifiedAs = identifiedAs;
|
||||
identifiedAs = newIdentifiedAs;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__IDENTIFIED_AS,
|
||||
oldIdentifiedAs, identifiedAs));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this,
|
||||
PseimPackage.PATTERN_PORT__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PortDirection getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDirection(PortDirection newDirection) {
|
||||
PortDirection oldDirection = direction;
|
||||
direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__DIRECTION, oldDirection,
|
||||
direction));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternPortDirection getDir() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDir(PatternPortDirection newDir) {
|
||||
PatternPortDirection oldDir = dir;
|
||||
dir = newDir == null ? DIR_EDEFAULT : newDir;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, PseimPackage.PATTERN_PORT__DIR, oldDir, dir));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).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 PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE:
|
||||
return getMultiplicityValue();
|
||||
case PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT:
|
||||
if (resolve)
|
||||
return getCardinalityElement();
|
||||
return basicGetCardinalityElement();
|
||||
case PseimPackage.PATTERN_PORT__IDENTIFIED_AS:
|
||||
if (resolve)
|
||||
return getIdentifiedAs();
|
||||
return basicGetIdentifiedAs();
|
||||
case PseimPackage.PATTERN_PORT__UID:
|
||||
return getUid();
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
return getName();
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
return getProperties();
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
return getDirection();
|
||||
case PseimPackage.PATTERN_PORT__DIR:
|
||||
return getDir();
|
||||
}
|
||||
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 PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE:
|
||||
setMultiplicityValue((Integer) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT:
|
||||
setCardinalityElement((CardinalityElement) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
setDirection((PortDirection) newValue);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__DIR:
|
||||
setDir((PatternPortDirection) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE:
|
||||
setMultiplicityValue(MULTIPLICITY_VALUE_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT:
|
||||
setCardinalityElement((CardinalityElement) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__IDENTIFIED_AS:
|
||||
setIdentifiedAs((PropertyHolder) null);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
setDirection(DIRECTION_EDEFAULT);
|
||||
return;
|
||||
case PseimPackage.PATTERN_PORT__DIR:
|
||||
setDir(DIR_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case PseimPackage.PATTERN_PORT__MULTIPLICITY_VALUE:
|
||||
return multiplicityValue != MULTIPLICITY_VALUE_EDEFAULT;
|
||||
case PseimPackage.PATTERN_PORT__CARDINALITY_ELEMENT:
|
||||
return cardinalityElement != null;
|
||||
case PseimPackage.PATTERN_PORT__IDENTIFIED_AS:
|
||||
return identifiedAs != null;
|
||||
case PseimPackage.PATTERN_PORT__UID:
|
||||
return isSetUid();
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
return direction != DIRECTION_EDEFAULT;
|
||||
case PseimPackage.PATTERN_PORT__DIR:
|
||||
return dir != DIR_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_PORT__IDENTIFIED_AS:
|
||||
return PseimPackage.IDENTIFIED_ELEMENT__IDENTIFIED_AS;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == com.irtsaintexupery.pseim.seim.IdentifiedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_PORT__UID:
|
||||
return SeimPackage.IDENTIFIED_ELEMENT__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_PORT__NAME:
|
||||
return SeimPackage.NAMED_ELEMENT__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_PORT__PROPERTIES:
|
||||
return SeimPackage.PROPERTY_HOLDER__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == BorderElement.class) {
|
||||
switch (derivedFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Port.class) {
|
||||
switch (derivedFeatureID) {
|
||||
case PseimPackage.PATTERN_PORT__DIRECTION:
|
||||
return SeimPackage.PORT__DIRECTION;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
|
||||
if (baseClass == IdentifiedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case PseimPackage.IDENTIFIED_ELEMENT__IDENTIFIED_AS:
|
||||
return PseimPackage.PATTERN_PORT__IDENTIFIED_AS;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == com.irtsaintexupery.pseim.seim.IdentifiedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.IDENTIFIED_ELEMENT__UID:
|
||||
return PseimPackage.PATTERN_PORT__UID;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == NamedElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.NAMED_ELEMENT__NAME:
|
||||
return PseimPackage.PATTERN_PORT__NAME;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == PropertyHolder.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.PROPERTY_HOLDER__PROPERTIES:
|
||||
return PseimPackage.PATTERN_PORT__PROPERTIES;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Element.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == BorderElement.class) {
|
||||
switch (baseFeatureID) {
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (baseClass == Port.class) {
|
||||
switch (baseFeatureID) {
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
return PseimPackage.PATTERN_PORT__DIRECTION;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (multiplicityValue: ");
|
||||
result.append(multiplicityValue);
|
||||
result.append(", uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(", direction: ");
|
||||
result.append(direction);
|
||||
result.append(", dir: ");
|
||||
result.append(dir);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PatternPortImpl
|
||||
@@ -0,0 +1,329 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.*;
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EDataType;
|
||||
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;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PseimFactoryImpl extends EFactoryImpl implements PseimFactory {
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static PseimFactory init() {
|
||||
try {
|
||||
PseimFactory thePseimFactory = (PseimFactory) EPackage.Registry.INSTANCE.getEFactory(PseimPackage.eNS_URI);
|
||||
if (thePseimFactory != null) {
|
||||
return thePseimFactory;
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new PseimFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimFactoryImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass) {
|
||||
switch (eClass.getClassifierID()) {
|
||||
case PseimPackage.LIBRARY:
|
||||
return createLibrary();
|
||||
case PseimPackage.PATTERN:
|
||||
return createPattern();
|
||||
case PseimPackage.CARDINALITY_ELEMENT:
|
||||
return createCardinalityElement();
|
||||
case PseimPackage.PATTERN_COMPONENT:
|
||||
return createPatternComponent();
|
||||
case PseimPackage.PATTERN_PORT:
|
||||
return createPatternPort();
|
||||
case PseimPackage.PATTERN_LINK:
|
||||
return createPatternLink();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object createFromString(EDataType eDataType, String initialValue) {
|
||||
switch (eDataType.getClassifierID()) {
|
||||
case PseimPackage.PATTERN_TYPE_HS:
|
||||
return createPatternTypeHSFromString(eDataType, initialValue);
|
||||
case PseimPackage.PATTERN_TYPE_FAILURE_MODE:
|
||||
return createPatternTypeFailureModeFromString(eDataType, initialValue);
|
||||
case PseimPackage.SAFETY_TACTIC:
|
||||
return createSafetyTacticFromString(eDataType, initialValue);
|
||||
case PseimPackage.LINK_TYPE:
|
||||
return createLinkTypeFromString(eDataType, initialValue);
|
||||
case PseimPackage.PATTERN_PORT_DIRECTION:
|
||||
return createPatternPortDirectionFromString(eDataType, initialValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String convertToString(EDataType eDataType, Object instanceValue) {
|
||||
switch (eDataType.getClassifierID()) {
|
||||
case PseimPackage.PATTERN_TYPE_HS:
|
||||
return convertPatternTypeHSToString(eDataType, instanceValue);
|
||||
case PseimPackage.PATTERN_TYPE_FAILURE_MODE:
|
||||
return convertPatternTypeFailureModeToString(eDataType, instanceValue);
|
||||
case PseimPackage.SAFETY_TACTIC:
|
||||
return convertSafetyTacticToString(eDataType, instanceValue);
|
||||
case PseimPackage.LINK_TYPE:
|
||||
return convertLinkTypeToString(eDataType, instanceValue);
|
||||
case PseimPackage.PATTERN_PORT_DIRECTION:
|
||||
return convertPatternPortDirectionToString(eDataType, instanceValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public Library createLibrary() {
|
||||
LibraryImpl library = new LibraryImpl();
|
||||
library.uid = EcoreUtil.generateUUID();
|
||||
return library;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Pattern createPattern() {
|
||||
PatternImpl pattern = new PatternImpl();
|
||||
return pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public CardinalityElement createCardinalityElement() {
|
||||
CardinalityElementImpl cardinalityElement = new CardinalityElementImpl();
|
||||
cardinalityElement.uid = EcoreUtil.generateUUID();
|
||||
return cardinalityElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public PatternComponent createPatternComponent() {
|
||||
PatternComponentImpl patternComponent = new PatternComponentImpl();
|
||||
patternComponent.uid = EcoreUtil.generateUUID();
|
||||
return patternComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public PatternPort createPatternPort() {
|
||||
PatternPortImpl patternPort = new PatternPortImpl();
|
||||
patternPort.uid = EcoreUtil.generateUUID();
|
||||
return patternPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public PatternLink createPatternLink() {
|
||||
PatternLinkImpl patternLink = new PatternLinkImpl();
|
||||
patternLink.uid = EcoreUtil.generateUUID();
|
||||
return patternLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternTypeHS createPatternTypeHSFromString(EDataType eDataType, String initialValue) {
|
||||
PatternTypeHS result = PatternTypeHS.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertPatternTypeHSToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternTypeFailureMode createPatternTypeFailureModeFromString(EDataType eDataType, String initialValue) {
|
||||
PatternTypeFailureMode result = PatternTypeFailureMode.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertPatternTypeFailureModeToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SafetyTactic createSafetyTacticFromString(EDataType eDataType, String initialValue) {
|
||||
SafetyTactic result = SafetyTactic.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertSafetyTacticToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public LinkType createLinkTypeFromString(EDataType eDataType, String initialValue) {
|
||||
LinkType result = LinkType.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertLinkTypeToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PatternPortDirection createPatternPortDirectionFromString(EDataType eDataType, String initialValue) {
|
||||
PatternPortDirection result = PatternPortDirection.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertPatternPortDirectionToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimPackage getPseimPackage() {
|
||||
return (PseimPackage) getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static PseimPackage getPackage() {
|
||||
return PseimPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //PseimFactoryImpl
|
||||
@@ -0,0 +1,789 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.IdentifiedElement;
|
||||
import com.irtsaintexupery.pseim.pseim.Library;
|
||||
import com.irtsaintexupery.pseim.pseim.LinkType;
|
||||
import com.irtsaintexupery.pseim.pseim.MultiplicityElement;
|
||||
import com.irtsaintexupery.pseim.pseim.Pattern;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternComponent;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternLink;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternPort;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternPortDirection;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternTypeFailureMode;
|
||||
import com.irtsaintexupery.pseim.pseim.PatternTypeHS;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimFactory;
|
||||
import com.irtsaintexupery.pseim.pseim.PseimPackage;
|
||||
import com.irtsaintexupery.pseim.pseim.SafetyTactic;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.util.PseimValidator;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EEnum;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import org.eclipse.emf.ecore.EValidator;
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class PseimPackageImpl extends EPackageImpl implements PseimPackage {
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass libraryEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass patternEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass cardinalityElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass patternComponentEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass patternPortEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass patternLinkEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass multiplicityElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass identifiedElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum patternTypeHSEEnum = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum patternTypeFailureModeEEnum = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum safetyTacticEEnum = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum linkTypeEEnum = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum patternPortDirectionEEnum = 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 com.irtsaintexupery.pseim.pseim.PseimPackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private PseimPackageImpl() {
|
||||
super(eNS_URI, PseimFactory.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 PseimPackage#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 PseimPackage init() {
|
||||
if (isInited)
|
||||
return (PseimPackage) EPackage.Registry.INSTANCE.getEPackage(PseimPackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
PseimPackageImpl thePseimPackage = (PseimPackageImpl) (EPackage.Registry.INSTANCE
|
||||
.get(eNS_URI) instanceof PseimPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
|
||||
: new PseimPackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Initialize simple dependencies
|
||||
SeimPackage.eINSTANCE.eClass();
|
||||
|
||||
// Create package meta-data objects
|
||||
thePseimPackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
thePseimPackage.initializePackageContents();
|
||||
|
||||
// Register package validator
|
||||
EValidator.Registry.INSTANCE.put(thePseimPackage, new EValidator.Descriptor() {
|
||||
public EValidator getEValidator() {
|
||||
return PseimValidator.INSTANCE;
|
||||
}
|
||||
});
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
thePseimPackage.freeze();
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(PseimPackage.eNS_URI, thePseimPackage);
|
||||
return thePseimPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getLibrary() {
|
||||
return libraryEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getLibrary_Patterns() {
|
||||
return (EReference) libraryEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPattern() {
|
||||
return patternEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_TypeHS() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_TypeFailure() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_AlsoKnownAs() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_UsedTactics() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_Context() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_Domain() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPattern_IsSingleChannel() {
|
||||
return (EAttribute) patternEClass.getEStructuralFeatures().get(6);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getPattern_InterfaceElements() {
|
||||
return (EReference) patternEClass.getEStructuralFeatures().get(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getPattern_CardinalityElements() {
|
||||
return (EReference) patternEClass.getEStructuralFeatures().get(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getCardinalityElement() {
|
||||
return cardinalityElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getCardinalityElement_CalculatedVia() {
|
||||
return (EReference) cardinalityElementEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPatternComponent() {
|
||||
return patternComponentEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPatternComponent_MergeContent() {
|
||||
return (EAttribute) patternComponentEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPatternPort() {
|
||||
return patternPortEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPatternPort_Dir() {
|
||||
return (EAttribute) patternPortEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPatternLink() {
|
||||
return patternLinkEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPatternLink_LinkType() {
|
||||
return (EAttribute) patternLinkEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getPatternLink_Element() {
|
||||
return (EReference) patternLinkEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getMultiplicityElement() {
|
||||
return multiplicityElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getMultiplicityElement_MultiplicityValue() {
|
||||
return (EAttribute) multiplicityElementEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getMultiplicityElement_CardinalityElement() {
|
||||
return (EReference) multiplicityElementEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getIdentifiedElement() {
|
||||
return identifiedElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getIdentifiedElement_IdentifiedAs() {
|
||||
return (EReference) identifiedElementEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getPatternTypeHS() {
|
||||
return patternTypeHSEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getPatternTypeFailureMode() {
|
||||
return patternTypeFailureModeEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getSafetyTactic() {
|
||||
return safetyTacticEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getLinkType() {
|
||||
return linkTypeEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getPatternPortDirection() {
|
||||
return patternPortDirectionEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimFactory getPseimFactory() {
|
||||
return (PseimFactory) 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
|
||||
libraryEClass = createEClass(LIBRARY);
|
||||
createEReference(libraryEClass, LIBRARY__PATTERNS);
|
||||
|
||||
patternEClass = createEClass(PATTERN);
|
||||
createEAttribute(patternEClass, PATTERN__TYPE_HS);
|
||||
createEAttribute(patternEClass, PATTERN__TYPE_FAILURE);
|
||||
createEAttribute(patternEClass, PATTERN__ALSO_KNOWN_AS);
|
||||
createEAttribute(patternEClass, PATTERN__USED_TACTICS);
|
||||
createEAttribute(patternEClass, PATTERN__CONTEXT);
|
||||
createEAttribute(patternEClass, PATTERN__DOMAIN);
|
||||
createEAttribute(patternEClass, PATTERN__IS_SINGLE_CHANNEL);
|
||||
createEReference(patternEClass, PATTERN__INTERFACE_ELEMENTS);
|
||||
createEReference(patternEClass, PATTERN__CARDINALITY_ELEMENTS);
|
||||
|
||||
cardinalityElementEClass = createEClass(CARDINALITY_ELEMENT);
|
||||
createEReference(cardinalityElementEClass, CARDINALITY_ELEMENT__CALCULATED_VIA);
|
||||
|
||||
patternComponentEClass = createEClass(PATTERN_COMPONENT);
|
||||
createEAttribute(patternComponentEClass, PATTERN_COMPONENT__MERGE_CONTENT);
|
||||
|
||||
patternPortEClass = createEClass(PATTERN_PORT);
|
||||
createEAttribute(patternPortEClass, PATTERN_PORT__DIR);
|
||||
|
||||
patternLinkEClass = createEClass(PATTERN_LINK);
|
||||
createEAttribute(patternLinkEClass, PATTERN_LINK__LINK_TYPE);
|
||||
createEReference(patternLinkEClass, PATTERN_LINK__ELEMENT);
|
||||
|
||||
multiplicityElementEClass = createEClass(MULTIPLICITY_ELEMENT);
|
||||
createEAttribute(multiplicityElementEClass, MULTIPLICITY_ELEMENT__MULTIPLICITY_VALUE);
|
||||
createEReference(multiplicityElementEClass, MULTIPLICITY_ELEMENT__CARDINALITY_ELEMENT);
|
||||
|
||||
identifiedElementEClass = createEClass(IDENTIFIED_ELEMENT);
|
||||
createEReference(identifiedElementEClass, IDENTIFIED_ELEMENT__IDENTIFIED_AS);
|
||||
|
||||
// Create enums
|
||||
patternTypeHSEEnum = createEEnum(PATTERN_TYPE_HS);
|
||||
patternTypeFailureModeEEnum = createEEnum(PATTERN_TYPE_FAILURE_MODE);
|
||||
safetyTacticEEnum = createEEnum(SAFETY_TACTIC);
|
||||
linkTypeEEnum = createEEnum(LINK_TYPE);
|
||||
patternPortDirectionEEnum = createEEnum(PATTERN_PORT_DIRECTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- 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);
|
||||
|
||||
// Obtain other dependent packages
|
||||
SeimPackage theSeimPackage = (SeimPackage) EPackage.Registry.INSTANCE.getEPackage(SeimPackage.eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
libraryEClass.getESuperTypes().add(theSeimPackage.getNamedElement());
|
||||
patternEClass.getESuperTypes().add(theSeimPackage.getModel());
|
||||
cardinalityElementEClass.getESuperTypes().add(theSeimPackage.getPropertyHolder());
|
||||
patternComponentEClass.getESuperTypes().add(this.getMultiplicityElement());
|
||||
patternComponentEClass.getESuperTypes().add(this.getIdentifiedElement());
|
||||
patternComponentEClass.getESuperTypes().add(theSeimPackage.getComponent());
|
||||
patternPortEClass.getESuperTypes().add(this.getMultiplicityElement());
|
||||
patternPortEClass.getESuperTypes().add(this.getIdentifiedElement());
|
||||
patternPortEClass.getESuperTypes().add(theSeimPackage.getPort());
|
||||
patternLinkEClass.getESuperTypes().add(this.getIdentifiedElement());
|
||||
patternLinkEClass.getESuperTypes().add(theSeimPackage.getLink());
|
||||
|
||||
// Initialize classes, features, and operations; add parameters
|
||||
initEClass(libraryEClass, Library.class, "Library", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getLibrary_Patterns(), this.getPattern(), null, "patterns", null, 0, -1, Library.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
||||
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(patternEClass, Pattern.class, "Pattern", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPattern_TypeHS(), this.getPatternTypeHS(), "typeHS", null, 0, -1, Pattern.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
|
||||
!IS_ORDERED);
|
||||
initEAttribute(getPattern_TypeFailure(), this.getPatternTypeFailureMode(), "typeFailure", null, 0, 1,
|
||||
Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getPattern_AlsoKnownAs(), ecorePackage.getEString(), "alsoKnownAs", null, 0, -1, Pattern.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
|
||||
!IS_ORDERED);
|
||||
initEAttribute(getPattern_UsedTactics(), this.getSafetyTactic(), "usedTactics", null, 0, -1, Pattern.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
|
||||
!IS_ORDERED);
|
||||
initEAttribute(getPattern_Context(), ecorePackage.getEString(), "context", null, 0, 1, Pattern.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getPattern_Domain(), ecorePackage.getEString(), "domain", null, 0, 1, Pattern.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getPattern_IsSingleChannel(), ecorePackage.getEBoolean(), "isSingleChannel", null, 1, 1,
|
||||
Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getPattern_InterfaceElements(), theSeimPackage.getPropertyHolder(), null, "interfaceElements",
|
||||
null, 0, -1, Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
|
||||
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getPattern_CardinalityElements(), this.getCardinalityElement(), null, "cardinalityElements",
|
||||
null, 0, -1, Pattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
|
||||
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(cardinalityElementEClass, CardinalityElement.class, "CardinalityElement", !IS_ABSTRACT,
|
||||
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getCardinalityElement_CalculatedVia(), theSeimPackage.getPropertyHolder(), null, "calculatedVia",
|
||||
null, 0, -1, CardinalityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
|
||||
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(patternComponentEClass, PatternComponent.class, "PatternComponent", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPatternComponent_MergeContent(), ecorePackage.getEBoolean(), "mergeContent", null, 1, 1,
|
||||
PatternComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(patternPortEClass, PatternPort.class, "PatternPort", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPatternPort_Dir(), this.getPatternPortDirection(), "dir", null, 1, 1, PatternPort.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(patternLinkEClass, PatternLink.class, "PatternLink", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPatternLink_LinkType(), this.getLinkType(), "linkType", null, 1, 1, PatternLink.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getPatternLink_Element(), this.getCardinalityElement(), null, "element", null, 0, 1,
|
||||
PatternLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
|
||||
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(multiplicityElementEClass, MultiplicityElement.class, "MultiplicityElement", IS_ABSTRACT,
|
||||
IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getMultiplicityElement_MultiplicityValue(), ecorePackage.getEInt(), "multiplicityValue", "1", 1,
|
||||
1, MultiplicityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
|
||||
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getMultiplicityElement_CardinalityElement(), this.getCardinalityElement(), null,
|
||||
"cardinalityElement", null, 0, 1, MultiplicityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
|
||||
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getIdentifiedElement_IdentifiedAs(), theSeimPackage.getPropertyHolder(), null, "identifiedAs",
|
||||
null, 0, 1, IdentifiedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
|
||||
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Initialize enums and add enum literals
|
||||
initEEnum(patternTypeHSEEnum, PatternTypeHS.class, "PatternTypeHS");
|
||||
addEEnumLiteral(patternTypeHSEEnum, PatternTypeHS.HARDWARE);
|
||||
addEEnumLiteral(patternTypeHSEEnum, PatternTypeHS.SOFTWARE);
|
||||
|
||||
initEEnum(patternTypeFailureModeEEnum, PatternTypeFailureMode.class, "PatternTypeFailureMode");
|
||||
addEEnumLiteral(patternTypeFailureModeEEnum, PatternTypeFailureMode.FAIL_SAFE);
|
||||
addEEnumLiteral(patternTypeFailureModeEEnum, PatternTypeFailureMode.FAIL_OVER);
|
||||
|
||||
initEEnum(safetyTacticEEnum, SafetyTactic.class, "SafetyTactic");
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SIMPLICITY);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SUBSTITUTION);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.SANITY_CHECK);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.CONDITION_MONITORING);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.COMPARISON);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.DIVERSE_REDUNDANCY);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.REPLICATION_REDUNDANCY);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.REPAIR);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.DEGRADATION);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.VOTING);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.OVERRIDE);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.BARRIER);
|
||||
addEEnumLiteral(safetyTacticEEnum, SafetyTactic.HEARTBEAT);
|
||||
|
||||
initEEnum(linkTypeEEnum, LinkType.class, "LinkType");
|
||||
addEEnumLiteral(linkTypeEEnum, LinkType.TRANSPOSE);
|
||||
addEEnumLiteral(linkTypeEEnum, LinkType.IDENTITY);
|
||||
addEEnumLiteral(linkTypeEEnum, LinkType.SHIFT);
|
||||
addEEnumLiteral(linkTypeEEnum, LinkType.FIRST);
|
||||
addEEnumLiteral(linkTypeEEnum, LinkType.ROTATE);
|
||||
|
||||
initEEnum(patternPortDirectionEEnum, PatternPortDirection.class, "PatternPortDirection");
|
||||
addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.UNSPECIFIED);
|
||||
addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.IN);
|
||||
addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.OUT);
|
||||
addEEnumLiteral(patternPortDirectionEEnum, PatternPortDirection.INOUT);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
|
||||
// Create annotations
|
||||
// http://www.eclipse.org/OCL/Import
|
||||
createImportAnnotations();
|
||||
// http://www.eclipse.org/emf/2002/Ecore
|
||||
createEcoreAnnotations();
|
||||
// http://www.eclipse.org/OCL/Collection
|
||||
createCollectionAnnotations();
|
||||
// http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
|
||||
createPivotAnnotations();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createImportAnnotations() {
|
||||
String source = "http://www.eclipse.org/OCL/Import";
|
||||
addAnnotation(this, source,
|
||||
new String[] { "ecore", "http://www.eclipse.org/emf/2002/Ecore", "seim", "seim.ecore#/" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createEcoreAnnotations() {
|
||||
String source = "http://www.eclipse.org/emf/2002/Ecore";
|
||||
addAnnotation(this, source,
|
||||
new String[] { "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
|
||||
"settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "validationDelegates",
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot" });
|
||||
addAnnotation(patternComponentEClass, source, new String[] { "constraints", "contentIsPatternContent" });
|
||||
addAnnotation(patternLinkEClass, source, new String[] { "constraints", "srcIsPatternPort dstIsPatternPort" });
|
||||
addAnnotation(multiplicityElementEClass, source, new String[] { "constraints", "cardinalityAsElementOrMult" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/OCL/Collection</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createCollectionAnnotations() {
|
||||
String source = "http://www.eclipse.org/OCL/Collection";
|
||||
addAnnotation(getPattern_AlsoKnownAs(), source, new String[] { "nullFree", "false" });
|
||||
addAnnotation(getPattern_UsedTactics(), source, new String[] { "nullFree", "false" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createPivotAnnotations() {
|
||||
String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
|
||||
addAnnotation(patternComponentEClass, source, new String[] { "contentIsPatternContent",
|
||||
"content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))" });
|
||||
addAnnotation(patternLinkEClass, source, new String[] { "srcIsPatternPort", "src.oclIsTypeOf(PatternLink)",
|
||||
"dstIsPatternPort", "dst.oclIsTypeOf(PatternLink)" });
|
||||
addAnnotation(multiplicityElementEClass, source, new String[] { "cardinalityAsElementOrMult",
|
||||
"(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1" });
|
||||
}
|
||||
|
||||
} //PseimPackageImpl
|
||||
@@ -0,0 +1,462 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.util;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.*;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BorderElement;
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PseimPackage
|
||||
* @generated
|
||||
*/
|
||||
public class PseimAdapterFactory extends AdapterFactoryImpl {
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static PseimPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimAdapterFactory() {
|
||||
if (modelPackage == null) {
|
||||
modelPackage = PseimPackage.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 PseimSwitch<Adapter> modelSwitch = new PseimSwitch<Adapter>() {
|
||||
@Override
|
||||
public Adapter caseLibrary(Library object) {
|
||||
return createLibraryAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePattern(Pattern object) {
|
||||
return createPatternAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseCardinalityElement(CardinalityElement object) {
|
||||
return createCardinalityElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePatternComponent(PatternComponent object) {
|
||||
return createPatternComponentAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePatternPort(PatternPort object) {
|
||||
return createPatternPortAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePatternLink(PatternLink object) {
|
||||
return createPatternLinkAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseMultiplicityElement(MultiplicityElement object) {
|
||||
return createMultiplicityElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseIdentifiedElement(IdentifiedElement object) {
|
||||
return createIdentifiedElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseSeim_IdentifiedElement(com.irtsaintexupery.pseim.seim.IdentifiedElement object) {
|
||||
return createSeim_IdentifiedElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseNamedElement(NamedElement object) {
|
||||
return createNamedElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePropertyHolder(PropertyHolder object) {
|
||||
return createPropertyHolderAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseModel(Model object) {
|
||||
return createModelAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseElement(Element object) {
|
||||
return createElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseGraphElement(GraphElement object) {
|
||||
return createGraphElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseComponent(Component object) {
|
||||
return createComponentAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseBorderElement(BorderElement object) {
|
||||
return createBorderElementAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter casePort(Port object) {
|
||||
return createPortAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Adapter caseLink(Link object) {
|
||||
return createLinkAdapter();
|
||||
}
|
||||
|
||||
@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 com.irtsaintexupery.pseim.pseim.Library <em>Library</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 com.irtsaintexupery.pseim.pseim.Library
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createLibraryAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.Pattern <em>Pattern</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 com.irtsaintexupery.pseim.pseim.Pattern
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPatternAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.CardinalityElement <em>Cardinality Element</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 com.irtsaintexupery.pseim.pseim.CardinalityElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createCardinalityElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.PatternComponent <em>Pattern Component</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 com.irtsaintexupery.pseim.pseim.PatternComponent
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPatternComponentAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.PatternPort <em>Pattern Port</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 com.irtsaintexupery.pseim.pseim.PatternPort
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPatternPortAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.PatternLink <em>Pattern 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 com.irtsaintexupery.pseim.pseim.PatternLink
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPatternLinkAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.MultiplicityElement <em>Multiplicity Element</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 com.irtsaintexupery.pseim.pseim.MultiplicityElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createMultiplicityElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.pseim.IdentifiedElement <em>Identified Element</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 com.irtsaintexupery.pseim.pseim.IdentifiedElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createIdentifiedElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.IdentifiedElement <em>Identified Element</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 com.irtsaintexupery.pseim.seim.IdentifiedElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createSeim_IdentifiedElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.NamedElement <em>Named Element</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 com.irtsaintexupery.pseim.seim.NamedElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createNamedElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.PropertyHolder <em>Property Holder</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 com.irtsaintexupery.pseim.seim.PropertyHolder
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPropertyHolderAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.Model <em>Model</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 com.irtsaintexupery.pseim.seim.Model
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createModelAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.Element <em>Element</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 com.irtsaintexupery.pseim.seim.Element
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.GraphElement <em>Graph Element</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 com.irtsaintexupery.pseim.seim.GraphElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createGraphElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.Component <em>Component</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 com.irtsaintexupery.pseim.seim.Component
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createComponentAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.BorderElement <em>Border Element</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 com.irtsaintexupery.pseim.seim.BorderElement
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createBorderElementAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.Port <em>Port</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 com.irtsaintexupery.pseim.seim.Port
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPortAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.seim.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 com.irtsaintexupery.pseim.seim.Link
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createLinkAdapter() {
|
||||
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;
|
||||
}
|
||||
|
||||
} //PseimAdapterFactory
|
||||
@@ -0,0 +1,500 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.util;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.*;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BorderElement;
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
|
||||
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 com.irtsaintexupery.pseim.pseim.PseimPackage
|
||||
* @generated
|
||||
*/
|
||||
public class PseimSwitch<T> extends Switch<T> {
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static PseimPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimSwitch() {
|
||||
if (modelPackage == null) {
|
||||
modelPackage = PseimPackage.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 PseimPackage.LIBRARY: {
|
||||
Library library = (Library) theEObject;
|
||||
T result = caseLibrary(library);
|
||||
if (result == null)
|
||||
result = caseNamedElement(library);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(library);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.PATTERN: {
|
||||
Pattern pattern = (Pattern) theEObject;
|
||||
T result = casePattern(pattern);
|
||||
if (result == null)
|
||||
result = caseModel(pattern);
|
||||
if (result == null)
|
||||
result = casePropertyHolder(pattern);
|
||||
if (result == null)
|
||||
result = caseNamedElement(pattern);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(pattern);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.CARDINALITY_ELEMENT: {
|
||||
CardinalityElement cardinalityElement = (CardinalityElement) theEObject;
|
||||
T result = caseCardinalityElement(cardinalityElement);
|
||||
if (result == null)
|
||||
result = casePropertyHolder(cardinalityElement);
|
||||
if (result == null)
|
||||
result = caseNamedElement(cardinalityElement);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(cardinalityElement);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.PATTERN_COMPONENT: {
|
||||
PatternComponent patternComponent = (PatternComponent) theEObject;
|
||||
T result = casePatternComponent(patternComponent);
|
||||
if (result == null)
|
||||
result = caseMultiplicityElement(patternComponent);
|
||||
if (result == null)
|
||||
result = caseIdentifiedElement(patternComponent);
|
||||
if (result == null)
|
||||
result = caseComponent(patternComponent);
|
||||
if (result == null)
|
||||
result = caseGraphElement(patternComponent);
|
||||
if (result == null)
|
||||
result = caseElement(patternComponent);
|
||||
if (result == null)
|
||||
result = casePropertyHolder(patternComponent);
|
||||
if (result == null)
|
||||
result = caseNamedElement(patternComponent);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(patternComponent);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.PATTERN_PORT: {
|
||||
PatternPort patternPort = (PatternPort) theEObject;
|
||||
T result = casePatternPort(patternPort);
|
||||
if (result == null)
|
||||
result = caseMultiplicityElement(patternPort);
|
||||
if (result == null)
|
||||
result = caseIdentifiedElement(patternPort);
|
||||
if (result == null)
|
||||
result = casePort(patternPort);
|
||||
if (result == null)
|
||||
result = caseBorderElement(patternPort);
|
||||
if (result == null)
|
||||
result = caseElement(patternPort);
|
||||
if (result == null)
|
||||
result = casePropertyHolder(patternPort);
|
||||
if (result == null)
|
||||
result = caseNamedElement(patternPort);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(patternPort);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.PATTERN_LINK: {
|
||||
PatternLink patternLink = (PatternLink) theEObject;
|
||||
T result = casePatternLink(patternLink);
|
||||
if (result == null)
|
||||
result = caseIdentifiedElement(patternLink);
|
||||
if (result == null)
|
||||
result = caseLink(patternLink);
|
||||
if (result == null)
|
||||
result = caseGraphElement(patternLink);
|
||||
if (result == null)
|
||||
result = caseElement(patternLink);
|
||||
if (result == null)
|
||||
result = casePropertyHolder(patternLink);
|
||||
if (result == null)
|
||||
result = caseNamedElement(patternLink);
|
||||
if (result == null)
|
||||
result = caseSeim_IdentifiedElement(patternLink);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.MULTIPLICITY_ELEMENT: {
|
||||
MultiplicityElement multiplicityElement = (MultiplicityElement) theEObject;
|
||||
T result = caseMultiplicityElement(multiplicityElement);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case PseimPackage.IDENTIFIED_ELEMENT: {
|
||||
IdentifiedElement identifiedElement = (IdentifiedElement) theEObject;
|
||||
T result = caseIdentifiedElement(identifiedElement);
|
||||
if (result == null)
|
||||
result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Library</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>Library</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseLibrary(Library object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Pattern</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>Pattern</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePattern(Pattern object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Cardinality Element</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>Cardinality Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseCardinalityElement(CardinalityElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Pattern Component</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>Pattern Component</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePatternComponent(PatternComponent object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Pattern Port</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>Pattern Port</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePatternPort(PatternPort object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Pattern 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>Pattern Link</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePatternLink(PatternLink object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Multiplicity Element</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>Multiplicity Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseMultiplicityElement(MultiplicityElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Identified Element</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>Identified Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseIdentifiedElement(IdentifiedElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Identified Element</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>Identified Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseSeim_IdentifiedElement(com.irtsaintexupery.pseim.seim.IdentifiedElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Named Element</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 Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseNamedElement(NamedElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Property Holder</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>Property Holder</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePropertyHolder(PropertyHolder object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Model</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>Model</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseModel(Model object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Element</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>Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseElement(Element object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Graph Element</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>Graph Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseGraphElement(GraphElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Component</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>Component</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseComponent(Component object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Border Element</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>Border Element</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseBorderElement(BorderElement object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Port</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>Port</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePort(Port 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>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;
|
||||
}
|
||||
|
||||
} //PseimSwitch
|
||||
@@ -0,0 +1,533 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.pseim.util;
|
||||
|
||||
import com.irtsaintexupery.pseim.pseim.*;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.util.SeimValidator;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.emf.common.util.Diagnostic;
|
||||
import org.eclipse.emf.common.util.DiagnosticChain;
|
||||
import org.eclipse.emf.common.util.ResourceLocator;
|
||||
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectValidator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Validator</b> for the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see com.irtsaintexupery.pseim.pseim.PseimPackage
|
||||
* @generated
|
||||
*/
|
||||
public class PseimValidator extends EObjectValidator {
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final PseimValidator INSTANCE = new PseimValidator();
|
||||
|
||||
/**
|
||||
* A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.common.util.Diagnostic#getSource()
|
||||
* @see org.eclipse.emf.common.util.Diagnostic#getCode()
|
||||
* @generated
|
||||
*/
|
||||
public static final String DIAGNOSTIC_SOURCE = "com.irtsaintexupery.pseim.pseim";
|
||||
|
||||
/**
|
||||
* A constant with a fixed name that can be used as the base value for additional hand written constants.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
|
||||
|
||||
/**
|
||||
* A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
|
||||
|
||||
/**
|
||||
* The cached base package validator.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SeimValidator seimValidator;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PseimValidator() {
|
||||
super();
|
||||
seimValidator = SeimValidator.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the package of this validator switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EPackage getEPackage() {
|
||||
return PseimPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>validateXXX</code> for the corresponding classifier of the model.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
switch (classifierID) {
|
||||
case PseimPackage.LIBRARY:
|
||||
return validateLibrary((Library) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN:
|
||||
return validatePattern((Pattern) value, diagnostics, context);
|
||||
case PseimPackage.CARDINALITY_ELEMENT:
|
||||
return validateCardinalityElement((CardinalityElement) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_COMPONENT:
|
||||
return validatePatternComponent((PatternComponent) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_PORT:
|
||||
return validatePatternPort((PatternPort) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_LINK:
|
||||
return validatePatternLink((PatternLink) value, diagnostics, context);
|
||||
case PseimPackage.MULTIPLICITY_ELEMENT:
|
||||
return validateMultiplicityElement((MultiplicityElement) value, diagnostics, context);
|
||||
case PseimPackage.IDENTIFIED_ELEMENT:
|
||||
return validateIdentifiedElement((IdentifiedElement) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_TYPE_HS:
|
||||
return validatePatternTypeHS((PatternTypeHS) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_TYPE_FAILURE_MODE:
|
||||
return validatePatternTypeFailureMode((PatternTypeFailureMode) value, diagnostics, context);
|
||||
case PseimPackage.SAFETY_TACTIC:
|
||||
return validateSafetyTactic((SafetyTactic) value, diagnostics, context);
|
||||
case PseimPackage.LINK_TYPE:
|
||||
return validateLinkType((LinkType) value, diagnostics, context);
|
||||
case PseimPackage.PATTERN_PORT_DIRECTION:
|
||||
return validatePatternPortDirection((PatternPortDirection) value, diagnostics, context);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateLibrary(Library library, DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(library, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(library, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(library, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePattern(Pattern pattern, DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(pattern, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(pattern, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validatePropertyHolder_uniqueKeys(pattern, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateCardinalityElement(CardinalityElement cardinalityElement, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(cardinalityElement, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(cardinalityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validatePropertyHolder_uniqueKeys(cardinalityElement, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternComponent(PatternComponent patternComponent, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(patternComponent, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validateMultiplicityElement_cardinalityAsElementOrMult(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validatePropertyHolder_uniqueKeys(patternComponent, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validatePatternComponent_contentIsPatternContent(patternComponent, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cached validation expression for the contentIsPatternContent constraint of '<em>Pattern Component</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static final String PATTERN_COMPONENT__CONTENT_IS_PATTERN_CONTENT__EEXPRESSION = "content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))";
|
||||
|
||||
/**
|
||||
* Validates the contentIsPatternContent constraint of '<em>Pattern Component</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternComponent_contentIsPatternContent(PatternComponent patternComponent,
|
||||
DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
return validate(PseimPackage.Literals.PATTERN_COMPONENT, patternComponent, diagnostics, context,
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "contentIsPatternContent",
|
||||
PATTERN_COMPONENT__CONTENT_IS_PATTERN_CONTENT__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternPort(PatternPort patternPort, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(patternPort, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validateMultiplicityElement_cardinalityAsElementOrMult(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(patternPort, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validatePropertyHolder_uniqueKeys(patternPort, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternLink(PatternLink patternLink, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(patternLink, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateIdentifiedElement_uidNotEmpty(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validateNamedElement_nameNotEmpty(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= seimValidator.validatePropertyHolder_uniqueKeys(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validatePatternLink_srcIsPatternPort(patternLink, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validatePatternLink_dstIsPatternPort(patternLink, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cached validation expression for the srcIsPatternPort constraint of '<em>Pattern Link</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static final String PATTERN_LINK__SRC_IS_PATTERN_PORT__EEXPRESSION = "src.oclIsTypeOf(PatternLink)";
|
||||
|
||||
/**
|
||||
* Validates the srcIsPatternPort constraint of '<em>Pattern Link</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternLink_srcIsPatternPort(PatternLink patternLink, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return validate(PseimPackage.Literals.PATTERN_LINK, patternLink, diagnostics, context,
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "srcIsPatternPort",
|
||||
PATTERN_LINK__SRC_IS_PATTERN_PORT__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* The cached validation expression for the dstIsPatternPort constraint of '<em>Pattern Link</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static final String PATTERN_LINK__DST_IS_PATTERN_PORT__EEXPRESSION = "dst.oclIsTypeOf(PatternLink)";
|
||||
|
||||
/**
|
||||
* Validates the dstIsPatternPort constraint of '<em>Pattern Link</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternLink_dstIsPatternPort(PatternLink patternLink, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return validate(PseimPackage.Literals.PATTERN_LINK, patternLink, diagnostics, context,
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "dstIsPatternPort",
|
||||
PATTERN_LINK__DST_IS_PATTERN_PORT__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateMultiplicityElement(MultiplicityElement multiplicityElement, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
if (!validate_NoCircularContainment(multiplicityElement, diagnostics, context))
|
||||
return false;
|
||||
boolean result = validate_EveryMultiplicityConforms(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryDataValueConforms(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryReferenceIsContained(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryBidirectionalReferenceIsPaired(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryProxyResolves(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_UniqueID(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryKeyUnique(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validate_EveryMapEntryUnique(multiplicityElement, diagnostics, context);
|
||||
if (result || diagnostics != null)
|
||||
result &= validateMultiplicityElement_cardinalityAsElementOrMult(multiplicityElement, diagnostics, context);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cached validation expression for the cardinalityAsElementOrMult constraint of '<em>Multiplicity Element</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static final String MULTIPLICITY_ELEMENT__CARDINALITY_AS_ELEMENT_OR_MULT__EEXPRESSION = "(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1";
|
||||
|
||||
/**
|
||||
* Validates the cardinalityAsElementOrMult constraint of '<em>Multiplicity Element</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateMultiplicityElement_cardinalityAsElementOrMult(MultiplicityElement multiplicityElement,
|
||||
DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
return validate(PseimPackage.Literals.MULTIPLICITY_ELEMENT, multiplicityElement, diagnostics, context,
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "cardinalityAsElementOrMult",
|
||||
MULTIPLICITY_ELEMENT__CARDINALITY_AS_ELEMENT_OR_MULT__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE,
|
||||
0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateIdentifiedElement(IdentifiedElement identifiedElement, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return validate_EveryDefaultConstraint(identifiedElement, diagnostics, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternTypeHS(PatternTypeHS patternTypeHS, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternTypeFailureMode(PatternTypeFailureMode patternTypeFailureMode,
|
||||
DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateSafetyTactic(SafetyTactic safetyTactic, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validateLinkType(LinkType linkType, DiagnosticChain diagnostics, Map<Object, Object> context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean validatePatternPortDirection(PatternPortDirection patternPortDirection, DiagnosticChain diagnostics,
|
||||
Map<Object, Object> context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ResourceLocator getResourceLocator() {
|
||||
// TODO
|
||||
// Specialize this to return a resource locator for messages specific to this validator.
|
||||
// Ensure that you remove @generated or mark it @generated NOT
|
||||
return super.getResourceLocator();
|
||||
}
|
||||
|
||||
} //PseimValidator
|
||||
@@ -0,0 +1,29 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Basic Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see com.irtsaintexupery.pseim.seim.SeimPackage#getBasicProperty()
|
||||
* @model interface="true" abstract="true"
|
||||
* @generated
|
||||
*/
|
||||
public interface BasicProperty extends Property {
|
||||
} // BasicProperty
|
||||