Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-05-10 05:06:47 +0000
committerHenrik Rentz-Reichert2011-05-10 05:06:47 +0000
commitba05d89c8197055c6dff8f73a0c01c18c56d173c (patch)
tree3cedcafe5dbe7c4e8ef1bbf72aa79de632637aef /plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice
parentab0050098c95fe8d958761443536424a9037f339 (diff)
downloadorg.eclipse.etrice-ba05d89c8197055c6dff8f73a0c01c18c56d173c.tar.gz
org.eclipse.etrice-ba05d89c8197055c6dff8f73a0c01c18c56d173c.tar.xz
org.eclipse.etrice-ba05d89c8197055c6dff8f73a0c01c18c56d173c.zip
344758: list of actor references would allow cyclic actor references
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344758 Using ValidationUtil to exclude structure classes referencing the current class.
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice')
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/ActorContainerRefPropertyDialog.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/ActorContainerRefPropertyDialog.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/ActorContainerRefPropertyDialog.java
index d7c9ff108..1130614e1 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/ActorContainerRefPropertyDialog.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/ActorContainerRefPropertyDialog.java
@@ -30,6 +30,7 @@ import org.eclipse.etrice.core.room.RoomPackage;
import org.eclipse.etrice.core.room.StructureClass;
import org.eclipse.etrice.core.room.SubSystemClass;
import org.eclipse.etrice.core.room.SubSystemRef;
+import org.eclipse.etrice.core.validation.ValidationUtil;
import org.eclipse.etrice.ui.common.dialogs.AbstractPropertyDialog;
import org.eclipse.etrice.ui.structure.Activator;
import org.eclipse.swt.graphics.Image;
@@ -133,21 +134,30 @@ public class ActorContainerRefPropertyDialog extends AbstractPropertyDialog {
NameValidator nv = new NameValidator();
ProtocolValidator pv = new ProtocolValidator();
- boolean isActor = sc instanceof ActorContainerClass;
+ boolean refIsActor = sc instanceof ActorContainerClass;
+ boolean containerIsActor = sc instanceof ActorClass;
ArrayList<IEObjectDescription> actors = new ArrayList<IEObjectDescription>();
Iterator<IEObjectDescription> it = scope.getAllElements().iterator();
while (it.hasNext()) {
IEObjectDescription desc = it.next();
EObject obj = desc.getEObjectOrProxy();
- if (isActor && obj instanceof ActorClass)
- actors.add(desc);
- if (!isActor && obj instanceof SubSystemClass)
- actors.add(desc);
+ if (refIsActor && obj instanceof ActorClass) {
+ if (containerIsActor) {
+ if (!ValidationUtil.isReferencing((ActorClass)obj, (ActorClass)sc))
+ actors.add(desc);
+ }
+ else
+ actors.add(desc);
+ }
+ else if (!refIsActor && obj instanceof SubSystemClass) {
+ if (obj!=sc)
+ actors.add(desc);
+ }
}
Text name = createText(body, "Name:", ref, RoomPackage.eINSTANCE.getActorContainerRef_Name(), nv);
- Combo refClass = isActor?
+ Combo refClass = refIsActor?
createComboUsingDesc(body, "Actor Class:", ref, ActorClass.class, RoomPackage.eINSTANCE.getActorRef_Type(), actors, RoomPackage.eINSTANCE.getRoomClass_Name(), pv)
: createComboUsingDesc(body, "SubSystem Class:", ref, SubSystemClass.class, RoomPackage.eINSTANCE.getSubSystemRef_Type(), actors, RoomPackage.eINSTANCE.getRoomClass_Name(), pv);

Back to the top