Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsboyko2014-10-23 13:53:42 +0000
committersboyko2014-11-10 19:56:43 +0000
commit7084fe04887173fedcb7310e8a7d5fee1a626881 (patch)
treeba4924100744ba272b6514508843f33eb0e20f44
parente6903132f559c8b3f73892be56b57aad53c9b31e (diff)
downloadorg.eclipse.papyrus-7084fe04887173fedcb7310e8a7d5fee1a626881.tar.gz
org.eclipse.papyrus-7084fe04887173fedcb7310e8a7d5fee1a626881.tar.xz
org.eclipse.papyrus-7084fe04887173fedcb7310e8a7d5fee1a626881.zip
Bug 448497 - [Sequence Diagram] ClassCastException when activating text
editor for nested InteractionOperand Change-Id: I33d30f6d44ea9c06675cb68f7514b858ae5dca30 Signed-off-by: sboyko <serg.boyko2011@gmail.com>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
index 88d64a46da4..1366114d47e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomInteractionOperandEditPart.java
@@ -232,8 +232,13 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
}
static String getGuardLabelText(InteractionOperand interactionOperand, boolean edit) {
- CombinedFragment enclosingCF = (CombinedFragment) interactionOperand.getOwner();
- InteractionOperatorKind cfOperator = enclosingCF.getInteractionOperator();
+ Element operationOwner = interactionOperand.getOwner();
+ while (operationOwner != null && false == operationOwner instanceof CombinedFragment) {
+ operationOwner = operationOwner.getOwner();
+ }
+
+ CombinedFragment enclosingCF = (CombinedFragment) operationOwner;
+ InteractionOperatorKind cfOperator = enclosingCF != null ? enclosingCF.getInteractionOperator() : InteractionOperatorKind.SEQ_LITERAL;
InteractionConstraint guard = interactionOperand.getGuard();
String specValue = null;
if (guard != null) {
@@ -252,7 +257,7 @@ public class CustomInteractionOperandEditPart extends InteractionOperandEditPart
sb.append(condition);
}
}
- if (specValue == null) {
+ if (specValue == null && enclosingCF != null) {
EList<InteractionOperand> operands = enclosingCF.getOperands();
if (InteractionOperatorKind.ALT_LITERAL.equals(cfOperator) && interactionOperand.equals(operands.get(operands.size() - 1))) {
specValue = "else";

Back to the top