JIDE 3.5.15

com.jidesoft.grid
Class MultiTableModelUtils

java.lang.Object
  extended by com.jidesoft.grid.MultiTableModelUtils

public class MultiTableModelUtils
extends Object

MultiTableModelUtils contains methods useful for MultiTableModel.


Constructor Summary
MultiTableModelUtils()
           
 
Method Summary
static boolean containsColumn(TableColumnModel model, String columnName)
           
static int getColumnCount(TableModel model, int columnType, int tableIndex)
          Gets the column count that matches with the specified columnType and tableIndex.
static boolean refreshColumns(JTable[] tables, int tableIndex)
          Adds/removes columns from each table to match the getColumnType in the MultiTableModel.
static void removeExtraColumns(JTable table, int columnType, int tableIndex)
          Removes extra columns from table.
static void removeExtraColumns(JTable table, int columnType, int tableIndex, int newlyAddedColumnIndex)
          Removes extra columns from table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiTableModelUtils

public MultiTableModelUtils()
Method Detail

removeExtraColumns

public static void removeExtraColumns(JTable table,
                                      int columnType,
                                      int tableIndex)
Removes extra columns from table.

Parameters:
table - The table which has a MultiTableModel as its model. If the model is not an instance of MultiTableModel, this method will do nothing.
columnType - which column type to keep. If MultiTableModel.getColumnType(int) returns a value different from the specified column type in parameter, the column will be removed.
tableIndex - which table index to keep If MultiTableModel.getTableIndex(int)} returns a value different from the specified table index in parameter, the column will be removed.

removeExtraColumns

public static void removeExtraColumns(JTable table,
                                      int columnType,
                                      int tableIndex,
                                      int newlyAddedColumnIndex)
Removes extra columns from table.

Parameters:
table - The table which has a MultiTableModel as its model. If the model is not an instance of MultiTableModel, this method will do nothing.
columnType - which column type to keep. If MultiTableModel.getColumnType(int) returns a value different from the specified column type in parameter, the column will be removed.
tableIndex - which table index to keep If MultiTableModel.getTableIndex(int)} returns a value different from the specified table index in parameter, the column will be removed.
newlyAddedColumnIndex - the newly added column index.

refreshColumns

public static boolean refreshColumns(JTable[] tables,
                                     int tableIndex)
Adds/removes columns from each table to match the getColumnType in the MultiTableModel.

Parameters:
tables - The sub-tables which have the same MultiTableModel as their table model. If the model is not an instance of MultiTableModel, this method will do nothing.
tableIndex - which table index to keep If MultiTableModel.getTableIndex(int)} returns a value different from the specified table index in parameter, the column will be removed.
Returns:
true if the table is refreshed correctly. Otherwise false.

containsColumn

public static boolean containsColumn(TableColumnModel model,
                                     String columnName)

getColumnCount

public static int getColumnCount(TableModel model,
                                 int columnType,
                                 int tableIndex)
Gets the column count that matches with the specified columnType and tableIndex.

Parameters:
model - the table model. It should be an instance of MultiTableModel.
columnType - the column type as defined MultiTableModel.
tableIndex - the table index.
Returns:
the column count.

JIDE 3.5.15