Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.PrinterName


        return printer;
    }

    private PrinterName getPrinterName() {
        if (name == null) {
            name = new PrinterName(printer, null);
        }
        return name;
    }
View Full Code Here


                            + " is not assignable from PrintServiceAttribute"); //$NON-NLS-1$
        }

        try {
            if (PrinterName.class.equals(category)) {
                return category.cast(new PrinterName(printerName, null));
            } else if (PrinterState.class.equals(category)) {
                return category.cast(WinPrinterFactory
                                .getPrinterState(getPrinterHandle()));
            } else if (QueuedJobCount.class.equals(category)) {
                return category.cast(WinPrinterFactory
View Full Code Here

    }

    public PrintServiceAttributeSet getAttributes() {
        final PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();

        attrs.add(new PrinterName(printerName, null));
        try {
            attrs.add(WinPrinterFactory.getPrinterState(getPrinterHandle()));
            attrs.add(WinPrinterFactory.getQueuedJobCount(getPrinterHandle()));
        } catch (final PrintException ex) {
            throw new RuntimeException(ex);
View Full Code Here

     * @see org.apache.harmony.x.print.PrintClient#getAttributes()
     */
    public PrintServiceAttributeSet getAttributes() {
        PrintServiceAttributeSet attributes =
            new HashPrintServiceAttributeSet();
        attributes.add(new PrinterName(serviceName, Locale.getDefault()));
        if (getColorSupported(serviceName)) {
            attributes.add(ColorSupported.SUPPORTED);
            int colorPPM = getPagesPerMinuteColor(serviceName);
            if (colorPPM > 0) {
                attributes.add(new PagesPerMinuteColor(colorPPM));
View Full Code Here

     * @see org.apache.harmony.x.print.PrintClient#getAttributes()
     */
    public PrintServiceAttributeSet getAttributes() {
        PrintServiceAttributeSet attributes =
            new HashPrintServiceAttributeSet();
        attributes.add(new PrinterName(serviceName, Locale.getDefault()));
        if (getColorSupported(serviceName)) {
            attributes.add(ColorSupported.SUPPORTED);
            int colorPPM = getPagesPerMinuteColor(serviceName);
            if (colorPPM > 0) {
                attributes.add(new PagesPerMinuteColor(colorPPM));
View Full Code Here

            }
        } else if (aname.equals("printer-name")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                // TODO need to set locale corresponded to
                // attributes-charset/attributes-natural-language
                a = new PrinterName(new String((byte[]) avalue.get(i)),
                        Locale.US);
                if (a != null) {
                    attrx.add(a);
                }
            }
View Full Code Here

         * that it meets the other requirements.
         * If printer name isn't mentioned then go a slow path checking
         * all printers if they meet the reqiremements.
         */
        PrintService[] services;
        PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
        PrintService defService;
        if (name != null && (defService = getDefaultPrintService()) != null) {
            /* To avoid execing a unix command  see if the client is asking
             * for the default printer by name, since we already have that
             * initialised.
             */

            PrinterName defName =
                (PrinterName)defService.getAttribute(PrinterName.class);

            if (defName != null && name.equals(defName)) {
                if (matchesAttributes(defService, serviceSet)) {
                    services = new PrintService[1];
View Full Code Here

            }
        } else if (aname.equals("printer-name")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                // TODO need to set locale corresponded to
                // attributes-charset/attributes-natural-language
                a = new PrinterName(new String((byte[]) avalue.get(i)),
                        Locale.US);
                if (a != null) {
                    attrx.add(a);
                }
            }
View Full Code Here

     * @see org.apache.harmony.x.print.PrintClient#getAttributes()
     */
    public PrintServiceAttributeSet getAttributes() {
        PrintServiceAttributeSet attributes =
            new HashPrintServiceAttributeSet();
        attributes.add(new PrinterName(serviceName, Locale.getDefault()));
        if (getColorSupported(serviceName)) {
            attributes.add(ColorSupported.SUPPORTED);
            int colorPPM = getPagesPerMinuteColor(serviceName);
            if (colorPPM > 0) {
                attributes.add(new PagesPerMinuteColor(colorPPM));
View Full Code Here

         * (by name) then we can save time by getting just that service
         * to check against the rest of the specified attributes.
         */
        PrintService[] services = null;
        if (serviceSet != null && serviceSet.get(PrinterName.class) != null) {
            PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
            PrintService service = getPrintServiceByName(name.getValue());
            if (service == null || !matchingService(service, serviceSet)) {
                services = new PrintService[0];
            } else {
                services = new PrintService[1];
                services[0] = service;
View Full Code Here

TOP

Related Classes of javax.print.attribute.standard.PrinterName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.