public class

ItemPositionUpdater

extends Object
java.lang.Object
   ↳ com.shinobicontrols.grids.supplement.ItemPositionUpdater

Class Overview

The ItemPositionUpdater is a helper class for maintaining the state of items when the ShinobiGridView is modified in some way. For example, it is used by the DefaultItemStateManager to help maintain the selection and hidden state of items when rows and columns are added, removed and reordered.

Note: This class does not update any item positions on the ShinobiGridView. Its methods simply provide an updated item position which can then be used to perform update operations on the ShinobiGridView.

Summary

Public Constructors
ItemPositionUpdater()
Public Methods
int getUpdatedPositionAfterAddColumn(int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column being added.

int getUpdatedPositionAfterAddRow(int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row being added.

int getUpdatedPositionAfterColumnReorder(int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, int endColumnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column reorder.

int getUpdatedPositionAfterRemoveColumn(int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column being removed.

int getUpdatedPositionAfterRemoveRow(int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row being removed.

int getUpdatedPositionAfterRowReorder(int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, int endRowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row reorder.

[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ItemPositionUpdater ()

Public Methods

public int getUpdatedPositionAfterAddColumn (int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column being added. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the column addition.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
columnIndex the index of the column being added
hasGridBehavior the HasGridBehavior that is having a column added to it

public int getUpdatedPositionAfterAddRow (int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row being added. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the row addition.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
rowIndex the index of the row being added
hasGridBehavior the HasGridBehavior that is having a row added to it

public int getUpdatedPositionAfterColumnReorder (int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, int endColumnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column reorder. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the column reorder.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView. For a column reorder when the endColumnIndex is -1 the item position passed in will be returned.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
columnIndex the index of the column being reordered
endColumnIndex the index of the column being reordered at the end of the column reorder
hasGridBehavior the HasGridBehavior whose column is being reordered
Returns
  • an updated item position taking into account the column reorder

public int getUpdatedPositionAfterRemoveColumn (int itemPosition, int itemRowIndex, int itemColumnIndex, int columnIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a column being removed. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the column removal.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
columnIndex the index of the column being removed
hasGridBehavior the HasGridBehavior whose column is being removed

public int getUpdatedPositionAfterRemoveRow (int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row being removed. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the row removal.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
rowIndex the index of the row being removed
hasGridBehavior the HasGridBehavior whose row is being removed

public int getUpdatedPositionAfterRowReorder (int itemPosition, int itemRowIndex, int itemColumnIndex, int rowIndex, int endRowIndex, HasGridBehavior hasGridBehavior)

Updates the given item position on the ShinobiGridView following a row reorder. Typically this method will be useful when updating the positions of selected or hidden items.

The given HasGridBehavior is used to obtain the updated item position by manipulating the row and column indices for the item at its position before the row reorder.

Note: This method does not update the ShinobiGridView in any way, nor does it check that the given values exist in the grid. It provides an updated item position, which can then be used to perform update operations on the ShinobiGridView. For a row reorder when the endRowIndex is -1 the item position passed in will be returned.

Parameters
itemPosition the item position to be updated
itemRowIndex the row index for the given item position
itemColumnIndex the column index for the given item position
rowIndex the index of the row being reordered
endRowIndex the index of the row being reordered at the end of the row reorder
hasGridBehavior the HasGridBehavior whose row is being reordered
Returns
  • an updated item position taking into account the row reorder