Oxygen XML Editor 12.2 Author API

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

java.lang.Object
  extended by ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
      extended by ro.sync.ecss.extensions.commons.table.operations.JoinRowCellsOperationBase
All Implemented Interfaces:
AuthorOperation, Extension
Direct Known Subclasses:
JoinRowCellsOperation, JoinRowCellsOperation, JoinRowCellsOperation, JoinRowCellsOperation, JoinRowCellsOperation

public abstract class JoinRowCellsOperationBase
extends AbstractTableOperation

Operation used to join the content of two or more cells from a table row. If there is a selection, the cell at selection start offset determines the destination cell where the content of the next cells will be moved. If there is no selection then it is assumed that the caret is between two table cells.


Field Summary
 
Fields inherited from class ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
tableHelper
 
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
 
Constructor Summary
JoinRowCellsOperationBase(AuthorTableHelper tableHelper)
          Constructor.
 
Method Summary
 void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
          Join the contents of one or more cells.
protected abstract  void generateColumnSpecifications(AuthorAccess authorAccess, AuthorTableCellSpanProvider tableCellSpanProvider, AuthorElement tableElement)
          Generates column specifications for the given table and inserts them into the document.
 ArgumentDescriptor[] getArguments()
          No arguments.
 java.lang.String getDescription()
           
protected  AuthorElement getFirstCell(AuthorAccess authorAccess)
          Find the first cell involved in the join operation.
protected  AuthorElement getLastCell(AuthorAccess authorAccess)
          Find the last cell for the join operation.
 
Methods inherited from class ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
createEmptyCell, findCellInsertionOffset, getElementAncestor, isElement, isTableElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoinRowCellsOperationBase

public JoinRowCellsOperationBase(AuthorTableHelper tableHelper)
Constructor.

Parameters:
tableHelper - Table helper with methods specific to a document type.
Method Detail

doOperation

public void doOperation(AuthorAccess authorAccess,
                        ArgumentsMap args)
                 throws java.lang.IllegalArgumentException,
                        AuthorOperationException
Join the contents of one or more cells.

Parameters:
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.
Throws:
java.lang.IllegalArgumentException - Thrown when one or more arguments are illegal.
AuthorOperationException - Thrown when the operation fails.
See Also:
AuthorOperation.doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)

getLastCell

protected AuthorElement getLastCell(AuthorAccess authorAccess)
                             throws javax.swing.text.BadLocationException
Find the last cell for the join operation. This is the last cell whose content will be moved in the destination cell.

Parameters:
authorAccess - The author access.
Returns:
The last cell involved in the join operation. Might be null.
Throws:
javax.swing.text.BadLocationException - If method fails.

getFirstCell

protected AuthorElement getFirstCell(AuthorAccess authorAccess)
                              throws javax.swing.text.BadLocationException
Find the first cell involved in the join operation. This is the cell where the content of next cells will be moved.

Parameters:
authorAccess - The author access.
Returns:
The first cell involved in the join operation. Might be null.
Throws:
javax.swing.text.BadLocationException - If method fails.

getArguments

public ArgumentDescriptor[] getArguments()
No arguments.

Returns:
An array of ArgumentDescriptor representing the arguments this operation uses.
See Also:
AuthorOperation.getArguments()

getDescription

public java.lang.String getDescription()
Returns:
The description of the extension.
See Also:
Extension.getDescription()

generateColumnSpecifications

protected abstract void generateColumnSpecifications(AuthorAccess authorAccess,
                                                     AuthorTableCellSpanProvider tableCellSpanProvider,
                                                     AuthorElement tableElement)
                                              throws AuthorOperationException
Generates column specifications for the given table and inserts them into the document.

Parameters:
authorAccess - Author access. Provides access to specific informations and actions for editor, document, workspace, tables, change tracking, utility a.s.o.
tableCellSpanProvider - Table cell span provider.
tableElement - The table element.
Throws:
AuthorOperationException - Failed to insert the column specifications into the table.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.