Package org.odftoolkit.odfdom.changes
Class Table<T>
- java.lang.Object
-
- org.odftoolkit.odfdom.changes.Component
-
- org.odftoolkit.odfdom.changes.Table<T>
-
public class Table<T> extends Component
A MultiCoomponent uses a single XML element to represent multiple components. This container can be used for spreadsheet row and cell components using repeated elements via an attribute.- Author:
- svante.schubertATgmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static intETERNITYUsed to indicate that the end position is not existingstatic IntegerMAX_COLUMN_NUMBER_CALCThe maximal number of columns being generated.static IntegerMAX_COLUMN_NUMBER_EXCELstatic IntegerMAX_ROW_NUMBERThe maximal number of rows being generated.-
Fields inherited from class org.odftoolkit.odfdom.changes.Component
mRootElement
-
-
Constructor Summary
Constructors Constructor Description Table(OdfElement componentElement, Component parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(int index, Component c)Adds the given component to the root elementstatic List<Integer>collectColumnWidths(TableTableElement tableElement, List<TableTableColumnElement> columns)NodegetChildNode(int index)ListgetChildren()org.json.JSONArraygetPosition()static StringgetProperty(OdfStyleProperty prop, OdfStylableElement element)static List<TableTableColumnElement>getTableColumnElements(Element parent, List columns)Returns all TableTableColumn descendants that exist within the tableElement, even within groups, columns and header elementsvoidhasChangedWidth()booleanisWidthChangeRequired()org.json.JSONArraypopTableGrid()voidpushTableGrid(List<Integer> columnWidths)voidpushTableGrid(org.json.JSONArray tableGrid)OH PLEASE DELETE ME AFTER THE API WAS FIXEDNoderemove(int index)Removes a component from the text element container.intrepetition()A multiple components can be represented by a single XML elementvoidreplaceLastTableGrid(org.json.JSONArray tableGrid)voidrequireLaterWidthChange(org.json.JSONArray start)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, getChildNode, getCorrectStartElementOfChild, getFamily, getFamilyDisplayName, getFamilyID, getFamilyID, getFamilyName, getLastChild, getMainStyleGroupingId, getMainStyleGroupingId, getNextSiblingOf, getOwnerDocument, getParent, getParentOf, getPosition, getPositionString, getRootComponent, getRootElement, getStyleNamePrefix, getStyleNamePrefix, hasRepeated, hasRepeated, indexOf, isComponentRoot, isComponentRoot, isComponentWrapper, isComponentWrapper, isCoveredComponentRoot, isDocumentRoot, isField, isFooterRoot, isHeaderRoot, isRowComponentRoot, isRowComponentRoot, isShapeElement, isTextComponentRoot, isTextComponentRoot, isTextSelection, isWhiteSpaceElement, toString
-
-
-
-
Field Detail
-
ETERNITY
public static final int ETERNITY
Used to indicate that the end position is not existing- See Also:
- Constant Field Values
-
MAX_ROW_NUMBER
public static final Integer MAX_ROW_NUMBER
The maximal number of rows being generated. Unspecified by ODF but commonly used. Counting starts with 0.
-
MAX_COLUMN_NUMBER_CALC
public static final Integer MAX_COLUMN_NUMBER_CALC
The maximal number of columns being generated. Unspecified by ODF but commonly used. Counting starts with 0.
-
MAX_COLUMN_NUMBER_EXCEL
public static final Integer MAX_COLUMN_NUMBER_EXCEL
-
-
Constructor Detail
-
Table
public Table(OdfElement componentElement, Component parent)
-
-
Method Detail
-
repetition
public int repetition()
A multiple components can be represented by a single XML element- Overrides:
repetitionin classComponent- Returns:
- the number of components the elements represents
-
getChildren
public List getChildren()
- Overrides:
getChildrenin classComponent
-
addChild
public void addChild(int index, Component c)Adds the given component to the root element
-
getChildNode
public Node getChildNode(int index)
- Overrides:
getChildNodein classComponent- Parameters:
index- the position of the row being returned- Returns:
- either a text node of size 1 or an element being the root element of a component
-
remove
public Node remove(int index)
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
-
getProperty
public static String getProperty(OdfStyleProperty prop, OdfStylableElement element)
- Returns:
- a property value.
-
collectColumnWidths
public static List<Integer> collectColumnWidths(TableTableElement tableElement, List<TableTableColumnElement> columns)
-
getTableColumnElements
public static List<TableTableColumnElement> getTableColumnElements(Element parent, List columns)
Returns all TableTableColumn descendants that exist within the tableElement, even within groups, columns and header elements
-
pushTableGrid
public void pushTableGrid(org.json.JSONArray tableGrid)
OH PLEASE DELETE ME AFTER THE API WAS FIXED
-
requireLaterWidthChange
public void requireLaterWidthChange(org.json.JSONArray start)
-
isWidthChangeRequired
public boolean isWidthChangeRequired()
-
hasChangedWidth
public void hasChangedWidth()
-
getPosition
public org.json.JSONArray getPosition()
-
popTableGrid
public org.json.JSONArray popTableGrid()
-
replaceLastTableGrid
public void replaceLastTableGrid(org.json.JSONArray tableGrid)
-
-