|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.SaveTableModelData edu.northwestern.at.utils.swing.SaveTableData
public class SaveTableData
Saves data stored in a JTable to a file is several different formats.
Field Summary |
---|
Fields inherited from class edu.northwestern.at.utils.swing.SaveTableModelData |
---|
csvFilter, htmlFilter, tabFilter |
Constructor Summary | |
---|---|
protected |
SaveTableData()
Don't allow instantiation but do allow overrides. |
Method Summary | |
---|---|
static java.lang.String[] |
getColumnTitles(javax.swing.JTable table)
Get column titles for a table. |
static void |
saveTableDataToFile(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles,
java.lang.String fileName)
Saves the table data to a file. |
static void |
saveTableDataToFile(java.awt.Window parentWindow,
javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles)
Saves the table model data to a file. |
static void |
saveTableDataToFileAsCSV(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles,
java.lang.String fileName)
Saves the table model data to a file in CSV format. |
static void |
saveTableDataToFileAsTAB(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles,
java.lang.String fileName)
Saves the table model data to a file in TAB format. |
static void |
saveTableDataToFileAsXHTML(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles,
java.lang.String fileName)
Saves the table model data to a file in XHTML format. |
static java.lang.String |
tableDataToCSV(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles)
Convert contents of a JTable to comma separated values. |
static java.lang.String |
tableDataToTAB(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles)
Convert contents of a Table to tab separated values. |
static java.lang.String |
tableDataToXHTML(javax.swing.JTable table,
java.lang.String title,
boolean outputColumnTitles,
int border)
Convert contents of a Table to XHTML. |
Methods inherited from class edu.northwestern.at.utils.swing.SaveTableModelData |
---|
cleanColumnHeader, saveTableModelDataToFile, saveTableModelDataToFile, saveTableModelDataToFileAsCSV, saveTableModelDataToFileAsTAB, saveTableModelDataToFileAsXHTML, tableModelDataToCSV, tableModelDataToTAB, tableModelDataToXHTML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SaveTableData()
Method Detail |
---|
public static java.lang.String[] getColumnTitles(javax.swing.JTable table)
table
- The table whose column titles are desired.
public static java.lang.String tableDataToCSV(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles)
table
- The table containing the data to
convert to command separated values.title
- Title for table.outputColumnTitles
- true to output column headers.
public static java.lang.String tableDataToTAB(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles)
table
- The table containing the data to
convert to command separated values.title
- Title for table.outputColumnTitles
- true to output column headers.
public static java.lang.String tableDataToXHTML(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles, int border)
table
- The table containing the data to
convert to command separated values.title
- Title for table.outputColumnTitles
- true to output column headers.border
- Border size for table. Set to 0 for
no border.
public static void saveTableDataToFileAsCSV(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles, java.lang.String fileName)
table
- The table containing the data to save.title
- The title for the data.outputColumnTitles
- true to output column titles.fileName
- The file name to which to save the data. public static void saveTableDataToFileAsTAB(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles, java.lang.String fileName)
table
- The table containing the data to save.title
- The title for the data.outputColumnTitles
- true to output column titles.fileName
- The file name to which to save the data. public static void saveTableDataToFileAsXHTML(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles, java.lang.String fileName)
table
- The table containing the data to save.title
- The title for the data.outputColumnTitles
- true to output column titles.fileName
- The file name to which to save the data. public static void saveTableDataToFile(javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles, java.lang.String fileName)
table
- Table holding data to save.title
- The title for the data. Null if no title.outputColumnTitles
- true to output column titles.fileName
- The file name to which to save the data.
The filename extension determines the type of output. .csv -> comma separated values, .tab -> tab separate values, and .htm or .html -> xhtml. If the filename does not end in one of these, a comma separated file format is used.
public static void saveTableDataToFile(java.awt.Window parentWindow, javax.swing.JTable table, java.lang.String title, boolean outputColumnTitles)
parentWindow
- Parent window for file dialog.table
- The table whose data is to be saved.title
- The title for the table data.outputColumnTitles
- true to output column titles.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |