Interface TextDocumentController


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface TextDocumentController
    Contains API for inserting XML content in certain places in the Text editing mode.
    Since:
    16.1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void insertXMLFragment​(java.lang.String xmlFragment, int caretOffset)
      Insert an XML fragment at the caret location.
      void insertXMLFragment​(java.lang.String xmlFragment, java.lang.String xpathLocation, RelativeInsertPosition relativePosition)
      Insert an XML fragment relative to the node identified by the xpathLocation and according with the relativePosition.
    • Method Detail

      • insertXMLFragment

        void insertXMLFragment​(java.lang.String xmlFragment,
                               int caretOffset)
                        throws TextOperationException
        Insert an XML fragment at the caret location. When the caret offset is inside an element tag (start element, empty element or end element) tries to place the caret inside the element's contents. If the element is empty, it tries to expand the element (eg: from <a/> to <a></a>) placing the caret between the tags. After insertion is done, the caret is placed after the inserted element.
        Parameters:
        xmlFragment - The XML fragment.
        caretOffset - The caret offset
        Throws:
        TextOperationException - Unable to insert the fragment.
        Since:
        21.0