Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-05-24 05:00:27 -0400
committerNicolas FAUVERGUE2018-05-25 03:27:05 -0400
commit219d217a757fed7f16a455da5958254656f0b5db (patch)
tree67a14024d6ab8809d21be9c1bd4b2808e95db619
parent119a214647ee4db3ba01d2f28200be137e57df31 (diff)
downloadorg.eclipse.papyrus-219d217a757fed7f16a455da5958254656f0b5db.tar.gz
org.eclipse.papyrus-219d217a757fed7f16a455da5958254656f0b5db.tar.xz
org.eclipse.papyrus-219d217a757fed7f16a455da5958254656f0b5db.zip
Bug 535056: [Sequence Diagram] When opening a sequence diagram, the
CombinedFragment label is collapsed https://bugs.eclipse.org/bugs/show_bug.cgi?id=535056 - Make sure the name of the CombinedFragment is set on EditPart creation Change-Id: I5a4c19e90434b6817c2a6077132ef5ddf4d99a53 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java23
2 files changed, 21 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
index e9812a58791..c9a25071015 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
@@ -938,7 +938,6 @@ public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyru
* @param name
* the name
*/
- // @unused
public void setName(String name) {
this.nameLabel.setText(name);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java
index 027ace577e4..33be1127393 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CCombinedFragmentEditPart.java
@@ -54,9 +54,28 @@ public class CCombinedFragmentEditPart extends CombinedFragmentEditPart {
*/
@Override
protected void handleNotificationEvent(Notification event) {
-
super.handleNotificationEvent(event);
- getPrimaryShape().setName(((CombinedFragment) this.resolveSemanticElement()).getInteractionOperator().getLiteral());
+ refreshLabel();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart#refreshVisuals()
+ *
+ */
+ @Override
+ protected void refreshVisuals() {
+ refreshLabel();
+ super.refreshVisuals();
+ }
+
+ /**
+ * @since 5.0
+ */
+ protected void refreshLabel() {
+ CombinedFragment semantic = (CombinedFragment) this.resolveSemanticElement();
+ if (semantic != null && semantic.getInteractionOperator() != null) {
+ getPrimaryShape().setName(semantic.getInteractionOperator().getLiteral());
+ }
}
/**

Back to the top