当前位置: 首页>>代码示例>>Java>>正文


Java PrinterIsAcceptingJobs.ACCEPTING_JOBS属性代码示例

本文整理汇总了Java中javax.print.attribute.standard.PrinterIsAcceptingJobs.ACCEPTING_JOBS属性的典型用法代码示例。如果您正苦于以下问题:Java PrinterIsAcceptingJobs.ACCEPTING_JOBS属性的具体用法?Java PrinterIsAcceptingJobs.ACCEPTING_JOBS怎么用?Java PrinterIsAcceptingJobs.ACCEPTING_JOBS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.print.attribute.standard.PrinterIsAcceptingJobs的用法示例。


在下文中一共展示了PrinterIsAcceptingJobs.ACCEPTING_JOBS属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPrinterIsAcceptingJobsSysV

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() {
    String command = "/usr/bin/lpstat -a " + printer;
    String results[]= UnixPrintServiceLookup.execCmd(command);

    if (results != null && results.length > 0) {
        if (results[0].startsWith(printer + " accepting requests")) {
            return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
        }
        else if (results[0].startsWith(printer)) {
            /* As well as "myprinter accepting requests", look for
             * "[email protected] accepting requests".
             */
            int index = printer.length();
            String str = results[0];
            if (str.length() > index &&
                str.charAt(index) == '@' &&
                str.indexOf(" accepting requests", index) > 0 &&
                str.indexOf(" not accepting requests", index) == -1) {
               return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }
    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:UnixPrintService.java

示例2: getPrinterIsAcceptingJobsAIX

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;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:UnixPrintService.java

示例3: getPrinterIsAcceptingJobsSysV

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() {
    String command = "/usr/bin/lpstat -a " + printer;
    String results[]= PrintServiceLookupProvider.execCmd(command);

    if (results != null && results.length > 0) {
        if (results[0].startsWith(printer + " accepting requests")) {
            return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
        }
        else if (results[0].startsWith(printer)) {
            /* As well as "myprinter accepting requests", look for
             * "[email protected] accepting requests".
             */
            int index = printer.length();
            String str = results[0];
            if (str.length() > index &&
                str.charAt(index) == '@' &&
                str.indexOf(" accepting requests", index) > 0 &&
                str.indexOf(" not accepting requests", index) == -1) {
               return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
            }
        }
    }
    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:UnixPrintService.java

示例4: getPrinterIsAcceptingJobsAIX

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;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:UnixPrintService.java

示例5: getPrinterIsAcceptingJobs

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
    if (getJobStatus(printer, 2) != 1) {
        return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS;
    }
    else {
        return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Win32PrintService.java

示例6: getPrinterIsAcceptingJobsBSD

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsBSD() {
    if (UnixPrintServiceLookup.cmdIndex ==
        UnixPrintServiceLookup.UNINITIALIZED) {

        UnixPrintServiceLookup.cmdIndex =
            UnixPrintServiceLookup.getBSDCommandIndex();
    }

    String command = "/usr/sbin/lpc status " + printer
        + lpcStatusCom[UnixPrintServiceLookup.cmdIndex];
    String results[]= UnixPrintServiceLookup.execCmd(command);

    if (results != null && results.length > 0) {
        if (UnixPrintServiceLookup.cmdIndex ==
            UnixPrintServiceLookup.BSD_LPD_NG) {
            if (results[0].startsWith("enabled enabled")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
            }
        } else {
            if ((results[1].trim().startsWith("queuing is enabled") &&
                results[2].trim().startsWith("printing is enabled")) ||
                (results.length >= 4 &&
                 results[2].trim().startsWith("queuing is enabled") &&
                 results[3].trim().startsWith("printing is enabled"))) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
            }
        }
    }
    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:UnixPrintService.java

示例7: getPrinterIsAcceptingJobs

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
    if (UnixPrintServiceLookup.isSysV()) {
        return getPrinterIsAcceptingJobsSysV();
    } else if (UnixPrintServiceLookup.isBSD()) {
        return getPrinterIsAcceptingJobsBSD();
    } else if (UnixPrintServiceLookup.isAIX()) {
        return getPrinterIsAcceptingJobsAIX();
    } else {
        return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:UnixPrintService.java

示例8: getPrinterIsAcceptingJobsBSD

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsBSD() {
    if (PrintServiceLookupProvider.cmdIndex ==
        PrintServiceLookupProvider.UNINITIALIZED) {

        PrintServiceLookupProvider.cmdIndex =
            PrintServiceLookupProvider.getBSDCommandIndex();
    }

    String command = "/usr/sbin/lpc status " + printer
        + lpcStatusCom[PrintServiceLookupProvider.cmdIndex];
    String results[]= PrintServiceLookupProvider.execCmd(command);

    if (results != null && results.length > 0) {
        if (PrintServiceLookupProvider.cmdIndex ==
            PrintServiceLookupProvider.BSD_LPD_NG) {
            if (results[0].startsWith("enabled enabled")) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
            }
        } else {
            if ((results[1].trim().startsWith("queuing is enabled") &&
                results[2].trim().startsWith("printing is enabled")) ||
                (results.length >= 4 &&
                 results[2].trim().startsWith("queuing is enabled") &&
                 results[3].trim().startsWith("printing is enabled"))) {
                return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
            }
        }
    }
    return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:UnixPrintService.java

示例9: getPrinterIsAcceptingJobs

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
    if (PrintServiceLookupProvider.isSysV()) {
        return getPrinterIsAcceptingJobsSysV();
    } else if (PrintServiceLookupProvider.isBSD()) {
        return getPrinterIsAcceptingJobsBSD();
    } else if (PrintServiceLookupProvider.isAIX()) {
        return getPrinterIsAcceptingJobsAIX();
    } else {
        return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:UnixPrintService.java

示例10: updateForSelectedService

/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  PrinterMakeAndModel att1 =
    getSelectedPrintService().getAttribute(PrinterMakeAndModel.class);
  typValue.setText(att1 == null ? "" : att1.getValue());

  PrinterInfo att2 =
    getSelectedPrintService().getAttribute(PrinterInfo.class);
  infoValue.setText(att2 == null ? "" : att2.getValue());

  PrinterIsAcceptingJobs att3 =
    getSelectedPrintService().getAttribute(PrinterIsAcceptingJobs.class);
  PrinterState att4 =
    getSelectedPrintService().getAttribute(PrinterState.class);

  String status = att4.toString();
  if (att3 == PrinterIsAcceptingJobs.ACCEPTING_JOBS)
    status += " - " + getLocalizedString("lb.acceptingjobs");
  else if (att3 == PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS)
    status += " - " + getLocalizedString("lb.notacceptingjobs");

  statusValue.setText(status);

  if (categorySupported(Destination.class))
    {
      fileRedirection_cb.setEnabled(false);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:33,代码来源:PrinterDialog.java

示例11: updateForSelectedService

/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  PrinterMakeAndModel att1 =
    getSelectedPrintService().getAttribute(PrinterMakeAndModel.class);
  typValue.setText(att1 == null ? "" : att1.getValue());
  
  PrinterInfo att2 = 
    getSelectedPrintService().getAttribute(PrinterInfo.class);
  infoValue.setText(att2 == null ? "" : att2.getValue());
  
  PrinterIsAcceptingJobs att3 =
    getSelectedPrintService().getAttribute(PrinterIsAcceptingJobs.class);
  PrinterState att4 =
    getSelectedPrintService().getAttribute(PrinterState.class);
  
  String status = att4.toString();  
  if (att3 == PrinterIsAcceptingJobs.ACCEPTING_JOBS)
    status += " - " + getLocalizedString("lb.acceptingjobs");
  else if (att3 == PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS)
    status += " - " + getLocalizedString("lb.notacceptingjobs");
  
  statusValue.setText(status);
  
  if (categorySupported(Destination.class))
    {
      fileRedirection_cb.setEnabled(false);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:33,代码来源:PrinterDialog.java

示例12: getPrinterIsAcceptingJobs

private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs() {
    if (UnixPrintServiceLookup.isSysV()) {
        return getPrinterIsAcceptingJobsSysV();
    } else if (UnixPrintServiceLookup.isBSD()) {
        return getPrinterIsAcceptingJobsBSD();
    } else {
        return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:9,代码来源:UnixPrintService.java


注:本文中的javax.print.attribute.standard.PrinterIsAcceptingJobs.ACCEPTING_JOBS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。