Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2015-07-29 13:27:00 +0000
committerGerrit Code Review @ Eclipse.org2015-07-31 12:44:23 +0000
commitcb996a76fe6f57dcbe6bc62465f73e9254845703 (patch)
tree2e014e8eefd37919c65694fe1fc79d526e6b3864 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java
parent4d94639ce51c5826dfe29d151cbf386d940e520f (diff)
downloadorg.eclipse.papyrus-cb996a76fe6f57dcbe6bc62465f73e9254845703.tar.gz
org.eclipse.papyrus-cb996a76fe6f57dcbe6bc62465f73e9254845703.tar.xz
org.eclipse.papyrus-cb996a76fe6f57dcbe6bc62465f73e9254845703.zip
Bug 472932: [Stereotype Display] Impossible to hide IBD Port Stereotype
Label with CSS https://bugs.eclipse.org/bugs/show_bug.cgi?id=472932 - Manage the DurationObservation and TimeObservation stereotype display in Class Diagram - Manage the Port stereotype display in Component Diagram - Manage the DurationObservation, Parameter, Port and TimeObservation stereotype display in Composite Diagram Change-Id: I94bec687c963c672ff4e8626df5880f27a9f8b43 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java
new file mode 100644
index 00000000000..cd234615048
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/edit/parts/CustomTimeObservationStereotypeLabelEditPartCN.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2015 CEA LIST.
+ *
+ * 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:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 472932
+ */
+package org.eclipse.papyrus.uml.diagram.communication.custom.edit.parts;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN;
+import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
+
+/**
+ * The custom edit policy for the time observation stereotype label.
+ */
+public class CustomTimeObservationStereotypeLabelEditPartCN extends TimeObservationStereotypeLabelEditPartCN {
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ * The view
+ */
+ public CustomTimeObservationStereotypeLabelEditPartCN(final View view) {
+ super(view);
+ }
+
+ /**
+ * Redefine the refresh label to get the STEREOTYPE_LABEL_POLICY if exist and don't recalculate the text.
+ *
+ * @see org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortAppliedStereotypeEditPart#refreshLabel()
+ */
+ @Override
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (maskLabelPolicy == null) {
+ maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
+ }
+ // Bug 472932 : Stereotype is always displayed
+ if (maskLabelPolicy == null) {
+ maskLabelPolicy = getEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
+ }
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ } else {
+ setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
+ setLabelIconHelper(getFigure(), null);
+ }
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ }
+ }
+}

Back to the top