Hello,
I think adding the SelectionChangeListener ist done as follow:
This is how you got you XTextViewCursor:
XTextViewCursorSupplier xViewCursorSupplier = (XTextViewCursorSupplier)
UnoRuntime
.queryInterface(XTextViewCursorSupplier.class,
currentDesktopController);
It is the case that the xViewCursorSupplier supports the Service
"TextDocumentView", which include the service "OfficeDocumentView".
OfficeDocumentView exports the interface "XSelectionSupplier". (Cf to
the idl documentation). XSelection is the interface we need, since it
defines the method addSelectionChangeListener()
Thus, querying for XSelectionSupplier is done as follow:
XSelectionSupplier xSelectionSupplier = (XSelectionSupplier) UnoRuntime
.queryInterface(XSelectionSupplier.class,
xViewCursorSupplier);
Eventually add to the retrieved XSelectionSupplier your own
SelectionChangeListener:
xSelectionSupplier.addSelectionChangeListener(new
MySelectionChangeListener());
(MySelectionChangeListener is a class that implements
XSelectionChangeListener).
I hope I made no mistakes.
Regards,
Daniel
p.s.: On Staroffice 8, an event is catched then I press the keys "up
arrow" or the "down arrow", but *not* then I press the "left" or the
"right arrow". This is a bug, isn't it ?
Matthias Benkmann wrote:
On 8/18/06, Mathias Bauer <[EMAIL PROTECTED]> wrote:
If the view cursor is moved the selection also changes, so registering
as a SelectionChangedListener should be sufficient.
Thanks. That works nicely.
Can I ask where and how you add the listener? A few lines of code maybe?
/W
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]