com.dlsc.flexgantt.swing.util
Class TableUtils

java.lang.Object
  extended by com.dlsc.flexgantt.swing.util.TableUtils

public class TableUtils
extends java.lang.Object

Utility methods for use with JTable.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
TableUtils()
           
 
Method Summary
static int autoResizeTable(javax.swing.JTable table, boolean includeColumnHeaderWidth)
          Resizes the given table so that all of its columns have their preferred width.
static int autoResizeTable(javax.swing.JTable table, boolean includeColumnHeaderWidth, int columnPadding)
          Resizes the given table so that all of its columns have their preferred width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableUtils

public TableUtils()
Method Detail

autoResizeTable

public static int autoResizeTable(javax.swing.JTable table,
                                  boolean includeColumnHeaderWidth)
Resizes the given table so that all of its columns have their preferred width. This preferred width is the maximum width used by any one of the table cells (plus an additional column padding).

Parameters:
table - the table to resize
includeColumnHeaderWidth - a flag that signals whether the width of the column header shall be considered as well
Returns:
the calculated preferred width of the table
Since:
1.0

autoResizeTable

public static int autoResizeTable(javax.swing.JTable table,
                                  boolean includeColumnHeaderWidth,
                                  int columnPadding)
Resizes the given table so that all of its columns have their preferred width. This preferred width is the maximum width used by any one of the table cells.

Parameters:
table - the table to resize
includeColumnHeaderWidth - a flag that signals whether the width of the column header shall be considered as well
columnPadding - a padding added to the preferred column width
Returns:
the calculated preferred width of the table
Since:
1.0