@API(type=INTERNAL, src=PUBLIC) public abstract class AbstractTableOperation extends java.lang.Object implements AuthorOperation
Modifier and Type | Field and Description |
---|---|
static ArgumentDescriptor |
TABLE_INFO_ARGUMENT_DESCRIPTOR
Argument descriptor for a table info argument.
|
static java.lang.String |
TABLE_INFO_ARGUMENT_NAME
The name of the table info argument.
|
protected AuthorTableHelper |
tableHelper
Table helper, has methods specific to each document type.
|
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
Constructor and Description |
---|
AbstractTableOperation(AuthorTableHelper authorTableHelper)
Constructor.
|
AbstractTableOperation(AuthorTableHelper authorTableHelper,
boolean markAsChange)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected AuthorDocumentFragment |
createEmptyCell(AuthorAccess authorAccess,
AuthorElement cell,
java.lang.String[] skippedAttributes)
Create an
AuthorDocumentFragment representing an empty cell by duplicating
the given cell without its content and skipping the specified attributes. |
void |
doOperation(AuthorAccess authorAccess,
ArgumentsMap args)
Perform the actual operation.
|
protected abstract void |
doOperationInternal(AuthorAccess authorAccess,
ArgumentsMap args)
Perform the actual operation.
|
protected int |
findCellInsertionOffset(AuthorAccess authorAccess,
AuthorElement tableElement,
int row,
int column)
Find the offset in the document where a new entry (table cell) should be inserted
for the given table row and column.
|
protected AuthorElement |
getElementAncestor(AuthorNode node,
int type)
Search for an ancestor
AuthorNode with the specified type. |
protected boolean |
isElement(AuthorNode node,
java.lang.String elemLocalName)
Test if a given
AuthorNode is an element and has the a specific local name. |
protected boolean |
isTableElement(AuthorNode node,
int type)
Test if an
AuthorNode is an element and it has one of the following types:
AuthorTableHelper.TYPE_CELL , AuthorTableHelper.TYPE_ROW or
AuthorTableHelper.TYPE_TABLE . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArguments
getDescription
public static final java.lang.String TABLE_INFO_ARGUMENT_NAME
public static final ArgumentDescriptor TABLE_INFO_ARGUMENT_DESCRIPTOR
protected AuthorTableHelper tableHelper
public AbstractTableOperation(AuthorTableHelper authorTableHelper)
authorTableHelper
- Table helper, has methods specific to each document type.public AbstractTableOperation(AuthorTableHelper authorTableHelper, boolean markAsChange)
authorTableHelper
- Table helper, has methods specific to each document type.markAsChange
- true
if the operation result is marked as a change.protected AuthorElement getElementAncestor(AuthorNode node, int type)
AuthorNode
with the specified type.node
- The starting node.type
- The type of the ancestor.node
or the node
itself if the type matches.protected boolean isElement(AuthorNode node, java.lang.String elemLocalName)
AuthorNode
is an element and has the a specific local name.node
- The AuthorNode
to be checked.elemLocalName
- The local name of the element.true
if the given AuthorNode
is an
element and its local name matches the given string.protected boolean isTableElement(AuthorNode node, int type)
AuthorNode
is an element and it has one of the following types:
AuthorTableHelper.TYPE_CELL
, AuthorTableHelper.TYPE_ROW
or
AuthorTableHelper.TYPE_TABLE
.node
- The node to be checked.type
- The type to search for.true
if the node
is an element with the specified type.protected int findCellInsertionOffset(AuthorAccess authorAccess, AuthorElement tableElement, int row, int column)
authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utilitytableElement
- The element rendered as a table. Its 'display' CSS property
is set to 'table'.row
- The table row where the insertion will occur, 0 based.column
- The column where the insertion will occur, 0 based.protected AuthorDocumentFragment createEmptyCell(AuthorAccess authorAccess, AuthorElement cell, java.lang.String[] skippedAttributes) throws javax.swing.text.BadLocationException
AuthorDocumentFragment
representing an empty cell by duplicating
the given cell without its content and skipping the specified attributes.authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utilitycell
- The reference cell.skippedAttributes
- The attributes which should not be copied.javax.swing.text.BadLocationException
- When the fragment cannot be created.public final void doOperation(AuthorAccess authorAccess, ArgumentsMap args) throws java.lang.IllegalArgumentException, AuthorOperationException
AuthorOperation
Workspace.getPlatform()
.
To get to the Workspace
you may use: AuthorAccess.getWorkspaceAccess()
.doOperation
in interface AuthorOperation
authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utility a.s.o.args
- The map of arguments. All the arguments defined by method
AuthorOperation.getArguments()
must be present in the map of arguments.java.lang.IllegalArgumentException
- Thrown when one or more arguments are illegal.AuthorOperationException
- Thrown when the operation fails.AuthorOperation.doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
protected abstract void doOperationInternal(AuthorAccess authorAccess, ArgumentsMap args) throws java.lang.IllegalArgumentException, AuthorOperationException
authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utility a.s.o.args
- The map of arguments. All the arguments defined by method
AuthorOperation.getArguments()
must be present in the map of arguments.java.lang.IllegalArgumentException
- Thrown when one or more arguments are illegal.AuthorOperationException
- Thrown when the operation fails.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.