|
Oxygen XML Editor 14.2 Author API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface ClipboardFragmentInformation
Provides information about a fragment in the clipboard.
The fragment received in the callback can either be directly processed or a new fragment can be set instead.
An easy way to modify the fragment XML content is like this:
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();
}
}
| Method Summary | |
|---|---|
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. |
| Method Detail |
|---|
int getPurposeID()
AuthorSchemaAwareEditingHandler.CREATE_FRAGMENT_PURPOSE_COPY
AuthorSchemaAwareEditingHandler.CREATE_FRAGMENT_PURPOSE_CUT
AuthorSchemaAwareEditingHandler.CREATE_FRAGMENT_PURPOSE_DND_COPY
AuthorSchemaAwareEditingHandler.CREATE_FRAGMENT_PURPOSE_DND_MOVE
java.lang.String getClipboardObjectID()
java.lang.String getFragmentOriginalLocation()
AuthorDocumentFragment getFragment()
void setFragment(AuthorDocumentFragment newFragment)
newFragment - The fragment which will be pasted/dropped.
|
Oxygen XML Editor 14.2 Author API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||