svn commit: r13586 - trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-09-24 18:37:44-0700
New Revision: 13586

Modified:
   trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java

Log:
Remove old listener on target change.  Only add new listener if visible.

Modified: trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java?view=diff&rev=13586&p1=trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java&r1=13585&r2=13586
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/PropPanelString.java	2007-09-24 18:37:44-0700
@@ -90,11 +90,16 @@
      * @see org.argouml.ui.TabTarget#setTarget(java.lang.Object)
      */
     public void setTarget(Object t) {
+        if (target != null) {
+            target.removePropertyChangeListener(this);
+        }
 	if (t instanceof FigText) {
 	    target = (FigText) t;
 	    // to circumvent too many registered listeners
 	    target.removePropertyChangeListener(this);
-	    target.addPropertyChangeListener(this);
+	    if (isVisible()) {
+	        target.addPropertyChangeListener(this);
+	    }
 	}
 
     }
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.