JIDE 3.5.15

com.jidesoft.list
Class ListModelWrapperUtils

java.lang.Object
  extended by com.jidesoft.list.ListModelWrapperUtils

public class ListModelWrapperUtils
extends Object

ListWrapperUtilsis a utility class that contains several useful methods for ListModelWrapper.


Constructor Summary
ListModelWrapperUtils()
           
 
Method Summary
static int getActualIndexAt(ListModel outerModel, int row)
          Gets the actual row index at an outerModel.
static int getActualIndexAt(ListModel outerModel, int row, Class<?> innerModelClass)
          Gets the actual row index at a list model whose class is innerModelClass.
static int getActualIndexAt(ListModel outerModel, int row, ListModel innerModel)
          Gets the actual row index at a list model which equals to the innerModel passed in as parameter.
static ListModel getActualListModel(ListModel outerModel)
          Gets the list model whose class is targetModelClass.
static ListModel getActualListModel(ListModel outerModel, Class<?> targetModelClass)
          Gets the list model whose class is targetModelClass.
static int getIndexAt(ListModel outerModel, int rowInInnerModel)
          Gets the row at the outermost model knowing the row index in an inner model
static int getIndexAt(ListModel outerModel, ListModel innerModel, int rowInInnerModel)
          Gets the row at the outer model knowing the row index in an inner model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListModelWrapperUtils

public ListModelWrapperUtils()
Method Detail

getActualIndexAt

public static int getActualIndexAt(ListModel outerModel,
                                   int row,
                                   Class<?> innerModelClass)
Gets the actual row index at a list model whose class is innerModelClass.

Parameters:
outerModel - the outermost outerModel.
row - the row of outermost outerModel
innerModelClass - the class of the inner outerModel
Returns:
the row index of inner outerModel. If it can't find it, -1 will be returned.

getActualIndexAt

public static int getActualIndexAt(ListModel outerModel,
                                   int row,
                                   ListModel innerModel)
Gets the actual row index at a list model which equals to the innerModel passed in as parameter.

Parameters:
outerModel - the outermost outerModel.
row - the row of outermost outerModel
innerModel - the inner outerModel
Returns:
the row index of inner outerModel. If it can't find it, -1 will be returned.

getActualIndexAt

public static int getActualIndexAt(ListModel outerModel,
                                   int row)
Gets the actual row index at an outerModel.

Parameters:
outerModel - the outermost outerModel.
row - the row of outermost outerModel
Returns:
the row index of nested model which is not a list wrapper. If it can't find it, -1 will be returned.

getIndexAt

public static int getIndexAt(ListModel outerModel,
                             ListModel innerModel,
                             int rowInInnerModel)
Gets the row at the outer model knowing the row index in an inner model

Parameters:
outerModel - the outer list model
innerModel - the inner list model
rowInInnerModel - the row index in the inner list model
Returns:
the row at the outer list model.

getIndexAt

public static int getIndexAt(ListModel outerModel,
                             int rowInInnerModel)
Gets the row at the outermost model knowing the row index in an inner model

Parameters:
outerModel - the outer list model
rowInInnerModel - the row index in the inner list model
Returns:
the row at the outermost model.

getActualListModel

public static ListModel getActualListModel(ListModel outerModel,
                                           Class<?> targetModelClass)
Gets the list model whose class is targetModelClass.

Parameters:
outerModel - the outer list model
targetModelClass - the target model class type
Returns:
the list model whose class is targetModelClass.

getActualListModel

public static ListModel getActualListModel(ListModel outerModel)
Gets the list model whose class is targetModelClass.

Parameters:
outerModel - the outer list model
Returns:
the inner most list model.

JIDE 3.5.15