svn commit: r15501 - trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-08-03 14:55:09-0700
New Revision: 15501

Modified:
   trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java

Log:
Issue 5280: Don't show delete if a target element is readonly.

Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=15501&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&r1=15500&r2=15501
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java	2008-08-03 14:55:09-0700
@@ -291,7 +291,9 @@
                 }
             }
 
-            if (selectedItem != projectModel) {
+            if (modelElementsOnly && selectedItem != projectModel) {
+                // TODO: Shouldn't be creating a new instance here. We should
+                // hold the delete action in some central place.
                 this.add(new ActionDeleteModelElements());
             }
         }
@@ -328,15 +330,16 @@
                         classifiers);
                 this.add(action);
             }
-        }
-
-        if (selectedItem instanceof Diagram) {
+        } else if (selectedItem instanceof Diagram) {
             this.add(new ActionSaveDiagramToClipboard());
+            // TODO: Delete should be available on any combination of model
+            // elements and diagrams.
+            // TODO: Shouldn't be creating a new instance here. We should
+            // hold the delete action in some central place.
             ActionDeleteModelElements ad = new ActionDeleteModelElements();
             ad.setEnabled(ad.shouldBeEnabled());
             this.add(ad);
         }
-
     }
 
     /**
@@ -755,6 +758,7 @@
         }
     }
 
+    // TODO: Is this needed now we have ModelManagementHelper.isReadOnly?
     private boolean isRelatedToProfiles(Project currentProject,
             Object selectedItem) {
         boolean found = selectedItem instanceof ProfileConfiguration
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.