This patch (committed) fixes a couple of methods in JTable to throw the required PropertyChangeEvents:

2006-07-11  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JTable.java
        (setRowSelectionAllowed): Fire required PropertyChangeEvent,
        (setColumnSelectionAllowed): Likewise.

Mauve tests to follow.

Regards,

Dave
Index: javax/swing/JTable.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.115
diff -u -r1.115 JTable.java
--- javax/swing/JTable.java     6 Jun 2006 03:33:32 -0000       1.115
+++ javax/swing/JTable.java     11 Jul 2006 16:44:46 -0000
@@ -3468,6 +3468,8 @@
    * Get the value of the [EMAIL PROTECTED] #rowSelectionAllowed} property.
    *
    * @return The current value of the property
+   * 
+   * @see #setRowSelectionAllowed(boolean)
    */
   public boolean getRowSelectionAllowed()
   {
@@ -3621,6 +3623,8 @@
    * Get the value of the <code>columnSelectionAllowed</code> property.
    *
    * @return The current value of the columnSelectionAllowed property
+   * 
+   * @see #setColumnSelectionAllowed(boolean)
    */
   public boolean getColumnSelectionAllowed()
   {
@@ -3874,11 +3878,17 @@
    * Set the value of the [EMAIL PROTECTED] #rowSelectionAllowed} property.
    *
    * @param r The new value of the rowSelectionAllowed property
+   * 
+   * @see #getRowSelectionAllowed()
    */ 
   public void setRowSelectionAllowed(boolean r)
   {
-    rowSelectionAllowed = r;
-    repaint();
+    if (rowSelectionAllowed != r) 
+      {
+        rowSelectionAllowed = r;
+        firePropertyChange("rowSelectionAllowed", !r, r);
+        repaint();
+      }
   }
 
   /**
@@ -3988,11 +3998,17 @@
    * Set the value of the <code>columnSelectionAllowed</code> property.
    *
    * @param c The new value of the property
+   * 
+   * @see #getColumnSelectionAllowed()
    */ 
   public void setColumnSelectionAllowed(boolean c)
   {
-    getColumnModel().setColumnSelectionAllowed(c);
-    repaint();
+    if (columnModel.getColumnSelectionAllowed() != c)
+      {
+        columnModel.setColumnSelectionAllowed(c);
+        firePropertyChange("columnSelectionAllowed", !c, c);
+        repaint();
+      }
   }
 
   /**

Reply via email to