classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: fix for JTable.setAutoCreateColumnsFromModel()


From: David Gilbert
Subject: [cp-patches] FYI: fix for JTable.setAutoCreateColumnsFromModel()
Date: Wed, 06 Jul 2005 09:04:43 +0000
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050426)

I committed this patch to fix setAutoCreateColumnsFromModel() to match
the API spec more closely:

2005-07-06  David Gilbert  <address@hidden>

        * javax/swing/JTable.java
        (setAutoCreateColumnsFromModel): when the flag changes from false to
        true, call createDefaultColumnsFromModel().

Regards,

Dave Gilbert

Index: javax/swing/JTable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.32
diff -u -r1.32 JTable.java
--- javax/swing/JTable.java     5 Jul 2005 20:17:14 -0000       1.32
+++ javax/swing/JTable.java     6 Jul 2005 07:57:45 -0000
@@ -1421,13 +1421,20 @@
   }
 
   /**
-   * Set the value of the address@hidden #autoCreateColumnsFromModel} property.
+   * Set the value of the address@hidden #autoCreateColumnsFromModel} flag.  
If the
+   * flag changes from <code>false</code> to <code>true</code>, the
+   * address@hidden #createDefaultColumnsFromModel()} method is called.
    *
-   * @param a The new value of the autoCreateColumnsFromModel property
+   * @param autoCreate  the new value of the flag.
    */ 
-  public void setAutoCreateColumnsFromModel(boolean a)
+  public void setAutoCreateColumnsFromModel(boolean autoCreate)
   {
-    autoCreateColumnsFromModel = a;
+    if (autoCreateColumnsFromModel != autoCreate)
+    {
+      autoCreateColumnsFromModel = autoCreate;
+      if (autoCreate)
+        createDefaultColumnsFromModel();
+    }
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]