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

Cancel event propagation in an XEventListener

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


Joined: 28 Sep 2011
Posts: 12

PostPosted: Wed Oct 19, 2011 12:54 am    Post subject: Cancel event propagation in an XEventListener Reply with quote

Is there any possibility to cancel the event propagation in an XEventListener ?

I have a class, DocumentEventListener, implementing the XEventListener interface which is added as a listener with the following code:

Code:

Object globalEventBroadcaster = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.GlobalEventBroadcaster", m_xContext);
         
XEventBroadcaster xEVBC = (XEventBroadcaster) UnoRuntime.queryInterface(XEventBroadcaster.class, globalEventBroadcaster);

xEVBC.addEventListener(new DocumentEventListener(m_xContext));



In this class I intercept the OnPrepareViewClosing event and call a project specific closing functionality, where at some point a project specific question message appears asking if the document should be saved (it has the buttons: yes, no, cancel).

If the user chooses to save the document, the project specific saving functionality is processed, that includes setting the modified flag to false and than the DocumentEventListener functionality is finished, the event is further propagated and Open Office closes the document.

If however, the user chooses to cancel the closing than the project specific handling is finished, the modified flag is not set to false, the event is further propagated and the Open Office specific question message about saving the document appears. Is there any possibility to cancel the event propagation from within the DocumentEventListener class ?

Thanks in advance !
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