Interface AuthorDocumentFilterBypass


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface AuthorDocumentFilterBypass
    Used as a way to circumvent calling back into the AuthorDocumentController to change the AuthorDocument.
    • Method Detail

      • insertText

        void insertText​(int offset,
                        java.lang.String text)
        Inserts a text at the given offset. After the operation the caret will be positioned at the end of the inserted text.
        Parameters:
        offset - The insert position, 0 based.
        text - The text to be inserted.
      • insertNode

        boolean insertNode​(int offset,
                           AuthorNode node)
        Insert the specified node at the given offset.
        Parameters:
        offset - The offset where the node will be inserted. 0 based.
        node - The AuthorNode to insert.
        Returns:
        true if the operation was successful.
      • insertMultipleElements

        void insertMultipleElements​(AuthorElement parentElement,
                                    java.lang.String[] elementNames,
                                    int[] offsets,
                                    java.lang.String namespace)
        Insert multiple elements at the given offsets.
        Note: The offsets and elements must be in document order.
        Parameters:
        parentElement - The parent element that contains all the new inserted elements.
        elementNames - The element names to be inserted.
        offsets - The absolute offsets where the elements will be inserted. 0 based.
        namespace - The namespace of the new inserted elements.
      • insertMultipleFragments

        boolean insertMultipleFragments​(AuthorElement parentElement,
                                        AuthorDocumentFragment[] fragments,
                                        int[] offsets)
        Insert multiple fragments at the given offsets.
        Note: The offsets and fragments must be in document order.
        Parameters:
        parentElement - The parent element that contains all the new inserted elements.
        fragments - The fragments to be inserted.
        offsets - The absolute offsets where the elements will be inserted. 0 based.
        Returns:
        true if the operation succeed.
        Since:
        14
      • delete

        boolean delete​(int startOffset,
                       int endOffset,
                       boolean withBackspace)
        Deletes a document fragment between the start and end offset.
        Parameters:
        startOffset - Start offset, 0 based and inclusive.
        endOffset - End offset, 0 based and inclusive.
        withBackspace - true if BACKSPACE key was used when deleting the fragment.
        Returns:
        true if the delete operation was successful.
      • deleteNode

        boolean deleteNode​(AuthorNode node)
        Deletes the specified node from the document.
        Parameters:
        node - The AuthorNode to delete.
        Returns:
        true if the delete node operation was successful.
      • multipleDelete

        void multipleDelete​(AuthorElement parentElement,
                            int[] startOffsets,
                            int[] endOffsets)
        Deletes the given intervals.
        Note: The offsets must be in document order and the intervals must not intersect with each other.
        Parameters:
        parentElement - The element that contains all the deleted intervals.
        startOffsets - The start offset for each interval. Must be in document order. 0 based and inclusive.
        endOffsets - The end offset for each interval. Must be in document order. 0 based and inclusive.
      • renameElement

        void renameElement​(AuthorElement element,
                           java.lang.String newName,
                           java.lang.Object infoProvider)
        Rename the given element. Any compound must be handled externally.
        Parameters:
        element - The AuthorElement that is renamed.
        newName - The new name for the element.
        infoProvider - Information provider used for internal processing.
      • setAttribute

        void setAttribute​(java.lang.String attributeName,
                          AttrValue value,
                          AuthorElement element)
        Sets the value of an attribute in the specified element. Attributes set in this manner (as opposed to calling AuthorElement.setAttribute(String, AttrValue) directly) will be subject to undo/redo.
        Parameters:
        attributeName - Name of the attribute being changed.
        value - New AttrValue for the attribute. If null, the attribute is removed from the element.
        element - The AuthorElement whose attribute is changing.
      • removeAttribute

        void removeAttribute​(java.lang.String attributeName,
                             AuthorElement element)
        Removes an attribute from the given element. Attributes removed in this manner (as opposed to calling AuthorElement.setAttribute(String, AttrValue) directly) will be subject to undo/redo.
        Parameters:
        attributeName - Name of the attribute to remove.
        element - The AuthorElement whose attribute will be removed.
      • split

        boolean split​(AuthorNode toSplit,
                      int splitOffset)
        Splits the specified node at the given offset. The attributes of the splitted node will also be copied excepting the unique ones. The unique attributes are identified by the UniqueAttributesRecognizer.
        Parameters:
        toSplit - The AuthorNode to split.
        splitOffset - The split offset. The offset must be greater or equal to 1 and less than the current document length.
        Returns:
        true if the node was split.
      • surroundWithNode

        void surroundWithNode​(AuthorNode node,
                              int startOffset,
                              int endOffset,
                              boolean leftToRight)
        Surrounds the fragment between the specified offset with the specified node. The fragment between the start and end offsets will become the node actual content.
        Parameters:
        node - The AuthorNode that will surround the fragment.
        startOffset - Start offset of the surrounded fragment. 0 based and inclusive.
        endOffset - End offset of the surrounded fragment. 0 based and inclusive.
        leftToRight - true if after the operation the selection in the author page is done from the left to the right.
      • surroundInFragment

        void surroundInFragment​(java.lang.String xmlFragment,
                                int startOffset,
                                int endOffset)
                         throws AuthorOperationException
        Surround the content between the given offsets with the xmlFragment. If endOffset < startOffset the xmlFragment will be inserted at startOffset.
        Parameters:
        xmlFragment - The XML fragment which will surround the given interval. The first leaf node of the XML fragment will be the parent of the surrounded content.
        startOffset - The start offset of the content to be surrounded, 0 based and inclusive.
        endOffset - The end offset of the content to be surrounded, 0 based and inclusive.
        Throws:
        AuthorOperationException - If the content between start and end offset could not be surrounded.
      • surroundInText

        void surroundInText​(java.lang.String header,
                            java.lang.String footer,
                            int startOffset,
                            int endOffset)
                     throws AuthorOperationException
        Surround the content between the given offsets with plain text fragments(without XML parsing). The method inserts the header at startOffset and the footer at endOffset.
        Parameters:
        header - The header to be inserted before the surrounded text.
        footer - The footer to be inserted after the surrounded text.
        startOffset - The start offset of the text to be surrounded, 0 based and inclusive.
        endOffset - The end offset of the text to be surrounded, 0 based and inclusive.
        Throws:
        AuthorOperationException - If the operation failed.
      • setDoctype

        void setDoctype​(AuthorDocumentType docType)
        Set a new internal document type to the Author content. This is a good method to add new entities (regular or unparsed) to the internal document type of the document. WARNING: if these modifications affect regular entities already inserted and expanded, they will not be re-parsed and their old content will remain rendered as such.
        Parameters:
        docType - The document type information.
      • surroundInFragment

        void surroundInFragment​(AuthorDocumentFragment xmlFragment,
                                int startOffset,
                                int endOffset)
                         throws AuthorOperationException
        Surround the content between the given offsets with the xmlFragment. If endOffset < startOffset the xmlFragment will be inserted at startOffset.
        Parameters:
        xmlFragment - The XML fragment which will surround the given interval. The first leaf node of the XML fragment will be the parent of the surrounded content.
        startOffset - The start offset of the content to be surrounded, 0 based and inclusive.
        endOffset - The end offset of the content to be surrounded, 0 based and inclusive.
        Throws:
        AuthorOperationException
        Since:
        12.1
      • setMultipleDistinctAttributes

        void setMultipleDistinctAttributes​(int parentElementStartOffset,
                                           int[] elementOffsets,
                                           java.util.List<java.util.Map<java.lang.String,​AttrValue>> attributes)
        Sets the value of the given attribute in the specified elements. Attributes set in this manner will be subject to undo/redo.
        Parameters:
        parentElementStartOffset - The start offset of the parent element.
        elementOffsets - The start offset for each element.
        attributes - The list with attributes. Every attribute name is mapped to an AttrValue object. If the value is null, the attribute will be removed.
      • setMultipleAttributes

        void setMultipleAttributes​(int parentElementStartOffset,
                                   int[] elementOffsets,
                                   java.util.Map<java.lang.String,​AttrValue> attributes)
        Sets the value of the given attribute in the specified elements. Attributes set in this manner will be subject to undo/redo.
        Parameters:
        parentElementStartOffset - The start offset of the parent element.
        elementOffsets - The start offset for each element.
        attributes - The list with attributes. Every attribute name is mapped to an AttrValue object. If the value is null, the attribute will be removed.
      • addCommentMarker

        AuthorPersistentHighlight addCommentMarker​(int startOffset,
                                                   int endOffset,
                                                   java.lang.String comment,
                                                   java.lang.String parentID)
        Add a comment marker for the given interval.
        Parameters:
        startOffset - Start offset of marker
        endOffset - End offset of marker
        comment - The comment to be added.
        parentID - The comment parent id (not null for replies).
        Returns:
        The added comment highlight if the comment was added or null.
        Since:
        22
      • addPersistentMarker

        AuthorPersistentHighlight addPersistentMarker​(AuthorPersistentHighlight.PersistentHighlightType type,
                                                      int startOffset,
                                                      int endOffset,
                                                      java.util.Map<java.lang.String,​java.lang.String> properties)
        Add a comment marker for the given interval.
        Parameters:
        type - The persistent marker type (comment or custom)
        startOffset - Start offset of marker
        endOffset - End offset of marker
        properties - not null comment properties.
        Returns:
        The added comment highlight if the comment was added or null.
        Since:
        23
      • removeMarker

        boolean removeMarker​(AuthorPersistentHighlight marker)
        Remove a persistent marker
        Parameters:
        marker - The marker
        Returns:
        True if the marker was removed
        Since:
        22