Fragment inside ClipboardFragmentInformation

Post here questions and problems related to oXygen frameworks/document types.
ralfpeterkorte
Posts: 5
Joined: Mon Feb 26, 2024 1:20 pm

Fragment inside ClipboardFragmentInformation

Post by ralfpeterkorte »

When using the interface ClipboardFragmentInformation I asked myself how the fragment / serializeFragmentToXML is composed by Oxygen.

Code: Select all

	  public void process(ClipboardFragmentInformation fragmentInformation) {
		AuthorDocumentFragment frag = fragmentInformation.getFragment();
		String xmlContent = authorAccess.getDocumentController().serializeFragmentToXML(frag);
		...
	}
For example when copying a table cell in full tags author mode <entry>Hello</entry> only the textual information 'Hello' is inside the fragment.
When copying a title <title>Hello</title> the whole markup <title>Hello</title> is inside the fragment.

Is there a documentation about the copy/paste behaviour how Oxygen handles special cases?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Fragment inside ClipboardFragmentInformation

Post by Radu »

Hi,
In general the pasted AuthorDocumentFragment object should contain exactly the copied content.
But there are certain cases like as you said, when an entire table cell is being copied, in this case in our code we retain only the cell content but we also have some metadata which describes that the selection was actually of an entire cell.
Unfortunately this extra information about the original selection is not available to you in the "ro.sync.ecss.extensions.api.content.ClipboardFragmentInformation" API.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply