@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface ClipboardFragmentInformation
public void process(ClipboardFragmentInformation fragmentInformation) {
AuthorDocumentFragment frag = fragmentInformation.getFragment();
try {
String xmlContent = authorAccess.getDocumentController().serializeFragmentToXML(frag);
//Modify the XML content here.....
//Re-create a new fragment from the XML
AuthorDocumentFragment newFragment = authorAccess.getDocumentController().createNewDocumentFragmentInContext(xmlContent, authorAccess.getEditorAccess().getCaretOffset());
fragmentInformation.setFragment(newFragment);
} catch (BadLocationException e) {
e.printStackTrace();
} catch (AuthorOperationException e) {
e.printStackTrace();
}
}| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getClipboardObjectID()
Get an unique ID of this object taken from the clipboard.
|
AuthorDocumentFragment |
getFragment()
Get the fragment which will be pasted/dropped.
|
java.lang.String |
getFragmentOriginalLocation()
Get the URL of the file from which the fragment was copied.
|
int |
getPurposeID()
Get the purpose for which this fragment is used.
|
void |
setFragment(AuthorDocumentFragment newFragment)
Set a new fragment replacing the original one which will be pasted/dropped.
|
int getPurposeID()
java.lang.String getClipboardObjectID()
java.lang.String getFragmentOriginalLocation()
AuthorDocumentFragment getFragment()
void setFragment(AuthorDocumentFragment newFragment)
newFragment - The fragment which will be pasted/dropped.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.