harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r516424 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/table/DefaultTableCellRenderer.java test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java
Date Fri, 09 Mar 2007 15:05:08 GMT
Author: ayza
Date: Fri Mar  9 07:05:05 2007
New Revision: 516424

URL: http://svn.apache.org/viewvc?view=rev&rev=516424
Log:
Applying patch from HARMONY-1721 ([classlib][swing] javax.swing.table.DefaultTableCellRenderer.getBackground()
returns some default value while RI returns null)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/table/DefaultTableCellRenderer.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/table/DefaultTableCellRenderer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/table/DefaultTableCellRenderer.java?view=diff&rev=516424&r1=516423&r2=516424
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/table/DefaultTableCellRenderer.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/table/DefaultTableCellRenderer.java
Fri Mar  9 07:05:05 2007
@@ -53,8 +53,10 @@
         super.setBackground(c);
     }
 
-    public void updateUI() {
+    public void updateUI() {        
         super.updateUI();
+        setBackground(null);
+        setForeground(null);
         focusBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
         focusCellBackground = UIManager.getColor("Table.focusCellBackground");
         focusCellForeground = UIManager.getColor("Table.focusCellForeground");

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java?view=diff&rev=516424&r1=516423&r2=516424
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableCellRendererTest.java
Fri Mar  9 07:05:05 2007
@@ -156,6 +156,11 @@
         assertEquals(table.getSelectionBackground(), renderer.getBackground());
         assertEquals(table.getSelectionForeground(), renderer.getForeground());
         assertEquals(table.getFont(), renderer.getFont());
+
+        // regression test for HARMONY-1721
+        DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
+        Color c = renderer.getBackground();
+        assertNull(c);
     }
 
     public void testIsOpaque() throws Exception {



Mime
View raw message