OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Events with Java using UNO

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
ayce
General User
General User


Joined: 27 Nov 2009
Posts: 14

PostPosted: Thu Dec 03, 2009 2:03 am    Post subject: Events with Java using UNO Reply with quote

Hi guys,

I searched an searched but can not solve my problem.
I did create a new Addon project with Netbeans for OpenOffice 3.1.1.
I just want to add an event listener to catch "save" and "close" events. Everything I need is a working example how to implement it.
Can anyone help me? I getting confused. Thanks.

greetings,
ayce
Back to top
View user's profile Send private message
ayce
General User
General User


Joined: 27 Nov 2009
Posts: 14

PostPosted: Thu Dec 03, 2009 3:00 am    Post subject: Reply with quote

Ok, I got it Smile

JAVA
Code:
document.addEventListener(new com.sun.star.document.XDocumentEventListener() {

                public void documentEventOccured(DocumentEvent arg0) {
                    JOptionPane.showMessageDialog(null, "test: document added" , "listener", JOptionPane.INFORMATION_MESSAGE);
                   
                }

                public void disposing(EventObject arg0) {
                    JOptionPane.showMessageDialog(null, "test: document removed" , "listener", JOptionPane.INFORMATION_MESSAGE);
                   
                }
            });
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group