svn commit: r18398 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-05-18 13:36:01-0700
New Revision: 18398

Removed:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java
Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java

Log:
Further changes required for issue 6086. It seems that when selecting a new operation for a call event were were only chnaging the GUI but not actually changing anything in the model.

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=18398&r1=18397&r2=18398
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	2010-05-18 13:36:01-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() {
         
@@ -417,18 +417,18 @@
             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 UMLComboBox(model);
-                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: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBox.java?view=markup&pathrev=18397

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java?view=diff&pathrev=18398&r1=18397&r2=18398
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	2010-05-18 13:36:01-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 {
     
@@ -117,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=2610527

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.