Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsboyko2014-12-08 17:00:10 +0000
committerCamille Letavernier2014-12-08 17:00:10 +0000
commitc5012ce6040c217f20a807badd71acb605fe5102 (patch)
tree0a523c116d1f7a05535cba520a94639418cfbb28 /plugins/uml
parentdfa017bbf02bc6223020ee128c4cfde778095768 (diff)
downloadorg.eclipse.papyrus-c5012ce6040c217f20a807badd71acb605fe5102.tar.gz
org.eclipse.papyrus-c5012ce6040c217f20a807badd71acb605fe5102.tar.xz
org.eclipse.papyrus-c5012ce6040c217f20a807badd71acb605fe5102.zip
Bug 445023 - [Sequence Diagram] Label editing does not work for Messages
and Gates Change-Id: I5fc4df057eaa0f6fe3276b00d4346e91e3ed0bde Signed-off-by: sboyko <serg.boyko2011@gmail.com>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java42
9 files changed, 63 insertions, 33 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
index f31bdb8a94c..16a80508a7b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName2EditPart.java
@@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.helper.NotificationHelper;
import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
@@ -59,6 +60,11 @@ public class CustomMessageName2EditPart extends MessageName2EditPart implements
super(view);
}
+ @Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#deactivate()
*
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
index 67fceab62ca..9050731a413 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName3EditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.swt.SWT;
@@ -38,6 +39,11 @@ public class CustomMessageName3EditPart extends MessageName3EditPart implements
}
@Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ @Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if (maskLabelPolicy == null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
index c1f679da090..1b196b255db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName4EditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.swt.SWT;
@@ -38,6 +39,11 @@ public class CustomMessageName4EditPart extends MessageName4EditPart implements
}
@Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ @Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if (maskLabelPolicy == null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
index 79c4c74e3b2..cad20391d45 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName5EditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.swt.SWT;
@@ -38,6 +39,11 @@ public class CustomMessageName5EditPart extends MessageName5EditPart implements
}
@Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ @Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if (maskLabelPolicy == null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
index f8a3056c14c..6bfc7609b40 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName6EditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.swt.SWT;
@@ -38,6 +39,11 @@ public class CustomMessageName6EditPart extends MessageName6EditPart implements
}
@Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ @Override
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getParent().getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if (maskLabelPolicy == null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
index cdf650f28b1..bd857c82b04 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageName7EditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.swt.SWT;
@@ -36,6 +37,11 @@ public class CustomMessageName7EditPart extends MessageName7EditPart implements
public CustomMessageName7EditPart(View view) {
super(view);
}
+
+ @Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
@Override
protected void refreshLabel() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
index babeb39b171..7628f0cb5b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomMessageNameEditPart.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.MessageLabelEditPolicy.ICustomMessageLabel;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.util.SelfMessageHelper;
@@ -37,6 +38,11 @@ public class CustomMessageNameEditPart extends MessageNameEditPart implements IC
public CustomMessageNameEditPart(View view) {
super(view);
}
+
+ @Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
@Override
public void refreshBounds() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
index 7d5782276b4..e540004b05c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateEditPart.java
@@ -388,6 +388,18 @@ public class GateEditPart extends AbstractBorderEditPart implements IBorderItemE
}
}
+ /**
+ * this method will return the primary child EditPart inside this edit part
+ *
+ * @return the primary child view inside this edit part
+ */
+ public EditPart getPrimaryChildEditPart() {
+ if (getChildren().size() > 0) {
+ return (EditPart) getChildren().get(0);
+ }
+ return super.getPrimaryChildEditPart();
+ }
+
public GateNameEditPart getLabelEditPart() {
IGraphicalEditPart labelEditPart = getChildBySemanticHint(GateNameEditPart.GATE_NAME_TYPE);
if (labelEditPart instanceof GateNameEditPart) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
index c6cb2e180bc..3633ad93102 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GateNameEditPart.java
@@ -4,7 +4,6 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.MarginBorder;
@@ -26,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
import org.eclipse.papyrus.uml.diagram.common.util.MessageDirection;
@@ -66,6 +66,11 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
public GateNameEditPart(View view) {
super(view);
}
+
+ @Override
+ public int getDirectEditionType() {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
@Override
protected void createDefaultEditPolicies() {
@@ -289,14 +294,12 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
}
}
- public class GateNameFigure extends Figure implements ILabelFigure, IPapyrusNodeUMLElementFigure {
+ public class GateNameFigure extends WrappingLabel implements ILabelFigure, IPapyrusNodeUMLElementFigure {
protected static final String LEFT_BRACE = "{";
protected static final String RIGHT_BRACE = "}";
- private WrappingLabel namedLabel;
-
private Label stereotypesLabel;
private Label stereotypePropertiesLabel;
@@ -314,10 +317,8 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
}
protected void createContents() {
- namedLabel = new WrappingLabel();
- namedLabel.setTextWrap(true);
- namedLabel.setAlignment(PositionConstants.CENTER);
- add(namedLabel);
+ setTextWrap(true);
+ setAlignment(PositionConstants.CENTER);
}
@Override
@@ -367,30 +368,5 @@ public class GateNameEditPart extends BorderItemLabelEditPart implements IPapyru
public Label getStereotypesLabel() {
return stereotypesLabel;
}
-
-
- @Override
- public void setText(String text) {
- namedLabel.setText(text);
- }
-
-
- @Override
- public String getText() {
- return namedLabel.getText();
- }
-
-
- @Override
- public void setIcon(Image icon) {
- namedLabel.setIcon(icon);
- }
-
-
- @Override
- public Image getIcon() {
- return namedLabel.getIcon();
- }
-
}
}

Back to the top