Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-12-08 16:39:45 +0000
committerGerrit Code Review @ Eclipse.org2014-12-08 16:39:45 +0000
commit4822d8397daaaaf637aff1a0338f0e5d88f3a4db (patch)
tree4c2643fdabc22f30b2352031276fd2521e9acad9 /plugins
parente2b80898f487aadb8b4c1b0894d39d787b78f842 (diff)
parent7084fe04887173fedcb7310e8a7d5fee1a626881 (diff)
downloadorg.eclipse.papyrus-4822d8397daaaaf637aff1a0338f0e5d88f3a4db.tar.gz
org.eclipse.papyrus-4822d8397daaaaf637aff1a0338f0e5d88f3a4db.tar.xz
org.eclipse.papyrus-4822d8397daaaaf637aff1a0338f0e5d88f3a4db.zip
Merge "Bug 448497 - [Sequence Diagram] ClassCastException when activating text editor for nested InteractionOperand " into streams/1.0-maintenance
Diffstat (limited to 'plugins')
-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