Java 类javax.print.attribute.standard.PrinterStateReason 实例源码

项目:OpenJSharp    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:OpenJSharp    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:OpenJSharp    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:jdk8u-jdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件:RasterPrinterJob.java   
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws {@code PrinterException} if the specified service
 * cannot support the {@code Pageable} and
 * {@code Printable} interfaces necessary to support 2D printing.
 * @param service 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 = service.getAttribute(PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                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);
        }
    }
}
项目:openjdk-jdk10    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk9    文件:RasterPrinterJob.java   
/**
 * Associate this PrinterJob with a new PrintService.
 *
 * Throws {@code PrinterException} if the specified service
 * cannot support the {@code Pageable} and
 * {@code Printable} interfaces necessary to support 2D printing.
 * @param service 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 = service.getAttribute(PrinterState.class);
        if (prnState == PrinterState.STOPPED) {
            PrinterStateReasons prnStateReasons =
                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);
        }
    }
}
项目:openjdk9    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk9    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:jdk8u_jdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:infobip-open-jdk-8    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:infobip-open-jdk-8    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:infobip-open-jdk-8    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:jdk8u-dev-jdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk7-jdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:jdk7-jdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:jdk7-jdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-source-code-learn    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:openjdk-source-code-learn    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-source-code-learn    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:OLD-OpenJDK8    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-jdk7u-jdk    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-jdk7u-jdk    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-icedtea7    文件:RasterPrinterJob.java   
/**
 * 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);
        }
    }
}
项目:openjdk-icedtea7    文件:Win32PrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}
项目:openjdk-icedtea7    文件:UnixPrintService.java   
private PrinterStateReasons getPrinterStateReasons() {
    if (isInvalid) {
        PrinterStateReasons psr = new PrinterStateReasons();
        psr.put(PrinterStateReason.SHUTDOWN, Severity.ERROR);
        return psr;
    } else {
        return null;
    }
}