RFR: 8295248: JEditorPane HTML form with multi selection broke drawing after reseting [v2]
Damon Nguyen
dnguyen at openjdk.org
Fri Oct 21 22:55:49 UTC 2022
On Mon, 17 Oct 2022 01:38:00 GMT, Toshio Nakamura <tnakamura at openjdk.org> wrote:
>> When JEditorPane shown HTML form with multi-selection, the reset operation broke its drawing.
>>
>> There are two issues. The current method `OptionListModel.removeIndexInterval()` disabled selections, but it didn't fire the change. Then, no re-drawing. Another issue is the method works as remove and shift. Then, selection values were corrupted.
>> I think the clear method `OptionListModel.clearSelection()` is suitable here.
>>
>> Test: jdk_desktop on macOS (x64, Monterey), Linux (x64, RHEL8), and Windows (x64, 2012R2).
>> No regression found
>
> Toshio Nakamura has updated the pull request incrementally with one additional commit since the last revision:
>
> Update testcase
Changes requested by dnguyen (Author).
test/jdk/javax/swing/text/html/TestResetSelectForm.java line 93:
> 91: if (getMaxColorDiff(baseColor, c) > LIMIT) {
> 92: throw new RuntimeException("Unexpected List selection at " +
> 93: (i+1) + ", " + baseColor + "," + c);
The points mentioned seem valid since I see the same things when I test it myself. OptionListModel's clearSelection is being called without the drawing updating. The fix seems logical and works as intended.
Just to nitpick, adding a space before and after the '+' in '(i+1)' here would match the pattern of all the other additions.
-------------
PR: https://git.openjdk.org/jdk/pull/10685
More information about the client-libs-dev
mailing list