Author: penyaskito
Date: 2008-10-07 04:16:55-0700
New Revision: 15900

Modified:
   
branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java

Log:
Issue 5418: Attribute multiplicity proppanel update problem. Fix by Michiel.

Modified: 
branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
Url: 
http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java?view=diff&rev=15900&p1=branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&p2=branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&r1=15899&r2=15900
==============================================================================
--- 
branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
        (original)
+++ 
branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
        2008-10-07 04:16:55-0700
@@ -24,11 +24,8 @@
 
 package org.argouml.uml.ui;
 
-import java.awt.Dimension;
-import java.awt.Rectangle;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -54,7 +51,6 @@
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.tigris.gef.presentation.Fig;
-import org.tigris.gef.presentation.FigText;
 
 /**
  * ComboBox Model for UML modelelements. <p>
@@ -197,6 +193,12 @@
                     if (elem != null && !contains(elem)) {
                         addElement(elem);
                     }
+                    /* MVW: for this case, I had to move the 
+                     * call to setSelectedItem() outside the "buildingModel", 
+                     * otherwise the combo does not update 
+                     * with the new selection. See issue 5418. 
+                     **/
+                    buildingModel = false;
                     setSelectedItem(elem);
                 }
             }
@@ -210,6 +212,7 @@
                 if (evt.getPropertyName().equals(propertySetName) 
                     && (evt.getSource() == getTarget())) {
                     Object elem = evt.getNewValue();
+                    /* TODO: Here too? */
                     setSelectedItem(elem);
                 } else {
                     Object o = getChangedElement(evt);
@@ -220,6 +223,7 @@
             if (evt.getPropertyName().equals(propertySetName) 
                     && (evt.getSource() == getTarget())) {
                 if (evt.getOldValue() == getSelectedItem()) {
+                    /* TODO: Here too? */
                     setSelectedItem(evt.getNewValue());
                 }
             } else {
@@ -233,10 +237,10 @@
                 && evt.getPropertyName().equals(propertySetName)) {
             /* This should not be necessary, but let's be sure: */
             addElement(evt.getNewValue());
-            /* TODO: MVW: for this case, I have to move the 
+            /* MVW: for this case, I have to move the 
              * call to setSelectedItem() outside the "buildingModel", otherwise
              * the combo does not update with the new selection. 
-             * Does the same not apply in the cases above? */
+             * The same does probably apply to the cases above! */
             buildingModel = false;
             setSelectedItem(evt.getNewValue());
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to