Re: How to run an add-on in a separate thread

Mathias Bauer <[email protected]>
Newsgroups gmane.comp.openoffice.devel.general
Message-ID <[email protected]>
On 21.12.2010 05:28, Zindy Minshava wrote:
>
> I am creating an add-on for OpenOffice Writer in java. In my
> application I have the need to refresh the text displayed in a GUI on
> a time basis manner.
>
> That is the user should be able to work on Writer application while
> the add on displays  different texts on a separate GUI time to time.
>
> Do I need to use separate thread for my add- on to achieve this? Or
> how can I achieve these idle time intervals without effecting the
> Writer application?
>
> Can anyone help me with this.. :)
Java components that are created from inside OOo will use the same 
thread as the code that created it. So if you want to run your code in 
parallel, you must create a thread. It is true that OOo has some issues 
with using its API from multiple threads, but it depends on what exactly 
you want to do in the thread if the answer is "you can do it, but be 
prepared for problems" or "you can do it, no problems".

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.