Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table
Class TableUtils

java.lang.Object
  extended by com.citra.table.TableUtils

public class TableUtils
extends Object

TableUtils is a utility class for converting model/view row indeces to the view/model respectively.


Method Summary
static int convertRowIndexToModel(JTable table, int viewRowIndex)
          Determines the index of the row in the underlying model in terms of the row index in the table.
static int convertRowIndexToView(JTable table, int modelRowIndex)
          Determines the index of the row in the table in terms of the row index in the underlying model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertRowIndexToModel

public static int convertRowIndexToModel(JTable table,
                                         int viewRowIndex)
Determines the index of the row in the underlying model in terms of the row index in the table.

Parameters:
table - the table whose row index we are converting
viewRowIndex - the index of the row in the table
Returns:
the index of the corresponding row in the underlying model

convertRowIndexToView

public static int convertRowIndexToView(JTable table,
                                        int modelRowIndex)
Determines the index of the row in the table in terms of the row index in the underlying model. If the row is not viewable in the table (such as filtered out), -1 is returned.

Parameters:
table - the table whose row index we are converting
modelRowIndex - the index of the row in the underlying model
Returns:
the index of the corresponding row in the table

Copyright © 2011 Citra Technologies. All Rights Reserved.