Package org.openpnp.gui.support
Class TableUtils
- java.lang.Object
-
- org.openpnp.gui.support.TableUtils
-
public class TableUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intMIN_COLUMN_WIDTH
-
Constructor Summary
Constructors Constructor Description TableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidinstallColumnWidthSavers(javax.swing.JTable table, java.util.prefs.Preferences prefs, java.lang.String prefKey)Installs listeners on each column of the table as well as the table itself that save and restore the table's column widths.static voidsetColumnAlignment(ColumnAlignable tableModel, javax.swing.JTable table)Sets the horizontal alignment of each of the columns of the specified table..
-
-
-
Field Detail
-
MIN_COLUMN_WIDTH
public static final int MIN_COLUMN_WIDTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
setColumnAlignment
public static void setColumnAlignment(ColumnAlignable tableModel, javax.swing.JTable table)
Sets the horizontal alignment of each of the columns of the specified table..- Parameters:
tableModel- - the table model for the table. Must implement ColumnAlignable.table- - the table whose columns' horizontal alignment is to be set
-
installColumnWidthSavers
public static void installColumnWidthSavers(javax.swing.JTable table, java.util.prefs.Preferences prefs, java.lang.String prefKey)Installs listeners on each column of the table as well as the table itself that save and restore the table's column widths. If the table's TableModel implements ColumnWidthSaveable, the restored column widths will be a combination of fixed and proportionally allocated to the table's total width based upon the values returned by the model's getColumnWidthTypes() method. Otherwise, all columns will be proportionally allocated to the table's total width.- Parameters:
table- - the table whose columns' widths are to be saved/restoredprefs- - the Preferences node where the widths are stored/retrievedprefKey- - the key prefix for the particular table
-
-