Class 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 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
    • Method Detail

      • repetition

        public int repetition()
        A multiple components can be represented by a single XML element
        Overrides:
        repetition in class Component
        Returns:
        the number of components the elements represents
      • addChild

        public void addChild​(int index,
                             Component c)
        Adds the given component to the root element
        Overrides:
        addChild in class Component
        Parameters:
        c - the component of the row to be added
        index - starting with 0 representing the position of the child, if -1 the new child will be appended
      • getChildNode

        public Node getChildNode​(int index)
        Overrides:
        getChildNode in class Component
        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
        Overrides:
        remove in class Component
        Parameters:
        index - row position to be removed
        Returns:
        the row being removed
      • 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
        Overrides:
        size in class Component
        Returns:
        the number of child components
      • 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