/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
static {
}
/* The singleton win32 print lookup service.
* Code that is aware of this field and wants to use it must first
* see if its null, and if so instantiate it by calling a method such as
* javax.print.PrintServiceLookup.defaultPrintService() so that the
* same instance is stored there.
*/
/* Think carefully before calling this. Preferably don't call it. */
if (win32PrintLUS == null) {
/* This call is internally synchronized.
* When it returns an instance of this class will have
* been instantiated - else there's a JDK internal error.
*/
}
return win32PrintLUS;
}
public Win32PrintServiceLookup() {
if (win32PrintLUS == null) {
win32PrintLUS = this;
// There's no capability for Win98 to refresh printers.
// See "OpenPrinter" for more info.
return;
}
// start the printer listener thread
} /* else condition ought to never happen! */
}
/* Want the PrintService which is default print service to have
* equality of reference with the equivalent in list of print services
* This isn't required by the API and there's a risk doing this will
* lead people to assume its guaranteed.
*/
}
if (printServices == null) {
}
return printServices;
}
private synchronized void refreshServices() {
// In Windows it is safe to assume no default if printers == null so we
// don't get the default.
return;
}
if (defService != null &&
newServices[p] = defService;
} else {
if (printServices == null) {
} else {
int j;
if ((printServices[j]!= null) &&
newServices[p] = printServices[j];
printServices[j] = null;
break;
}
}
if (j == printServices.length) {
}
}
}
}
// Look for deleted services and invalidate these
if (printServices != null) {
if ((printServices[j] instanceof Win32PrintService) &&
}
}
}
}
return null;
} else {
/* getPrintServices() is now very fast. */
return printServices[i];
}
}
return null;
}
}
if (serviceSet != null) {
return false;
}
}
}
return true;
}
}
requestSet = new HashPrintRequestAttributeSet();
serviceSet = new HashPrintServiceAttributeSet();
if (attrs[i] instanceof PrintRequestAttribute) {
} else if (attrs[i] instanceof PrintServiceAttribute) {
}
}
}
/*
* Special case: If client is asking for a particular printer
* (by name) then we can save time by getting just that service
* to check against the rest of the specified attributes.
*/
} else {
}
} else {
services = getPrintServices();
}
return services;
} else {
try {
if (services[i].
}
} catch (IllegalArgumentException e) {
}
}
}
}
/*
* return empty array as don't support multi docs
*/
public MultiDocPrintService[]
}
return new MultiDocPrintService[0];
}
}
// Windows does not have notification for a change in default
// so we always get the latest.
if (defaultPrinter == null) {
return null;
}
if ((defaultPrintService != null) &&
return defaultPrintService;
}
// Not the same as default so proceed to get new PrintService.
// clear defaultPrintService
if (printServices != null) {
break;
}
}
}
if (defaultPrintService == null) {
}
return defaultPrintService;
}
long chgObj;
}
public void run() {
if (chgObj != -1) {
while (true) {
// wait for configuration to change
try {
} catch (SecurityException se) {
break;
}
} else {
break;
}
}
}
}
}
}