Interface WebappAuthorSchemaAwareActionsHandler
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface WebappAuthorSchemaAwareActionsHandler
Handles schema aware actions like paste.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(boolean del, boolean wordLevel) Deletes the the current selection using information from the schema associated to the document such that document is left in a valid state.ro.sync.ecss.component.AuthorClipboardObject
Copy from offset to offset inclusive.ro.sync.ecss.component.AuthorClipboardObject
Cuts from offset to offset inclusive.void
handleDragAndDrop
(int targetOffset, boolean doCut) Drag and drop selection to the given location.void
handleDragAndDrop
(int start, int end, int target) Drag and drop from offset to offset inclusive.void
handleHtmlPaste
(String html) Handles a paste with an HTML content from an external source.void
handlePaste
(ro.sync.ecss.component.AuthorClipboardObject toPaste, boolean removeSelection, boolean pasteAsXml) Paste a fragment.void
handleTextPaste
(String text) Handles a paste with a text content.void
handleXmlPaste
(String xml) Handles a paste with an XML content.void
insertCharAtCurrentOffset
(char ch) Inserts the given character at the current caret position.void
insertCodePointAtCurrentOffset
(int codePoint) Inserts the given Unicode code point at the current caret position.
-
Method Details
-
handleHtmlPaste
Handles a paste with an HTML content from an external source.- Parameters:
html
- The HTML content.- Throws:
InvalidEditException
- If the paste could not be performed.
-
handleXmlPaste
Handles a paste with an XML content.- Parameters:
xml
- the XML content.- Throws:
InvalidEditException
- If the paste could not be performed.
-
handleTextPaste
Handles a paste with a text content.- Parameters:
text
- the text content.- Throws:
InvalidEditException
- If the paste could not be performed.
-
handlePaste
void handlePaste(ro.sync.ecss.component.AuthorClipboardObject toPaste, boolean removeSelection, boolean pasteAsXml) throws InvalidEditException Paste a fragment.- Parameters:
toPaste
- The fragment to pasteremoveSelection
- Remove the selectionpasteAsXml
- Iftrue
treat the pasted text as an xml fragment. Else escape it and insert it.- Throws:
InvalidEditException
- When paste was rejected.
-
handleCopy
Copy from offset to offset inclusive.- Returns:
- The doc fragment with the copy text.
- Throws:
BadLocationException
-
handleCut
Cuts from offset to offset inclusive.- Returns:
- The doc fragment with the cut text.
- Throws:
InvalidEditException
-
insertCharAtCurrentOffset
void insertCharAtCurrentOffset(char ch) Inserts the given character at the current caret position. Any selected content is first deleted.- Parameters:
ch
- The character to insert.
-
insertCodePointAtCurrentOffset
void insertCodePointAtCurrentOffset(int codePoint) Inserts the given Unicode code point at the current caret position. Any selected content is first deleted.- Parameters:
codePoint
- The code point to insert.- Since:
- 26.1
**************************************
EXPERIMENTAL - Subject to change
**************************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
delete
Deletes the the current selection using information from the schema associated to the document such that document is left in a valid state.- Parameters:
del
-true
if the deletion was triggered by a DEL.wordLevel
- Whether we should delete an entire word.- Throws:
InvalidEditException
- If the edit fails.
-
handleDragAndDrop
void handleDragAndDrop(int start, int end, int target) throws InvalidEditException, BadLocationException Drag and drop from offset to offset inclusive.- Parameters:
start
- The start offset of the dragged fragment.end
- The end offset of the dragged fragment.target
- The location where the fragment is dropped.- Throws:
InvalidEditException
- If the edit fails.BadLocationException
- If the target is in a bad location.- Since:
- 21.1.1
-
handleDragAndDrop
void handleDragAndDrop(int targetOffset, boolean doCut) throws InvalidEditException, BadLocationException Drag and drop selection to the given location.- Parameters:
targetOffset
- The location where the fragment is dropped.doCut
- True to cut, otherwise copy.- Throws:
InvalidEditException
- If the edit fails.BadLocationException
- If the target is in a bad location.- Since:
- 26.1.1
-