Interface WebappAuthorSchemaAwareActionsHandler


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

    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
    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
    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
    Handles a paste with a text content.
    void
    Handles a paste with an XML content.
    void
    Inserts the given character at the current caret position.
    void
    Inserts the given Unicode code point at the current caret position.
  • Method Details

    • handleHtmlPaste

      void handleHtmlPaste(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(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(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 BadLocationException
      Copy from offset to offset inclusive.
      Returns:
      The doc fragment with the copy text.
      Throws:
      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, 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