Class DeleteRowOperationBase
- java.lang.Object
-
- ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
-
- ro.sync.ecss.extensions.commons.table.operations.DeleteRowOperationBase
-
- All Implemented Interfaces:
AuthorOperation
,Extension
- Direct Known Subclasses:
DeleteRowOperation
,DeleteRowOperation
,DeleteRowOperation
,DeleteRowOperation
,DeleteRowOperation
,DeleteRowOperation
@API(type=INTERNAL, src=PUBLIC) public abstract class DeleteRowOperationBase extends AbstractTableOperation
Operation used to delete table rows. If there is a selection in the table all the rows that intersect that selection are removed. If there is no selection in the table, the row at caret is deleted.
-
-
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 DeleteRowOperationBase(AuthorTableHelper documentTypeHelper)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract SplitCellAboveBelowOperationBase
createSplitCellOperation()
Create the split cell operation.void
doOperationInternal(AuthorAccess authorAccess, ArgumentsMap args)
Delete the table rows.ArgumentDescriptor[]
getArguments()
No arguments for this operation.java.lang.String
getDescription()
boolean
performDeleteRows(AuthorAccess authorAccess, int startRowOffset, int endRowOffset)
Delete table rows.boolean
performDeleteRows(AuthorAccess authorAccess, java.util.List<ContentInterval> contentIntervals)
Delete table rows.-
Methods inherited from class ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation
createEmptyCell, doOperation, findCellInsertionOffset, getElementAncestor, isElement, isTableElement
-
-
-
-
Constructor Detail
-
DeleteRowOperationBase
public DeleteRowOperationBase(AuthorTableHelper documentTypeHelper)
Constructor.- Parameters:
documentTypeHelper
- The table helper specific to a document type. An implementation ofAuthorTableHelper
.
-
-
Method Detail
-
performDeleteRows
public boolean performDeleteRows(AuthorAccess authorAccess, java.util.List<ContentInterval> contentIntervals) throws AuthorOperationException
Delete table rows. The rows that must be deleted are determined in the following order:- by the list of content intervals if not
null
- all the rows that intersect the selection
- the row at caret offset
- Parameters:
authorAccess
- The access to Author operations.contentIntervals
- The content intervals that intersects the rows that must be deleted. Each interval contains two integers, one for start interval offset and one for end interval offset.- Returns:
true
if the rows are deleted.- Throws:
AuthorOperationException
- by the list of content intervals if not
-
performDeleteRows
public boolean performDeleteRows(AuthorAccess authorAccess, int startRowOffset, int endRowOffset) throws AuthorOperationException
Delete table rows. The row that must be deleted is determined in the following order:- by startRowOffset and endRowOffset if both are bigger than
0
- all the rows that intersect the selection
- the row at caret offset
- Parameters:
authorAccess
- The access to Author operations.startRowOffset
- The start row offset.endRowOffset
- The end row offset.- Returns:
true
if at least one row is deleted.- Throws:
java.lang.IllegalArgumentException
AuthorOperationException
- by startRowOffset and endRowOffset if both are bigger than
-
doOperationInternal
public final void doOperationInternal(AuthorAccess authorAccess, ArgumentsMap args) throws AuthorOperationException
Delete the table rows. For this operation the caret must be inside a table cell.- 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:
AuthorOperationException
- Thrown when the operation fails.- See Also:
AbstractTableOperation.doOperationInternal(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
-
getArguments
public ArgumentDescriptor[] getArguments()
No arguments for this operation.- 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()
-
createSplitCellOperation
protected abstract SplitCellAboveBelowOperationBase createSplitCellOperation()
Create the split cell operation. The operation is needed to split the cells that span over multiple rows and start on the row to be deleted.- Returns:
- The split cell operation.
-
-