svn commit: r15900 - branches/BRANCH_0_26_x/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
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());
         }
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.