Hi Mark,
Mark Wielaard wrote:
> Hi Carsten,
>
> On Sat, 2006-03-25 at 16:48 +0100, Carsten Neumann wrote:
>> Mark Wielaard wrote:
>>> On Fri, 2006-03-24 at 23:52 +0100, Carsten Neumann wrote:
>>>
>>>> I've implemented the method: public boolean isActive().
>>> Nice. Useful method also. Last time I worked with the DefaultCaret I was
>>> confused there wasn't such a method. I see this was added in 1.5. Could
>>> you add a @since 1.5.
>> see attached new version of patch.
>
> I see this was never applied, sorry about that.
> Could you take a look at DefaultCaret and see if it is still the correct
> way to implement this? Since you submitted the patch Robert added some
> new logic and an active field to that class.
now it's my turn to apologize for the long delay in answering your
request :-/
In answer to your question, I do believe the patch implements what the
API doc of the RI specifies, but I'm not sure if that's also what the RI
does ;)
Anyway, I updated the patch, so it is now against current cvs. I need to
finish my diploma thesis (dunno if that's the right translation) at the
moment, so I don't have the time to check the RI behaviour, sorry.
Cheers,
Carsten
Index: javax/swing/text/DefaultCaret.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.42
diff -u -r1.42 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java 21 Jun 2006 15:35:09 -0000 1.42
+++ javax/swing/text/DefaultCaret.java 21 Jun 2006 17:56:44 -0000
@@ -1147,6 +1147,24 @@
}
/**
+ * Returns <code>true</code> if this <code>Caret</code> is blinking,
+ * and <code>false</code> if not. The returned value is independent of
+ * the visiblity of this <code>Caret</code> as returned by [EMAIL PROTECTED] #isVisible()}.
+ *
+ * @return <code>true</code> if this <code>Caret</code> is blinking,
+ * and <code>false</code> if not.
+ * @see #isVisible()
+ * @since 1.5
+ */
+ public boolean isActive()
+ {
+ if (blinkTimer != null)
+ return blinkTimer.isRunning();
+
+ return false;
+ }
+
+ /**
* Returns <code>true</code> if this <code>Caret</code> is currently visible,
* and <code>false</code> if it is not.
*