RFR: 8223717: javafx printing: Support Specifying Print to File in the API [v2]

Kevin Rushforth kcr at openjdk.java.net
Thu Jun 24 22:47:09 UTC 2021


On Thu, 24 Jun 2021 22:34:36 GMT, Phil Race <prr at openjdk.org> wrote:

>> This enhancement adds the String property outputFileProperty() to the JobSettings class.
>> The value should be a string that references a local file encoded as a URL.
>> If this is non-null and set to a location that the user has permission to write to,
>> then the printer output will be spooled there instead of the printer, so long as the platform printing system supports this.
>> The user can of course also set a print-to-file destination in the platform printer dialogs which may over-ride what the application set. But now the application can also see what it was set to, and cancel or alter it if necessary.
>> 
>> A simple manual test is provided, manual mainly because the few real printing functional tests are all manual as they are only useful if run with a printer configured.
>
> Phil Race has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - 8223717: javafx printing: Support Specifying Print to File in the API
>  - 8223717: javafx printing: Support Specifying Print to File in the API

One more comment on the API for the getters and setter methods.

modules/javafx.graphics/src/main/java/javafx/print/JobSettings.java line 541:

> 539:      * @since 17
> 540:      */
> 541:     public String getOutputFile() {

This should be final (as should the setter). I see that other getter and setter methods in this class are also non-final, but we shouldn't propagate this mistake.

Also, you don't need javadoc comments on the getters and setters, since it will copy them from the property (and add appropriate links).

-------------

PR: https://git.openjdk.java.net/jfx/pull/543


More information about the openjfx-dev mailing list