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 thexpathLocation
and according with therelativePosition
.
-
-
-
Method Detail
-
insertXMLFragment
void insertXMLFragment(java.lang.String xmlFragment, java.lang.String xpathLocation, RelativeInsertPosition relativePosition) throws TextOperationException
Insert an XML fragment relative to the node identified by thexpathLocation
and according with therelativePosition
.After the operation the caret will be positioned in the first leaf of the fragment.
- Parameters:
xmlFragment
- The XML fragment.xpathLocation
- The XPath location.relativePosition
- The position relative to the node identified by the XPath location. Can be one of the constants:AuthorConstants.POSITION_BEFORE
,AuthorConstants.POSITION_AFTER
,AuthorConstants.POSITION_INSIDE_FIRST
orAuthorConstants.POSITION_INSIDE_LAST
.- Throws:
TextOperationException
- Unable to insert the fragment.
-
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
-
-