I have a java UNO application that opens an OpenOffice document, and
provides the user with a swing UI to manipulate the document.

The swing application has a toolbar that provides various mark-up and
editing tools that act on the document.

I want to enable / disable some of these toolbar actions based on the
state of the viewcursor in the openoffice document.

for. e.g. if the cursor is in a particular section a toolbar action is
enabled, or if an image is selected in the document certain toolbar
items are disabled and so on....

Currently i do this within a swing timer thread that does all these
checks perioidically on the document and changes the state of the
toolbar approriately.  However this is quite expensive as I have to do
all the checks everytime in the timer thread.

Is there a standard way I can make openoffice send notifications to my
application about such changes ? I have been looking at attaching an
XEventLister to the document's XComponent object and notifiying the
application from within the XEventListener class .... but is this the
correct way to do it ? or is there a better way to do this ?

thanks

ashok

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to