[OpenJDK 2D-Dev] RFR: 8203796: Define API to support specifying ownership of print dialogs.

Phil Race philip.race at oracle.com
Mon Jun 4 19:39:59 UTC 2018

I have posted an updated webrev http://cr.openjdk.java.net/~prr/8203796.1
which removes the "native id" case from the public API. Now the plan is
that any code that needs to specify this will need to use native code to 
set it.
The CSR text is also updated, and so is the referenced FX webrev


On 05/25/2018 11:04 AM, Phil Race wrote:
> This defines a new class "DialogOwner" implementing PrintRequestAttribute
> which allows an application to specify that a Print or Page dialog be  
> one of
> 1) owned by an application specified AWT window
> 2) owned by an application specified foreign (non-AWT) window
> 3) use AWT's alwaysOnTop functionality where supported.
> JDK bug: https://bugs.openjdk.java.net/browse/JDK-8203796
> CSR : https://bugs.openjdk.java.net/browse/JDK-8203834
> JDK webrev : http://cr.openjdk.java.net/~prr/8203796/
> Please review the webrev and the CSR.
> The webrev will show that this functionality was already mostly 
> available but only as internal API.
> To help applications be able to query what is supported, the various
> PrintService implementation classes needed to be updated, for example 
> "ID"
> is reported as unsupported unless specifying using the native dialog 
> on windows.
> That actually pointed out that back in JDK 7 when we added 
> DialogTypeSelection
> to be able to choose native or Swing there was no query support for 
> that to be
> added. It was not a problem though as if it was not supported it 
> really just meant
> that applications would have to live with what dialog was provided, as 
> before.
> But it made a test for this new API more difficult .. so I added code 
> needed for that.
> The test is manual. An automated test might be possible, but probably 
> very flaky.
> But the test only makes you run through the scenarios that we know are 
> supportable.
> The motivation for this new public API is to help OpenJFX since it 
> uses the Java 2D PrinterJob class
> to implement its own printing, so there is also an FX side to switch 
> to using this instead
> of the earlier internal API which it can not access when it is outside 
> the JDK :
> FX bug : https://bugs.openjdk.java.net/browse/JDK-8195808
> FX webrev: http://cr.openjdk.java.net/~prr/8195808/
> -phil.

More information about the 2d-dev mailing list