RFR: 8314070: javax.print: Support IPP output-bin attribute extension [v3]

Phil Race prr at openjdk.org
Sun Apr 14 00:59:49 UTC 2024


On Thu, 7 Dec 2023 12:34:13 GMT, Alexander Scherbatiy <alexsch at openjdk.org> wrote:

> One more question which I have relates to the java common print dialog. It needs to contain list of available output bins. Is it safe to assume that the first output bin retrieved by `ppdFindOption(ppd, "OutputBin")` is the default one? Or should there be added one more `Default` option for the default output bin selection?

You should definitely query for the default.  But then how to use it ..

The way the dialog works is that there's an initial set of attributes (needed if the user cancels)
and the "asCurrent" which starts out as a copy of that inital set.
Anything not in the initial set, or if the default value is not supported, we look for the default value - assuming
that the category is supported at all -  and that's what is the selected item in the dialog UI but that does
NOT cause the default to be copied to asCurrent.
So if the user selects a different printer, the dialog gets the new printer's default - if any is supported.
The general idea being anything they didn't touch should mean "use the default".

But if the user explicitly selects a value it is added to asCurrent and carried over to the next printer, so long
as it is a supported value there, otherwise its discarded (at least that's the intended idea).
So if you don't know the default, it isn't very easy to do the right thing.

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

PR Comment: https://git.openjdk.org/jdk/pull/16166#issuecomment-2053828563


More information about the client-libs-dev mailing list