Skip navigation links


com.essbase.eas.ui
Class TableUtilities

java.lang.Object
  extended by com.essbase.eas.ui.TableUtilities


public class TableUtilities
extends java.lang.Object

Provides some standard utility methods that should be useful for all tables.

Version:
6.5.0, 12/12/2001
Author:
Joe Fernandez

Method Summary
static void adjustColumnWidths(javax.swing.JTable table)
          Sets the column widths for a table, given the data contained in it.
static int getColumnIndex(javax.swing.table.TableModel model, java.lang.String columnName)
          Returns the column index corresponding to the column name
static int getColumnPreferredWidth(int column, javax.swing.table.TableColumn col, javax.swing.JTable table)
           
static int getColumnPreferredWidth(javax.swing.table.TableColumn col, javax.swing.JTable table)
          Sets the width of a specified column in a table.
static int[] getFilledRows(javax.swing.JTable table)
          returns a list of row indexes with content, even if they are incompletely filled
static java.lang.String getHTML(javax.swing.table.TableModel model)
           
static java.lang.String getHTML(javax.swing.table.TableModel model, java.awt.Font font)
           
static java.lang.String getHTML(javax.swing.table.TableModel model, java.lang.String fontName, int fontSize)
           
static int getHTMLFontSize(java.awt.Font font)
           
static java.lang.String[] getTableText(javax.swing.table.TableModel model)
           
static int isRowFilled(javax.swing.JTable table, int rowIndex)
          checks to see if there are values in all cells of a row.
static java.lang.String modelToString(javax.swing.table.TableModel model)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

adjustColumnWidths

public static void adjustColumnWidths(javax.swing.JTable table)
Sets the column widths for a table, given the data contained in it. This method checks the actual width of header titles and the first 30 rows of data to set the width of the columns in the table. Note: The JTable should have the AutoResizeMode set to off and the width of the table should *not* be explicitly set (do not set preferredSize on the JTable or the ScrollPane which contains it). To set AutoResizeMode to off, make the following call *before* calling the adjustColumnWidths() method: myTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

getColumnPreferredWidth

public static int getColumnPreferredWidth(javax.swing.table.TableColumn col,
                                          javax.swing.JTable table)
Sets the width of a specified column in a table. Follows the same width- determination logic as adjustColumnWidths().
See Also:
adjustColumnWidths()

getColumnPreferredWidth

public static int getColumnPreferredWidth(int column,
                                          javax.swing.table.TableColumn col,
                                          javax.swing.JTable table)

getFilledRows

public static int[] getFilledRows(javax.swing.JTable table)
returns a list of row indexes with content, even if they are incompletely filled

isRowFilled

public static int isRowFilled(javax.swing.JTable table,
                              int rowIndex)
checks to see if there are values in all cells of a row.
Returns:
Returns -1 if all rows are filled or the column index of the first unfilled cell.

modelToString

public static java.lang.String modelToString(javax.swing.table.TableModel model)

getHTML

public static java.lang.String getHTML(javax.swing.table.TableModel model)

getHTML

public static java.lang.String getHTML(javax.swing.table.TableModel model,
                                       java.awt.Font font)

getHTML

public static java.lang.String getHTML(javax.swing.table.TableModel model,
                                       java.lang.String fontName,
                                       int fontSize)

getHTMLFontSize

public static int getHTMLFontSize(java.awt.Font font)

getTableText

public static java.lang.String[] getTableText(javax.swing.table.TableModel model)

getColumnIndex

public static int getColumnIndex(javax.swing.table.TableModel model,
                                 java.lang.String columnName)
Returns the column index corresponding to the column name
Parameters:
model - table model
columnName - column name
Returns:
the column position in the table model

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.