Interface AuthorTableHelper

    • Method Detail

      • isTableCell

        boolean isTableCell​(AuthorNode node)
        Check if an AuthorNode is a table cell node.
        Parameters:
        node - The AuthorNode to be checked.
        Returns:
        true if the node is a table cell node, false otherwise.
      • isTableRow

        boolean isTableRow​(AuthorNode node)
        Check if an AuthorNode is a table row node.
        Parameters:
        node - The AuthorNode to be checked.
        Returns:
        true if the node is a table row node, false otherwise.
      • isTable

        boolean isTable​(AuthorNode node)
        Check if an AuthorNode is a table node.
        Parameters:
        node - The AuthorNode to be checked.
        Returns:
        true if the node is a table node, false otherwise.
      • getTableCellSpanProvider

        AuthorTableCellSpanProvider getTableCellSpanProvider​(AuthorElement tableElement)
        Create the table cell span provider for a specific table element.
        Parameters:
        tableElement - The element rendered as a table. Its 'display' CSS property is set to 'table'.
        Returns:
        The table cell span provider. Must not be null.
      • checkTableColSpanIsDefined

        void checkTableColSpanIsDefined​(AuthorAccess authorAccess,
                                        AuthorTableCellSpanProvider tableCellSpanProvider,
                                        AuthorElement cellElement)
                                 throws AuthorOperationException
        Check if the column span is defined for a table cell.

        I.E. for DocBook the column span is defined by the 'colspec' element. If it is missing then the column span is not defined.

        Parameters:
        authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        tableCellSpanProvider - The table cell span provider.
        cellElement - The cell element to be tested.
        Throws:
        AuthorOperationException - When the column span is not defined for the table cell.
      • updateTableColSpan

        void updateTableColSpan​(AuthorAccess authorAccess,
                                AuthorTableCellSpanProvider tableCellSpanProvider,
                                AuthorElement cellElem,
                                int startCol,
                                int endCol)
                         throws AuthorOperationException
        Update the column span of the cell by modifying the indices of start and end column. For example, for the DocBook CALS tables the namest and nameend attributes will be set according to the startCol and endCol supplied values.
        Parameters:
        authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        tableCellSpanProvider - The object responsible for providing information about the cell spanning.
        cellElem - The cell element whose column span will be updated.
        startCol - The new index of start column. It is 1 based and inclusive.
        endCol - The new index of end column. It is 1 based and inclusive.
        Throws:
        AuthorOperationException - When the column specifications for start or end columns are missing.
      • updateTableRowSpan

        void updateTableRowSpan​(AuthorAccess authorAccess,
                                AuthorElement cellElem,
                                int rowSpan)
        Updates the cell row span to a specified value. For example, for the DocBook CALS tables the morerows attribute value will be updated.
        Parameters:
        authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        cellElem - The cell element whose row span will be updated.
        rowSpan - The new row span value. It is 1 based.
      • updateTableColumnNumber

        void updateTableColumnNumber​(AuthorAccess authorAccess,
                                     AuthorElement tableElement,
                                     int colNum)
        Update the table columns number. For example, for the DocBook CALS tables the cols attribute value will be updated.
        Parameters:
        authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        tableElement - The element rendered as a table. Its 'display' CSS property is set to 'table'.
        colNum - The updated number of columns.
      • updateTableRowNumber

        void updateTableRowNumber​(AuthorAccess authorAccess,
                                  AuthorElement tableElement,
                                  int relativeValue)
        Update the table rows number.
        Parameters:
        authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
        tableElement - The element rendered as a table. Its 'display' CSS property is set to 'table'.
        relativeValue - The number of rows to increase or decrease the current number of table rows. If the number of rows must be decreased then the argument must be negative.
      • getIgnoredRowAttributes

        java.lang.String[] getIgnoredRowAttributes()
        Gets the attributes which should be skipped when using the current row as template for insert operation.
        Returns:
        The attributes which should be skipped.
      • getIgnoredColumnAttributes

        java.lang.String[] getIgnoredColumnAttributes()
        Gets the attributes which should be skipped when inserting a new column and the attributes from source cell fragments must be copied.
        Returns:
        The attributes which should be skipped.
      • getIgnoredCellIDAttributes

        java.lang.String[] getIgnoredCellIDAttributes()
        Gets the ID attribute names which should be skipped when inserting a new column or row and the attributes from source cell fragments must be copied.
        Returns:
        The ID attributes which should be skipped.
      • getTableElementForDeletion

        AuthorNode getTableElementForDeletion​(AuthorNode node)
        When we delete all the rows or all the columns of a table, we also want to delete the entire table element.

        OBS: For CALS tables we don't want to delete only the "tgroup", but the parent table element itself.
        Parameters:
        node - the node whose parent table we are looking for.
        Returns:
        the table element to be deleted.
      • isColspec

        boolean isColspec​(AuthorNode node)
        Check if a node is a colspec node.
        Parameters:
        node - The node.
        Returns:
        true if a node is a colspec node.