svn commit: r12561 - trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-05-06 16:02:42-0700
New Revision: 12561

Modified:
   trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java

Log:
Only enable up/down actions when Parameter is part of an ordered list

Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java?view=diff&rev=12561&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java&r1=12560&r2=12561
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/PropPanelParameter.java	2007-05-06 16:02:42-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -93,9 +93,8 @@
                 Translator.localize("label.parameter.kind"), true));
 
         addAction(new ActionNavigateContainerElement());
-        // The following two actions are only significant if the Parameter is
-        // contained in the list of parameters for a Behavioral Feature or an
-        // Event.  I'm not sure if they need to be conditionally disabled.-tfm
+
+        // Up & Down are only enabled if the Parameter list is ordered
         addAction(new ActionNavigateUpPreviousDown() {
             public List getFamily(Object parent) {
                 return Model.getFacade().getParametersList(parent);
@@ -104,6 +103,12 @@
             public Object getParent(Object child) {
                 return Model.getFacade().getModelElementContainer(child);
             }
+            
+            public boolean isEnabled() {
+                return (Model.getFacade().isABehavioralFeature(getTarget()) 
+                        || Model.getFacade().isAEvent(getTarget())
+                        ) && super.isEnabled();
+            }
         });
         addAction(new ActionNavigateUpNextDown() {
             public List getFamily(Object parent) {
@@ -113,6 +118,12 @@
             public Object getParent(Object child) {
                 return Model.getFacade().getModelElementContainer(child);
             }
+            
+            public boolean isEnabled() {
+                return (Model.getFacade().isABehavioralFeature(getTarget()) 
+                        || Model.getFacade().isAEvent(getTarget())
+                        ) && super.isEnabled();
+            }
         });
         addAction(new ActionNewParameter());
         addAction(new ActionAddDataType());
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.