Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/InstanceSpecificationNameLabelEditPolicy.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/MaskManagedFloatingLabelEditPolicy.java14
2 files changed, 22 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/InstanceSpecificationNameLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/InstanceSpecificationNameLabelEditPolicy.java
index 0cac1b5e965..92bdc68452d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/InstanceSpecificationNameLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/InstanceSpecificationNameLabelEditPolicy.java
@@ -100,28 +100,32 @@ public class InstanceSpecificationNameLabelEditPolicy extends AbstractMaskManage
Object object = notification.getNotifier();
if (notification.getEventType() == Notification.ADD) {
- if (notification.getFeature().equals(UMLPackage.eINSTANCE.getInstanceSpecification_Classifier())) {
+ if (UMLPackage.eINSTANCE.getInstanceSpecification_Classifier().equals(notification.getFeature())) {
getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), this);
}
}
if (notification.getEventType() == Notification.REMOVE) {
- if (notification.getFeature().equals(UMLPackage.eINSTANCE.getInstanceSpecification_Classifier())) {
+ if (UMLPackage.eINSTANCE.getInstanceSpecification_Classifier().equals(notification.getFeature())) {
getDiagramEventBroker().removeNotificationListener((EObject) notification.getOldValue(), this);
}
}
if (object == null) {
return;
}
- if (notification.getFeature().equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
+ if (UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeature())) {
refreshDisplay();
- } else if (notification.getFeature().equals(UMLPackage.eINSTANCE.getInstanceSpecification_Classifier())) {
+ return;
+ } else if (UMLPackage.eINSTANCE.getInstanceSpecification_Classifier().equals(notification.getFeature())) {
refreshDisplay();
+ return;
}
if (isMaskManagedAnnotation(object)) {
refreshDisplay();
+ return;
}
if (isRemovedMaskManagedLabelAnnotation(object, notification)) {
refreshDisplay();
+ return;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/MaskManagedFloatingLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/MaskManagedFloatingLabelEditPolicy.java
index 27f73eb02fd..7de6f25b5f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/MaskManagedFloatingLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/MaskManagedFloatingLabelEditPolicy.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.uml.diagram.common.editpolicies;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
@@ -247,4 +248,17 @@ public class MaskManagedFloatingLabelEditPolicy extends AbstractMaskManagedEditP
getDiagramEventBroker().removeNotificationListener(((MultiplicityElement) umlElement).getLowerValue(), this);
}
}
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractMaskManagedEditPolicy#getCurrentDisplayValue()
+ *
+ * @return
+ */
+ @Override
+ public Collection<String> getCurrentDisplayValue() {
+ if (getView() == null){
+ return Collections.emptySet();
+ }
+ return super.getCurrentDisplayValue();
+ }
}

Back to the top