Interface WebappAuthorSchemaAwareActionsHandler


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface WebappAuthorSchemaAwareActionsHandler
    Handles schema aware actions like paste.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void 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 handleCopy()
      Copy from offset to offset inclusive.
      ro.sync.ecss.component.AuthorClipboardObject handleCut()
      Cuts from offset to offset inclusive.
      void handleDragAndDrop​(int start, int end, int target)
      Drag and drop from offset to offset inclusive.
      void handleHtmlPaste​(java.lang.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​(java.lang.String text)
      Handles a paste with a text content.
      void handleXmlPaste​(java.lang.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 Detail

      • handleHtmlPaste

        void handleHtmlPaste​(java.lang.String html)
                      throws InvalidEditException
        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

        void handleXmlPaste​(java.lang.String xml)
                     throws InvalidEditException
        Handles a paste with an XML content.
        Parameters:
        xml - the XML content.
        Throws:
        InvalidEditException - If the paste could not be performed.
      • handleTextPaste

        void handleTextPaste​(java.lang.String text)
                      throws InvalidEditException
        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 paste
        removeSelection - Remove the selection
        pasteAsXml - If true treat the pasted text as an xml fragment. Else escape it and insert it.
        Throws:
        InvalidEditException - When paste was rejected.
      • handleCopy

        ro.sync.ecss.component.AuthorClipboardObject handleCopy()
                                                         throws javax.swing.text.BadLocationException
        Copy from offset to offset inclusive.
        Returns:
        The doc fragment with the copy text.
        Throws:
        javax.swing.text.BadLocationException
      • handleCut

        ro.sync.ecss.component.AuthorClipboardObject handleCut()
                                                        throws InvalidEditException
        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

        void delete​(boolean del,
                    boolean wordLevel)
             throws InvalidEditException
        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,
                               javax.swing.text.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.
        javax.swing.text.BadLocationException - If the target is in a bad location.
        Since:
        21.1.1