Merge
This commit is contained in:
commit
dd364409e2
@ -59,6 +59,8 @@ import javax.print.PrintService;
|
||||
import javax.print.StreamPrintService;
|
||||
import javax.print.attribute.HashPrintRequestAttributeSet;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
import javax.print.attribute.PrintServiceAttributeSet;
|
||||
import javax.print.attribute.standard.PrinterName;
|
||||
import javax.print.attribute.standard.Chromaticity;
|
||||
import javax.print.attribute.standard.Copies;
|
||||
import javax.print.attribute.standard.Destination;
|
||||
@ -471,6 +473,9 @@ public class PSPrinterJob extends RasterPrinterJob {
|
||||
PrintService pServ = getPrintService();
|
||||
if (pServ != null) {
|
||||
mDestination = pServ.getName();
|
||||
if (UnixPrintServiceLookup.isMac()) {
|
||||
mDestination = ((IPPPrintService)pServ).getDest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -766,8 +771,12 @@ public class PSPrinterJob extends RasterPrinterJob {
|
||||
}
|
||||
}
|
||||
if (mDestType == RasterPrinterJob.PRINTER) {
|
||||
if (getPrintService() != null) {
|
||||
mDestination = getPrintService().getName();
|
||||
PrintService pServ = getPrintService();
|
||||
if (pServ != null) {
|
||||
mDestination = pServ.getName();
|
||||
if (UnixPrintServiceLookup.isMac()) {
|
||||
mDestination = ((IPPPrintService)pServ).getDest();
|
||||
}
|
||||
}
|
||||
PrinterSpooler spooler = new PrinterSpooler();
|
||||
java.security.AccessController.doPrivileged(spooler);
|
||||
|
@ -1099,6 +1099,15 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
|
||||
|
||||
if (category == PrinterName.class) {
|
||||
return (T)(new PrinterName(printer, null));
|
||||
} else if (category == PrinterInfo.class) {
|
||||
PrinterInfo pInfo = new PrinterInfo(printer, null);
|
||||
AttributeClass ac = (getAttMap != null) ?
|
||||
(AttributeClass)getAttMap.get(pInfo.getName())
|
||||
: null;
|
||||
if (ac != null) {
|
||||
return (T)(new PrinterInfo(ac.getStringValue(), null));
|
||||
}
|
||||
return (T)pInfo;
|
||||
} else if (category == QueuedJobCount.class) {
|
||||
QueuedJobCount qjc = new QueuedJobCount(0);
|
||||
AttributeClass ac = (getAttMap != null) ?
|
||||
@ -1566,7 +1575,24 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
|
||||
}
|
||||
}
|
||||
|
||||
String getDest() {
|
||||
return printer;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
/*
|
||||
* Mac is using printer-info IPP attribute for its human-readable printer
|
||||
* name and is also the identifier used in NSPrintInfo:setPrinter.
|
||||
*/
|
||||
if (UnixPrintServiceLookup.isMac()) {
|
||||
PrintServiceAttributeSet psaSet = this.getAttributes();
|
||||
if (psaSet != null) {
|
||||
PrinterInfo pName = (PrinterInfo)psaSet.get(PrinterInfo.class);
|
||||
if (pName != null) {
|
||||
return pName.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return printer;
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ import javax.print.attribute.PrintJobAttribute;
|
||||
import javax.print.attribute.PrintJobAttributeSet;
|
||||
import javax.print.attribute.PrintRequestAttribute;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
import javax.print.attribute.PrintServiceAttributeSet;
|
||||
import javax.print.attribute.standard.Copies;
|
||||
import javax.print.attribute.standard.Destination;
|
||||
import javax.print.attribute.standard.DocumentName;
|
||||
@ -76,6 +77,7 @@ import javax.print.attribute.standard.Media;
|
||||
import javax.print.attribute.standard.MediaSize;
|
||||
import javax.print.attribute.standard.MediaSizeName;
|
||||
import javax.print.attribute.standard.OrientationRequested;
|
||||
import javax.print.attribute.standard.PrinterName;
|
||||
import javax.print.attribute.standard.RequestingUserName;
|
||||
import javax.print.attribute.standard.NumberUp;
|
||||
import javax.print.attribute.standard.Sides;
|
||||
@ -120,6 +122,9 @@ public class UnixPrintJob implements CancelablePrintJob {
|
||||
UnixPrintJob(PrintService service) {
|
||||
this.service = service;
|
||||
mDestination = service.getName();
|
||||
if (UnixPrintServiceLookup.isMac()) {
|
||||
mDestination = ((IPPPrintService)service).getDest();
|
||||
}
|
||||
mDestType = UnixPrintJob.DESTPRINTER;
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,12 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 4485755 6361370 6448717 5080051 6939417
|
||||
* @bug 4485755 6361370 6448717 5080051 6939417 8016343
|
||||
* @summary dialog doesn't have way to specify margins
|
||||
* for 6361370, verify exception for offline printer in Windows
|
||||
* for 6448717, faster display of print dialog
|
||||
* for 6500903, verify status of printer if accepting jobs or not
|
||||
* for 8016343, verify printing to non-default printer
|
||||
* @author prr
|
||||
* @run main/manual DialogMargins
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user