diff options
author | Henrik Rentz-Reichert | 2018-12-14 14:46:36 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2018-12-14 15:51:44 +0000 |
commit | 4c2b39b661edefe990086cae086343fce0580609 (patch) | |
tree | bf24068c5781f9b4c2a049e9f9406a1e34cd41e6 /plugins/org.eclipse.etrice.core.room | |
parent | 7af344b02c6bfe2559748fa685b8d68e3a64648d (diff) | |
download | org.eclipse.etrice-4c2b39b661edefe990086cae086343fce0580609.tar.gz org.eclipse.etrice-4c2b39b661edefe990086cae086343fce0580609.tar.xz org.eclipse.etrice-4c2b39b661edefe990086cae086343fce0580609.zip |
Bug 541363 - [Usability] SAP not satisfied should be validated in editor
behavior was improved significantly (cf. the bug)
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room')
2 files changed, 18 insertions, 6 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomNameProvider.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomNameProvider.java index a3e35d4c9..d6096c661 100644 --- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomNameProvider.java +++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomNameProvider.java @@ -31,6 +31,7 @@ import org.eclipse.etrice.core.room.ActorContainerRef; import org.eclipse.etrice.core.room.ActorRef; import org.eclipse.etrice.core.room.Binding; import org.eclipse.etrice.core.room.BindingEndPoint; +import org.eclipse.etrice.core.room.LogicalSystem; import org.eclipse.etrice.core.room.Operation; import org.eclipse.etrice.core.room.PortOperation; import org.eclipse.etrice.core.room.RoomClass; @@ -70,7 +71,11 @@ public class RoomNameProvider extends FSMNameProvider { @Override public String caseActorClass(ActorClass object) { return "ActorClass "+object.getName(); } @Override - public String caseSubSystemClass(SubSystemClass object) { return "SubsystemClass "+object.getName(); } + public String caseSubSystemClass(SubSystemClass object) { return "SubSystemClass "+object.getName(); } + @Override + public String caseLogicalSystem(LogicalSystem object) { return "LogicalSystem "+object.getName(); } + @Override + public String caseRoomModel(RoomModel object) { return "RoomModel " + object.getName(); } } private class CombinedProvider extends ComposedSwitch<String> { diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java index 074ad5034..64e21c2b1 100644 --- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java +++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java @@ -54,9 +54,12 @@ public class ValidatorExtensionManager extends CustomValidatorManager { private ICustomValidator validator; private String id; - public ValidatorInfo(ICustomValidator validator, String id) { + private String mode; + + public ValidatorInfo(ICustomValidator validator, String mode, String id) { super(); this.validator = validator; + this.mode = mode; this.id = id; } @@ -72,6 +75,10 @@ public class ValidatorExtensionManager extends CustomValidatorManager { return validator.getDescription(); } + public String getMode() { + return mode; + } + public String getId() { return id; } @@ -114,7 +121,7 @@ public class ValidatorExtensionManager extends CustomValidatorManager { for (EClass sup : superTypes) { EPackage pckg = (EPackage) sup.eContainer(); String path = pckg.getName(); - put(path+"."+sup.getName(), ((EClass) cls).getName(), cls2sub); + put(path+"."+sup.getName(), cls.getEPackage().getName()+"."+((EClass) cls).getName(), cls2sub); } } } @@ -130,9 +137,9 @@ public class ValidatorExtensionManager extends CustomValidatorManager { final Object ext = injector.getInstance(extClass); if (ext instanceof ICustomValidator) { ICustomValidator validator = (ICustomValidator) ext; - infos.add(new ValidatorInfo(validator, e.getName() + ValidatorInfo.SEP - + e.getNamespaceIdentifier())); String mode = e.getAttribute("mode"); + infos.add(new ValidatorInfo(validator, mode, e.getName() + ValidatorInfo.SEP + + e.getNamespaceIdentifier())); String classToCheck = e.getAttribute("classToCheck"); int pos = classToCheck.lastIndexOf('.'); if (pos>=0) { @@ -212,7 +219,7 @@ public class ValidatorExtensionManager extends CustomValidatorManager { HashMap<String, ArrayList<ICustomValidator>> map, HashSet<ICustomValidator> executed) { ArrayList<ICustomValidator> result = new ArrayList<ICustomValidator>(); - ArrayList<ICustomValidator> validators = map.get(object.eClass().getName()); + ArrayList<ICustomValidator> validators = map.get(object.eClass().getEPackage().getName() + "." + object.eClass().getName()); if (validators != null) for (ICustomValidator validator : validators) { if (!executed.contains(validator)) { |