Package org.openl.rules.table.actions
Class UndoableInsertAction
- java.lang.Object
-
- org.openl.rules.table.actions.UndoableEditTableAction
-
- org.openl.rules.table.actions.UndoableInsertAction
-
- All Implemented Interfaces:
IUndoableAction,IUndoableGridTableAction
- Direct Known Subclasses:
UndoableInsertColumnsAction,UndoableInsertRowsAction
public abstract class UndoableInsertAction extends UndoableEditTableAction
Default behaviour for insert operations.- Author:
- DLiauchuk
-
-
Field Summary
Fields Modifier and Type Field Description protected MetaInfoWritermetaInfoWriter-
Fields inherited from class org.openl.rules.table.actions.UndoableEditTableAction
COLUMNS, INSERT, REMOVE, ROWS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUndoableInsertAction(MetaInfoWriter metaInfoWriter)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleancanPerformAction(IGridTable table)Checks if action can be performed without moving the table.voiddoAction(IGridTable table)protected abstract GridRegionActiongetGridRegionAction(IGridRegion gridRegion, int numberToInsert)protected abstract intgetNumberToInsert(IGridTable table)Get actual number of rows or columns to be inserted.protected abstract IUndoableGridTableActionperformAction(int numberToInsert, IGridRegion fullTableRegion, IGridTable table)Perform action for inserting rows or columns.voidundoAction(IGridTable table)-
Methods inherited from class org.openl.rules.table.actions.UndoableEditTableAction
getOriginalRegion, getOriginalTable, isDecoratorTable, moveTable
-
-
-
-
Field Detail
-
metaInfoWriter
protected final MetaInfoWriter metaInfoWriter
-
-
Constructor Detail
-
UndoableInsertAction
protected UndoableInsertAction(MetaInfoWriter metaInfoWriter)
-
-
Method Detail
-
doAction
public void doAction(IGridTable table)
-
undoAction
public void undoAction(IGridTable table)
-
canPerformAction
protected abstract boolean canPerformAction(IGridTable table)
Checks if action can be performed without moving the table.- Parameters:
table- a table to apply the action.- Returns:
- true if action can be performed without moving the table.
-
getNumberToInsert
protected abstract int getNumberToInsert(IGridTable table)
Get actual number of rows or columns to be inserted. It depends whether the cell is merged or not.- Parameters:
table- a table to apply the action.- Returns:
- actual number to be inserted.
-
performAction
protected abstract IUndoableGridTableAction performAction(int numberToInsert, IGridRegion fullTableRegion, IGridTable table)
Perform action for inserting rows or columns.- Parameters:
numberToInsert- number of rows or columns to be inserted.fullTableRegion- a region of original tabletable- a table to apply the action.- Returns:
- action for inserting rows or columns.
-
getGridRegionAction
protected abstract GridRegionAction getGridRegionAction(IGridRegion gridRegion, int numberToInsert)
-
-