Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-03-07 15:36:43 +0000
committerAnsgar Radermacher2014-03-07 15:39:38 +0000
commit8812639e3fcf949d67e43f9a53182ff241c329a5 (patch)
treefafff952bb3258327e5782778944aadf3fb4d032 /plugins/infra
parent0ec296da99df678daac12c38adef223f39167b31 (diff)
downloadorg.eclipse.papyrus-8812639e3fcf949d67e43f9a53182ff241c329a5.tar.gz
org.eclipse.papyrus-8812639e3fcf949d67e43f9a53182ff241c329a5.tar.xz
org.eclipse.papyrus-8812639e3fcf949d67e43f9a53182ff241c329a5.zip
Bug 413512 - [OCL for Papyrus] Papyrus does does not validate OCL constraints in Profiles for well formnedness
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EcoreDiagnostician.java11
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationFunctions.java8
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java2
3 files changed, 15 insertions, 6 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EcoreDiagnostician.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EcoreDiagnostician.java
index 25c89b5c292..0a06f3af747 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EcoreDiagnostician.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EcoreDiagnostician.java
@@ -32,7 +32,16 @@ public class EcoreDiagnostician extends Diagnostician implements IPapyrusDiagnos
protected AdapterFactory adapterFactory;
protected IProgressMonitor progressMonitor;
+ /**
+ * Create diagnostician with custom validator (that must subclass ECore validator)
+ * @param validatorAdapter custom validator adapter
+ */
+ public EcoreDiagnostician(EValidatorAdapter validatorAdapter) {
+ this.validatorAdapter = validatorAdapter;
+ }
+
public EcoreDiagnostician() {
+ validatorAdapter = new EValidatorAdapter();
}
public void initialize (final AdapterFactory adapterFactory, final IProgressMonitor progressMonitor) {
@@ -40,7 +49,7 @@ public class EcoreDiagnostician extends Diagnostician implements IPapyrusDiagnos
this.progressMonitor=progressMonitor;
}
- protected EValidatorAdapter validatorAdapter = new EValidatorAdapter();
+ protected EValidatorAdapter validatorAdapter;
@Override
public String getObjectLabel(EObject eObject) {
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationFunctions.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationFunctions.java
index 553d5dfc013..efa81b4be64 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationFunctions.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationFunctions.java
@@ -29,11 +29,11 @@ import org.eclipse.ui.PlatformUI;
public class ValidationFunctions implements IDecorationSpecificFunctions {
- public static final String error_co = "icons/etool16/error_co.gif";
+ public static final String error_co = "icons/etool16/error_co.gif"; //$NON-NLS-1$
- public static final String warning_co = "icons/etool16/warning_co.gif";
+ public static final String warning_co = "icons/etool16/warning_co.gif"; //$NON-NLS-1$
- public static final String info_co = "icons/etool16/info_co.gif";
+ public static final String info_co = "icons/etool16/info_co.gif"; //$NON-NLS-1$
/**
* Return the image descriptor associated with an validation marker
@@ -104,7 +104,7 @@ public class ValidationFunctions implements IDecorationSpecificFunctions {
public String getMessage(IPapyrusMarker marker) {
// message is stored within marker
- return marker.getAttribute(IPapyrusMarker.MESSAGE, "");
+ return marker.getAttribute(IPapyrusMarker.MESSAGE, ""); //$NON-NLS-1$
}
public int getPriority(IPapyrusMarker marker) {
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
index 33eadfffb1f..22358c24cc4 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/commands/AbstractValidateCommand.java
@@ -96,7 +96,7 @@ abstract public class AbstractValidateCommand extends AbstractTransactionalComma
super(domain, label, Collections.EMPTY_LIST);
this.domain = domain;
this.selectedElement = selectedElement;
- this.diagnostician= diagnostician;
+ this.diagnostician = diagnostician;
this.showUIfeedback = true; // default is true;
}

Back to the top