Oxygen XML Editor 11.2 Author API

ro.sync.ecss.extensions.commons.table.operations
Class AbstractTableOperation

java.lang.Object
  extended by ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
All Implemented Interfaces:
AuthorOperation, Extension
Direct Known Subclasses:
DeleteColumnOperationBase, DeleteRowOperationBase, InsertColumnOperationBase, InsertRowOperationBase, InsertTableOperation, JoinCellAboveBelowOperationBase, JoinRowCellsOperationBase, SplitCellAboveBelowOperationBase, SplitLeftRightOperationBase

public abstract class AbstractTableOperation
extends Object
implements AuthorOperation

Base class for table operations.


Field Summary
protected  AuthorTableHelper tableHelper
          Table helper, has methods specific to each document type.
 
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
 
Constructor Summary
AbstractTableOperation(AuthorTableHelper authorTableHelper)
          Constructor.
 
Method Summary
protected  AuthorDocumentFragment createEmptyCell(AuthorAccess authorAccess, AuthorElement cell, String[] skippedAttributes)
          Create an AuthorDocumentFragment representing an empty cell by duplicating the given cell without its content and skipping the specified attributes.
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, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
doOperation, getArguments
 
Methods inherited from interface ro.sync.ecss.extensions.api.Extension
getDescription
 

Field Detail

tableHelper

protected AuthorTableHelper tableHelper
Table helper, has methods specific to each document type.

Constructor Detail

AbstractTableOperation

public AbstractTableOperation(AuthorTableHelper authorTableHelper)
Constructor.

Parameters:
authorTableHelper - Table helper, has methods specific to each document type.
Method Detail

getElementAncestor

protected AuthorElement getElementAncestor(AuthorNode node,
                                           int type)
Search for an ancestor AuthorNode with the specified type.

Parameters:
node - The starting node.
type - The type of the ancestor.
Returns:
The ancestor node of the given node or the node itself if the type matches.

isElement

protected boolean isElement(AuthorNode node,
                            String elemLocalName)
Test if a given AuthorNode is an element and has the a specific local name.

Parameters:
node - The AuthorNode to be checked.
elemLocalName - The local name of the element.
Returns:
true if the given AuthorNode is an element and its local name matches the given string.

isTableElement

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.

Parameters:
node - The node to be checked.
type - The type to search for.
Returns:
true if the node is an element with the specified type.

findCellInsertionOffset

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.

Parameters:
authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility
tableElement - 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.
Returns:
The offset where the new entry should be inserted.

createEmptyCell

protected AuthorDocumentFragment createEmptyCell(AuthorAccess authorAccess,
                                                 AuthorElement cell,
                                                 String[] skippedAttributes)
                                          throws BadLocationException
Create an AuthorDocumentFragment representing an empty cell by duplicating the given cell without its content and skipping the specified attributes.

Parameters:
authorAccess - The author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility
cell - The reference cell.
skippedAttributes - The attributes which should not be copied.
Returns:
The document fragment representing the empty cell created starting from the original cell.
Throws:
BadLocationException - When the fragment cannot be created.

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.