harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r506130 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/text/DefaultCaret.java test/api/java/common/javax/swing/text/DefaultCaretTest.java
Date Sun, 11 Feb 2007 20:49:22 GMT
Author: ayza
Date: Sun Feb 11 12:49:22 2007
New Revision: 506130

URL: http://svn.apache.org/viewvc?view=rev&rev=506130
Log:
Applying patch from HARMONY-1768 ([classlib][swing]javax.swing.text.DefaultCaret.getSelectionPainter()
method returns null)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java?view=diff&rev=506130&r1=506129&r2=506130
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
Sun Feb 11 12:49:22 2007
@@ -380,11 +380,12 @@
 
     /**
      * Sets all fiels to default values
-     *
      */
     public DefaultCaret() {
         blinkTimer = createTimer(false, 0);
         magicTimer = createTimer(true, 0);       
+        painter = new DefaultHighlighter.DefaultHighlightPainter(
+                selectionColor);
     }
 
     public void addChangeListener(final ChangeListener changeListener) {
@@ -1002,10 +1003,10 @@
     /**
      * If current JTextComponent has NavigationFilter then call
      * getComponent.getNavigationFilter.setDot. Otherwise, sets dot and mark to
-     * a0, sets dotBias and markBias to a1. Removes highlight, if any.
+     * i, sets dotBias and markBias to b. Removes highlight, if any.
      *
-     * @param a0 new dot
-     * @param a1 new dotBias
+     * @param i new dot
+     * @param b new dotBias
      */
 
     void setDot(final int i, final Position.Bias b) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java?view=diff&rev=506130&r1=506129&r2=506130
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
Sun Feb 11 12:49:22 2007
@@ -512,6 +512,14 @@
         assertEquals(h[0].getPainter(), dc.getSelectionPainter());
         assertEquals(4, h[0].getStartOffset());
         assertEquals(9, h[0].getEndOffset());
+        
+        // Regression for HARMONY-1768
+        DefaultCaret obj = new DefaultCaret() {
+            public  Highlighter.HighlightPainter getSelectionPainter(){
+                return super.getSelectionPainter();
+            }
+        };
+        assertNotNull(obj.getSelectionPainter());
     }
 
     public void testFocusGained() throws Exception {
@@ -900,3 +908,5 @@
         assertEquals(1, jta.getHighlighter().getHighlights().length);
     }
 }
+
+



Mime
View raw message