medi.swing.util
Class TableUtils

java.lang.Object
  |
  +--medi.swing.util.TableUtils

public class TableUtils
extends java.lang.Object

Contains a set of function to manage tables.


Constructor Summary
TableUtils()
          Creates new TableUtils
 
Method Summary
static void clearIndexedTable(javax.swing.JTable table)
          Clears an indexed table.
static void clearSortedTable(javax.swing.JTable table)
          Clears a sorted table.
static void clearTable(javax.swing.JTable table)
          Clears a normal table.
static void fillIndexedTable(javax.swing.JTable table, DbIterator rowIt, int[] colIndexes, int indexPos)
          Fills an indexed table.
static void fillIndexedTable(javax.swing.JTable table, java.util.Iterator rowIt, int[] colIndexes, int indexPos)
          Fills an indexed table.
static void fillSortedTable(javax.swing.JTable table, DbIterator rowIt, int[] colIndexes, int indexPos)
          Fills a sorted table.
static void fillSortedTable(javax.swing.JTable table, java.util.Iterator rowIt, int[] colIndexes, int indexPos)
          Fills a sorted table.
static void fillTable(javax.swing.JTable table, DbIterator rowIt, int[] colIndexes)
          Fills a normal table.
static void fillTable(javax.swing.JTable table, java.lang.String scriptFileName)
          Fills a table with a single column using data from a script file.
static void saveTable(javax.swing.JTable table, java.lang.String scriptFileName)
          Saves a table with a single column into a script file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableUtils

public TableUtils()
Creates new TableUtils

Method Detail

fillTable

public static void fillTable(javax.swing.JTable table,
                             DbIterator rowIt,
                             int[] colIndexes)
                      throws DbException
Fills a normal table.

Parameters:
table - The table to use.
rowIt - The iterator containing the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
Throws:
DbException - If something goes wrong.

fillTable

public static void fillTable(javax.swing.JTable table,
                             java.lang.String scriptFileName)
Fills a table with a single column using data from a script file.

Parameters:
table - The table to be filled.
scriptFileName - The file name of the script to use.

fillIndexedTable

public static void fillIndexedTable(javax.swing.JTable table,
                                    DbIterator rowIt,
                                    int[] colIndexes,
                                    int indexPos)
                             throws DbException
Fills an indexed table.

Parameters:
table - The table to use.
rowIt - The iterator that contains the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
indexPos - The column to use as an index.
Throws:
DbException - If something goes wrong.

fillIndexedTable

public static void fillIndexedTable(javax.swing.JTable table,
                                    java.util.Iterator rowIt,
                                    int[] colIndexes,
                                    int indexPos)
                             throws DbException
Fills an indexed table.

Parameters:
table - The table to use.
rowIt - The iterator that contains the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
indexPos - The position of the column to use as an index.
Throws:
DbException - If something goes wrong.

fillSortedTable

public static void fillSortedTable(javax.swing.JTable table,
                                   DbIterator rowIt,
                                   int[] colIndexes,
                                   int indexPos)
                            throws DbException
Fills a sorted table.

Parameters:
table - The table to use.
rowIt - The iterator that contains the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
indexPos - The position of the column to use as an index.
Throws:
DbException - If something goes wrong.

fillSortedTable

public static void fillSortedTable(javax.swing.JTable table,
                                   java.util.Iterator rowIt,
                                   int[] colIndexes,
                                   int indexPos)
                            throws DbException
Fills a sorted table.

Parameters:
table - The table to use.
rowIt - The iterator containing the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
indexPos - The position of the column to use as an index.
Throws:
DbException - If something goes wrong.

clearTable

public static void clearTable(javax.swing.JTable table)
Clears a normal table.

Parameters:
table - The table to use.

clearIndexedTable

public static void clearIndexedTable(javax.swing.JTable table)
Clears an indexed table.

Parameters:
table - The table to use.

clearSortedTable

public static void clearSortedTable(javax.swing.JTable table)
Clears a sorted table.

Parameters:
table - The table to use.

saveTable

public static void saveTable(javax.swing.JTable table,
                             java.lang.String scriptFileName)
                      throws java.io.IOException
Saves a table with a single column into a script file.

Parameters:
table - The table to use.
scriptFileName - The file name of the script to use.
Throws:
java.io.IOException - If the operation does not work.