svn commit: r18456 - branches/BRANCH_0_30_x: . src/argouml-app src/argouml-app/tests/org/argouml/profile src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms src/argouml-core-model-mdr/src/org/argouml/model/mdr src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2010-06-29 13:21:26-0700
New Revision: 18456

Removed:
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java
Modified:
   branches/BRANCH_0_30_x/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/TestUMLTagDefinitionComboBoxModel.java   (props changed)
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java

Log:
Merged issue 6086.

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java?view=diff&pathrev=18456&r1=18455&r2=18456
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java	2010-06-29 13:21:26-0700
@@ -738,8 +738,9 @@
                 }
             }
             /* TODO: This is the 2nd part of this method: */
-            Collection imports = modelImpl.getFacade().getImportedElements(ns);
-            results.addAll(imports);
+            if (ns instanceof UmlPackage) {
+                results.addAll(modelImpl.getFacade().getImportedElements(ns));
+            }
         } catch (InvalidObjectException e) {
             throw new InvalidElementException(e);
         }

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=18456&r1=18455&r2=18456
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	2010-06-29 13:21:26-0700
@@ -67,7 +67,7 @@
  */
 class SwingUIFactory {
 	
-	private static final Logger LOG = Logger.getLogger(SwingUIFactory.class);
+    private static final Logger LOG = Logger.getLogger(SwingUIFactory.class);
     
     public SwingUIFactory() {
         
@@ -415,19 +415,19 @@
             if (Model.getFacade().isACallEvent(target)) {
                 UMLComboBoxModel model = 
                     new UMLCallEventOperationComboBoxModel(propertyName, target);
-                UMLComboBox combo = new UMLCallEventOperationComboBox(model);
+                UMLComboBox combo = new UMLComboBox(model);
                 comp = new UMLComboBoxNavigator(Translator.localize(
                         "label.operation.navigate.tooltip"),
                         combo);
             } else {
                 final UMLComboBoxModel model = 
                     new UMLCallActionOperationComboBoxModel(propertyName, target);
-                UMLComboBox operationComboBox =
+                UMLComboBox combo =
                     new UMLCallActionOperationComboBox(model,
                             model.getAction());
-                comp = new UMLComboBoxNavigator(
-                        Translator.localize("label.operation.navigate.tooltip"),
-                        operationComboBox);
+                comp = new UMLComboBoxNavigator(Translator.localize(
+                	"label.operation.navigate.tooltip"),
+                        combo);
             }
         } else if ("representedClassifier".equals(prop.getName())) {
             final UMLComboBoxModel model = 

Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java?view=markup&pathrev=18455

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java?view=diff&pathrev=18456&r1=18455&r2=18456
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	2010-06-29 13:21:26-0700
@@ -38,12 +38,14 @@
 
 package org.argouml.core.propertypanels.ui;
 
+import java.awt.event.ActionEvent;
 import java.util.ArrayList;
 import java.util.Collection;
 
 import javax.swing.Action;
 
 import org.argouml.model.Model;
+import org.argouml.ui.UndoableAction;
 
 class UMLCallEventOperationComboBoxModel extends UMLComboBoxModel {
     
@@ -70,23 +72,24 @@
         Collection ops = new ArrayList();
         if (Model.getFacade().isACallEvent(target)) {
             Object ns = Model.getFacade().getNamespace(target);
-            if (Model.getFacade().isANamespace(ns)) {
-                Collection classifiers =
-                    Model.getModelManagementHelper().getAllModelElementsOfKind(
-                            ns,
-                            Model.getMetaTypes().getClassifier());
-                for (Object classifier : classifiers) {
-                    ops.addAll(Model.getFacade().getOperations(classifier));
-                }
-                
-                // TODO: getAllModelElementsOfKind should probably do this
-                // processing of imported elements automatically
-                for (Object importedElem : Model.getModelManagementHelper()
-                        .getAllImportedElements(ns)) {
-                    if (Model.getFacade().isAClassifier(importedElem)) {
-                        ops.addAll(Model.getFacade()
-                                .getOperations(importedElem));
-                    }
+            if (Model.getFacade().isAClassifier(ns)) {
+                ns = Model.getFacade().getNamespace(ns);
+            }
+            Collection classifiers =
+                Model.getModelManagementHelper().getAllModelElementsOfKind(
+                        ns,
+                        Model.getMetaTypes().getClassifier());
+            for (Object classifier : classifiers) {
+                ops.addAll(Model.getFacade().getOperations(classifier));
+            }
+            
+            // TODO: getAllModelElementsOfKind should probably do this
+            // processing of imported elements automatically
+            for (Object importedElem : Model.getModelManagementHelper()
+                    .getAllImportedElements(ns)) {
+                if (Model.getFacade().isAClassifier(importedElem)) {
+                    ops.addAll(Model.getFacade()
+                            .getOperations(importedElem));
                 }
             }
         }
@@ -116,6 +119,35 @@
     }
     
     public Action getAction() {
-        return null;
+        return new SetAction();
     }
+    
+    private class SetAction extends UndoableAction {
+
+        /**
+         * The constructor.
+         */
+        public SetAction() {
+            super("");
+        }
+
+        /*
+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+         */
+        public void actionPerformed(ActionEvent e) {
+            super.actionPerformed(e);
+            final Object source = e.getSource();
+            if (source instanceof UMLComboBox) {
+                final Object selected = ((UMLComboBox) source).getSelectedItem();
+                final Object target = ((UMLComboBox) source).getTarget();
+                if (Model.getFacade().isACallEvent(target) 
+                    && Model.getFacade().isAOperation(selected)) {
+                    if (Model.getFacade().getOperation(target) != selected) {
+                        Model.getCommonBehaviorHelper().setOperation(
+                                target, selected);
+                    }
+                }
+            }
+        }
+    }    
 }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2627462

To unsubscribe from this discussion, e-mail: [[email protected]].
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.