Hi Joel,
Joel Cordeiro escribió:
Hi,
does anyone could help me about how to get the selected text in the actual
TextDocument (Writer)? How does we cast the returned object in the method
getCurrentSelection() ? Or there is another way?
basically, you have to check if the object returned by
getCurrentSelection() is not null/void/empty (depending on your
programming language), and if not, then query for the selection's
com.sun.star.lang.XServiceInfo. According to the service supported by
the selection, you can know what is selected.
If possible, a simple example would be really nice..
http://www.ArielConstenlaHaile.com.ar/ooo/temp/WriterSelectionDetector.zip
is an example of a selection change listener, but you can adapt it
easyly (see the file
WriterSelectionDetector/src/org/openoffice/sdk/java/text/WriterSelectionListener.java,
it has some comments explaining the different types of selections).
Besides, you'll find the documentation in
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/TextView
Regards
Ariel.
--
Ariel Constenla-Haile
La Plata, Argentina
[EMAIL PROTECTED]
http://www.ArielConstenlaHaile.com.ar/ooo/
"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]