notifyClosing doesn't work

Java, C++, C#, Delphi, ??? - Using the UNO bridges

notifyClosing doesn't work

Postby ber » Thu Jul 04, 2013 10:15 am

Hello,

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   Expand viewCollapse view
            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);


I hope you can unsterstand me and help me.
OpenOffice 3.4.1 on Windows 8
ber
 
Posts: 1
Joined: Thu Jul 04, 2013 10:10 am

Return to External Programs

Who is online

Users browsing this forum: No registered users and 1 guest