Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-08-27 13:52:08 +0000
committerCamille Letavernier2013-08-27 13:52:08 +0000
commitce8aa9e818698b36aef8567c7a581b6e82d6cfbe (patch)
tree9eed812dd1ffe4a5949b07af8ec94cfbcbfd3a7c /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src
parentcc9de8d55a2a0a342f3f3354c3b484d431177d6f (diff)
downloadorg.eclipse.papyrus-ce8aa9e818698b36aef8567c7a581b6e82d6cfbe.tar.gz
org.eclipse.papyrus-ce8aa9e818698b36aef8567c7a581b6e82d6cfbe.tar.xz
org.eclipse.papyrus-ce8aa9e818698b36aef8567c7a581b6e82d6cfbe.zip
414785: [General] Improve performances of common operations for
large-scale models https://bugs.eclipse.org/bugs/show_bug.cgi?id=414785 Fix regression on Delete action from the previous commit. The "enabled" state of the handler was not properly computed
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/handlers/DeleteFromModelCommandHandler.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java
index 5fec5833c85..5fe91cae260 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/DeleteFromModelCommandHandler.java
@@ -98,11 +98,18 @@ public class DeleteFromModelCommandHandler extends GraphicalCommandHandler imple
for(IGraphicalEditPart editPart : getSelectedElements()) {
EObject semantic = EMFHelper.getEObject(editPart);
+
View graphical = NotationHelper.findView(editPart);
if(readOnly != null) {
List<URI> uris = new LinkedList<URI>();
- if(semantic != null) {
+ if(semantic == null || semantic == graphical) {
+ return false;
+ } else {
+ if(semantic.eContainer() == null) {
+ //Do not delete root semantic element
+ return false;
+ }
uris.add(EcoreUtil.getURI(semantic));
}

Back to the top