Request for review: 7124528 [macosx] Selection is not cleared properly in text component.

Sergey Bylokhov sergey.bylokhov at oracle.com
Wed Feb 8 09:14:28 PST 2012


08.02.2012 20:16, Mike Swingler пишет:
> On Feb 8, 2012, at 8:04 AM, Sergey Bylokhov wrote:
>
>> 08.02.2012 20:03, Mike Swingler wrote:
>>> On Feb 8, 2012, at 2:05 AM, Sergey Bylokhov wrote:
>>>
>>>> Hi Everyone,
>>>> Now we reset selection in text components on focuslost event.
>>>>
>>>> Bug: http://monaco.sfbay.sun.com/detail.jsf?cr=7124528
>>>> Webrev can be found at: http://cr.openjdk.java.net/~serb/7124528/webrev.00/
>>> That bug isn't publicly accessible. Could you give us the gist of it?
>> jira:
>> http://java.net/jira/browse/MACOSX_PORT-616
>
> Thanks. After this fix, does the text field completely select it's contents when it is re-focused by tabbing into it?
Under aqua l&f text components reselect text if cursor was at first or 
at last position.
AquaCaret.java
public void focusGained(final FocusEvent e) {
....
final int dot = getDot();
final int mark = getMark();
if (dot == mark) {
if (dot == 0) {
component.setCaretPosition(end);
component.moveCaretPosition(0);
} else if (dot == end) {
component.setCaretPosition(0);
component.moveCaretPosition(end);
}
}
....
If this is wrong behavior we probably should change it in aqua?
>
> If so, this fix looks good.
>
> Cheers,
> Mike Swingler
> Apple Inc.
>


-- 
Best regards, Sergey.



More information about the macosx-port-dev mailing list