Class RowBandInsertAction
- java.lang.Object
-
- org.eclipse.birt.report.model.api.RowBandInsertAction
-
public class RowBandInsertAction extends java.lang.ObjectDoes table row insert operation.
-
-
Field Summary
Fields Modifier and Type Field Description protected RowBandAdapteradapterAdapter to work on the grid/table columns.
-
Constructor Summary
Constructors Constructor Description RowBandInsertAction(RowBandAdapter adapter)Constructs aRowBandAdapterfor the insert action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intadjustPosition(int destIndex, int count)Adjusts position of destination index.protected booleancanInsert(RowOperationParameters parameters)Checks whether the insert operation can be done with the given slot id , group id , index and the operation flag.protected intcomputeColumnCount(RowHandle rowHandle)Returns column count in the given row.protected intcomputeColumnCount(org.eclipse.birt.report.model.elements.TableRow row)Returns column count in the given row.protected booleancontainsRowSpan(RowHandle rowHandle)Checks every cell contains row span or not.protected IDesignElementcopyRow(RowHandle rowHandle)Copies a row with the given row handle.protected org.eclipse.birt.report.model.elements.TableRowcopyRow(org.eclipse.birt.report.model.elements.TableRow row)Copies a row with the given table rowprotected voiddoInsert(RowOperationParameters parameters)Inserts source table row below or above target table row.protected intgetPositionOfRow(org.eclipse.birt.report.model.elements.TableRow row)Gets position of table row.protected SlotHandlegetSlotHandle(RowOperationParameters parameters)Get slot handle in table or group according to the slot id and group id.protected booleanisRectangleArea(RowHandle rowHandle)Checks whether copied row handle is a rectangle.
-
-
-
Field Detail
-
adapter
protected RowBandAdapter adapter
Adapter to work on the grid/table columns.
-
-
Constructor Detail
-
RowBandInsertAction
public RowBandInsertAction(RowBandAdapter adapter)
Constructs aRowBandAdapterfor the insert action.- Parameters:
adapter- the adapter to work on tables and grids.
-
-
Method Detail
-
canInsert
protected boolean canInsert(RowOperationParameters parameters)
Checks whether the insert operation can be done with the given slot id , group id , index and the operation flag.- Parameters:
copiedRow- source copied table rowparameters- parameters needed by insert operation.- Returns:
trueindicates the insert operation can be done. Otherwisefalse.
-
doInsert
protected void doInsert(RowOperationParameters parameters) throws SemanticException
Inserts source table row below or above target table row. Table row can be inserted in position from zero to count of rows.- Parameters:
copiedRow- the copied table row.parameters- parameters needed by insert operation.- Throws:
SemanticExceptionjava.lang.Exception
-
copyRow
protected IDesignElement copyRow(RowHandle rowHandle)
Copies a row with the given row handle.- Parameters:
rowHandle- handle of row- Returns:
- a new row instance
-
copyRow
protected org.eclipse.birt.report.model.elements.TableRow copyRow(org.eclipse.birt.report.model.elements.TableRow row)
Copies a row with the given table row- Parameters:
row- table row- Returns:
- a new row instance
-
isRectangleArea
protected boolean isRectangleArea(RowHandle rowHandle)
Checks whether copied row handle is a rectangle.- Parameters:
rowHandle- handle of row- Returns:
trueif the shape of integrated row handle is a rectangle, otherwisefalse.
-
containsRowSpan
protected boolean containsRowSpan(RowHandle rowHandle)
Checks every cell contains row span or not. If contains any row span , returnfalse;Otherwise returntrue- Parameters:
rowHandle- handle of row.- Returns:
- If contains any row span , return
true;Otherwise returnfalse
-
getPositionOfRow
protected int getPositionOfRow(org.eclipse.birt.report.model.elements.TableRow row)
Gets position of table row.- Parameters:
row- table row . can't be copied row, because copied row is not in tree.- Returns:
- position of table row.
-
computeColumnCount
protected int computeColumnCount(org.eclipse.birt.report.model.elements.TableRow row)
Returns column count in the given row.- Parameters:
row- table row including copied row and row in design file.- Returns:
- column count in the given row.
-
computeColumnCount
protected int computeColumnCount(RowHandle rowHandle)
Returns column count in the given row.- Parameters:
rowHandle- row handle- Returns:
- column count in the given row.
-
getSlotHandle
protected SlotHandle getSlotHandle(RowOperationParameters parameters)
Get slot handle in table or group according to the slot id and group id.- Parameters:
parameters- parameters for getting slot container.- Returns:
- if can be found, return
SlotHandle.Otherwise return null.
-
adjustPosition
protected int adjustPosition(int destIndex, int count)Adjusts position of destination index. The range is from zero to count-1.- Parameters:
destIndex- index of destinationcount- count of row.- Returns:
- position after adjusting.
-
-