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

项目:OpenJSharp    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:OpenJSharp    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:jdk8u-jdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:openjdk-jdk10    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= PrintServiceLookupProvider.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:openjdk-jdk10    文件:UnixPrintService.java   
@SuppressWarnings("unchecked")
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:openjdk9    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= PrintServiceLookupProvider.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:openjdk9    文件:UnixPrintService.java   
@SuppressWarnings("unchecked")
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk9    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:jdk8u_jdk    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:jdk8u_jdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:lookaside_java-1.8.0-openjdk    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:lookaside_java-1.8.0-openjdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:infobip-open-jdk-8    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:infobip-open-jdk-8    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:infobip-open-jdk-8    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:jdk8u-dev-jdk    文件:UnixPrintService.java   
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() {
    // On AIX there should not be a blank after '-a'.
    String command = "/usr/bin/lpstat -a" + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    // Remove headers and bogus entries added by remote printers.
    results = filterPrinterNamesAIX(results);

    if (results != null && results.length > 0) {
        for (int i = 0; i < results.length; i++) {
            if (results[i].contains("READY") ||
                results[i].contains("RUNNING")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }

    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;

}
项目:jdk8u-dev-jdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:jdk7-jdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk-source-code-learn    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:PrintServiceStub.java   
public PrintServiceStub(String name) {
    _name = name;
    _flavors = new HashSet<DocFlavor>();
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE);
    _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE);
    _attributes = new HashMap<>();
    _attributes.put(PrinterName.class, new PrinterName(name, null));
    _attributes.put(PrinterState.class, PrinterState.IDLE);
    _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location",
            null));
    _attributes.put(PrinterIsAcceptingJobs.class,
            PrinterIsAcceptingJobs.ACCEPTING_JOBS);
    _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel(
            "Custom printer", null));
    _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 });
}
项目:openjdk-jdk7u-jdk    文件:UnixPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }

    if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}