Event Handlers
The listing below shows how to listen for and use events.
01 // The following lines attach to the document events using a default implementation
02 // for the events and override one of its methods.
03 // If you want to override all document events, it is better to derive your listener class
04 // from DocumentEvents and implement all methods of this interface.
05 Document doc = authenticDesktop.getActiveDocument();
06 doc.addListener(new DocumentEventsDefaultHandler()
07 {
08 @Override
09 public boolean onBeforeCloseDocument(Document i_ipDoc) throws AutomationException
10 {
11 System.out.println("Document " + i_ipDoc.getName() + " requested closing.");
12
13 // allow closing of document
14 return true;
15 }
16 });
17 doc.close(true);
18 doc = null;