Package org.odftoolkit.odfdom.changes
Class TextContainer<T>
java.lang.Object
org.odftoolkit.odfdom.changes.Component
org.odftoolkit.odfdom.changes.TextContainer<T>
This container can be used for components including a mix of text and elements, where each
character and element are components. Instead of a list of this mixed components only a list of
the elements is being held
- Author:
- svante.schubertATgmail.com
-
Field Summary
Fields inherited from class org.odftoolkit.odfdom.changes.Component
mRootElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given component to the root elementappendChild(Node node) voidappendText(Text text) getChildNode(int index) getChildNode(int startIndex, int endIndex) intremove(int index) Removes a component from the text element container.voidremoveText(int start, int end) intsize()All children of the root element will be traversed.Methods inherited from class org.odftoolkit.odfdom.changes.Component
createChildComponent, createChildComponent, createComponent, get, get, getAllStyleGroupingIdProperties, getAllStyleGroupingIdProperties, getChildren, getCorrectStartElementOfChild, getFamily, getFamilyDisplayName, getFamilyID, getFamilyID, getFamilyName, getLastChild, getMainStyleGroupingId, getMainStyleGroupingId, getNextSiblingOf, getOwnerDocument, getParent, getParentOf, getPosition, getPositionString, getRootComponent, getRootElement, getStyleNamePrefix, getStyleNamePrefix, hasRepeated, hasRepeated, isComponentRoot, isComponentRoot, isComponentWrapper, isComponentWrapper, isCoveredComponentRoot, isDocumentRoot, isField, isFooterRoot, isHeaderRoot, isRowComponentRoot, isRowComponentRoot, isShapeElement, isTextComponentRoot, isTextComponentRoot, isTextSelection, isWhiteSpaceElement, repetition, toString
-
Constructor Details
-
TextContainer
-
-
Method Details
-
appendText
-
removeText
public void removeText(int start, int end) -
appendChild
-
addChild
Adds the given component to the root element -
getChildNode
- Overrides:
getChildNodein classComponent- Returns:
- either a text node of size 1 or an element being the root element of a component
-
getChildNode
- Overrides:
getChildNodein classComponent- Returns:
- either a text node from start index and cut after endIndex) or an element being the root element of a component
-
remove
Removes a component from the text element container. Removes either an element representing a component or text node of size 1 -
size
public int size()All children of the root element will be traversed. If it is a text node the size is added, if it is an element and a component a size of one is added, if it is a marker, for known text marker elements (text:span, text:bookmark) the children are recursive checked -
indexOf
-