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
FieldsModifier and TypeFieldDescriptionstatic final int
The cell type.static final int
The row type.static final int
The table type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkTableColSpanIsDefined
(AuthorAccess authorAccess, AuthorTableCellSpanProvider tableCellSpanProvider, AuthorElement cellElement) Check if the column span is defined for a table cell.String[]
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.String[]
Gets the attributes which should be skipped when inserting a new column and the attributes from source cell fragments must be copied.String[]
Gets the attributes which should be skipped when using the current row as template for insert operation.getTableCellSpanProvider
(AuthorElement tableElement) Create the table cell span provider for a specific table element.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 Details
-
TYPE_CELL
static final int TYPE_CELLThe cell type.- See Also:
-
TYPE_ROW
static final int TYPE_ROWThe row type.- See Also:
-
TYPE_TABLE
static final int TYPE_TABLEThe table type.- See Also:
-
-
Method Details
-
isTableCell
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
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
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
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
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
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
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
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
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
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
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
Check if a node is a colspec node.- Parameters:
node
- The node.- Returns:
true
if a node is a colspec node.
-