Page 1 of 1

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

Posted: Fri May 31, 2013 2:07 pm
by SSC
Hello,

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

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

Posted: Fri May 31, 2013 2:54 pm
by Radu
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.

Regards,
Radu