Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-01-17 17:26:43 +0000
committerHenrik Rentz-Reichert2011-01-17 17:26:43 +0000
commita586c3b435f178710c1fbf74d5b6674ad6bb67f0 (patch)
tree8048fafeeb8ddbfa28391818b34b0dfca91abd54
parent9796b83b4edfdf270fea09ae79cf6ee17fdc7256 (diff)
downloadorg.eclipse.etrice-a586c3b435f178710c1fbf74d5b6674ad6bb67f0.tar.gz
org.eclipse.etrice-a586c3b435f178710c1fbf74d5b6674ad6bb67f0.tar.xz
org.eclipse.etrice-a586c3b435f178710c1fbf74d5b6674ad6bb67f0.zip
core.room: label generation for transitions
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomNameProvider.java30
1 files changed, 30 insertions, 0 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 787ff1bd4..61ec29fe8 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
@@ -238,4 +238,34 @@ public class RoomNameProvider {
return "not_unique";
}
+
+ public static String getTransitionLabelName(Transition t) {
+ String name = null;
+ if (t instanceof InitialTransition) {
+ return "init";
+ }
+ else {
+ NonInitialTransition nit = (NonInitialTransition) t;
+ if (nit.getFrom() instanceof ChoicepointTerminal) {
+ if (nit instanceof ContinuationTransition)
+ return "[else]";
+
+ if (nit instanceof CPBranchTransition) {
+ CPBranchTransition cpt = (CPBranchTransition) nit;
+ if (cpt.getCondition()!=null && !cpt.getCondition().getCommands().isEmpty())
+ return "["+cpt.getCondition().getCommands().get(0)+"]";
+ }
+
+ return "[?]";
+ }
+
+ if (t.getName()!=null)
+ name = t.getName()+": ";
+ else
+ name ="";
+
+ // TODOHRR: add triggers
+ }
+ return name;
+ }
}

Back to the top