diff options
author | Florian Noyrit | 2014-04-23 15:15:31 +0000 |
---|---|---|
committer | Florian Noyrit | 2014-04-23 15:15:31 +0000 |
commit | 141d0bf127c0b57c4fe63b579343c2ee5abec7a4 (patch) | |
tree | bd897f4c64e29d8bac5bdb69cecd6398d8c111fd /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src | |
parent | efe795e575007b6aff92990a652272753ac01a4b (diff) | |
parent | 403f4eca218593c7ddcc3c0992861115b8df1650 (diff) | |
download | org.eclipse.papyrus-141d0bf127c0b57c4fe63b579343c2ee5abec7a4.tar.gz org.eclipse.papyrus-141d0bf127c0b57c4fe63b579343c2ee5abec7a4.tar.xz org.eclipse.papyrus-141d0bf127c0b57c4fe63b579343c2ee5abec7a4.zip |
Merge branch 'master' of ssh://fnoyrit@git.eclipse.org:29418/papyrus/org.eclipse.papyrus
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java index 260b242a978..82eebf23859 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java @@ -1,7 +1,7 @@ /***************************************************************************** * Copyright (c) 2009 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 @@ -60,9 +60,10 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen } /** - * + * * {@inheritDoc} */ + @Override public void activate() { // retrieve the view and the element managed by the edit part View view = (View)getHost().getModel(); @@ -102,7 +103,7 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen /** * set the qualified name to display - * + * * @param nodeNamedElementFigure * the associated figure to the editpart */ @@ -112,7 +113,7 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen /** * refresh the editpart with a depth for the qualified name - * + * * @param nodeNamedElementFigure * the associated figure to the editpart */ @@ -121,9 +122,10 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen } /** - * + * * {@inheritDoc} */ + @Override public void deactivate() { // retrieve the view and the element managed by the edit part View view = (View)getHost().getModel(); @@ -142,7 +144,7 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen } /** - * + * * @return the associated named element to the editpart. it can return null * if this not a named element */ @@ -159,7 +161,7 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen /** * Gets the diagram event broker from the editing domain. - * + * * @return the diagram event broker */ protected DiagramEventBroker getDiagramEventBroker() { @@ -171,10 +173,15 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen } /** - * + * * {@inheritDoc} */ + @Override public void notifyChanged(Notification notification) { + if(getNamedElement() == null) { + return; + } + if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeatureID(NamedElement.class)) || notification.getNotifier() instanceof EAnnotation) { refreshQualifiedNameDisplay(); } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeature())) { @@ -184,8 +191,9 @@ public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implemen } else if(notification.getFeature() instanceof EReference) { EReference ref = (EReference)notification.getFeature(); if(ref.isContainment()) { - if(parentListeners.contains(notification.getNotifier())) + if(parentListeners.contains(notification.getNotifier())) { removeParentListeners(); + } addParentListeners(); refreshQualifiedNameDisplay(); } |