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

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-12-18 05:43:15-0800
New Revision: 17665

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBox.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java

Log:
Remove model listeners when combo is removed from panel

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBox.java?view=diff&pathrev=17665&r1=17664&r2=17665
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBox.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBox.java	2009-12-18 05:43:15-0800
@@ -30,7 +30,6 @@
 import javax.swing.JComboBox;
 
 import org.argouml.ui.LookAndFeelMgr;
-import org.argouml.ui.targetmanager.TargettableModelView;
 import org.argouml.uml.ui.UMLListCellRenderer2;
 
 
@@ -109,4 +108,9 @@
     public Object getTarget() {
         return ((UMLComboBoxModel) getModel()).getTarget();
     }
+    
+    @Override
+    public void removeNotify() {
+        ((UMLComboBoxModel) getModel()).removeModelEventListener();
+    }
 }

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java?view=diff&pathrev=17665&r1=17664&r2=17665
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java	2009-12-18 05:43:15-0800
@@ -417,6 +417,13 @@
         }
     }
     
+    public void removeModelEventListener() {
+        Model.getPump().addModelEventListener(this, comboBoxTarget,
+                propertySetName);
+        removeOtherModelEventListeners(comboBoxTarget);
+    }
+
+    
     /**
      * Build the minimal number of items in the model for the edit box
      * to be populated. By default this calls buildModelList but it

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

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.