Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2015-05-28 14:52:37 +0000
committerAnsgar Radermacher2015-05-28 14:53:53 +0000
commit616f2f8443fec848f11cb1921d3e491b6243cea5 (patch)
tree952aab2fa1bf14915df1c671f3a55c7e3bc7768d /extraplugins/dsml.validation
parente370e93de2fadfc5dee43a19d94b68221b786942 (diff)
downloadorg.eclipse.papyrus-616f2f8443fec848f11cb1921d3e491b6243cea5.tar.gz
org.eclipse.papyrus-616f2f8443fec848f11cb1921d3e491b6243cea5.tar.xz
org.eclipse.papyrus-616f2f8443fec848f11cb1921d3e491b6243cea5.zip
467692 - [UML-RT] Multiple issues when validating a UML-RT model (modified ValidationGenerator)
Diffstat (limited to 'extraplugins/dsml.validation')
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java
index d3cd101717b..e22b25900c4 100644
--- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java
@@ -82,6 +82,8 @@ public class ValidationPluginGenerator {
private static final String ATTRIB_ID = "id"; //$NON-NLS-1$
+ private static final String ATTRIB_NAME = "id"; //$NON-NLS-1$
+
private static final String EMF_VALIDATION_CONSTRAINT_PROVIDERS_EXTENSIONPOINT = "org.eclipse.emf.validation.constraintProviders"; //$NON-NLS-1$
private static final String EMF_VALIDATION_CONSTRAINT_BINDINGS_EXTENSIONPOINT = "org.eclipse.emf.validation.constraintBindings"; //$NON-NLS-1$
@@ -169,7 +171,7 @@ public class ValidationPluginGenerator {
editor.getManifestEditor().addDependency(UML_VALIDATION_PLUGIN);
editor.getManifestEditor().addDependency(UML_PLUGIN);
- String filterID = "dsml.validation.generated" + SEPARATOR + this.constraintsManager.getPrimeCategory().getID();
+ String filterID = "dsml.validation.generated" + SEPARATOR + this.constraintsManager.getPrimeCategory().getID(); //$NON-NLS-1$
Element constraintProviderExtension = createOrCleanExtension(editor, EMF_VALIDATION_CONSTRAINT_PROVIDERS_EXTENSIONPOINT, filterID);
// creation of categories extension point
@@ -382,8 +384,8 @@ public class ValidationPluginGenerator {
@SuppressWarnings("nls")
- private void generateBindings(String pluginID, PluginEditor editor, IConstraintsManager constraintsManager, String filterID) {
- Element extension = createOrCleanExtension(editor, EMF_VALIDATION_CONSTRAINT_BINDINGS_EXTENSIONPOINT, filterID);
+ private void generateBindings(String pluginID, PluginEditor editor, IConstraintsManager constraintsManager, String filterName) {
+ Element extension = createOrCleanExtension(editor, EMF_VALIDATION_CONSTRAINT_BINDINGS_EXTENSIONPOINT, filterName);
// create a client context per stereotype
Set<Stereotype> constrainedStereotype = constraintsManager.getConstraintsOfStereotype().keySet();
@@ -416,26 +418,30 @@ public class ValidationPluginGenerator {
* name already exists. In case of the latter, the existing extensions will be cleaned first, i.e. all of its
* children are removed. This function enables multiple generation phases without duplicating elements.
*
+ * CAVEAT: This function has been changed: filtering is now based on its name instead of the ID. Using an
+ * ID on the extension point level, unifies the associated contexts, see bug 467692 - [UML-RT] Multiple
+ * issues when validating a UML-RT model
+ *
* @param editor
* the plugin editor
* @param extensionName
* the name of the extension
* @return
*/
- protected Element createOrCleanExtension(PluginEditor editor, String extensionName, String filterID) {
+ protected Element createOrCleanExtension(PluginEditor editor, String extensionName, String filterName) {
List<Node> existingExtensions = editor.getPluginEditor().getExtensions(extensionName);
for (Node extension : existingExtensions) {
if (extension instanceof Element) {
Element extensionElement = (Element) extension;
// use optional ID field to identify an item that has been generated by this plugin.
// Context: bug 464363 - The DSML plugin generator removes all existing constraints from the plugin.xml
- String id = extensionElement.getAttribute(ATTRIB_ID);
+ String id = extensionElement.getAttribute(ATTRIB_NAME);
// TODO: temporary accept entries without ID (ID == "") to avoid migration issues (bug 464363)
if (id.equals("")) { //$NON-NLS-1$
- extensionElement.setAttribute(ATTRIB_ID, filterID);
- id = filterID;
+ extensionElement.setAttribute(ATTRIB_NAME, filterName);
+ id = filterName;
}
- if (id.equals(filterID)) {
+ if (id.equals(filterName)) {
// use existing extension and remove all children
for (;;) {
Node child = extension.getFirstChild();
@@ -450,7 +456,7 @@ public class ValidationPluginGenerator {
}
// create new extension
Element newExtension = editor.getPluginEditor().addExtension(extensionName);
- newExtension.setAttribute(ATTRIB_ID, filterID);
+ newExtension.setAttribute(ATTRIB_NAME, filterName);
return newExtension;
}

Back to the top