classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] RFC: Suggested change in PlainView.


From: Roman Kennke
Subject: Re: [cp-patches] RFC: Suggested change in PlainView.
Date: Thu, 03 Nov 2005 22:49:50 +0100

Hi Audrius,

Am Donnerstag, den 03.11.2005, 15:50 +0100 schrieb Meskauskas Audrius:
> Our JTextField contains an "imaginary" end of line character (0xA), but 
> the new text must be always inserted before it, not after. When clicking 
> right from the last character in the field, the 
> PlainTextView.viewToModel should return the position before the end of 
> line character and not after the end of line character. Otherwise the 
> inputs blocks. If the empty field receives focus by the mouse click, the 
> caret position is always set after the 0xA and, a result, it is never 
> possible to enter any text in the field.

Wow, good observations and bug finding. You are right, the Content model
of the PlainDocument contains an imaginary 0xA character at the end.
This should not be exposed via the Document accessor methods, also not
by the viewToModel or getText. Your patch fixes you problem, but at best
hides the real problem, beeing that this newline character is somehow
counted in in getText.

I can fix this tomorrow. Thanks for this good observations.

/Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

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