Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/README.txt7
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/plugin.properties2
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extendedsysml.genmodel20
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extentedsysml.ecore12
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsFacets.facetSet2
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsQueries.querySet4
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/NAFlowPortDirection.java198
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsFactory.java41
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsPackage.java130
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsFactoryImpl.java150
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsPackageImpl.java175
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java25
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortIsAtomicQuery.java11
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/setter/SetFlowPortDirectionQuery.java44
14 files changed, 797 insertions, 24 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/README.txt b/plugins/sysml/org.eclipse.papyrus.sysml.facets/README.txt
new file mode 100644
index 00000000000..51c4cbfeaf5
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/README.txt
@@ -0,0 +1,7 @@
+The goal of this plugin :
+ - provide facets to represent and edit the SysML elements in the Papyrus Table. The facets allow to
+ represent and edit stereotypes properties.
+
+the goal of extendedsysml :
+ This model provides the Enumeration NAFlowPortDirection. This Enumeration is used to display N/A in the FlowPortDirection
+ when the port is not atomic. So the Facet "Direction" extends Enumerator and not FlowDirection to allow this behavior.
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/plugin.properties b/plugins/sysml/org.eclipse.papyrus.sysml.facets/plugin.properties
index f0cf24e236a..3789020ecd7 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/plugin.properties
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/plugin.properties
@@ -1,3 +1,3 @@
#Properties file for org.eclipse.papyrus.sysml.facets
providerName = Eclipse Modeling Project
-pluginName = EMF Facets for Papyrus SysML \ No newline at end of file
+pluginName = EMF Facets for Papyrus SysML
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extendedsysml.genmodel b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extendedsysml.genmodel
new file mode 100644
index 00000000000..ba39a559190
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extendedsysml.genmodel
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.papyrus.sysml.facets_branch/src"
+ modelPluginID="org.eclipse.papyrus.sysml.facets_branch" modelName="Extendedsysml"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false">
+ <foreignModel>extentedsysml.ecore</foreignModel>
+ <genPackages prefix="Extendedsysml" basePackage="org.eclipse.papyrus.sysml.facets.extendedsysml"
+ disposableProviderFactory="true" ecorePackage="extentedsysml.ecore#/">
+ <nestedGenPackages prefix="Portandflows" disposableProviderFactory="true" ecorePackage="extentedsysml.ecore#//portandflows">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="extentedsysml.ecore#//portandflows/FlowPortDirection">
+ <genEnumLiterals ecoreEnumLiteral="extentedsysml.ecore#//portandflows/FlowPortDirection/in"/>
+ <genEnumLiterals ecoreEnumLiteral="extentedsysml.ecore#//portandflows/FlowPortDirection/out"/>
+ <genEnumLiterals ecoreEnumLiteral="extentedsysml.ecore#//portandflows/FlowPortDirection/inout"/>
+ </genEnums>
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="extentedsysml.ecore#//portandflows/NAFlowPortDirection">
+ <genEnumLiterals ecoreEnumLiteral="extentedsysml.ecore#//portandflows/NAFlowPortDirection/NA"/>
+ </genEnums>
+ </nestedGenPackages>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extentedsysml.ecore b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extentedsysml.ecore
new file mode 100644
index 00000000000..154a23ae23d
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/extentedsysml.ecore
@@ -0,0 +1,12 @@
+<?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="extendedsysml"
+ nsURI="http://www.eclipse.org/papyrus/0.8.0/ExtendedSysML" nsPrefix="ExtendedSysml">
+ <eSubpackages name="portandflows" nsURI="http://www.eclipse.org/papyrus/0.7.0/ExtendedSysML/PortAndFlows"
+ nsPrefix="PortAndFlows">
+ <eClassifiers xsi:type="ecore:EEnum" name="NAFlowPortDirection" instanceTypeName="NAFlowPortDirection">
+ <eLiterals name="NA" literal="N/A"/>
+ </eClassifiers>
+ </eSubpackages>
+</ecore:EPackage>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsFacets.facetSet b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsFacets.facetSet
index 2c84994c523..4a1595523df 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsFacets.facetSet
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsFacets.facetSet
@@ -7,7 +7,7 @@
<valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/portAndFlowsQueries#GetFlowPortIsAtomicQuery"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="facet:FacetAttribute" name="direction" volatile="true" unsettable="true">
- <eType xsi:type="ecore:EEnum" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows/FlowDirection"/>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EEnumerator"/>
<valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/portAndFlowsQueries#GetFlowPortDirectionQuery"/>
<setQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/portAndFlowsQueries#SetFlowPortDirectionQuery"/>
</eStructuralFeatures>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsQueries.querySet b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsQueries.querySet
index 703f5dc4188..7c1fedbeb5c 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsQueries.querySet
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/portAndFlowsQueries.querySet
@@ -8,11 +8,11 @@
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Port"/>
</queries>
<queries xsi:type="query:JavaModelQuery" name="GetFlowPortDirectionQuery" description="Query to qet the attribute &quot;Direction&quot; of the FlowPort" implementationClassName="org.eclipse.papyrus.sysml.facets.portandflows.query.value.getter.GetFlowPortDirectionQuery">
- <returnType xsi:type="ecore:EEnum" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows/FlowDirection"/>
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EEnumerator"/>
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Port"/>
</queries>
<queries xsi:type="query:JavaModelQuery" name="SetFlowPortDirectionQuery" description="Query to qet the attribute &quot;Direction&quot; of the FlowPort" implementationClassName="org.eclipse.papyrus.sysml.facets.portandflows.query.value.setter.SetFlowPortDirectionQuery">
- <returnType xsi:type="ecore:EEnum" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows/FlowDirection"/>
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EEnumerator"/>
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Port"/>
</queries>
</query:ModelQuerySet>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/NAFlowPortDirection.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/NAFlowPortDirection.java
new file mode 100644
index 00000000000..fa4ef9b6907
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/NAFlowPortDirection.java
@@ -0,0 +1,198 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows;
+
+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>NA Flow Port Direction</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsPackage#getNAFlowPortDirection()
+ * @model instanceClass="org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection"
+ * @generated
+ */
+public enum NAFlowPortDirection implements Enumerator {
+ /**
+ * The '<em><b>NA</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #NA_VALUE
+ * @generated
+ * @ordered
+ */
+ NA(0, "NA", "N/A");
+
+ /**
+ * The '<em><b>NA</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>NA</b></em>' literal object isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @see #NA
+ * @model literal="N/A"
+ * @generated
+ * @ordered
+ */
+ public static final int NA_VALUE = 0;
+
+ /**
+ * An array of all the '<em><b>NA Flow Port Direction</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static final NAFlowPortDirection[] VALUES_ARRAY = new NAFlowPortDirection[]{ NA, };
+
+ /**
+ * A public read-only list of all the '<em><b>NA Flow Port Direction</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final List<NAFlowPortDirection> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>NA Flow Port Direction</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static NAFlowPortDirection get(String literal) {
+ for(int i = 0; i < VALUES_ARRAY.length; ++i) {
+ NAFlowPortDirection result = VALUES_ARRAY[i];
+ if(result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>NA Flow Port Direction</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static NAFlowPortDirection getByName(String name) {
+ for(int i = 0; i < VALUES_ARRAY.length; ++i) {
+ NAFlowPortDirection result = VALUES_ARRAY[i];
+ if(result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>NA Flow Port Direction</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static NAFlowPortDirection get(int value) {
+ switch(value) {
+ case NA_VALUE:
+ return NA;
+ }
+ 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 NAFlowPortDirection(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;
+ }
+
+} //NAFlowPortDirection
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsFactory.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsFactory.java
new file mode 100644
index 00000000000..8517e729810
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsFactory.java
@@ -0,0 +1,41 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows;
+
+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 org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsPackage
+ * @generated
+ */
+public interface PortandflowsFactory extends EFactory {
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ PortandflowsFactory eINSTANCE = org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl.PortandflowsFactoryImpl.init();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the package supported by this factory.
+ * @generated
+ */
+ PortandflowsPackage getPortandflowsPackage();
+
+} //PortandflowsFactory
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsPackage.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsPackage.java
new file mode 100644
index 00000000000..d29c765c961
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/PortandflowsPackage.java
@@ -0,0 +1,130 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows;
+
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface PortandflowsPackage extends EPackage {
+
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNAME = "portandflows";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/papyrus/0.7.0/ExtendedSysML/PortAndFlows";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNS_PREFIX = "PortAndFlows";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ PortandflowsPackage eINSTANCE = org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl.PortandflowsPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * <em>NA Flow Port Direction</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl.PortandflowsPackageImpl#getNAFlowPortDirection()
+ * @generated
+ */
+ int NA_FLOW_PORT_DIRECTION = 0;
+
+
+ /**
+ * Returns the meta object for enum '{@link org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * <em>NA Flow Port Direction</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for enum '<em>NA Flow Port Direction</em>'.
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * @generated
+ */
+ EEnum getNAFlowPortDirection();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ PortandflowsFactory getPortandflowsFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ interface Literals {
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * <em>NA Flow Port Direction</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection
+ * @see org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl.PortandflowsPackageImpl#getNAFlowPortDirection()
+ * @generated
+ */
+ EEnum NA_FLOW_PORT_DIRECTION = eINSTANCE.getNAFlowPortDirection();
+
+ }
+
+} //PortandflowsPackage
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsFactoryImpl.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsFactoryImpl.java
new file mode 100644
index 00000000000..b215fe62a44
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsFactoryImpl.java
@@ -0,0 +1,150 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl;
+
+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.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PortandflowsFactoryImpl extends EFactoryImpl implements PortandflowsFactory {
+
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static PortandflowsFactory init() {
+ try {
+ PortandflowsFactory thePortandflowsFactory = (PortandflowsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/0.7.0/ExtendedSysML/PortAndFlows");
+ if(thePortandflowsFactory != null) {
+ return thePortandflowsFactory;
+ }
+ } catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new PortandflowsFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PortandflowsFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch(eClass.getClassifierID()) {
+ 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 PortandflowsPackage.NA_FLOW_PORT_DIRECTION:
+ return createNAFlowPortDirectionFromString(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 PortandflowsPackage.NA_FLOW_PORT_DIRECTION:
+ return convertNAFlowPortDirectionToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NAFlowPortDirection createNAFlowPortDirectionFromString(EDataType eDataType, String initialValue) {
+ NAFlowPortDirection result = NAFlowPortDirection.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 convertNAFlowPortDirectionToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PortandflowsPackage getPortandflowsPackage() {
+ return (PortandflowsPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static PortandflowsPackage getPackage() {
+ return PortandflowsPackage.eINSTANCE;
+ }
+
+} //PortandflowsFactoryImpl
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsPackageImpl.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsPackageImpl.java
new file mode 100644
index 00000000000..ad7425bd84a
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/extendedsysml/extendedsysml/portandflows/impl/PortandflowsPackageImpl.java
@@ -0,0 +1,175 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.impl;
+
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection;
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsFactory;
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PortandflowsPackageImpl extends EPackageImpl implements PortandflowsPackage {
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EEnum naFlowPortDirectionEEnum = 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 org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.PortandflowsPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private PortandflowsPackageImpl() {
+ super(eNS_URI, PortandflowsFactory.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 PortandflowsPackage#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 PortandflowsPackage init() {
+ if(isInited)
+ return (PortandflowsPackage)EPackage.Registry.INSTANCE.getEPackage(PortandflowsPackage.eNS_URI);
+
+ // Obtain or create and register package
+ PortandflowsPackageImpl thePortandflowsPackage = (PortandflowsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PortandflowsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PortandflowsPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ thePortandflowsPackage.createPackageContents();
+
+ // Initialize created meta-data
+ thePortandflowsPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thePortandflowsPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(PortandflowsPackage.eNS_URI, thePortandflowsPackage);
+ return thePortandflowsPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EEnum getNAFlowPortDirection() {
+ return naFlowPortDirectionEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PortandflowsFactory getPortandflowsFactory() {
+ return (PortandflowsFactory)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 enums
+ naFlowPortDirectionEEnum = createEEnum(NA_FLOW_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);
+
+ // Initialize enums and add enum literals
+ initEEnum(naFlowPortDirectionEEnum, NAFlowPortDirection.class, "NAFlowPortDirection");
+ addEEnumLiteral(naFlowPortDirectionEEnum, NAFlowPortDirection.NA);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //PortandflowsPackageImpl
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
index 56ed15c1956..5b7fbdadde1 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortDirectionQuery.java
@@ -1,21 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.sysml.facets.portandflows.query.value.getter;
+import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection;
import org.eclipse.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.util.ElementUtil;
import org.eclipse.uml2.uml.Port;
/** Query to qet the attribute "Direction" of the FlowPort */
-public class GetFlowPortDirectionQuery implements IJavaModelQuery<Port, FlowDirection> {
+public class GetFlowPortDirectionQuery implements IJavaModelQuery<Port, Enumerator> {
- public FlowDirection evaluate(final Port context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
+ public Enumerator evaluate(final Port context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
FlowPort flowPort = ElementUtil.getStereotypeApplication(context, FlowPort.class);
if(flowPort != null) {
- return flowPort.getDirection();
+ if(flowPort.isIsAtomic()) {
+ return flowPort.getDirection();
+ } else {
+ return NAFlowPortDirection.get(0);
+ }
}
return null;
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortIsAtomicQuery.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortIsAtomicQuery.java
index 03dbb606914..f3f6c02038f 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortIsAtomicQuery.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/getter/GetFlowPortIsAtomicQuery.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.sysml.facets.portandflows.query.value.getter;
import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/setter/SetFlowPortDirectionQuery.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/setter/SetFlowPortDirectionQuery.java
index 757d1754e98..cb2061afa72 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/setter/SetFlowPortDirectionQuery.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/portandflows/query/value/setter/SetFlowPortDirectionQuery.java
@@ -1,4 +1,16 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.sysml.facets.portandflows.query.value.setter;
+
import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -10,8 +22,8 @@ import org.eclipse.papyrus.core.services.ServiceException;
import org.eclipse.papyrus.core.utils.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.papyrus.gmf.diagram.common.commands.IdentityCommandWithNotification;
+import org.eclipse.papyrus.sysml.facets.extendedsysml.extendedsysml.portandflows.NAFlowPortDirection;
import org.eclipse.papyrus.sysml.facets.messages.Messages;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
import org.eclipse.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
import org.eclipse.papyrus.sysml.util.ElementUtil;
@@ -19,15 +31,16 @@ import org.eclipse.papyrus.ui.toolbox.notification.Type;
import org.eclipse.uml2.uml.Port;
/** Query to qet the attribute "Direction" of the FlowPort */
-public class SetFlowPortDirectionQuery implements IJavaModelQueryWithEditingDomain<Port, FlowDirection> {
+public class SetFlowPortDirectionQuery implements IJavaModelQueryWithEditingDomain<Port, Enumerator> {
- public FlowDirection evaluate(final Port context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
+ public Enumerator evaluate(final Port context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
//nothing to do
return null;
}
- public FlowDirection evaluate(Port context, ParameterValueList parameterValues, EditingDomain editingDomain) throws ModelQueryExecutionException {
+
+ @Override
+ public Enumerator evaluate(Port context, ParameterValueList parameterValues, EditingDomain editingDomain) throws ModelQueryExecutionException {
FlowPort flowPort = ElementUtil.getStereotypeApplication(context, FlowPort.class);
if(flowPort != null) {
@@ -37,24 +50,25 @@ public class SetFlowPortDirectionQuery implements IJavaModelQueryWithEditingDoma
// Retrieve new value from parameter and update if the property value has changed.
Enumerator newValue = (parameterValues.get(0).getValue() instanceof Enumerator) ? (Enumerator)parameterValues.get(0).getValue() : null;
- if(newValue != flowPort.getDirection()) {
- try {
- TransactionalEditingDomain domain = ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
- SetCommand command = new SetCommand(domain, flowPort, PortandflowsPackage.eINSTANCE.getFlowPort_Direction(), newValue);
- if(command.canExecute()) {
- domain.getCommandStack().execute(command);
+ if(!(newValue instanceof NAFlowPortDirection)) {//we do nothing in this case
+ if(newValue != flowPort.getDirection()) {
+ try {
+ TransactionalEditingDomain domain = ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
+ SetCommand command = new SetCommand(domain, flowPort, PortandflowsPackage.eINSTANCE.getFlowPort_Direction(), newValue);
+ if(command.canExecute()) {
+ domain.getCommandStack().execute(command);
+ }
+
+ } catch (ServiceException e) {
+ throw new ModelQueryExecutionException(e);
}
- } catch (ServiceException e) {
- throw new ModelQueryExecutionException(e);
}
-
}
}
} else {
editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new IdentityCommandWithNotification(Messages.SetRequirementTextQuery_AssignmentCantBeDone, "The edited element is not a SysML FlowPort.", Type.ERROR)));
}
-
return null;
}
}

Back to the top