Interface AuthorTableHelper
-
- All Known Implementing Classes:
AbstractDocumentTypeHelper
,CALSDocumentTypeHelper
,DITARelTableDocumentTypeHelper
,DITASimpleTableDocumentTypeHelper
,DITATableDocumentTypeHelper
,TEIDocumentTypeHelper
,XHTMLDocumentTypeHelper
@API(type=INTERNAL, src=PUBLIC) public interface AuthorTableHelper
Document type specific table information helper. It contains methods that are specific to a document type and are used to obtain table and table cells related information.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_CELL
The cell type.static int
TYPE_ROW
The row type.static int
TYPE_TABLE
The table type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkTableColSpanIsDefined(AuthorAccess authorAccess, AuthorTableCellSpanProvider tableCellSpanProvider, AuthorElement cellElement)
Check if the column span is defined for a table cell.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.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.java.lang.String[]
getIgnoredRowAttributes()
Gets the attributes which should be skipped when using the current row as template for insert operation.AuthorTableCellSpanProvider
getTableCellSpanProvider(AuthorElement tableElement)
Create the table cell span provider for a specific table element.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.boolean
isColspec(AuthorNode node)
Check if a node is a colspec node.boolean
isTable(AuthorNode node)
Check if anAuthorNode
is a table node.boolean
isTableCell(AuthorNode node)
Check if anAuthorNode
is a table cell node.boolean
isTableRow(AuthorNode node)
Check if anAuthorNode
is a table row node.void
updateTableColSpan(AuthorAccess authorAccess, AuthorTableCellSpanProvider tableCellSpanProvider, AuthorElement cellElem, int startCol, int endCol)
Update the column span of the cell by modifying the indices of start and end column.void
updateTableColumnNumber(AuthorAccess authorAccess, AuthorElement tableElement, int colNum)
Update the table columns number.void
updateTableRowNumber(AuthorAccess authorAccess, AuthorElement tableElement, int relativeValue)
Update the table rows number.void
updateTableRowSpan(AuthorAccess authorAccess, AuthorElement cellElem, int rowSpan)
Updates the cell row span to a specified value.
-
-
-
Field Detail
-
TYPE_CELL
static final int TYPE_CELL
The cell type.- See Also:
- Constant Field Values
-
TYPE_ROW
static final int TYPE_ROW
The row type.- See Also:
- Constant Field Values
-
TYPE_TABLE
static final int TYPE_TABLE
The table type.- See Also:
- Constant Field Values
-
-
Method Detail
-
isTableCell
boolean isTableCell(AuthorNode node)
Check if anAuthorNode
is a table cell node.- Parameters:
node
- TheAuthorNode
to be checked.- Returns:
true
if the node is a table cell node,false
otherwise.
-
isTableRow
boolean isTableRow(AuthorNode node)
Check if anAuthorNode
is a table row node.- Parameters:
node
- TheAuthorNode
to be checked.- Returns:
true
if the node is a table row node,false
otherwise.
-
isTable
boolean isTable(AuthorNode node)
Check if anAuthorNode
is a table node.- Parameters:
node
- TheAuthorNode
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 thenamest
andnameend
attributes will be set according to thestartCol
andendCol
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 themorerows
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 thecols
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.
-
-