Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2012-06-20 04:27:47 -0400
committerptessier2012-06-20 04:27:47 -0400
commite30f213fa22f2a4940cc6a177a678900d0e3fca8 (patch)
treec90a548493ccd20660ece11b516276fbf8e3e484
parenta6add2cb8a1d0213c4d8c7060c9f1d2f518713e2 (diff)
downloadorg.eclipse.papyrus-e30f213fa22f2a4940cc6a177a678900d0e3fca8.tar.gz
org.eclipse.papyrus-e30f213fa22f2a4940cc6a177a678900d0e3fca8.tar.xz
org.eclipse.papyrus-e30f213fa22f2a4940cc6a177a678900d0e3fca8.zip
382733: [validation] Papyrus shall to compute constraints from the profile at the model level
https://bugs.eclipse.org/bugs/show_bug.cgi?id=382733
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.classpath7
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.project28
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/META-INF/MANIFEST.MF24
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/about.html28
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.classbin0 -> 1000 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.classbin0 -> 2689 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.classbin0 -> 3277 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator$1.classbin0 -> 2719 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.classbin0 -> 2672 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.classbin0 -> 411 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.classbin0 -> 12611 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.classbin0 -> 516 bytes
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/build.properties6
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.properties12
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.xml5
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.java67
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.java91
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.java100
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.java92
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.java18
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.java379
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.java25
23 files changed, 890 insertions, 0 deletions
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.classpath b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.project b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.project
new file mode 100644
index 00000000000..262fcf65d6a
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.dsml.validation.wizard</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.settings/org.eclipse.jdt.core.prefs b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..6cf479bfb4a
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Oct 10 13:22:15 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/META-INF/MANIFEST.MF b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..3503cf8acba
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.dsml.validation.wizard;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.dsml.validation.generation.wizard.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.pde;bundle-version="3.6.100",
+ org.eclipse.pde.core;bundle-version="3.7.0",
+ org.eclipse.pde.ui;bundle-version="3.6.100",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.ui.ide;bundle-version="3.7.0",
+ org.eclipse.papyrus.customization;bundle-version="0.8.0",
+ org.eclipse.papyrus.eclipse.project.editors;bundle-version="0.9.0",
+ org.eclipse.papyrus.dsml.validation.model;bundle-version="0.9.0",
+ org.eclipse.uml2.uml;bundle-version="3.2.100",
+ org.eclipse.papyrus.dsml.validation.generator;bundle-version="0.9.0",
+ org.eclipse.acceleo.engine;bundle-version="3.1.1"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.dsml.validation.generation.wizard
+Bundle-Vendor: %pluginProvider
+Bundle-Localization: plugin
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/about.html b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.class
new file mode 100644
index 00000000000..0a1162c1423
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.class
new file mode 100644
index 00000000000..a86c860a5db
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.class
new file mode 100644
index 00000000000..1c64cf81d34
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator$1.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator$1.class
new file mode 100644
index 00000000000..4219e30be6c
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator$1.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.class
new file mode 100644
index 00000000000..78fcc76e2f2
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.class
new file mode 100644
index 00000000000..fd34af98cfe
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.class
new file mode 100644
index 00000000000..e53c68fac97
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.class b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.class
new file mode 100644
index 00000000000..5c881b60fa4
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/bin/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.class
Binary files differ
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/build.properties b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/build.properties
new file mode 100644
index 00000000000..8665ac2ffec
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.properties b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.properties
new file mode 100644
index 00000000000..a8973277c37
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2010 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:
+# CEA LIST - initial API and implementation
+###############################################################################
+pluginName=Papyrus DSML Validation wizard (Incubation)
+pluginProvider=Eclipse Modeling Project
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.xml b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.xml
new file mode 100644
index 00000000000..b60f62ae57e
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/plugin.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+</plugin>
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.java
new file mode 100644
index 00000000000..245d5e77299
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/Activator.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.ccpg.wizard_incubation_"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.java
new file mode 100644
index 00000000000..d64c4416abc
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ClassesGenerator.java
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.papyrus.dsml.validation.generator.main.Generate;
+
+/**
+ * Main entry point of the 'Uml To Java' generation module.
+ *
+ */
+public class ClassesGenerator {
+
+ /**
+ * The model URI.
+ */
+ private URI modelURI;
+
+ /**
+ * The output folder.
+ */
+ private IContainer targetFolder;
+
+ /**
+ * The other arguments.
+ */
+ List<? extends Object> arguments;
+
+ /**
+ * Constructor.
+ *
+ * @param modelURI
+ * is the URI of the model.
+ * @param targetFolder
+ * is the output folder
+ * @param arguments
+ * are the other arguments
+ * @throws IOException
+ * Thrown when the output cannot be saved.
+ * @generated
+ */
+ public ClassesGenerator(URI modelURI, IContainer targetFolder,
+ List<? extends Object> arguments) {
+ this.modelURI = modelURI;
+ this.targetFolder = targetFolder;
+ this.arguments = arguments;
+ }
+
+ /**
+ * execute the generation
+ * @param monitor
+ * @throws IOException
+ */
+ public void doGenerate(IProgressMonitor monitor) throws IOException {
+ if (!targetFolder.getLocation().toFile().exists()) {
+ targetFolder.getLocation().toFile().mkdirs();
+ }
+
+ monitor.subTask("Loading...");
+
+ Generate gen0 = new Generate(modelURI, targetFolder.getLocation()
+ .toFile(), arguments);
+ monitor.worked(1);
+
+ String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil
+ .computeUIProjectID(
+ "org.eclipse.papyrus.dsml.validation.generator",
+ "org.eclipse.papyrus.dsml.validation.generator.GenerateAllJava",
+ modelURI.toString(),
+ targetFolder.getLocation().toString(), new ArrayList<String>());
+ gen0.setGenerationID(generationID);
+ gen0.doGenerate(BasicMonitor.toMonitor(monitor));
+
+ }
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.java
new file mode 100644
index 00000000000..298adca22b2
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/CreateEMFValidationProject.java
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - modification
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IConstraintsManager;
+import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Profile;
+
+/**
+ * This class represents the plugin project wizard and triggers creation of an
+ * EMF Validation plugin when user clicks finish button on a plugin creation
+ * wizard.
+ *
+ *
+ */
+public class CreateEMFValidationProject extends NewPluginProjectWizard {
+
+ private static final String GENERATION_MESSAGE = "Generation of EMF Validation Plugin";
+
+ private IConstraintsManager constraintsManager;
+
+ private JavaContentGenerator generateAllJava;
+
+
+ private Profile selectedProfile;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param selectedProfile
+ * @param constraintsExtractor
+ */
+ public CreateEMFValidationProject(Profile selectedProfile,
+ IConstraintsManager constraintsExtractor) {
+ super();
+ setWindowTitle(GENERATION_MESSAGE);
+ this.constraintsManager = constraintsExtractor;
+ this.selectedProfile = selectedProfile;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ if(page == fContentPage) { //Remove the template page
+ return null;
+ }
+ return super.getNextPage(page);
+ }
+
+ @Override
+ public void addPages() {
+ super.addPages();
+ }
+
+ /**
+ * run the dialog
+ */
+ public void openDialog() {
+ Shell frame = new Shell(SWT.SHELL_TRIM);
+ WizardDialog dialog = new WizardDialog(frame, (IWizard) this);
+ dialog.open();
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean result = super.performFinish();
+ if (result) {
+ IProject project = this.fMainPage.getProjectHandle();
+ try {
+ //generate plugin + extension point
+ ValidationPluginGenerator.instance.generate(project, this,constraintsManager);
+ //generate java code
+ generateAllJava = new JavaContentGenerator(project, selectedProfile);
+ generateAllJava.run();
+ project.refreshLocal(IProject.DEPTH_INFINITE, null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.java
new file mode 100644
index 00000000000..5374c79ac3e
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/JavaContentGenerator.java
@@ -0,0 +1,92 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - modification
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Profile;
+
+/**
+ *this class generate java classes in the project
+ *
+ */
+public class JavaContentGenerator {
+
+ /**
+ * Selected model files.
+ */
+ protected List<IFile> files;
+
+ protected Profile umlProfile;
+
+ private IProject project;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param project the content has to be filled in the given project
+ * @param umlProfile the uml profile
+ */
+ public JavaContentGenerator(IProject project, Profile umlProfile) {
+ this.project = project;
+ this.umlProfile = umlProfile;
+ }
+
+ /**
+ * launch the generation of the content
+ */
+ public void run() {
+ IRunnableWithProgress operation = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+
+ URI modelURI = umlProfile.eResource().getURI();
+
+ try {
+ IContainer target = project.getFolder("src");
+ ClassesGenerator generator = new ClassesGenerator(modelURI, target, getArguments());
+ generator.doGenerate(monitor);
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR,Activator.PLUGIN_ID, e.getMessage(), e);
+ Activator.getDefault().getLog().log(status);
+ }
+ }
+ };
+ try {
+ PlatformUI.getWorkbench().getProgressService().run(true, true, operation);
+ } catch (InvocationTargetException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ Activator.getDefault().getLog().log(status);
+ } catch (InterruptedException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ Activator.getDefault().getLog().log(status);
+ }
+ }
+
+ protected List<? extends Object> getArguments() {
+ return new ArrayList<String>();
+ }
+
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.java
new file mode 100644
index 00000000000..22a3246da2c
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationClassesGenerator.java
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+public class ValidationClassesGenerator {
+
+
+
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.java
new file mode 100644
index 00000000000..7a42cb86a9b
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/ValidationPluginGenerator.java
@@ -0,0 +1,379 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - modification
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.papyrus.customization.plugin.PluginEditor;
+import org.eclipse.papyrus.dsml.validation.model.elements.impl.ValidationRuleImpl;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.Category;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IConstraintProvider;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IConstraintsCategory;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IConstraintsManager;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IValidationRule;
+import org.eclipse.papyrus.dsml.validation.model.profilenames.Utils;
+import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * This is the main class that generates the EMF Validation plugin. It creates
+ * extension points and adds required dependencies.
+ *
+ *
+ */
+public class ValidationPluginGenerator {
+
+ private static final String SEPARATOR = ".";
+
+ private static final String SINGLETON_TRUE = ";singleton := true";
+
+ private static final String EMF_VALIDATION_CONSTRAINT_CHILD = "constraint";
+
+ private static final String ID = "id";
+
+ private static final String OCL_LANGUAGE = "OCL";
+
+ private static final String EMF_VALIDATION_CONSTRAINT_PROVIDERS_EXTENSIONPOINT = "org.eclipse.emf.validation.constraintProviders";
+
+ private static final String UML_PLUGIN = "org.eclipse.uml2.uml";
+
+ private static final String EMF_VALIDATION_PLUGIN = "org.eclipse.emf.validation";
+
+ private static final String UML_URL = "http://www.eclipse.org/uml2/4.0.0/UML";
+
+// private final static String contextPrefix = "org.eclipse.papyrus.validation.generation.context";
+
+ /**
+ * singleton
+ */
+ public static ValidationPluginGenerator instance = new ValidationPluginGenerator();
+
+ private final static String PLUGIN_NATURE_ID = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$
+
+ private IConstraintsManager constraintsManager;
+
+ /**
+ * generate the java code form constraints contained in the profile
+ * @param project the project eclipse
+ * @param wizard the ref to to wizard
+ * @param constraintsManager the class in charge to collect all inforamtion from the model
+ * @throws CoreException
+ * @throws IOException
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ */
+ public void generate(IProject project, NewPluginProjectWizard wizard, IConstraintsManager constraintsManager) throws CoreException,
+ IOException, SAXException, ParserConfigurationException {
+ PluginEditor editor;
+
+ String packageName= "org.eclipse.papyrus.validation";
+ this.constraintsManager = constraintsManager;
+
+ //prepare the plugin
+ editor = new PluginEditor(project);
+ editor.setBundleName(editor.getSymbolicBundleName()+SINGLETON_TRUE);
+
+ Set<String> natures = new HashSet<String>();
+ natures.add(PLUGIN_NATURE_ID);
+ editor.addNatures(natures);
+
+ editor.getManifestEditor().addDependency(EMF_VALIDATION_PLUGIN);
+ editor.getManifestEditor().addDependency(UML_PLUGIN);
+
+ Element extension = editor.getPluginEditor().addExtension(EMF_VALIDATION_CONSTRAINT_PROVIDERS_EXTENSIONPOINT);
+
+ //creation of categories extension point
+ //that correspond to sub-profiles and stereotypes
+ this.createHierarchyOfCategories(packageName,this.constraintsManager.getPrimeCategory(), extension, editor);
+
+ //add the constraint provider extension point, normally it exist only one
+ for (IConstraintProvider constraintProvider : constraintsManager.getConstraintsProviders()) {
+ //create the extension point for the provider
+ Element extElForConstraintsProvider = createExtensionForConstraintsProvider(constraintProvider, extension, editor);
+ // go though category (profile+ stereotype)
+ for (IConstraintsCategory constraintCategory : constraintProvider.getConstraintsCategories()) {
+
+ //create the extension point validationRule for category
+ Element extElForConstraintsCategory = createExtensionForConstraintsCategory(packageName,
+ constraintCategory, extElForConstraintsProvider, editor);
+
+ for (IValidationRule constraint : constraintCategory.getConstraints()) {
+
+ //this is a java constraint?
+ if (Utils.hasSpecificationForJava(constraint.getConstraint())) {
+ createExtensionForConstraint(packageName,constraint,extElForConstraintsCategory, editor);
+ }
+
+ //this is an OCL constraint?
+ if (Utils.hasSpecificationForOCL(constraint.getConstraint())) {
+ createOCLExtensionForConstraint(constraint,extElForConstraintsCategory, editor);
+ }
+ //((ValidationRuleImpl) constraint).setParentID();
+
+ }
+
+ }
+ }
+
+ generateCommonExtension2(packageName,editor);
+
+ editor.getProject().refreshLocal(0, null);
+
+ try {
+ editor.save();
+ } catch (Throwable ex) {
+
+ return;
+ }
+ }
+
+ private Element createExtensionForConstraint(String projectName,IValidationRule constraint,
+ Element parentElement, PluginEditor editor) {
+
+ Element extElForConstraint = editor.getPluginEditor().addChild(
+ parentElement, EMF_VALIDATION_CONSTRAINT_CHILD);
+
+ extElForConstraint.setAttribute(ID, constraint.getID());
+ extElForConstraint.setAttribute("name", constraint.getName());
+ extElForConstraint.setAttribute("lang", "Java");
+ extElForConstraint.setAttribute("statusCode", constraint.getStatusCode().toString());
+ extElForConstraint.setAttribute("severity", constraint.getSeverity().name());
+
+ extElForConstraint.setAttribute("class",projectName+SEPARATOR+constraint.getImplementingClass());
+
+ extElForConstraint.setAttribute("mode", constraint.getMode().name());
+ extElForConstraint.setAttribute("isEnabledByDefault",
+ String.valueOf(constraint.isEnabledByDefault()));
+
+ if (constraint.getTargets() != null) {
+ for (String target : constraint.getTargets()) {
+ Element targetExtension = editor.addChild(extElForConstraint,"target");
+ targetExtension.setAttribute("class", target);
+ }
+ }
+
+ if (constraint.getMessage() != null) {
+ Element message = editor.addChild(extElForConstraint, "message");
+ message.setTextContent(constraint.getMessage());
+ }
+ else{
+ Element message = editor.addChild(extElForConstraint, "message");
+ message.setTextContent(constraint.getName() +" not validated");
+ }
+
+ if (constraint.getDescription() != null) {
+ Element description = editor.addChild(extElForConstraint,
+ "description");
+ description.setTextContent(constraint.getDescription());
+ }
+
+ return extElForConstraint;
+
+ }
+
+ /**
+ * create the extension point for constraint of emf validation
+ * @param validation the validation rule
+ * @param parentElement
+ * @param editor
+ * @return the extension point
+ */
+ private Element createOCLExtensionForConstraint(IValidationRule validation,
+ Element parentElement, PluginEditor editor) {
+
+ Element extElForConstraint = editor.getPluginEditor().addChild(
+ parentElement, EMF_VALIDATION_CONSTRAINT_CHILD);
+
+ extElForConstraint.setAttribute(ID, validation.getID() + OCL_LANGUAGE);
+ extElForConstraint.setAttribute("name", validation.getName() + OCL_LANGUAGE);
+ extElForConstraint.setAttribute("lang", OCL_LANGUAGE);
+ extElForConstraint.setAttribute("statusCode", validation
+ .getStatusCode().toString());
+ extElForConstraint.setAttribute("severity", validation.getSeverity()
+ .name());
+
+ extElForConstraint.setAttribute("mode", validation.getMode().name());
+ extElForConstraint.setAttribute("isEnabledByDefault",
+ String.valueOf(validation.isEnabledByDefault()));
+
+ if (validation.getTargets() != null) {
+ for (String target : validation.getTargets()) {
+ Element targetExtension = editor.addChild(extElForConstraint,
+ "target");
+ targetExtension.setAttribute("class", target);
+ }
+ }
+
+ if (validation.getMessage() != null) {
+ Element message = editor.addChild(extElForConstraint, "message");
+ message.setTextContent(validation.getMessage());
+ }
+
+ if (validation.getDescription() != null) {
+ Element description = editor.addChild(extElForConstraint,
+ "description");
+ description.setTextContent(validation.getDescription());
+ }
+
+ if (Utils.getOCLConstraintBody(validation.getConstraint()) != null) {
+ Document doc = editor.getDocument();
+
+ CDATASection cdata = doc.createCDATASection(Utils
+ .getOCLConstraintBody(validation.getConstraint()));
+ extElForConstraint.appendChild(cdata);
+ }
+
+ parentElement.appendChild(extElForConstraint);
+
+ return extElForConstraint;
+
+ }
+
+ public static Document parseXmlFile(String filename, boolean validating) {
+ try {
+ // Create a builder factory
+ DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ factory.setValidating(validating);
+
+ // Create the builder and parse the file
+ Document doc = factory.newDocumentBuilder().parse(
+ new File(filename));
+ return doc;
+ } catch (SAXException e) {
+ // A parsing error occurred; the xml input is not valid
+ } catch (ParserConfigurationException e) {
+ } catch (IOException e) {
+ }
+ return null;
+ }
+
+ private Element createExtensionForCategory(String projectName, Category category,
+ Element parentElement, PluginEditor editor) {
+
+ Element extElForCategory = editor.getPluginEditor().addChild(
+ parentElement, "category");
+
+ extElForCategory.setAttribute(ID, projectName+SEPARATOR+category.getID());
+
+ extElForCategory.setAttribute("name",projectName+SEPARATOR+ category.getName());
+
+ extElForCategory.setAttribute("mandatory",String.valueOf(category.isMandatory()));
+
+ return extElForCategory;
+
+ }
+
+ /**
+ * create the constraint provider extension point
+ * @param constraintProvider
+ * @param parentElement
+ * @param editor
+ * @return the extension point
+ */
+ private Element createExtensionForConstraintsProvider(
+ IConstraintProvider constraintProvider, Element parentElement,
+ PluginEditor editor) {
+
+ Element extElForConstraintsProvider = editor.getPluginEditor().addChild(parentElement, "constraintProvider");
+
+ extElForConstraintsProvider.setAttribute("mode", constraintProvider.getMode().name());
+
+ extElForConstraintsProvider.setAttribute("cache",String.valueOf(constraintProvider.getCache()));
+
+ Element pcg = editor.addChild(extElForConstraintsProvider, "package");
+ pcg.setAttribute("namespaceUri",UML_URL);
+
+ return extElForConstraintsProvider;
+
+ }
+
+ private Element createExtensionForConstraintsCategory(
+ String projectName,IConstraintsCategory constraintsCategory, Element parentElement,
+ PluginEditor editor) {
+
+ Element extElForConstraintsCategory = editor.getPluginEditor()
+ .addChild(parentElement, "constraints");
+ String list=constraintsCategory.getCategoriesList();
+ list= list.replace(", " , ", "+projectName+SEPARATOR);
+ list= list.trim();
+ list= projectName+SEPARATOR+list;
+ extElForConstraintsCategory.setAttribute("categories",list);
+
+ return extElForConstraintsCategory;
+
+ }
+
+ private void generateCommonExtension2(String projectName,PluginEditor editor) {
+
+ Element extension = editor.getPluginEditor().addExtension(
+ "org.eclipse.emf.validation.constraintBindings");
+
+ extension.setAttribute(ID, ValidationPluginGenerator.getContextprefix());
+
+ Element element = editor.getPluginEditor().addChild(extension,"clientContext");
+ element.setAttribute(ID,ValidationPluginGenerator.getContextprefix());
+
+ element = editor.getPluginEditor().addChild(element, "selector");
+ element.setAttribute("class",projectName+SEPARATOR+"ValidationDelegateClientSelector");
+
+ element = editor.getPluginEditor().addChild(extension, "binding");
+ element.setAttribute("context", ValidationPluginGenerator.getContextprefix());
+
+ this.createCategoriesForBinding(projectName,this.constraintsManager.getPrimeCategory(), element, editor);
+ }
+
+
+ /**
+ * create the extension point categories
+ * @param projectName the name of the project
+ * @param category a category
+ * @param parentElement
+ * @param editor
+ */
+ private void createHierarchyOfCategories(String projectName, Category category,Element parentElement, PluginEditor editor) {
+
+ Element subElement = this.createExtensionForCategory(projectName, category,parentElement, editor);
+
+ for (Category subCategory : category.getSubcategories()) {
+ this.createHierarchyOfCategories(projectName,subCategory, subElement, editor);
+ }
+
+ }
+
+ private void createCategoriesForBinding(String projectName,Category category, Element parentElement, PluginEditor editor) {
+
+ Element subElement = editor.addChild(parentElement, "category");
+ subElement.setAttribute("ref",projectName+SEPARATOR+ category.getID());
+
+ for (Category subCategory : category.getSubcategories()) {
+ this.createCategoriesForBinding(projectName,subCategory, parentElement, editor);
+ }
+
+ }
+
+ public static String getContextprefix() {
+ return "";
+ }
+}
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.java
new file mode 100644
index 00000000000..7b5757a5a20
--- /dev/null
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/generation/wizard/interfaces/IValidationPluginGenerator.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ernest Wozniak (CEA LIST) ernest.wozniak@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.dsml.validation.generation.wizard.interfaces;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.papyrus.dsml.validation.model.elements.interfaces.IConstraintsManager;
+import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
+
+public interface IValidationPluginGenerator {
+
+ final static String PLUGIN_NATURE_ID = "org.eclipse.pde.PluginNature";
+
+ public void generate(IProject project, NewPluginProjectWizard wizard,
+ IConstraintsManager constraintsManager);
+
+}

Back to the top