Drag and drop into Writer

In Java I’m trying to implement an XDropTargetListener, can anyone point me in the right direction.
I need to intercept the drop data and further process it before the text is inserted in the document.

I found this post link text

Where I have the exact same requirement and constraints as the original poster, but the link is quite old, missing links
and no solution at that time.

Thanks for any help.
… Simon