Is there a custom Paste-Handler for certain Java objects?

<oXygen/> general issues.
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Is there a custom Paste-Handler for certain Java objects?

Post by SSC » Fri May 31, 2013 2:07 pm


I wanted to alternate the paste operation in order to paste certain data into the content.
I found the ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler and wonder if it could also be possible to paste a Java object and insert individual data according to the java objects properties.

Is something like this possible or can only xhtml be pasted to the oXygen editor?

Best regards,

Simon Scholz
vogella GmbH

Posts: 6979
Joined: Fri Jul 09, 2004 5:18 pm

Re: Is there a custom Paste-Handler for certain Java objects

Post by Radu » Fri May 31, 2013 2:54 pm

Hi Simon,

Maybe you could add a "Paste special" action which looks in the clipboard for your specific Java object.

Does the copy/paste occur in the same application or between two applications?

If it is in the same application and you control the Copy part, maybe instead of setting the object in the clipboard you could set it in a static variable and set some custom XHTML to the clipboard to signal that the object is available in that static variable. Then on paste in the AuthorExternalObjectInsertionHandler if the XHTML contains some constant you have set you could look in that static variable.

Or you could serialize the object using some base 64 encoding, set it in the clipboard wrapped in some XHTML content and then retrieve it on paste. This would work even between 2 applications.

Radu Coravu
<oXygen/> XML Editor

Post Reply