Interface PrinterPeer


public interface PrinterPeer
What a backend's window implements so that Printer can print through it: the system's own print dialog, owned by the window, and the hand-over of a PDF to the system once the dialog is confirmed.

Called on the UI thread. The stage completes on the UI thread, and the UI thread is never blocked while the dialog is open: the window waits, as it does for the system's file choosers. A peer that cannot ask answers PrintResult.UNAVAILABLE; one that asked and failed logs why and answers PrintResult.FAILED. A peer never throws for what the PDF holds.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PrinterPeer
    The peer of a window with no printing under it: nothing is asked.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Shows the system's print dialog, owned by the window, and hands the job's PDF to the system if the user confirms it.
  • Field Details

    • NONE

      static final PrinterPeer NONE
      The peer of a window with no printing under it: nothing is asked.
  • Method Details

    • isAvailable

      boolean isAvailable()
      Returns:
      whether a print can be asked under this window now, without asking anything; false for a window with no desktop under it and for a Linux desktop with no print portal
    • print

      Shows the system's print dialog, owned by the window, and hands the job's PDF to the system if the user confirms it.
      Parameters:
      job - what to print
      Returns:
      what became of it, completed on the UI thread