com.levigo.jadice.printer
Class PrintManager

java.lang.Object
  extended by com.levigo.jadice.printer.PrintManager

public class PrintManager
extends Object

The PrintManager manages and executes print requests.


Method Summary
static void executePrintJob(AbstractPrinter printer)
          Executes a print job using the given printer instance.
static void executePrintJob(PrintJobConfiguration cfg)
          Executes a print job using a configuration specified in the given PrintJobConfiguration object.
static void executePrintJob(PrintJobConfiguration cfg, AbstractPrintDialog dialog)
          Executes a print job using a configuration specified in the given PrintJobConfiguration object.
static String getLastPrintServiceName()
          Returns the last used print service name if available.
static String[] getLastPrintServiceNames()
          Returns all last used print service names if available.
static boolean isPrintServiceAvailable()
          Returns whether any printing service is available.
static void setLastPrintServiceName(String lastPrintServiceName)
          Sets the last used print service name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

executePrintJob

public static void executePrintJob(AbstractPrinter printer)
Executes a print job using the given printer instance.

Whether the print job runs asynchronously or synchronously depends on the PrintJobConfiguration.isAsynchronousPrinting() setting provided by the PrintJobConfiguration retrieved with AbstractPrinter.getPrintJobConfiguration().

Parameters:
printer - the AbstractPrinter that should be executed.

executePrintJob

public static void executePrintJob(PrintJobConfiguration cfg)
Executes a print job using a configuration specified in the given PrintJobConfiguration object.

The print job runs asynchronously or synchronously depending on the PrintJobConfiguration.isAsynchronousPrinting() setting.

Parameters:
cfg - the PrintJobConfiguration that provides the configuration for the print job to be executed.

executePrintJob

public static void executePrintJob(PrintJobConfiguration cfg,
                                   AbstractPrintDialog dialog)
Executes a print job using a configuration specified in the given PrintJobConfiguration object.

The print job runs asynchronously or synchronously depending on the PrintJobConfiguration.isAsynchronousPrinting() setting.

Parameters:
cfg - the PrintJobConfiguration that provides the configuration for the print job to be executed.
dialog - a print dialog instance to be displayed before the print job execution starts. This parameter may be null.

getLastPrintServiceName

public static String getLastPrintServiceName()
Returns the last used print service name if available.

Returns:
last used print service name or null if not available.

getLastPrintServiceNames

public static String[] getLastPrintServiceNames()
Returns all last used print service names if available.

Returns:
all last used print service names or null if not available

setLastPrintServiceName

public static void setLastPrintServiceName(String lastPrintServiceName)
Sets the last used print service name.

Parameters:
lastPrintServiceName - last used print service name.
Throws:
IllegalArgumentException - if argument for lastPrintServiceName is null.

isPrintServiceAvailable

public static boolean isPrintServiceAvailable()
Returns whether any printing service is available.

Returns:
true if at least one print service is available and printing is possible, false otherwise


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.