On Mon, 9 Jan 2023 17:28:36 GMT, Damon Nguyen <[email protected]> wrote:
>> FileChooser Open/Approve button size is shown incorrectly when no Approve
>> button text is set in `CUSTOM_DIALOG` type. Reason being that no default
>> Approve Button text is returned during Dialog Type Property change. Since
>> `null` is returned as Button string the Button size is incorrectly shown.
>> The fix here addresses the issue by adding a default Approve Button Text
>> when no text is set explicitly in case of `CUSTOM_DIALOG` type.
>> Automated test is attached which has been tested with multiple test runs.
>
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
> line 413:
>
>> 411: helpButtonText =
>> UIManager.getString("FileChooser.helpButtonText",l);
>> 412: directoryOpenButtonText =
>> UIManager.getString("FileChooser.directoryOpenButtonText",l);
>> 413: customApproveButtonText =
>> UIManager.getString("FileChooser.customApproveButtonText", l);
>
> Not sure if it needs to be addressed throughout the file, but for the "L" var
> at the end of each getString(), sometimes there's a space after the comma and
> sometimes there's none. Maybe it's better to follow the same convention
> throughout the file. Maybe it's better to just copy the lines above the one's
> you added to match the code block only.
Follow the style in the surrounding code so that newly added lines aren't out
of place.
For new isolated code, follow the common Java code style where spaces are added.
-------------
PR: https://git.openjdk.org/jdk/pull/11901