javax.print.attribute.standard.PrinterStateReason Java Examples

The following examples show how to use javax.print.attribute.standard.PrinterStateReason. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnixPrintService.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #2
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #3
Source File: RasterPrinterJob.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #4
Source File: Win32PrintService.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #5
Source File: UnixPrintService.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #6
Source File: RasterPrinterJob.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #7
Source File: Win32PrintService.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #8
Source File: UnixPrintService.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #9
Source File: RasterPrinterJob.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #10
Source File: Win32PrintService.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #11
Source File: Win32PrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #12
Source File: RasterPrinterJob.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #13
Source File: Win32PrintService.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #14
Source File: UnixPrintService.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #15
Source File: RasterPrinterJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #16
Source File: Win32PrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #17
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #18
Source File: RasterPrinterJob.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #19
Source File: Win32PrintService.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #20
Source File: UnixPrintService.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #21
Source File: Win32PrintService.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #22
Source File: Win32PrintService.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #23
Source File: UnixPrintService.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #24
Source File: RasterPrinterJob.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #25
Source File: Win32PrintService.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #26
Source File: UnixPrintService.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #27
Source File: RasterPrinterJob.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}
 
Example #28
Source File: Win32PrintService.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #29
Source File: UnixPrintService.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
 
Example #30
Source File: RasterPrinterJob.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws <code>PrinterException</code> if the specified service
 * cannot support the <code>Pageable</code> and
 * <code>Printable</code> interfaces necessary to support 2D printing.
 * @param a print service which supports 2D printing.
 *
 * @throws PrinterException if the specified service does not support
 * 2D printing or no longer available.
 */
public void setPrintService(PrintService service)
    throws PrinterException {
    if (service == null) {
        throw new PrinterException("Service cannot be null");
    } else if (!(service instanceof StreamPrintService) &&
               service.getName() == null) {
        throw new PrinterException("Null PrintService name.");
    } else {
        // Check the list of services.  This service may have been
        // deleted already
        PrinterState prnState = (PrinterState)service.getAttribute(
                                              PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                (PrinterStateReasons)service.getAttribute(
                                             PrinterStateReasons.class);
            if ((prnStateReasons != null) &&
                (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
            {
                throw new PrinterException("PrintService is no longer available.");
            }
        }


        if (service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE) &&
            service.isDocFlavorSupported(
                                         DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
            myService = service;
        } else {
            throw new PrinterException("Not a 2D print service: " + service);
        }
    }
}