[Quality] Fix Sonar code smell
- move component version to 0.0.23
- refactor the code to use the same context
SysMLServiceTypeUtil.SYSML14_CONTEXT_ID
- add SysMLServiceTypeUtil.isKnow utility
- remove deprecated unused FixedPortPositionLocator and
PrivatePackageImportEditHelperAdvice
- use non deprecated constructor for ParameterPositionLocator
- fix commented tests
Change-Id: I3aac292bfb0688eacad7228d2bbf10a9a0273d4d
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/PrivatePackageImportTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/PrivatePackageImportTest.java
index 4d82d73..5aa34fe 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/PrivatePackageImportTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/PrivatePackageImportTest.java
@@ -30,6 +30,7 @@
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.eclipse.papyrus.sysml14.util.SysMLResource;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.PackageImport;
@@ -50,7 +51,7 @@
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet.extension");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
@@ -69,7 +70,7 @@
IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(model);
ICommand editCommand = commandService.getEditCommand(validRequest);
- Assert.assertTrue("The command for creating a provate package import should be executable", editCommand.canExecute());
+ Assert.assertTrue("The command for creating a private package import should be executable", editCommand.canExecute());
InternalTransaction startTransaction = editingDomain.startTransaction(false, null);
editingDomain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(editCommand));
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SharedAssociationTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SharedAssociationTest.java
index 01c56d4..5a3c4f9 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SharedAssociationTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SharedAssociationTest.java
@@ -30,6 +30,7 @@
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.eclipse.papyrus.sysml14.util.SysMLResource;
import org.eclipse.uml2.uml.AggregationKind;
import org.eclipse.uml2.uml.Association;
@@ -51,7 +52,7 @@
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet.extension");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesExtensionTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesExtensionTest.java
index 9735343..fa2cd8c 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesExtensionTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesExtensionTest.java
@@ -23,15 +23,12 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
-import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
import org.eclipse.papyrus.infra.types.AbstractMatcherConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.SpecializationTypeConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
@@ -52,7 +49,7 @@
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet.extension");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
@@ -67,8 +64,8 @@
}
/**
- * Check that all SpecializationTypeConfiguration have a matcher (avoid to broke UML Diagrams)
- * TODO #482245 : a validation should be added to Papyrus core
+ * Check that all SpecializationTypeConfiguration have a matcher
+ * (This is no more required for avoiding to broke UML Diagrams since contextid but still a good idea)
*/
@Test
public void checkElementTypeMatcher() {
@@ -94,60 +91,49 @@
}
}
- // TODO: no utility class in tests
- private boolean isknown(String elementTypeId) {
- try {
- IClientContext context = TypeContext.getContext("org.eclipse.papyrus.infra.services.edit.TypeContext");
- IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(context);
- return editServiceProvider.isKnownElementType(elementTypeId);
- } catch (Exception e) {
- return false;
- }
- }
-
@Test
public void testRegistryContentForUnit() {
- Assert.assertTrue("Unit element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Unit"));
+ Assert.assertTrue("Unit element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Unit"));
}
@Test
public void testRegistryContentForQuantityKind() {
- Assert.assertTrue("QuantityKind element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.QuantityKind"));
+ Assert.assertTrue("QuantityKind element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.QuantityKind"));
}
@Test
public void testRegistryContentForPartAssociation() {
- Assert.assertTrue("PartAssociation element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.PartAssociation"));
+ Assert.assertTrue("PartAssociation element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.PartAssociation"));
}
@Test
public void testRegistryContentForSharedAssociation() {
- Assert.assertTrue("SharedAssociation element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.SharedAssociation"));
+ Assert.assertTrue("SharedAssociation element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.SharedAssociation"));
}
@Test
public void testRegistryContentForConstraintProperty() {
- Assert.assertTrue("ConstraintProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ConstraintProperty"));
+ Assert.assertTrue("ConstraintProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ConstraintProperty"));
}
@Test
public void testRegistryContentForActorPart() {
- Assert.assertTrue("ActorPart element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ActorPart"));
+ Assert.assertTrue("ActorPart element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ActorPart"));
}
@Test
public void testRegistryContentForValue() {
- Assert.assertTrue("Value element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Value"));
+ Assert.assertTrue("Value element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Value"));
}
@Test
public void testRegistryContentForReference() {
- Assert.assertTrue("Reference element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Reference"));
+ Assert.assertTrue("Reference element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Reference"));
}
@Test
public void testRegistryContentForPart() {
- Assert.assertTrue("Part element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Part"));
+ Assert.assertTrue("Part element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Part"));
}
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesTest.java
index 731d90d..a0612ff 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/SysML14ElementTypesTest.java
@@ -15,12 +15,9 @@
import java.util.Map;
-import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
-import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -38,380 +35,369 @@
public static void loadSysml14Defintion() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
}
-
- // TODO: no utility class in tests
- private boolean isknown(String elementTypeId) {
- try {
- IClientContext context = TypeContext.getContext("org.eclipse.papyrus.infra.services.edit.TypeContext");
- IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(context);
- return editServiceProvider.isKnownElementType(elementTypeId);
- } catch (Exception e) {
- return false;
- }
- }
-
+
@Test
public void testRegistryContentForAcceptChangeStructuralFeatureEventAction() {
- Assert.assertTrue("AcceptChangeStructuralFeatureEventAction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.AcceptChangeStructuralFeatureEventAction"));
+ Assert.assertTrue("AcceptChangeStructuralFeatureEventAction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.AcceptChangeStructuralFeatureEventAction"));
}
@Test
public void testRegistryContentForAdjunctProperty() {
- Assert.assertTrue("AdjunctProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.AdjunctProperty"));
+ Assert.assertTrue("AdjunctProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.AdjunctProperty"));
}
@Test
public void testRegistryContentForAllocateActivityPartition() {
- Assert.assertTrue("AllocateActivityPartition element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.AllocateActivityPartition"));
+ Assert.assertTrue("AllocateActivityPartition element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.AllocateActivityPartition"));
}
@Test
public void testRegistryContentForAllocateAbstraction() {
- Assert.assertTrue("Allocate Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Allocate_Abstraction"));
+ Assert.assertTrue("Allocate Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Allocate_Abstraction"));
}
@Test
public void testRegistryContentForAllocateDirectedRelationship() {
- Assert.assertTrue("Allocate DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Allocate_DirectedRelationship"));
+ Assert.assertTrue("Allocate DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Allocate_DirectedRelationship"));
}
@Test
public void testRegistryContentForBindingConnector() {
- Assert.assertTrue("BindingConnector element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.BindingConnector"));
+ Assert.assertTrue("BindingConnector element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.BindingConnector"));
}
@Test
public void testRegistryContentForBlock() {
- Assert.assertTrue("Block element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Block"));
+ Assert.assertTrue("Block element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Block"));
}
@Test
public void testRegistryContentForBoundReference() {
- Assert.assertTrue("BoundReference element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.BoundReference"));
+ Assert.assertTrue("BoundReference element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.BoundReference"));
}
@Test
public void testRegistryContentForChangeStructuralFeatureEvent() {
- Assert.assertTrue("ChangeStructuralFeatureEvent element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ChangeStructuralFeatureEvent"));
+ Assert.assertTrue("ChangeStructuralFeatureEvent element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ChangeStructuralFeatureEvent"));
}
@Test
public void testRegistryContentForClassifierBehaviorProperty() {
- Assert.assertTrue("ClassifierBehaviorProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ClassifierBehaviorProperty"));
+ Assert.assertTrue("ClassifierBehaviorProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ClassifierBehaviorProperty"));
}
@Test
public void testRegistryContentForConform() {
- Assert.assertTrue("Conform element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Conform"));
+ Assert.assertTrue("Conform element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Conform"));
}
@Test
public void testRegistryContentForConnectorProperty() {
- Assert.assertTrue("ConnectorProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ConnectorProperty"));
+ Assert.assertTrue("ConnectorProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ConnectorProperty"));
}
@Test
public void testRegistryContentForConstraintBlock() {
- Assert.assertTrue("ConstraintBlock element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ConstraintBlock"));
+ Assert.assertTrue("ConstraintBlock element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ConstraintBlock"));
}
@Test
public void testRegistryContentForContinuousActivityEdge() {
- Assert.assertTrue("Continuous ActivityEdge element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Continuous_ActivityEdge"));
+ Assert.assertTrue("Continuous ActivityEdge element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Continuous_ActivityEdge"));
}
@Test
public void testRegistryContentForContinuousObjectNode() {
- Assert.assertTrue("Continuous ObjectNode element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Continuous_ObjectNode"));
+ Assert.assertTrue("Continuous ObjectNode element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Continuous_ObjectNode"));
}
@Test
public void testRegistryContentForContinuousParameter() {
- Assert.assertTrue("Continuous Parameter element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Continuous_Parameter"));
+ Assert.assertTrue("Continuous Parameter element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Continuous_Parameter"));
}
@Test
public void testRegistryContentForControlOperatorBehavior() {
- Assert.assertTrue("ControlOperator Behavior element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ControlOperator_Behavior"));
+ Assert.assertTrue("ControlOperator Behavior element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ControlOperator_Behavior"));
}
@Test
public void testRegistryContentForControlOperatorOperation() {
- Assert.assertTrue("ControlOperator Operation element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ControlOperator_Operation"));
+ Assert.assertTrue("ControlOperator Operation element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ControlOperator_Operation"));
}
@Test
public void testRegistryContentForCopyAbstraction() {
- Assert.assertTrue("Copy Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Copy_Abstraction"));
+ Assert.assertTrue("Copy Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Copy_Abstraction"));
}
@Test
public void testRegistryContentForCopyDirectedRelationship() {
- Assert.assertTrue("Copy DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Copy_DirectedRelationship"));
+ Assert.assertTrue("Copy DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Copy_DirectedRelationship"));
}
@Test
public void testRegistryContentForDeriveReqtAbstraction() {
- Assert.assertTrue("DeriveReqt Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.DeriveReqt_Abstraction"));
+ Assert.assertTrue("DeriveReqt Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.DeriveReqt_Abstraction"));
}
@Test
public void testRegistryContentForDeriveReqtDirectedRelationship() {
- Assert.assertTrue("DeriveReqt DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.DeriveReqt_DirectedRelationship"));
+ Assert.assertTrue("DeriveReqt DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.DeriveReqt_DirectedRelationship"));
}
@Test
public void testRegistryContentForDirectedFeature() {
- Assert.assertTrue("DirectedFeature element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.DirectedFeature"));
+ Assert.assertTrue("DirectedFeature element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.DirectedFeature"));
}
@Test
public void testRegistryContentForDirectedRelationshipPropertyPath() {
- Assert.assertTrue("DirectedRelationshipPropertyPath element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.DirectedRelationshipPropertyPath"));
+ Assert.assertTrue("DirectedRelationshipPropertyPath element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.DirectedRelationshipPropertyPath"));
}
@Test
public void testRegistryContentForDiscreteActivityEdge() {
- Assert.assertTrue("Discrete ActivityEdge element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Discrete_ActivityEdge"));
+ Assert.assertTrue("Discrete ActivityEdge element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Discrete_ActivityEdge"));
}
@Test
public void testRegistryContentForDiscreteObjectNode() {
- Assert.assertTrue("Discrete ObjectNode element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Discrete_ObjectNode"));
+ Assert.assertTrue("Discrete ObjectNode element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Discrete_ObjectNode"));
}
@Test
public void testRegistryContentForDiscreteParameter() {
- Assert.assertTrue("Discrete Parameter element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Discrete_Parameter"));
+ Assert.assertTrue("Discrete Parameter element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Discrete_Parameter"));
}
@Test
public void testRegistryContentForDistributedProperty() {
- Assert.assertTrue("DistributedProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.DistributedProperty"));
+ Assert.assertTrue("DistributedProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.DistributedProperty"));
}
@Test
public void testRegistryContentForElementGroup() {
- Assert.assertTrue("ElementGroup element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ElementGroup"));
+ Assert.assertTrue("ElementGroup element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ElementGroup"));
}
@Test
public void testRegistryContentForElementPropertyPath() {
- Assert.assertTrue("ElementPropertyPath element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ElementPropertyPath"));
+ Assert.assertTrue("ElementPropertyPath element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ElementPropertyPath"));
}
@Test
public void testRegistryContentForEndPathMultiplicity() {
- Assert.assertTrue("EndPathMultiplicity element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.EndPathMultiplicity"));
+ Assert.assertTrue("EndPathMultiplicity element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.EndPathMultiplicity"));
}
@Test
public void testRegistryContentForExpose() {
- Assert.assertTrue("Expose element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Expose"));
+ Assert.assertTrue("Expose element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Expose"));
}
@Test
public void testRegistryContentForFlowPort() {
- Assert.assertTrue("FlowPort element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.FlowPort"));
+ Assert.assertTrue("FlowPort element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.FlowPort"));
}
@Test
public void testRegistryContentForFlowProperty() {
- Assert.assertTrue("FlowProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.FlowProperty"));
+ Assert.assertTrue("FlowProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.FlowProperty"));
}
@Test
public void testRegistryContentForFlowSpecification() {
- Assert.assertTrue("FlowSpecification element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.FlowSpecification"));
+ Assert.assertTrue("FlowSpecification element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.FlowSpecification"));
}
@Test
public void testRegistryContentForFullPort() {
- Assert.assertTrue("FullPort element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.FullPort"));
+ Assert.assertTrue("FullPort element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.FullPort"));
}
@Test
public void testRegistryContentForInterfaceBlock() {
- Assert.assertTrue("InterfaceBlock element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.InterfaceBlock"));
+ Assert.assertTrue("InterfaceBlock element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.InterfaceBlock"));
}
@Test
public void testRegistryContentForInvocationOnNestedPortActionElement() {
- Assert.assertTrue("InvocationOnNestedPortAction Element element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_Element"));
+ Assert.assertTrue("InvocationOnNestedPortAction Element element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_Element"));
}
@Test
public void testRegistryContentForInvocationOnNestedPortActionInvocationAction() {
- Assert.assertTrue("InvocationOnNestedPortAction InvocationAction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_InvocationAction"));
+ Assert.assertTrue("InvocationOnNestedPortAction InvocationAction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_InvocationAction"));
}
@Test
public void testRegistryContentForItemFlow() {
- Assert.assertTrue("ItemFlow element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ItemFlow"));
+ Assert.assertTrue("ItemFlow element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ItemFlow"));
}
@Test
public void testRegistryContentForNestedConnectorEndConnectorEnd() {
- Assert.assertTrue("NestedConnectorEnd ConnectorEnd element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.NestedConnectorEnd_ConnectorEnd"));
+ Assert.assertTrue("NestedConnectorEnd ConnectorEnd element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.NestedConnectorEnd_ConnectorEnd"));
}
@Test
public void testRegistryContentForNestedConnectorEndElement() {
- Assert.assertTrue("NestedConnectorEnd Element element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.NestedConnectorEnd_Element"));
+ Assert.assertTrue("NestedConnectorEnd Element element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.NestedConnectorEnd_Element"));
}
@Test
public void testRegistryContentForNoBuffer() {
- Assert.assertTrue("NoBuffer element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.NoBuffer"));
+ Assert.assertTrue("NoBuffer element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.NoBuffer"));
}
@Test
public void testRegistryContentForOptional() {
- Assert.assertTrue("Optional element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Optional"));
+ Assert.assertTrue("Optional element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Optional"));
}
@Test
public void testRegistryContentForOverwrite() {
- Assert.assertTrue("Overwrite element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Overwrite"));
+ Assert.assertTrue("Overwrite element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Overwrite"));
}
@Test
public void testRegistryContentForParticipantProperty() {
- Assert.assertTrue("ParticipantProperty element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ParticipantProperty"));
+ Assert.assertTrue("ParticipantProperty element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ParticipantProperty"));
}
@Test
public void testRegistryContentForProbabilityActivityEdge() {
- Assert.assertTrue("Probability ActivityEdge element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Probability_ActivityEdge"));
+ Assert.assertTrue("Probability ActivityEdge element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Probability_ActivityEdge"));
}
@Test
public void testRegistryContentForProbabilityParameterSet() {
- Assert.assertTrue("Probability ParameterSet element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Probability_ParameterSet"));
+ Assert.assertTrue("Probability ParameterSet element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Probability_ParameterSet"));
}
@Test
public void testRegistryContentForProblem() {
- Assert.assertTrue("Problem element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Problem"));
+ Assert.assertTrue("Problem element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Problem"));
}
@Test
public void testRegistryContentForPropertySpecificType() {
- Assert.assertTrue("PropertySpecificType element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.PropertySpecificType"));
+ Assert.assertTrue("PropertySpecificType element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.PropertySpecificType"));
}
@Test
public void testRegistryContentForProxyPort() {
- Assert.assertTrue("ProxyPort element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ProxyPort"));
+ Assert.assertTrue("ProxyPort element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ProxyPort"));
}
@Test
public void testRegistryContentForRateActivityEdge() {
- Assert.assertTrue("Rate ActivityEdge element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Rate_ActivityEdge"));
+ Assert.assertTrue("Rate ActivityEdge element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Rate_ActivityEdge"));
}
@Test
public void testRegistryContentForRateObjectNode() {
- Assert.assertTrue("Rate ObjectNode element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Rate_ObjectNode"));
+ Assert.assertTrue("Rate ObjectNode element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Rate_ObjectNode"));
}
@Test
public void testRegistryContentForRateParameter() {
- Assert.assertTrue("Rate Parameter element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Rate_Parameter"));
+ Assert.assertTrue("Rate Parameter element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Rate_Parameter"));
}
@Test
public void testRegistryContentForRationale() {
- Assert.assertTrue("Rationale element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Rationale"));
+ Assert.assertTrue("Rationale element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Rationale"));
}
@Test
public void testRegistryContentForRefineAbstraction() {
- Assert.assertTrue("Refine Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Refine_Abstraction"));
+ Assert.assertTrue("Refine Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Refine_Abstraction"));
}
@Test
public void testRegistryContentForRefineDirectedRelationship() {
- Assert.assertTrue("Refine DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Refine_DirectedRelationship"));
+ Assert.assertTrue("Refine DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Refine_DirectedRelationship"));
}
@Test
public void testRegistryContentForRequirement() {
- Assert.assertTrue("Requirement element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Requirement"));
+ Assert.assertTrue("Requirement element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Requirement"));
}
@Test
public void testRegistryContentForSatisfyAbstraction() {
- Assert.assertTrue("Satisfy Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Satisfy_Abstraction"));
+ Assert.assertTrue("Satisfy Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Satisfy_Abstraction"));
}
@Test
public void testRegistryContentForSatisfyDirectedRelationship() {
- Assert.assertTrue("Satisfy DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Satisfy_DirectedRelationship"));
+ Assert.assertTrue("Satisfy DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Satisfy_DirectedRelationship"));
}
@Test
public void testRegistryContentForStakeholder() {
- Assert.assertTrue("Stakeholder element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Stakeholder"));
+ Assert.assertTrue("Stakeholder element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Stakeholder"));
}
@Test
public void testRegistryContentForTestCaseBehavior() {
- Assert.assertTrue("TestCase Behavior element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.TestCase_Behavior"));
+ Assert.assertTrue("TestCase Behavior element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.TestCase_Behavior"));
}
@Test
public void testRegistryContentForTestCaseOperation() {
- Assert.assertTrue("TestCase Operation element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.TestCase_Operation"));
+ Assert.assertTrue("TestCase Operation element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.TestCase_Operation"));
}
@Test
public void testRegistryContentForTraceAbstraction() {
- Assert.assertTrue("Trace Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Trace_Abstraction"));
+ Assert.assertTrue("Trace Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Trace_Abstraction"));
}
@Test
public void testRegistryContentForTraceDirectedRelationship() {
- Assert.assertTrue("Trace DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Trace_DirectedRelationship"));
+ Assert.assertTrue("Trace DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Trace_DirectedRelationship"));
}
@Test
public void testRegistryContentForTriggerOnNestedPortElement() {
- Assert.assertTrue("TriggerOnNestedPort Element element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Element"));
+ Assert.assertTrue("TriggerOnNestedPort Element element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Element"));
}
@Test
public void testRegistryContentForTriggerOnNestedPortTrigger() {
- Assert.assertTrue("TriggerOnNestedPort Trigger element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Trigger"));
+ Assert.assertTrue("TriggerOnNestedPort Trigger element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Trigger"));
}
@Test
public void testRegistryContentForValueType() {
- Assert.assertTrue("ValueType element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.ValueType"));
+ Assert.assertTrue("ValueType element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.ValueType"));
}
@Test
public void testRegistryContentForVerifyAbstraction() {
- Assert.assertTrue("Verify Abstraction element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Verify_Abstraction"));
+ Assert.assertTrue("Verify Abstraction element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Verify_Abstraction"));
}
@Test
public void testRegistryContentForVerifyDirectedRelationship() {
- Assert.assertTrue("Verify DirectedRelationship element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Verify_DirectedRelationship"));
+ Assert.assertTrue("Verify DirectedRelationship element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Verify_DirectedRelationship"));
}
@Test
public void testRegistryContentForView() {
- Assert.assertTrue("View element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.View"));
+ Assert.assertTrue("View element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.View"));
}
@Test
public void testRegistryContentForViewpoint() {
- Assert.assertTrue("Viewpoint element type not found in SysML element type set ", isknown("org.eclipse.papyrus.SysML14.Viewpoint"));
+ Assert.assertTrue("Viewpoint element type not found in SysML element type set ", SysMLServiceTypeUtil.isKnown("org.eclipse.papyrus.SysML14.Viewpoint"));
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformCreationEditHelperAdviceTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformCreationEditHelperAdviceTest.java
index 7639a78..1ef7769 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformCreationEditHelperAdviceTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformCreationEditHelperAdviceTest.java
@@ -44,7 +44,7 @@
public static void loadSysml14Definition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformReorientEditHelperAdviceTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformReorientEditHelperAdviceTest.java
index d369942..4011874 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformReorientEditHelperAdviceTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/ConformReorientEditHelperAdviceTest.java
@@ -23,6 +23,7 @@
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.sysml14.modelelements.ModelelementsPackage;
import org.eclipse.papyrus.sysml14.service.types.advice.ConformReorientEditHelperAdvice;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.eclipse.papyrus.sysml14.util.SysMLResource;
import org.eclipse.uml2.uml.Abstraction;
import org.eclipse.uml2.uml.Class;
@@ -45,7 +46,7 @@
public static void loadSysml14Definition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/DirectedRelationshipPropertyPathEditHelperAdviceTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/DirectedRelationshipPropertyPathEditHelperAdviceTest.java
index 2eeadb6..c8efe2d 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/DirectedRelationshipPropertyPathEditHelperAdviceTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/advice/DirectedRelationshipPropertyPathEditHelperAdviceTest.java
@@ -41,7 +41,7 @@
public static void loadSysml14Definition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/SetNestedPathCommandTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/SetNestedPathCommandTest.java
index 0970645..847e3d5 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/SetNestedPathCommandTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/SetNestedPathCommandTest.java
@@ -56,7 +56,7 @@
public static void loadSysml14Defintion() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/util/SysMLServiceTypeUtilTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/util/SysMLServiceTypeUtilTest.java
index e0230a1..ad2cc58 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/util/SysMLServiceTypeUtilTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/util/SysMLServiceTypeUtilTest.java
@@ -18,9 +18,6 @@
import java.util.Map;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
@@ -45,7 +42,7 @@
public static void loadSysml14Defintion() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet");
Assert.assertNotNull("The SysML 1.4 element type set definition is missing", elementTypeSetConfiguration);
ElementTypeSetConfiguration elementTypeSetConfigurationExtension = map.get("org.eclipse.papyrus.sysml14.service.types.elementTypeSet.extension");
@@ -60,9 +57,8 @@
* @throws IllegalAccessException
* @throws ServiceException
*/
- @Test //TODO: use correct SysML 1.4 context
+ @Test
public void testElementTypeIdsDefinedAsConstant() throws IllegalArgumentException, IllegalAccessException, ServiceException {
- IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(TypeContext.getContext("org.eclipse.papyrus.infra.services.edit.TypeContext"));
Field[] declaredFields = SysMLServiceTypeUtil.class.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i];
@@ -70,7 +66,7 @@
String name = field.getName();
Object value = field.get(SysMLServiceTypeUtil.class);
Assert.assertTrue(name+" value should define as a String", value instanceof String);
- boolean knownElementType = editServiceProvider.isKnownElementType((String) value);
+ boolean knownElementType = SysMLServiceTypeUtil.isKnown((String) value);
Assert.assertTrue(name+" value should define an existing elementtype id", knownElementType);
}
}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types/model/SysML14-extension.elementtypesconfigurations b/core/org.eclipse.papyrus.sysml14.service.types/model/SysML14-extension.elementtypesconfigurations
index 49eac3c..f565ae4 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types/model/SysML14-extension.elementtypesconfigurations
+++ b/core/org.eclipse.papyrus.sysml14.service.types/model/SysML14-extension.elementtypesconfigurations
@@ -95,7 +95,7 @@
<specializedTypes xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.AssociationClass"/>
</elementTypeConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_TpKq0FFwEeWPz5cwbRdVrg" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_001" identifier="org.eclipse.papyru.sysml14.advice.ConformCreation" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ConformCreationEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Classifier"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Classifier"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_HjxKkIe7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_pt2vIFIiEeWPz5cwbRdVrg" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_001" identifier="org.eclipse.papyru.sysml14.advice.ConformReorient" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ConformReorientEditHelperAdvice">
@@ -103,7 +103,7 @@
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_H3hNAIe7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_NLW78FMHEeWPz5cwbRdVrg" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_002" identifier="org.eclipse.papyru.sysml14.advice.ElementGroup" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ElementGroupEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Comment"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Comment"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_H_W6YIe7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_YSwK8FeYEeWPz5cwbRdVrg" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_004" identifier="org.eclipse.papyrus.sysml14.service.types.advice.PartCreationEditHelperAdvice" target="org.eclipse.papyrus.SysML14.Part" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.PartCreationEditHelperAdvice">
@@ -113,7 +113,7 @@
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_IMTxQIe7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_tA9JMFhlEeWtAJZqY6vX8w" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_007" identifier="org.eclipse.papyru.sysml14.advice.ConnectorReorientEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ConnectorReorientEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Connector"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Connector"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_ISq38Ie7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_tO760FhlEeWtAJZqY6vX8w" description="satisfy org.eclipse.papyrus.sysml14.service.types.REQ_007" identifier="org.eclipse.papyru.sysml14.advice.ConnectorCreationEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ConnectorCreationEditHelperAdvice">
@@ -166,7 +166,7 @@
</stereotypesToApply>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_hnZx8HHKEeWA-bU7ePaZzw" identifier="Allocate_Abstraction.DirectedRelationshipPropertyPathEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.DirectedRelationshipPropertyPathEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Package"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Package"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_KTvX0Ie7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_df5_gHMnEeWA-bU7ePaZzw" identifier="Allocate_Abstraction.ReorientDirectedRelationshipPPEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ReorientDirectedRelationshipPPEditHelperAdvice">
@@ -174,7 +174,7 @@
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_KbIZQIe7EeW05oI_3tpDGw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_TLxCYIPfEeWhLaOZG6fRyw" identifier="org.eclipse.papyrus.sysml14.service.types.advice.ConstraintCreationEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.ConstraintCreationEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Property"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Property"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="setvaluesadvice:SetValuesAdviceConfiguration" xmi:id="_v6SvEKsWEeaA7ctmzDJT8w" description="Set visibility to private " identifier="org.eclipse.papyrus.SysML14.PrivatePackageImport.setPrivate" target="org.eclipse.papyrus.SysML14.PrivatePackageImport">
<featuresToSet xmi:id="_w_Fz8KsWEeaA7ctmzDJT8w" featureName="visibility">
@@ -187,11 +187,11 @@
</featuresToSet>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_Qe1A8DbzEeeuq_-iYg-Yhg" description="" identifier="org.eclipse.papyru.sysml14.advice.DeriveReqtClient" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.DeriveReqtClientEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Element"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Element"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_Qe1A8TbzEeeuq_-iYg-Yhg" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_XecvUDoxEeeIivSImw6BZw" description="" identifier="org.eclipse.papyru.sysml14.advice.DeriveReqtSupplier" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.sysml14.service.types.advice.DeriveReqtSupplierEditHelperAdvice">
- <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Package"/>
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Package"/>
<matcherConfiguration xsi:type="elementtypesconfigurations:MatcherConfiguration" xmi:id="_XecvUToxEeeIivSImw6BZw" matcherClassName="org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher"/>
</adviceBindingsConfigurations>
</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/ConnectorReorientEditHelperAdvice.java b/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/ConnectorReorientEditHelperAdvice.java
index e8d8f98..504eba9 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/ConnectorReorientEditHelperAdvice.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/ConnectorReorientEditHelperAdvice.java
@@ -18,7 +18,6 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -145,8 +144,6 @@
if (reorientedEdgeView != null) {
View oppositeEndView = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
View newEndView = RequestParameterUtils.getReconnectedEndView(request);
- Assert.isNotNull(oppositeEndView);
- Assert.isNotNull(newEndView);
if (newEndView != null && oppositeEndView != null) {
// If the source or target view is enclosed in a structure encapsulated view, forbid creation.
if (ConnectorUtil.isCrossingEncapsulation(newEndView, oppositeEndView) || ConnectorUtil.isCrossingEncapsulation(oppositeEndView, newEndView)) {
diff --git a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/PrivatePackageImportEditHelperAdvice.java b/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/PrivatePackageImportEditHelperAdvice.java
deleted file mode 100644
index 94b540c..0000000
--- a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/advice/PrivatePackageImportEditHelperAdvice.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.sysml14.service.types.advice;
-
-
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.uml2.uml.PackageImport;
-import org.eclipse.uml2.uml.VisibilityKind;
-
-
-/**
- * The helperadvice class used for PrivatePackageImport
- * @deprecated
- */
-@Deprecated // Unused (now model based) see Bug 483804
-public class PrivatePackageImportEditHelperAdvice extends AbstractEditHelperAdvice {
-
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest)
- *
- * @param request
- * @return
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
-
-
- final PackageImport packageImport = (PackageImport) request.getElementToConfigure();
-
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- packageImport.setVisibility(VisibilityKind.PRIVATE_LITERAL);
- return CommandResult.newOKCommandResult(packageImport);
- }
- };
- }
-}
diff --git a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/util/SysMLServiceTypeUtil.java b/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/util/SysMLServiceTypeUtil.java
index a022b33..22905f7 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/util/SysMLServiceTypeUtil.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types/src/org/eclipse/papyrus/sysml14/service/types/util/SysMLServiceTypeUtil.java
@@ -13,169 +13,188 @@
package org.eclipse.papyrus.sysml14.service.types.util;
+import org.eclipse.gmf.runtime.emf.type.core.ClientContextManager;
+import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
+
/**
* List all SysML 1.4 element type ids
- *
*/
public final class SysMLServiceTypeUtil {
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VALUETYPE= "org.eclipse.papyrus.SysML14.ValueType"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISTRIBUTEDPROPERTY= "org.eclipse.papyrus.SysML14.DistributedProperty"; //$NON-NLS-1$
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONNECTORPROPERTY= "org.eclipse.papyrus.SysML14.ConnectorProperty"; //$NON-NLS-1$
+ /**
+ * Say if an element is know in the SysML 1.4 context
+ * @param elementTypeId
+ * @return
+ */
+ public static boolean isKnown(String elementTypeId) {
+ IClientContext context = ClientContextManager.getInstance().getClientContext(SYSML14_CONTEXT_ID);
+ IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(context);
+ return editServiceProvider.isKnownElementType(elementTypeId);
+ }
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PARTICIPANTPROPERTY= "org.eclipse.papyrus.SysML14.ParticipantProperty"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BINDINGCONNECTOR= "org.eclipse.papyrus.SysML14.BindingConnector"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BLOCK= "org.eclipse.papyrus.SysML14.Block"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROPERTYSPECIFICTYPE= "org.eclipse.papyrus.SysML14.PropertySpecificType"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NESTEDCONNECTOREND_CONNECTOREND= "org.eclipse.papyrus.SysML14.NestedConnectorEnd_ConnectorEnd"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NESTEDCONNECTOREND_ELEMENT= "org.eclipse.papyrus.SysML14.NestedConnectorEnd_Element"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DIRECTEDRELATIONSHIPPROPERTYPATH= "org.eclipse.papyrus.SysML14.DirectedRelationshipPropertyPath"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ELEMENTPROPERTYPATH= "org.eclipse.papyrus.SysML14.ElementPropertyPath"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ENDPATHMULTIPLICITY= "org.eclipse.papyrus.SysML14.EndPathMultiplicity"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BOUNDREFERENCE= "org.eclipse.papyrus.SysML14.BoundReference"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ADJUNCTPROPERTY= "org.eclipse.papyrus.SysML14.AdjunctProperty"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CLASSIFIERBEHAVIORPROPERTY= "org.eclipse.papyrus.SysML14.ClassifierBehaviorProperty"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ITEMFLOW= "org.eclipse.papyrus.SysML14.ItemFlow"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWPROPERTY= "org.eclipse.papyrus.SysML14.FlowProperty"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FULLPORT= "org.eclipse.papyrus.SysML14.FullPort"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INTERFACEBLOCK= "org.eclipse.papyrus.SysML14.InterfaceBlock"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROXYPORT= "org.eclipse.papyrus.SysML14.ProxyPort"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ACCEPTCHANGESTRUCTURALFEATUREEVENTACTION= "org.eclipse.papyrus.SysML14.AcceptChangeStructuralFeatureEventAction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CHANGESTRUCTURALFEATUREEVENT= "org.eclipse.papyrus.SysML14.ChangeStructuralFeatureEvent"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DIRECTEDFEATURE= "org.eclipse.papyrus.SysML14.DirectedFeature"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INVOCATIONONNESTEDPORTACTION_INVOCATIONACTION= "org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_InvocationAction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INVOCATIONONNESTEDPORTACTION_ELEMENT= "org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_Element"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRIGGERONNESTEDPORT_TRIGGER= "org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Trigger"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRIGGERONNESTEDPORT_ELEMENT= "org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Element"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_OVERWRITE= "org.eclipse.papyrus.SysML14.Overwrite"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTROLOPERATOR_BEHAVIOR= "org.eclipse.papyrus.SysML14.ControlOperator_Behavior"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTROLOPERATOR_OPERATION= "org.eclipse.papyrus.SysML14.ControlOperator_Operation"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATE_ACTIVITYEDGE= "org.eclipse.papyrus.SysML14.Rate_ActivityEdge"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATE_PARAMETER= "org.eclipse.papyrus.SysML14.Rate_Parameter"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NOBUFFER= "org.eclipse.papyrus.SysML14.NoBuffer"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISCRETE_ACTIVITYEDGE= "org.eclipse.papyrus.SysML14.Discrete_ActivityEdge"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISCRETE_PARAMETER= "org.eclipse.papyrus.SysML14.Discrete_Parameter"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTINUOUS_ACTIVITYEDGE= "org.eclipse.papyrus.SysML14.Continuous_ActivityEdge"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTINUOUS_PARAMETER= "org.eclipse.papyrus.SysML14.Continuous_Parameter"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBABILITY_ACTIVITYEDGE= "org.eclipse.papyrus.SysML14.Probability_ActivityEdge"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBABILITY_PARAMETERSET= "org.eclipse.papyrus.SysML14.Probability_ParameterSet"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_OPTIONAL= "org.eclipse.papyrus.SysML14.Optional"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATIONALE= "org.eclipse.papyrus.SysML14.Rationale"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VIEW= "org.eclipse.papyrus.SysML14.View"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONFORM= "org.eclipse.papyrus.SysML14.Conform"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBLEM= "org.eclipse.papyrus.SysML14.Problem"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VIEWPOINT= "org.eclipse.papyrus.SysML14.Viewpoint"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_STAKEHOLDER= "org.eclipse.papyrus.SysML14.Stakeholder"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_EXPOSE= "org.eclipse.papyrus.SysML14.Expose"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ELEMENTGROUP= "org.eclipse.papyrus.SysML14.ElementGroup"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINTBLOCK= "org.eclipse.papyrus.SysML14.ConstraintBlock"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATEACTIVITYPARTITION= "org.eclipse.papyrus.SysML14.AllocateActivityPartition"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION= "org.eclipse.papyrus.SysML14.Allocate_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Allocate_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DERIVEREQT_ABSTRACTION= "org.eclipse.papyrus.SysML14.DeriveReqt_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DERIVEREQT_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.DeriveReqt_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_COPY_ABSTRACTION= "org.eclipse.papyrus.SysML14.Copy_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_COPY_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Copy_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_SATISFY_ABSTRACTION= "org.eclipse.papyrus.SysML14.Satisfy_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_SATISFY_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Satisfy_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TESTCASE_OPERATION= "org.eclipse.papyrus.SysML14.TestCase_Operation"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TESTCASE_BEHAVIOR= "org.eclipse.papyrus.SysML14.TestCase_Behavior"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REQUIREMENT= "org.eclipse.papyrus.SysML14.Requirement"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VERIFY_ABSTRACTION= "org.eclipse.papyrus.SysML14.Verify_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VERIFY_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Verify_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION= "org.eclipse.papyrus.SysML14.Trace_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Trace_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION= "org.eclipse.papyrus.SysML14.Refine_Abstraction"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_DIRECTEDRELATIONSHIP= "org.eclipse.papyrus.SysML14.Refine_DirectedRelationship"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWPORT= "org.eclipse.papyrus.SysML14.FlowPort"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWSPECIFICATION= "org.eclipse.papyrus.SysML14.FlowSpecification"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_UNIT= "org.eclipse.papyrus.SysML14.Unit"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_QUANTITYKIND= "org.eclipse.papyrus.SysML14.QuantityKind"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PARTASSOCIATION= "org.eclipse.papyrus.SysML14.PartAssociation"; //$NON-NLS-1$
+ public static final String SYSML14_CONTEXT_ID = "org.eclipse.papyrus.infra.services.edit.TypeContext"; //$NON-NLS-1$
+ //"org.eclipse.papyrus.sysml.architecture.SysML14"; //$NON-NLS-1$
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VALUETYPE = "org.eclipse.papyrus.SysML14.ValueType"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISTRIBUTEDPROPERTY = "org.eclipse.papyrus.SysML14.DistributedProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONNECTORPROPERTY = "org.eclipse.papyrus.SysML14.ConnectorProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PARTICIPANTPROPERTY = "org.eclipse.papyrus.SysML14.ParticipantProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BINDINGCONNECTOR = "org.eclipse.papyrus.SysML14.BindingConnector"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BLOCK = "org.eclipse.papyrus.SysML14.Block"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROPERTYSPECIFICTYPE = "org.eclipse.papyrus.SysML14.PropertySpecificType"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NESTEDCONNECTOREND_CONNECTOREND = "org.eclipse.papyrus.SysML14.NestedConnectorEnd_ConnectorEnd"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NESTEDCONNECTOREND_ELEMENT = "org.eclipse.papyrus.SysML14.NestedConnectorEnd_Element"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DIRECTEDRELATIONSHIPPROPERTYPATH = "org.eclipse.papyrus.SysML14.DirectedRelationshipPropertyPath"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ELEMENTPROPERTYPATH = "org.eclipse.papyrus.SysML14.ElementPropertyPath"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ENDPATHMULTIPLICITY = "org.eclipse.papyrus.SysML14.EndPathMultiplicity"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_BOUNDREFERENCE = "org.eclipse.papyrus.SysML14.BoundReference"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ADJUNCTPROPERTY = "org.eclipse.papyrus.SysML14.AdjunctProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CLASSIFIERBEHAVIORPROPERTY = "org.eclipse.papyrus.SysML14.ClassifierBehaviorProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ITEMFLOW = "org.eclipse.papyrus.SysML14.ItemFlow"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWPROPERTY = "org.eclipse.papyrus.SysML14.FlowProperty"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FULLPORT = "org.eclipse.papyrus.SysML14.FullPort"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INTERFACEBLOCK = "org.eclipse.papyrus.SysML14.InterfaceBlock"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROXYPORT = "org.eclipse.papyrus.SysML14.ProxyPort"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ACCEPTCHANGESTRUCTURALFEATUREEVENTACTION = "org.eclipse.papyrus.SysML14.AcceptChangeStructuralFeatureEventAction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CHANGESTRUCTURALFEATUREEVENT = "org.eclipse.papyrus.SysML14.ChangeStructuralFeatureEvent"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DIRECTEDFEATURE = "org.eclipse.papyrus.SysML14.DirectedFeature"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INVOCATIONONNESTEDPORTACTION_INVOCATIONACTION = "org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_InvocationAction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_INVOCATIONONNESTEDPORTACTION_ELEMENT = "org.eclipse.papyrus.SysML14.InvocationOnNestedPortAction_Element"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRIGGERONNESTEDPORT_TRIGGER = "org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Trigger"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRIGGERONNESTEDPORT_ELEMENT = "org.eclipse.papyrus.SysML14.TriggerOnNestedPort_Element"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_OVERWRITE = "org.eclipse.papyrus.SysML14.Overwrite"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTROLOPERATOR_BEHAVIOR = "org.eclipse.papyrus.SysML14.ControlOperator_Behavior"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTROLOPERATOR_OPERATION = "org.eclipse.papyrus.SysML14.ControlOperator_Operation"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATE_ACTIVITYEDGE = "org.eclipse.papyrus.SysML14.Rate_ActivityEdge"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATE_PARAMETER = "org.eclipse.papyrus.SysML14.Rate_Parameter"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_NOBUFFER = "org.eclipse.papyrus.SysML14.NoBuffer"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISCRETE_ACTIVITYEDGE = "org.eclipse.papyrus.SysML14.Discrete_ActivityEdge"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DISCRETE_PARAMETER = "org.eclipse.papyrus.SysML14.Discrete_Parameter"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTINUOUS_ACTIVITYEDGE = "org.eclipse.papyrus.SysML14.Continuous_ActivityEdge"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONTINUOUS_PARAMETER = "org.eclipse.papyrus.SysML14.Continuous_Parameter"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBABILITY_ACTIVITYEDGE = "org.eclipse.papyrus.SysML14.Probability_ActivityEdge"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBABILITY_PARAMETERSET = "org.eclipse.papyrus.SysML14.Probability_ParameterSet"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_OPTIONAL = "org.eclipse.papyrus.SysML14.Optional"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_RATIONALE = "org.eclipse.papyrus.SysML14.Rationale"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VIEW = "org.eclipse.papyrus.SysML14.View"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONFORM = "org.eclipse.papyrus.SysML14.Conform"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PROBLEM = "org.eclipse.papyrus.SysML14.Problem"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VIEWPOINT = "org.eclipse.papyrus.SysML14.Viewpoint"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_STAKEHOLDER = "org.eclipse.papyrus.SysML14.Stakeholder"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_EXPOSE = "org.eclipse.papyrus.SysML14.Expose"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ELEMENTGROUP = "org.eclipse.papyrus.SysML14.ElementGroup"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINTBLOCK = "org.eclipse.papyrus.SysML14.ConstraintBlock"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATEACTIVITYPARTITION = "org.eclipse.papyrus.SysML14.AllocateActivityPartition"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION = "org.eclipse.papyrus.SysML14.Allocate_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Allocate_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DERIVEREQT_ABSTRACTION = "org.eclipse.papyrus.SysML14.DeriveReqt_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_DERIVEREQT_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.DeriveReqt_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_COPY_ABSTRACTION = "org.eclipse.papyrus.SysML14.Copy_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_COPY_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Copy_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_SATISFY_ABSTRACTION = "org.eclipse.papyrus.SysML14.Satisfy_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_SATISFY_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Satisfy_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TESTCASE_OPERATION = "org.eclipse.papyrus.SysML14.TestCase_Operation"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TESTCASE_BEHAVIOR = "org.eclipse.papyrus.SysML14.TestCase_Behavior"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REQUIREMENT = "org.eclipse.papyrus.SysML14.Requirement"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VERIFY_ABSTRACTION = "org.eclipse.papyrus.SysML14.Verify_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VERIFY_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Verify_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION = "org.eclipse.papyrus.SysML14.Trace_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Trace_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION = "org.eclipse.papyrus.SysML14.Refine_Abstraction"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_DIRECTEDRELATIONSHIP = "org.eclipse.papyrus.SysML14.Refine_DirectedRelationship"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWPORT = "org.eclipse.papyrus.SysML14.FlowPort"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_FLOWSPECIFICATION = "org.eclipse.papyrus.SysML14.FlowSpecification"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_UNIT = "org.eclipse.papyrus.SysML14.Unit"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_QUANTITYKIND = "org.eclipse.papyrus.SysML14.QuantityKind"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PARTASSOCIATION = "org.eclipse.papyrus.SysML14.PartAssociation"; //$NON-NLS-1$
+
+
// List here the elementype present in the extension element type set
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINTPROPERTY= "org.eclipse.papyrus.SysML14.ConstraintProperty"; //$NON-NLS-1$
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFERENCE= "org.eclipse.papyrus.SysML14.Reference"; //$NON-NLS-1$
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINTPROPERTY = "org.eclipse.papyrus.SysML14.ConstraintProperty"; //$NON-NLS-1$
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PART= "org.eclipse.papyrus.SysML14.Part"; //$NON-NLS-1$
-
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VALUE= "org.eclipse.papyrus.SysML14.Value"; //$NON-NLS-1$
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_REFERENCE = "org.eclipse.papyrus.SysML14.Reference"; //$NON-NLS-1$
- public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ACTORPART= "org.eclipse.papyrus.SysML14.ActorPart"; //$NON-NLS-1$
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_PART = "org.eclipse.papyrus.SysML14.Part"; //$NON-NLS-1$
- private SysMLServiceTypeUtil(){
- }
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_VALUE = "org.eclipse.papyrus.SysML14.Value"; //$NON-NLS-1$
+
+ public static final String ORG_ECLIPSE_PAPYRUS_SYSML14_ACTORPART = "org.eclipse.papyrus.SysML14.ActorPart"; //$NON-NLS-1$
+
+ private SysMLServiceTypeUtil() {
+ }
}
diff --git a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityBaseElementModelConstraint.java b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityBaseElementModelConstraint.java
index a095d3b..90e260b 100644
--- a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityBaseElementModelConstraint.java
+++ b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityBaseElementModelConstraint.java
@@ -26,7 +26,7 @@
import org.eclipse.uml2.uml.ParameterSet;
/**
- * 11.3.2.7 Probability [1] The «probability» stereotype can only be applied to
+ * 11.3.2.7 Probability [1] The <<probability>> stereotype can only be applied to
* activity edges that have decision nodes or object nodes as sources, or to
* output parameter sets.
*/
@@ -50,8 +50,7 @@
}
}
ParameterSet parameterSet = probability.getBase_ParameterSet();
- // FIXME :What is an output parameter set? (I chose all parameters are
- // OUT)
+ // What is an output parameter set? (I chose all parameters are OUT)
if (parameterSet != null) {
EList<Parameter> parameters = parameterSet.getParameters();
for (Parameter parameter : parameters) {
diff --git a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityOutputParametersModelConstraint.java b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityOutputParametersModelConstraint.java
index e3638be..b4e5eb0 100644
--- a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityOutputParametersModelConstraint.java
+++ b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/ProbabilityOutputParametersModelConstraint.java
@@ -21,7 +21,7 @@
import org.eclipse.uml2.uml.ParameterSet;
/**
- * 11.3.2.7 Probability [4] When the «probability» stereotype is applied to an
+ * 11.3.2.7 Probability [4] When the <<probability>> stereotype is applied to an
* output parameter set, all the output parameters must be in some parameter
* set.
*/
@@ -38,8 +38,7 @@
public IStatus validate(IValidationContext context) {
Probability probability = (Probability) context.getTarget();
ParameterSet parameterSet = probability.getBase_ParameterSet();
- // FIXME :What is an output parameter set? (I chose all parameters are
- // OUT)
+ //What is an output parameter set? (I chose all parameters are OUT)
if (parameterSet != null) {
EList<Parameter> parameters = parameterSet.getParameters();
for (Parameter parameter : parameters) {
diff --git a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/deprecatedelements/FlowPortCustomImpl.java b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/deprecatedelements/FlowPortCustomImpl.java
index ffefd4c..ea97a50 100644
--- a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/deprecatedelements/FlowPortCustomImpl.java
+++ b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/deprecatedelements/FlowPortCustomImpl.java
@@ -38,9 +38,9 @@
/**
* @return the icons for port orientation
*/
- public EList<Image> getIcons() {
+ public static EList<Image> getIcons(FlowPort flowPort) {
if (icons == null){// for PERFORMANCE we call UMLUtil.getStereotype only once
- icons = UMLUtil.getStereotype(this).getIcons();
+ icons = UMLUtil.getStereotype(flowPort).getIcons();
}
return icons;
}
@@ -87,7 +87,7 @@
public Image getIcon() {
Image image = null;
if (getBase_Port() != null) {
- EList<Image> iconList = getIcons();
+ EList<Image> iconList = getIcons(this);
switch (getDirection()) {
case IN:
image = iconList.get(FlowDirection.IN.getValue());
diff --git a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/portsandflows/FlowPropertyCustomImpl.java b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/portsandflows/FlowPropertyCustomImpl.java
index d72b2eb..698b7e0 100644
--- a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/portsandflows/FlowPropertyCustomImpl.java
+++ b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/portsandflows/FlowPropertyCustomImpl.java
@@ -23,7 +23,7 @@
*
*
*/
-public class FlowPropertyCustomImpl extends FlowPropertyImpl {
+public class FlowPropertyCustomImpl extends FlowPropertyImpl implements FlowProperty{
/**
* Icons for displaying flow property orientation
@@ -34,9 +34,9 @@
/**
* @return the icons for flow property orientation
*/
- public EList<Image> getIcons() {
+ public static EList<Image> getIcons(FlowProperty flowProperty) {
if (icons == null){// for PERFORMANCE we call UMLUtil.getStereotype only once
- icons = UMLUtil.getStereotype(this).getIcons();
+ icons = UMLUtil.getStereotype(flowProperty).getIcons();
}
return icons;
}
@@ -53,7 +53,7 @@
public Image getIcon() {
Image image = null;
if (getBase_Property() != null) {
- EList<Image> iconList = getIcons();
+ EList<Image> iconList = getIcons(this);
switch (getDirection()) {
case IN:
image = iconList.get(FlowDirection.IN.getValue());
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14ClassDiagramElementTypesExtensionTest.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14ClassDiagramElementTypesExtensionTest.java
index 165a022..12e9710 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14ClassDiagramElementTypesExtensionTest.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14ClassDiagramElementTypesExtensionTest.java
@@ -23,31 +23,28 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.types.AbstractMatcherConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.SpecializationTypeConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
/**
- * This class is to check any change in the SysML 1.4 element type id
- * (since the ids can be used a specialization they are part of public API)
- * => This should be replaced by the api tolling when working with model
*/
@SuppressWarnings("nls")
public class SysML14ClassDiagramElementTypesExtensionTest {
public static final String CLASS_DIAGRAM_EXTENSION_ELEMENT_TYPE_PATH = "org.eclipse.papyrus.sysml14.diagram.common/resources/SysML14ClassDiagram-extension.elementtypesconfigurations"; //$NON-NLS-1$
-
+
@BeforeClass
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14di.elementTypeSet.class.extension");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
@@ -61,11 +58,11 @@
Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true);
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0));
Assert.assertEquals("The element type model is not valid ", Diagnostic.OK, diagnostic.getSeverity());
- }
+ }
/**
- * Check that all SpecializationTypeConfiguration have a matcher (avoid to broke UML Diagrams)
- * TODO #482245 : a validation should be added to Papyrus core
+ * Check that all SpecializationTypeConfiguration have a matcher
+ * (This is no more required for avoiding to broke UML Diagrams since contextid but still a good idea)
*/
@Test
public void checkElementTypeMatcher() {
@@ -82,36 +79,12 @@
if (elementTypeConfiguration instanceof SpecializationTypeConfiguration) {
SpecializationTypeConfiguration specializationTypeConfiguration = (SpecializationTypeConfiguration) elementTypeConfiguration;
AbstractMatcherConfiguration matcherConfiguration = specializationTypeConfiguration.getMatcherConfiguration();
- Assert.assertNotNull(specializationTypeConfiguration.getName()+"is missing its matcher. All SysML 1.4 SpecializationTypeConfiguration must have a matcher. By default, use org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher)", matcherConfiguration);
+ Assert.assertNotNull(specializationTypeConfiguration.getName()
+ + "is missing its matcher. All SysML 1.4 SpecializationTypeConfiguration must have a matcher. By default, use org.eclipse.papyrus.sysml14.service.types.matcher.internal.SysML14ProfileMatcher)", matcherConfiguration);
}
}
}
}
- }
+ }
- /** TODO: done by validation?
- @Test
- public void checkElementTypeSpecialization() {
- URI createPlatformPluginURI = URI.createPlatformPluginURI(CLASS_DIAGRAM_EXTENSION_ELEMENT_TYPE_PATH, true);
- ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
- Resource resource = resourceSetImpl.getResource(createPlatformPluginURI, true);
- TreeIterator<EObject> allContents = resource.getAllContents();
- while (allContents.hasNext()) {
- EObject eObject = (EObject) allContents.next();
- if (eObject instanceof ElementTypeSetConfiguration) {
- ElementTypeSetConfiguration elementTypeSetConfiguration = (ElementTypeSetConfiguration) eObject;
- EList<ElementTypeConfiguration> elementTypeConfigurations = elementTypeSetConfiguration.getElementTypeConfigurations();
- for (ElementTypeConfiguration elementTypeConfiguration : elementTypeConfigurations) {
- if (elementTypeConfiguration instanceof SpecializationTypeConfiguration) {
- SpecializationTypeConfiguration specializationTypeConfiguration = (SpecializationTypeConfiguration) elementTypeConfiguration;
- EList<String> specializedTypesID = specializationTypeConfiguration.getSpecializedTypesID();
- for (String elementTypeId : specializedTypesID) {
- Assert.assertTrue("Unregistred element id : " + elementTypeId, ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(elementTypeId));
- }
- }
- }
- }
- }
- }
-**/
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14CompositeDiagramElementTypesExtensionTest.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14CompositeDiagramElementTypesExtensionTest.java
index 49f007b..bb2c46a 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14CompositeDiagramElementTypesExtensionTest.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysML14CompositeDiagramElementTypesExtensionTest.java
@@ -23,12 +23,12 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.types.AbstractMatcherConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.SpecializationTypeConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -47,7 +47,7 @@
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14di.elementTypeSet.composite.extension");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
@@ -64,8 +64,8 @@
}
/**
- * Check that all SpecializationTypeConfiguration have a matcher (avoid to broke UML Diagrams)
- * TODO #482245 : a validation should be added to Papyrus core
+ * Check that all SpecializationTypeConfiguration have a matcher
+ * (This is no more required for avoiding to broke UML Diagrams since contextid but still a good idea)
*/
@Test
public void checkElementTypeMatcher() {
@@ -89,32 +89,4 @@
}
}
- /**
- * Check that all parent specialization are known by the ElementTypeService
-
- TODO: done by validation?
- @Test
- public void checkElementTypeSpecialization() {
- URI createPlatformPluginURI = URI.createPlatformPluginURI(COMPOSITE_DIAGRAM_EXTENSION_ELEMENT_TYPE_PATH, true);
- ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
- Resource resource = resourceSetImpl.getResource(createPlatformPluginURI, true);
- TreeIterator<EObject> allContents = resource.getAllContents();
- while (allContents.hasNext()) {
- EObject eObject = (EObject) allContents.next();
- if (eObject instanceof ElementTypeSetConfiguration) {
- ElementTypeSetConfiguration elementTypeSetConfiguration = (ElementTypeSetConfiguration) eObject;
- EList<ElementTypeConfiguration> elementTypeConfigurations = elementTypeSetConfiguration.getElementTypeConfigurations();
- for (ElementTypeConfiguration elementTypeConfiguration : elementTypeConfigurations) {
- if (elementTypeConfiguration instanceof SpecializationTypeConfiguration) {
- SpecializationTypeConfiguration specializationTypeConfiguration = (SpecializationTypeConfiguration) elementTypeConfiguration;
- EList<String> specializedTypesID = specializationTypeConfiguration.getSpecializedTypesID();
- for (String elementTypeId : specializedTypesID) {
- Assert.assertTrue("Unregistred element id : " + elementTypeId, ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(elementTypeId));
- }
- }
- }
- }
- }
- }
- */
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysMLDiUMLTest.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysMLDiUMLTest.java
index 882306c..9587536 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysMLDiUMLTest.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/resources/SysMLDiUMLTest.java
@@ -19,20 +19,16 @@
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
-import org.eclipse.papyrus.infra.types.SpecializationTypeConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -42,56 +38,28 @@
public class SysMLDiUMLTest {
public static final String SYSMLDI_ELEMENT_TYPE_PATH = "org.eclipse.papyrus.sysml14.diagram.common/resources/SysMLDiUML.elementtypesconfigurations";
-
+
@BeforeClass
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14di.elementTypes");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
- /**@Ignore // See Bug 477206
+ /**
* Validate the model with the rules defined in the meta-model tooling
*/
-
+
@Test
public void validateSysML14ElementTypesModel() {
URI createPlatformPluginURI = URI.createPlatformPluginURI(SYSMLDI_ELEMENT_TYPE_PATH, true);
Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true);
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0));
Assert.assertEquals("The element type model is not valid ", Diagnostic.OK, diagnostic.getSeverity());
- }
- /**
- * Check that all parent specialization are known by the ElementTypeService
+ }
- TODO: done by validation?
- @Test
- public void checkElementTypeSpecialization() {
- URI createPlatformPluginURI = URI.createPlatformPluginURI(SYSMLDI_ELEMENT_TYPE_PATH, true);
- ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
- Resource resource = resourceSetImpl.getResource(createPlatformPluginURI, true);
- TreeIterator<EObject> allContents = resource.getAllContents();
- while (allContents.hasNext()) {
- EObject eObject = (EObject) allContents.next();
- if (eObject instanceof ElementTypeSetConfiguration) {
- ElementTypeSetConfiguration elementTypeSetConfiguration = (ElementTypeSetConfiguration) eObject;
- EList<ElementTypeConfiguration> elementTypeConfigurations = elementTypeSetConfiguration.getElementTypeConfigurations();
- for (ElementTypeConfiguration elementTypeConfiguration : elementTypeConfigurations) {
- if (elementTypeConfiguration instanceof SpecializationTypeConfiguration) {
- SpecializationTypeConfiguration specializationTypeConfiguration = (SpecializationTypeConfiguration) elementTypeConfiguration;
- EList<String> specializedTypesID = specializationTypeConfiguration.getSpecializedTypesID();
- for (String elementTypeId : specializedTypesID) {
- Assert.assertTrue("Unregistred element id : " + elementTypeId, ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(elementTypeId));
- }
- }
- }
- }
- }
- }
-
- */
/**
* Check if there is a duplicated identifier in all loaded element types
*/
@@ -99,16 +67,16 @@
public void checkAlreadyExistingId() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
List<String> alreadyCheckedIds = new ArrayList<>();
for (ElementTypeSetConfiguration elementTypeSetConfiguration : map.values()) {
EList<ElementTypeConfiguration> elementTypeConfigurations = elementTypeSetConfiguration.getElementTypeConfigurations();
for (ElementTypeConfiguration elementTypeConfiguration : elementTypeConfigurations) {
String identifier = elementTypeConfiguration.getIdentifier();
- Assert.assertFalse("Duplicated elementtype identifer "+identifier, alreadyCheckedIds.contains(identifier));
- alreadyCheckedIds.add(identifier);
+ Assert.assertFalse("Duplicated elementtype identifer " + identifier, alreadyCheckedIds.contains(identifier));
+ alreadyCheckedIds.add(identifier);
+ }
}
}
- }
-
+
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/util/GraphicalSysMLServiceTypeUtilTest.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/util/GraphicalSysMLServiceTypeUtilTest.java
index 9e90f2a..2ac23f7 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/util/GraphicalSysMLServiceTypeUtilTest.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common.tests/src/org/eclipse/papyrus/sysml14/diagram/common/tests/util/GraphicalSysMLServiceTypeUtilTest.java
@@ -16,10 +16,10 @@
import java.util.Map;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.sysml14.diagram.common.util.GraphicalSysMLServiceTypeUtil;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -34,19 +34,20 @@
public static void loadSysMLDefinition() {
ElementTypeSetConfigurationRegistry instance = ElementTypeSetConfigurationRegistry.getInstance();
Map<String, Map<String, ElementTypeSetConfiguration>> elementTypeSetConfigurations = instance.getElementTypeSetConfigurations();
- Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get("org.eclipse.papyrus.infra.services.edit.TypeContext");
- ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysmldi.elementTypes");
+ Map<String, ElementTypeSetConfiguration> map = elementTypeSetConfigurations.get(SysMLServiceTypeUtil.SYSML14_CONTEXT_ID);
+ ElementTypeSetConfiguration elementTypeSetConfiguration = map.get("org.eclipse.papyrus.sysml14di.elementTypes");
Assert.assertNotNull("The SysML element type set definition is missing", elementTypeSetConfiguration);
}
-/** FIXME: path the tests
+
+
@Test
public void checkConstraintLabelElementTypeId() {
- Assert.assertTrue("ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINT_LABEL should have a valid element id : " , ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(GraphicalSysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINT_LABEL));
+ Assert.assertTrue("ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINT_LABEL should have a valid element id : " , SysMLServiceTypeUtil.isKnown(GraphicalSysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_CONSTRAINT_LABEL));
}
@Test
public void checkParameterBorderItemLabelElementTypeId() {
- Assert.assertTrue("ORG_ECLIPSE_PAPYRUS_SYSML14_PARAMETER_BORDER_ITEM should have a valid element id : " , ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(GraphicalSysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_PARAMETER_BORDER_ITEM));
+ Assert.assertTrue("ORG_ECLIPSE_PAPYRUS_SYSML14_PARAMETER_BORDER_ITEM should have a valid element id : " , SysMLServiceTypeUtil.isKnown(GraphicalSysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_PARAMETER_BORDER_ITEM));
}
-**/
+
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common/META-INF/MANIFEST.MF b/diagram/org.eclipse.papyrus.sysml14.diagram.common/META-INF/MANIFEST.MF
index 89c2912..b67ef72 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common/META-INF/MANIFEST.MF
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common/META-INF/MANIFEST.MF
@@ -58,7 +58,6 @@
org.eclipse.papyrus.sysml14.diagram.internalblock,
org.eclipse.papyrus.sysml14.diagram.parametric,
org.eclipse.papyrus.sysml14.diagram.requirement",
- org.eclipse.papyrus.sysml14.diagram.common.locator,
org.eclipse.papyrus.sysml14.diagram.common.provider,
org.eclipse.papyrus.sysml14.diagram.common.util
Bundle-ActivationPolicy: lazy
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/locator/FixedPortPositionLocator.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/locator/FixedPortPositionLocator.java
deleted file mode 100644
index 30492fa..0000000
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/locator/FixedPortPositionLocator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
- *
- * 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:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.sysml14.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator;
-
-/**
- * This locator is used to fix bug about PortPositionLocator sometimes the computedPosition is bad due to a bad tolerance about location.
- *
- * @deprecated
- */
-@Deprecated
-public class FixedPortPositionLocator extends PortPositionLocator {
-
- /**
- * Constructor.
- *
- * @param parentFigure
- * @param preferredSide
- */
- public FixedPortPositionLocator(IFigure parentFigure, int preferredSide) {
- super(parentFigure, preferredSide);
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator#getCurrentSideOfParent()
- *
- * @return
- */
- @Override
- public int getCurrentSideOfParent() {
- int defaultSkink = 10;
- Rectangle basisRectangle = new Rectangle(0, 0, parentFigure.getBounds().width, parentFigure.getBounds().height);
- // creation of an internal rectangle in order to compute the position (size divided by 2);
- int skinkWidth = constraint.width / 2;
- int skinkHeight = constraint.height / 2;
- // sometime the size of element in the notation can be negative to explain that he can take the default size code.
- // The size in this case is inside the draw2D figure but here it is impossible to access to the figure of the port.
- // in this case , we compute a default internal rectangle minus 10.
- if (skinkWidth <= 0) {
- skinkWidth = defaultSkink;
- }
- if (skinkHeight <= 0) {
- skinkHeight = defaultSkink;
- }
- Rectangle internalRectangle = basisRectangle.getShrinked(new Insets(skinkHeight, skinkWidth, skinkHeight, skinkWidth));
- // let draw2D to compute position
- return internalRectangle.getPosition(constraint.getTopLeft());
- }
-}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/edit/part/ParameterBorderItermEditPart.java b/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/edit/part/ParameterBorderItermEditPart.java
index 86d8910..d866887 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/edit/part/ParameterBorderItermEditPart.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/edit/part/ParameterBorderItermEditPart.java
@@ -14,7 +14,6 @@
package org.eclipse.papyrus.sysml14.diagram.parametric.edit.part;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.sysml14.diagram.parametric.locator.ParameterPositionLocator;
@@ -37,7 +36,7 @@
@Override
public IBorderItemLocator getNewBorderItemLocator(IFigure mainFigure) {
- return new ParameterPositionLocator(mainFigure, PositionConstants.NONE);
+ return new ParameterPositionLocator(mainFigure);
}
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/locator/ParameterPositionLocator.java b/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/locator/ParameterPositionLocator.java
index f7cb7ef..0b6c0c5 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/locator/ParameterPositionLocator.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/locator/ParameterPositionLocator.java
@@ -26,33 +26,19 @@
public class ParameterPositionLocator extends PortPositionLocator {
-
- // FIXME: Use that after Neon.2
-// /**
-// * Constructor.
-// * @param parentFigure
-// */
-// public ParameterPositionLocator(IFigure parentFigure) {
-// super(parentFigure);
-// }
-//
/**
* Constructor.
- *
* @param parentFigure
- * @param preferredSide
- * @deprecated
*/
- @Deprecated
- public ParameterPositionLocator(IFigure parentFigure, int preferredSide) {
- super(parentFigure, preferredSide);
- }
+ public ParameterPositionLocator(IFigure parentFigure) {
+ super(parentFigure);
+ }
/**
* @see org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator#setPortPosition(java.lang.String)
*
* @param position
- * @deprecated
+ * @deprecated (to be removed only when the deprecated parent is removed)
*/
@Override
@Deprecated
@@ -60,4 +46,15 @@
// Always internal
super.setPortPosition(PortPositionEnum.INSIDE.toString());
}
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator#setPosition(org.eclipse.papyrus.infra.gmfdiag.common.utils.PortPositionEnum)
+ *
+ * @param position
+ */
+ @Override
+ public void setPosition(PortPositionEnum position) {
+ super.setPosition(PortPositionEnum.INSIDE);
+ }
+
}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.requirement.tests/src/org/eclipse/papyrus/sysml14/diagram/requirement/tests/resources/ModelValidationTest.java b/diagram/org.eclipse.papyrus.sysml14.diagram.requirement.tests/src/org/eclipse/papyrus/sysml14/diagram/requirement/tests/resources/ModelValidationTest.java
index 5617473..f4e766d 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.requirement.tests/src/org/eclipse/papyrus/sysml14/diagram/requirement/tests/resources/ModelValidationTest.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.requirement.tests/src/org/eclipse/papyrus/sysml14/diagram/requirement/tests/resources/ModelValidationTest.java
@@ -24,7 +24,6 @@
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.papyrus.sysml14.diagram.requirement.Activator;
import org.junit.Assert;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
diff --git a/pom.xml b/pom.xml
index e68a7d3..7d886ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.papyrus.components</groupId>
<artifactId>org.eclipse.papyrus.components.parent</artifactId>
- <version>0.0.22</version>
+ <version>0.0.23</version>
</parent>
<groupId>org.eclipse.papyrus.sysml</groupId>
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.allocation.tests/src/org/eclipse/papyrus/sysml14/nattable/allocation/tests/resources/AllocationNattableTest.java b/table/org.eclipse.papyrus.sysml14.nattable.allocation.tests/src/org/eclipse/papyrus/sysml14/nattable/allocation/tests/resources/AllocationNattableTest.java
index 4b3b5b7..a386b8a 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.allocation.tests/src/org/eclipse/papyrus/sysml14/nattable/allocation/tests/resources/AllocationNattableTest.java
+++ b/table/org.eclipse.papyrus.sysml14.nattable.allocation.tests/src/org/eclipse/papyrus/sysml14/nattable/allocation/tests/resources/AllocationNattableTest.java
@@ -21,9 +21,9 @@
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.PasteEObjectConfiguration;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.sysml14.nattable.allocation.Activator;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -58,7 +58,7 @@
/**
* check that the past configuration use a correct element type id
-// TODO : probably replaced by validation
+ */
@Test
public void checkPastedElementId() {
URI createPlatformPluginURI = URI.createPlatformPluginURI(ALLOCATION_NATTABLE_PATH, true);
@@ -70,9 +70,9 @@
if (eObject instanceof PasteEObjectConfiguration) {
PasteEObjectConfiguration pasteEObjectConfiguration = (PasteEObjectConfiguration) eObject;
String elementTypeId = pasteEObjectConfiguration.getPastedElementId();
- Assert.assertTrue("Unregistred element id : " + elementTypeId, ElementEditServiceUtils.getEditServiceProvider().isKnownElementType(elementTypeId));
+ Assert.assertTrue("Unregistred element id : " + elementTypeId, SysMLServiceTypeUtil.isKnown(elementTypeId));
}
}
- } */
+ }
}
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/resources/RequirementNattableTest.java b/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/resources/RequirementNattableTest.java
index 3f529e5..b3505e7 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/resources/RequirementNattableTest.java
+++ b/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/resources/RequirementNattableTest.java
@@ -22,11 +22,9 @@
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.PasteEObjectConfiguration;
-import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditServiceProvider;
import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurationRegistry;
import org.eclipse.papyrus.sysml14.nattable.requirement.Activator;
+import org.eclipse.papyrus.sysml14.service.types.util.SysMLServiceTypeUtil;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -75,7 +73,7 @@
/**
* check that the past configuration use a correct element type id
*/
- @Test //TODO: probably replaced by validation
+ @Test
public void checkPastedElementId() throws ServiceException{
URI createPlatformPluginURI = URI.createPlatformPluginURI(REQUIREMENT_NATTABLE_PATH, true);
ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
@@ -86,8 +84,7 @@
if (eObject instanceof PasteEObjectConfiguration) {
PasteEObjectConfiguration pasteEObjectConfiguration = (PasteEObjectConfiguration) eObject;
String elementTypeId = pasteEObjectConfiguration.getPastedElementId();
- IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(TypeContext.getContext("org.eclipse.papyrus.infra.services.edit.TypeContext"));
- Assert.assertTrue("Unregistred element id : " + elementTypeId, editServiceProvider.isKnownElementType(elementTypeId));
+ Assert.assertTrue("Unregistred element id : " + elementTypeId, SysMLServiceTypeUtil.isKnown(elementTypeId));
}
}
}
@@ -95,7 +92,7 @@
/**
* check that the past configuration use a correct element type id
*/
- @Test //TODO: probably replaced by validation
+ @Test
public void checkTreePastedElementId() throws ServiceException{
URI createPlatformPluginURI = URI.createPlatformPluginURI(REQUIREMENT_TREE_NATTABLE_PATH, true);
ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
@@ -106,8 +103,7 @@
if (eObject instanceof PasteEObjectConfiguration) {
PasteEObjectConfiguration pasteEObjectConfiguration = (PasteEObjectConfiguration) eObject;
String elementTypeId = pasteEObjectConfiguration.getPastedElementId();
- IElementEditServiceProvider editServiceProvider = ElementEditServiceUtils.getEditServiceProvider(TypeContext.getContext("org.eclipse.papyrus.infra.services.edit.TypeContext"));
- Assert.assertTrue("Unregistred element id : " + elementTypeId, editServiceProvider.isKnownElementType(elementTypeId));
+ Assert.assertTrue("Unregistred element id : " + elementTypeId, SysMLServiceTypeUtil.isKnown(elementTypeId));
}
}
}
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/tester/RequirementTableTesterTest.java b/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/tester/RequirementTableTesterTest.java
index 3148859..639cf62 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/tester/RequirementTableTesterTest.java
+++ b/table/org.eclipse.papyrus.sysml14.nattable.requirement.tests/src/org/eclipse/papyrus/sysml14/nattable/requirement/tests/tester/RequirementTableTesterTest.java
@@ -35,7 +35,7 @@
@BeforeClass
public static void loadElementTypeSet (){
- ElementTypeSetConfigurationRegistry.getInstance(); // FIXME : this should'nt be requirement papyrus element type fwk should provide a getter that initialize the tooling
+ ElementTypeSetConfigurationRegistry.getInstance();
}
/**