Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/CreateJavaValidationPluginHandler.java26
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/Messages.java1
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/messages.properties1
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/CreateEMFValidationProject.java6
-rw-r--r--extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/ValidationPluginGenerator.java6
5 files changed, 5 insertions, 35 deletions
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/CreateJavaValidationPluginHandler.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/CreateJavaValidationPluginHandler.java
index a16fe1d31b6..13336cd8a6f 100644
--- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/CreateJavaValidationPluginHandler.java
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/CreateJavaValidationPluginHandler.java
@@ -29,16 +29,11 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.dsml.validation.model.elements.impl.ConstraintManagerImpl;
-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.papyrus.dsml.validation.wizard.CreateEMFValidationProject;
import org.eclipse.papyrus.dsml.validation.wizard.JavaContentGenerator;
import org.eclipse.papyrus.dsml.validation.wizard.ValidationPluginGenerator;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -101,27 +96,8 @@ public class CreateJavaValidationPluginHandler extends AbstractHandler {
Profile profileSelection = (Profile) selection;
constraintsManager = new ConstraintManagerImpl(profileSelection);
- boolean isOCLConstraint = false;
- for (IConstraintProvider constraintProvider : constraintsManager.getConstraintsProviders()) {
- for (IConstraintsCategory constraintCategory : constraintProvider.getConstraintsCategories()) {
- for (IValidationRule constraint : constraintCategory.getConstraints()) {
- // this is an OCL constraint?
- if (Utils.hasSpecificationForOCL(constraint.getConstraint())) {
- isOCLConstraint = true;
- }
- }
- }
- }
EPackage definition = null;
- if (isOCLConstraint) {
- definition = profileSelection.getDefinition();
- if (definition == null) {
- NotificationBuilder errorDialog = NotificationBuilder.createErrorPopup(Messages.CreateJavaValidationPluginHandler_ProfileMustBeDefined);
- errorDialog.run();
- // finish by displaying a message for the user to inform that it need to define it before to launch it.
- return null;
- }
- }
+
IProject existingProject = null;
URI uri = profileSelection.eResource().getURI();
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/Messages.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/Messages.java
index 8be2b41e53a..832c1904397 100644
--- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/Messages.java
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/Messages.java
@@ -33,7 +33,6 @@ public class Messages extends NLS {
public static String CreateJavaValidationPluginHandler_HowtoGeneratePlugin;
public static String CreateJavaValidationPluginHandler_ProfileIsNotAPlugin;
public static String CreateJavaValidationPluginHandler_ProfileIsNotAPluginExplication;
- public static String CreateJavaValidationPluginHandler_ProfileMustBeDefined;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/messages.properties b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/messages.properties
index 5f029ea470d..29f4102dd56 100644
--- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/messages.properties
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.model.ui/src/org/eclipse/papyrus/dsml/validation/generation/ui/messages.properties
@@ -10,4 +10,3 @@ CreateJavaValidationPluginHandler_SelectExisting=Select an existing plugin
CreateJavaValidationPluginHandler_HowtoGeneratePlugin=How should the plugin be generated?\n\n(Please note that customized messages and severities can be supplied via the DSML validation profile)
CreateJavaValidationPluginHandler_ProfileIsNotAPlugin=Profile is not a plugin
CreateJavaValidationPluginHandler_ProfileIsNotAPluginExplication=The project (%s) that hosts the profile is not a plugin. Verify that the project itself is imported into the workspace. If you continue, the option to generate into the hosting plugin is not available. Papyrus will also not be able to create a dependency to the DSML plugin for you.
-CreateJavaValidationPluginHandler_ProfileMustBeDefined=The profile must be defined in order to generate OCL Constraints
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/CreateEMFValidationProject.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/CreateEMFValidationProject.java
index 353f2eebca7..25846075c06 100644
--- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/CreateEMFValidationProject.java
+++ b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.wizard/src/org/eclipse/papyrus/dsml/validation/wizard/CreateEMFValidationProject.java
@@ -19,8 +19,7 @@ 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.swt.widgets.Display;
import org.eclipse.uml2.uml.Profile;
/**
@@ -76,8 +75,7 @@ public class CreateEMFValidationProject extends NewPluginProjectWizard {
* run the dialog
*/
public void openDialog() {
- Shell frame = new Shell(SWT.SHELL_TRIM);
- WizardDialog dialog = new WizardDialog(frame, this);
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), this);
dialog.open();
}
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 7fe172f0d68..c64c15aeeaf 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
@@ -36,6 +36,7 @@ import org.eclipse.papyrus.eclipse.project.editors.file.ManifestEditor;
import org.eclipse.papyrus.eclipse.project.editors.interfaces.IPluginProjectEditor;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.UMLPackage;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -98,9 +99,6 @@ public class ValidationPluginGenerator {
// [well, that's not always the case]
private static final String UML_VALIDATION_PROFILE_PLUGIN = "org.eclipse.papyrus.dsml.validation"; //$NON-NLS-1$
- private static final String UML_URL = "http://www.eclipse.org/uml2/5.0.0/UML"; //$NON-NLS-1$
-
-
/**
* singleton
*/
@@ -365,7 +363,7 @@ public class ValidationPluginGenerator {
Element pcg = editor.addChild(extElForConstraintsProvider, "package");
if (constraintProvider.getEPackage() == null) {
- pcg.setAttribute("namespaceUri", UML_URL);
+ pcg.setAttribute("namespaceUri", UMLPackage.eNS_URI);
} else {
pcg.setAttribute("namespaceUri", constraintProvider.getEPackage().getNsURI());

Back to the top