Class JoinRowCellsOperationBase
- java.lang.Object
-
- ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
-
- ro.sync.ecss.extensions.commons.table.operations.JoinRowCellsOperationBase
-
- All Implemented Interfaces:
AuthorOperation
,Extension
- Direct Known Subclasses:
JoinRowCellsOperation
,JoinRowCellsOperation
,JoinRowCellsOperation
,JoinRowCellsOperation
,JoinRowCellsOperation
@API(type=INTERNAL, src=PUBLIC) 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
CHANGE_TRACKING_BEHAVIOR_ARGUMENT, TABLE_INFO_ARGUMENT_DESCRIPTOR, TABLE_INFO_ARGUMENT_NAME, 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
Constructors Constructor Description JoinRowCellsOperationBase(AuthorTableHelper tableHelper)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
doOperationInternal(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.protected AuthorElement
getCell(AuthorAccess authorAccess, int selectionOffset, boolean start)
Find the last cell for the join operation.java.lang.String
getDescription()
-
Methods inherited from class ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
createEmptyCell, doOperation, findCellInsertionOffset, getElementAncestor, isElement, isTableElement
-
-
-
-
Constructor Detail
-
JoinRowCellsOperationBase
public JoinRowCellsOperationBase(AuthorTableHelper tableHelper)
Constructor.- Parameters:
tableHelper
- Table helper with methods specific to a document type.
-
-
Method Detail
-
doOperationInternal
protected void doOperationInternal(AuthorAccess authorAccess, ArgumentsMap args) throws java.lang.IllegalArgumentException, AuthorOperationException
Join the contents of one or more cells.- Specified by:
doOperationInternal
in classAbstractTableOperation
- 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 methodAuthorOperation.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:
AbstractTableOperation.doOperationInternal(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
-
getCell
protected AuthorElement getCell(AuthorAccess authorAccess, int selectionOffset, boolean start) 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.selectionOffset
- The selection end offset- Returns:
- The last 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.
-
-