1 /* 2 * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.print.event; 27 28 /** 29 * An abstract adapter class for receiving print job events. 30 * The methods in this class are empty. 31 * This class exists as a convenience for creating listener objects. 32 * Extend this class to create a {@link PrintJobEvent} listener and override 33 * the methods for the events of interest. Unlike the 34 * {@link java.awt.event.ComponentListener ComponentListener} 35 * interface, this abstract interface provides null methods so that you 36 * only need to define the methods you need, rather than all of the methods. 37 * 38 */ 39 40 public abstract class PrintJobAdapter implements PrintJobListener { 41 42 /** 43 * Called to notify the client that data has been successfully 44 * transferred to the print service, and the client may free 45 * local resources allocated for that data. The client should 46 * not assume that the data has been completely printed after 47 * receiving this event. 48 * 49 * @param pje the event being notified 50 */ 51 public void printDataTransferCompleted(PrintJobEvent pje) { 52 } 53 54 /** 55 * Called to notify the client that the job completed successfully. 56 * 57 * @param pje the event being notified 58 */ 59 public void printJobCompleted(PrintJobEvent pje) { 60 } 61 62 63 /** 64 * Called to notify the client that the job failed to complete 65 * successfully and will have to be resubmitted. 66 * 67 * @param pje the event being notified 68 */ 69 public void printJobFailed(PrintJobEvent pje) { 70 } 71 72 /** 73 * Called to notify the client that the job was canceled 74 * by user or program. 75 * 76 * @param pje the event being notified 77 */ 78 public void printJobCanceled(PrintJobEvent pje) { 79 } 80 81 82 /** 83 * Called to notify the client that no more events will be delivered. 84 * One cause of this event being generated is if the job 85 * has successfully completed, but the printing system 86 * is limited in capability and cannot verify this. 87 * This event is required to be delivered if none of the other 88 * terminal events (completed/failed/canceled) are delivered. 89 * 90 * @param pje the event being notified 91 */ 92 public void printJobNoMoreEvents(PrintJobEvent pje) { 93 } 94 95 96 /** 97 * Called to notify the client that some possibly user rectifiable 98 * problem occurs (eg printer out of paper). 99 * 100 * @param pje the event being notified 101 */ 102 public void printJobRequiresAttention(PrintJobEvent pje) { 103 } 104 105 } | 1 /* 2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.print.event; 27 28 /** 29 * An abstract adapter class for receiving print job events. The methods in this 30 * class are empty. This class exists as a convenience for creating listener 31 * objects. Extend this class to create a {@link PrintJobEvent} listener and 32 * override the methods for the events of interest. Unlike the 33 * {@link java.awt.event.ComponentListener ComponentListener} interface, this 34 * abstract interface provides empty methods so that you only need to define the 35 * methods you need, rather than all of the methods. 36 */ 37 public abstract class PrintJobAdapter implements PrintJobListener { 38 39 /** 40 * Called to notify the client that data has been successfully transferred 41 * to the print service, and the client may free local resources allocated 42 * for that data. The client should not assume that the data has been 43 * completely printed after receiving this event. 44 * 45 * @param pje the event being notified 46 */ 47 public void printDataTransferCompleted(PrintJobEvent pje) { 48 } 49 50 /** 51 * Called to notify the client that the job completed successfully. 52 * 53 * @param pje the event being notified 54 */ 55 public void printJobCompleted(PrintJobEvent pje) { 56 } 57 58 /** 59 * Called to notify the client that the job failed to complete successfully 60 * and will have to be resubmitted. 61 * 62 * @param pje the event being notified 63 */ 64 public void printJobFailed(PrintJobEvent pje) { 65 } 66 67 /** 68 * Called to notify the client that the job was canceled by user or program. 69 * 70 * @param pje the event being notified 71 */ 72 public void printJobCanceled(PrintJobEvent pje) { 73 } 74 75 /** 76 * Called to notify the client that no more events will be delivered. One 77 * cause of this event being generated is if the job has successfully 78 * completed, but the printing system is limited in capability and cannot 79 * verify this. This event is required to be delivered if none of the other 80 * terminal events (completed/failed/canceled) are delivered. 81 * 82 * @param pje the event being notified 83 */ 84 public void printJobNoMoreEvents(PrintJobEvent pje) { 85 } 86 87 /** 88 * Called to notify the client that some possibly user rectifiable problem 89 * occurs (eg printer out of paper). 90 * 91 * @param pje the event being notified 92 */ 93 public void printJobRequiresAttention(PrintJobEvent pje) { 94 } 95 } |