Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java
new file mode 100644
index 00000000000..1814d0e4c88
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomTimeConstraintLabelEditPart.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Soyatec - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.AppliedStereotypeCommentCreationEditPolicyEx;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomConnectionHandleEditPolicy;
+import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedStereotypeCommentCreationEditPolicy;
+
+
+/**
+ * Support displaying Stereotype as a Comment Node for TimeConstraint.
+ *
+ * @author Jin Liu (jin.liu@soyatec.com)
+ */
+public class CustomTimeConstraintLabelEditPart extends TimeConstraintLabelEditPart implements IPapyrusEditPart {
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ */
+ public CustomTimeConstraintLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart#getPrimaryShape()
+ *
+ * @return
+ */
+
+ public IFigure getPrimaryShape() {
+ return getFigure();
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new CustomConnectionHandleEditPolicy());
+ //install a editpolicy to display stereotypes
+ installEditPolicy(AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT, new AppliedStereotypeCommentCreationEditPolicyEx());
+ }
+
+}

Back to the top