javax.print.event.PrintJobListener Java Examples

The following examples show how to use javax.print.event.PrintJobListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PSStreamPrintJob.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #2
Source File: Win32PrintJob.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #3
Source File: PSStreamPrintJob.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void addPrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (jobListeners == null) {
            jobListeners = new Vector<>();
        }
        jobListeners.add(listener);
    }
}
 
Example #4
Source File: PSStreamPrintJob.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #5
Source File: PSStreamPrintJob.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void notifyEvent(int reason) {
    synchronized (this) {
        if (jobListeners != null) {
            PrintJobListener listener;
            PrintJobEvent event = new PrintJobEvent(this, reason);
            for (int i = 0; i < jobListeners.size(); i++) {
                listener = jobListeners.elementAt(i);
                switch (reason) {

                    case PrintJobEvent.JOB_CANCELED :
                        listener.printJobCanceled(event);
                        break;

                    case PrintJobEvent.JOB_FAILED :
                        listener.printJobFailed(event);
                        break;

                    case PrintJobEvent.DATA_TRANSFER_COMPLETE :
                        listener.printDataTransferCompleted(event);
                        break;

                    case PrintJobEvent.NO_MORE_EVENTS :
                        listener.printJobNoMoreEvents(event);
                        break;

                    case PrintJobEvent.JOB_COMPLETE :
                        listener.printJobCompleted(event);
                        break;

                    default:
                        break;
                }
            }
        }
   }
}
 
Example #6
Source File: PSStreamPrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addPrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (jobListeners == null) {
            jobListeners = new Vector<>();
        }
        jobListeners.add(listener);
    }
}
 
Example #7
Source File: PSStreamPrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #8
Source File: PSStreamPrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void notifyEvent(int reason) {
    synchronized (this) {
        if (jobListeners != null) {
            PrintJobListener listener;
            PrintJobEvent event = new PrintJobEvent(this, reason);
            for (int i = 0; i < jobListeners.size(); i++) {
                listener = jobListeners.elementAt(i);
                switch (reason) {

                    case PrintJobEvent.JOB_CANCELED :
                        listener.printJobCanceled(event);
                        break;

                    case PrintJobEvent.JOB_FAILED :
                        listener.printJobFailed(event);
                        break;

                    case PrintJobEvent.DATA_TRANSFER_COMPLETE :
                        listener.printDataTransferCompleted(event);
                        break;

                    case PrintJobEvent.NO_MORE_EVENTS :
                        listener.printJobNoMoreEvents(event);
                        break;

                    case PrintJobEvent.JOB_COMPLETE :
                        listener.printJobCompleted(event);
                        break;

                    default:
                        break;
                }
            }
        }
   }
}
 
Example #9
Source File: Win32PrintJob.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #10
Source File: UnixPrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addPrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (jobListeners == null) {
            jobListeners = new Vector<>();
        }
        jobListeners.add(listener);
    }
}
 
Example #11
Source File: Win32PrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addPrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (jobListeners == null) {
            jobListeners = new Vector<>();
        }
        jobListeners.add(listener);
    }
}
 
Example #12
Source File: Win32PrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #13
Source File: PSStreamPrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #14
Source File: Win32PrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #15
Source File: UnixPrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #16
Source File: UnixPrintJob.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #17
Source File: Win32PrintJob.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #18
Source File: UnixPrintJob.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #19
Source File: Win32PrintJob.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #20
Source File: UnixPrintJob.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #21
Source File: PSStreamPrintJob.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #22
Source File: Win32PrintJob.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #23
Source File: UnixPrintJob.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #24
Source File: PSStreamPrintJob.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #25
Source File: Win32PrintJob.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #26
Source File: UnixPrintJob.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #27
Source File: PSStreamPrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #28
Source File: Win32PrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #29
Source File: UnixPrintJob.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}
 
Example #30
Source File: PSStreamPrintJob.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void removePrintJobListener(PrintJobListener listener) {
    synchronized (this) {
        if (listener == null || jobListeners == null ) {
            return;
        }
        jobListeners.remove(listener);
        if (jobListeners.isEmpty()) {
            jobListeners = null;
        }
    }
}