Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.JobName


                AttributeSet attrs = new HashAttributeSet();
                attrs.add(Finishings.EDGE_STITCH);
                attrs.add(MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
                attrs.add(new Destination(uri));
                attrs.add(new DocumentName("Doc X", Locale.US));
                attrs.add(new JobName("Job Y", Locale.US));
                attrs.add(new RequestingUserName("User Z", Locale.US));

                for (int j = 0; j < flavors.length; j++) {
                    if (services[i].isDocFlavorSupported(flavors[j])) {
                        AttributeSet aset = services[i]
View Full Code Here


        if (jobNameTxt.isEnabled()) {
            String name = jobNameTxt.getText();
            if (name.length() == 0) {
                removeAttribute(JobName.class);
            } else {
                newAttrs.add(new JobName(name, Locale.getDefault()));
            }
        } else {
            removeAttribute(JobName.class);
        }
    }
View Full Code Here

     * @see org.apache.harmony.x.print.PrintClient#getDefaultAttributeValue(
     * java.lang.Class)
     */
    public Object getDefaultAttributeValue(Class category) {
        if (category.equals(JobName.class)) {
            return new JobName("Java GDI client print job", Locale.US);
        } else if (category.equals(RequestingUserName.class)) {
            return new RequestingUserName(System.getProperty("user.name"),
                    Locale.US);
        } else if (category.equals(Destination.class)) {
            File file = new File(System.getProperty("user.dir") +
View Full Code Here

    }

    String getJobName(PrintRequestAttributeSet attrs) {
        if (attrs != null) {
            if (attrs.containsKey(JobName.class)) {
                JobName name = (JobName)attrs.get(JobName.class);
                return name.getValue();
            }
        }
        return "Java GDI client print job";
    }
View Full Code Here

        "Attribute value '" + this.sides + "' is not supported.");
      this.printRequestAttributeSet.add(this.sides);
    }

    if (StringUtils.hasText(this.printJobName)) {
      this.printRequestAttributeSet.add(new JobName(this.printJobName, Locale.getDefault()));
    }

    super.onInit();

  }
View Full Code Here

        }

        PrintRequestAttributeSet attributes =
            new HashPrintRequestAttributeSet();
        attributes.add(new Copies(getCopies()));
        attributes.add(new JobName(getJobName(), null));

        try {
            setAttributes(attributes);
        } catch (PrinterException e) {
        }
        this.attributes = attributes;

        boolean doPrint = printDialog(attributes);
        if (doPrint) {
            JobName jobName = (JobName)attributes.get(JobName.class);
            if (jobName != null) {
                setJobName(jobName.getValue());
            }
            Copies copies = (Copies)attributes.get(Copies.class);
            if (copies != null) {
                setCopies(copies.getValue());
            }
View Full Code Here

        JobSheets jobSheets = (JobSheets)attributes.get(JobSheets.class);
        if (jobSheets != null) {
            noJobSheet = jobSheets == JobSheets.NONE;
        }

        JobName jobName = (JobName)attributes.get(JobName.class);
        if (isSupportedValue(jobName,  attributes) ||
            (!fidelity & jobName != null)) {
            jobNameAttr = jobName.getValue();
        } else {
            jobNameAttr = getJobName();
        }

        RequestingUserName userName =
View Full Code Here

        if (attributes == null) {
            attributes = new HashPrintRequestAttributeSet();
        }
        attributes.add(new Copies(getCopies()));
        attributes.add(new JobName(getJobName(), null));
        boolean doPrint = printDialog(attributes);
        if (doPrint) {
            JobName jobName = (JobName)attributes.get(JobName.class);
            if (jobName != null) {
                setJobName(jobName.getValue());
            }
            Copies copies = (Copies)attributes.get(Copies.class);
            if (copies != null) {
                setCopies(copies.getValue());
            }
View Full Code Here

     */
    private void copyAttributes() {

        attributes = new HashPrintRequestAttributeSet();
        printerJob.setJobName(docTitle);
        attributes.add(new JobName(docTitle, null));

        JobAttributes.DestinationType dest = jobAttributes.getDestination();
        if (dest == JobAttributes.DestinationType.PRINTER) {
            String printerName = jobAttributes.getPrinter();
            if (printerName != null && printerName != "") {
View Full Code Here

      }

      private void updateTextfields(FocusEvent event)
      {
        if (event.getSource() == jobname_tf)
            atts.add(new JobName(jobname_tf.getText(), null));
        else
            atts.add(new RequestingUserName(username_tf.getText(), null));
      }
View Full Code Here

TOP

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

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.