i've wrote an Extension and i'm using a CloseListener.
When i want to close the document, queryClosing gets triggerd.
My problem is: When the document is already closed, notifyClosing won't trigger.
How does notifyClosing work and how can i trigger it, after the document is closed? (like it should do)
That's my code:
Code: Select all
XTextDocument xDoc = (XTextDocument)UnoRuntime.queryInterface(
XTextDocument.class, m_xFrame.getController().getModel());
XCloseBroadcaster xClBr = (XCloseBroadcaster)UnoRuntime.queryInterface(
XCloseBroadcaster.class, xDoc);
XCloseListener xCloseListener = new XCloseListener() {
public void queryClosing(EventObject arg0, boolean arg1) throws CloseVetoException {
// WORKING
JOptionPane.showMessageDialog(null, "Close1", "Close1", JOptionPane.OK_CANCEL_OPTION);
throw new UnsupportedOperationException("Not supported yet.");
}
public void notifyClosing(EventObject arg0) {
// DOESN'T WORK
JOptionPane.showMessageDialog(null, "Close2", "Close2", JOptionPane.OK_CANCEL_OPTION);
throw new UnsupportedOperationException("Not supported yet.");
}
public void disposing(EventObject arg0) {
JOptionPane.showMessageDialog(null, "Close3", "Close3", JOptionPane.OK_CANCEL_OPTION);
throw new UnsupportedOperationException("Not supported yet.");
}
};
xClBr.addCloseListener(xCloseListener);