jgnash.ui.util
Class JTableUtils

java.lang.Object
  extended by jgnash.ui.util.JTableUtils

public class JTableUtils
extends java.lang.Object

Methods for working with JTables

Version:
$Id$
Author:
Craig Cavanaugh

Constructor Summary
private JTableUtils()
          Static methods only
 
Method Summary
static java.lang.String getColumnOrder(javax.swing.JTable table)
          Returns the column order of a table in a formatted String.
static java.lang.String getColumnWidths(javax.swing.JTable table)
          Returns the column widths of a table in a formatted String.
static void packGenericTable(javax.swing.JTable table)
          Sizes the columns in a JTable
static void packTable(javax.swing.JTable table)
           
static void setColumnOrder(javax.swing.JTable table, java.lang.String positions)
          Sets the column order of a table given a correctly formatted String.
static void setColumnWidths(javax.swing.JTable table, java.lang.String widths)
          Sets the columns widths of a table given a correctly formatted String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTableUtils

private JTableUtils()
Static methods only

Method Detail

getColumnOrder

public static java.lang.String getColumnOrder(javax.swing.JTable table)
Returns the column order of a table in a formatted String.

Parameters:
table - The table to get the column order from
Returns:
A string in the format "0 1 2 3"

setColumnOrder

public static void setColumnOrder(javax.swing.JTable table,
                                  java.lang.String positions)
Sets the column order of a table given a correctly formatted String.

Parameters:
table - the table to set the column positions
positions - A string in the format "0 1 2 3"

getColumnWidths

public static java.lang.String getColumnWidths(javax.swing.JTable table)
Returns the column widths of a table in a formatted String.

Parameters:
table - The table to collect column widths from
Returns:
A String in the format "34 56 56 56"

setColumnWidths

public static void setColumnWidths(javax.swing.JTable table,
                                   java.lang.String widths)
Sets the columns widths of a table given a correctly formatted String. If the provided String is null, the table columns are sized to default values.

Parameters:
table - The table to set the columns widths
widths - A String in the format "34 56 56 56"

packGenericTable

public static void packGenericTable(javax.swing.JTable table)
Sizes the columns in a JTable

Parameters:
table - The table to size the columns in

packTable

public static void packTable(javax.swing.JTable table)