<AWT Dev> Review Request for 8055197: TextField deletes multiline strings

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Wed Oct 21 13:59:05 UTC 2015



   Is this is Windows specific issue only? If so, it is better to 
replace EOL on window text peer side or may be even better to do it on 
the native side before setting a text to the single-line RichEdit. May 
be there are methods that can remove EOL from a string exactly in the 
same way as it is done by Edit control.

  Thanks,
  Alexandr.

On 10/19/2015 9:31 PM, Ambarish Rapte wrote:
> Hi Alexander,
>
> 	In single line mode , there is no rich edit control style to handle EOL.
> 	Referenced documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787605(v=vs.85).aspx
>
> Many Thanks
> Ambarish
>
> -----Original Message-----
> From: Alexander Scherbatiy
> Sent: Friday, October 16, 2015 4:45 PM
> To: Ambarish Rapte
> Cc: awt-dev at openjdk.java.net; Sergey Bylokhov
> Subject: Re: Review Request for 8055197: TextField deletes multiline strings
>
>
>     The TextField is based on Rich Edit control on Windows. Does the Rich Edit control have properties to properly handle multiline strings in single-line mode?
>
>     Thanks,
>     Alexandr.
>
> On 10/14/2015 7:44 PM, Ambarish Rapte wrote:
>> Dear All,
>>
>>       Please review the patch for jdk9.
>>       Bug: https://bugs.openjdk.java.net/browse/JDK-8055197
>>       Webrev:
>> http://cr.openjdk.java.net/~rchamyal/ambarish/8055197/webrev.00/
>>
>>
>> Issue:
>>       - If text containing new line character is set to TextField, Text after new line character was terminated.
>>       - Issue occurs only on windows.
>>
>> Cause:
>>       - For windows new line character is   ‘\r\n’.
>>       - For windows code this new line character was not replaced by space character.
>>       - Other platforms replace the EOL character by space character.
>>
>> Fix:
>>       - Added code to TextComponent.java to remove EOL on java side before passing to peer.
>>         => Added a private method replaceEOL() , which replaces EOL by space.
>>         => removeEOL will be called by newly added TextComponent
>> construcotr and setText()
>>
>>       - The text variable on in TextComponent.java & on string displayed on native side will be same.
>>
>>
>>
>> Many Thanks,
>> Ambarish



More information about the awt-dev mailing list