|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.workbench.model.AbstractWorkbenchFileEditor
com.partnersoft.workbench.editors.TableEditor
public abstract class TableEditor
Abstract TableEditor class. Defines JTable helper methods. Extending classes need to implement save(), load(), and optionally saveWrapper().
Copyright 2008 Partner Software, Inc.
| Nested Class Summary | |
|---|---|
class |
TableEditor.ComboBoxCellEditor
|
| Field Summary | |
|---|---|
protected javax.swing.JTable |
table
|
| Fields inherited from class com.partnersoft.workbench.model.AbstractWorkbenchFileEditor |
|---|
actionBureau, file, gui, name, workbench |
| Constructor Summary | |
|---|---|
TableEditor()
Creates a new TableEditor. |
|
| Method Summary | |
|---|---|
void |
addBlankRow()
Adds an empty row to the end of the table. |
void |
addColumn(java.lang.String name)
Adds a column. |
void |
addPicklistColumn(java.lang.String name,
java.lang.String... options)
Adds a column with all cells being combo boxes. |
void |
addRow(Naming rowData)
Adds a row to the end of the table. |
void |
addRow(java.lang.Object... orderedRowData)
Adds a row to the end of the table. |
void |
clear()
|
void |
deleteRow(int rowIndex)
Removes specified row from table. |
java.util.List<Naming> |
getAllData()
Returns a List |
java.lang.Object |
getCellValueAt(int colIndex,
int rowIndex)
Returns object at given table coordinates. |
java.lang.String[] |
getColumnNames()
Returns a String[] of all column names in order. |
Naming |
getRowAt(int rowIndex)
Returns Naming of column names mapped to column values for specified row. |
java.util.Vector |
getRowVectorAt(int rowIndex)
Returns vector of row data for specified row. |
void |
insertBlankRow(int rowIndex)
Inserts an empty row at the given index. |
void |
insertRowAt(int rowIndex,
Naming rowData)
Inserts row at specified index. |
void |
insertRowAt(int rowIndex,
java.lang.Object... orderedRowData)
Inserts row at specified index. |
abstract void |
load()
|
void |
removeColumn(int colIndex)
Removes specified column from the table. |
void |
removeColumn(java.lang.String colName)
Removes specified column from the table. |
abstract void |
save()
Called on every table update through saveWrapper(). |
void |
saveWrapper()
Wrapper for save() allowing extending classes to handle IOException. |
void |
setCellValueAt(java.lang.Object value,
int colIndex,
int rowIndex)
Sets object at given table coordinates. |
void |
setColumnCellEditor(int colIndex,
javax.swing.table.TableCellEditor editor)
Sets a column editor for specified column. |
void |
setColumnCellEditor(java.lang.String colName,
javax.swing.table.TableCellEditor editor)
Sets a column editor for specified column. |
void |
setColumnCellRenderer(int colIndex,
javax.swing.table.TableCellRenderer renderer)
Sets a column renderer for specified column. |
void |
setColumnCellRenderer(java.lang.String colName,
javax.swing.table.TableCellRenderer renderer)
Sets a column renderer for specified column. |
void |
setLine(int line)
|
void |
setRowAt(int rowIndex,
Naming rowData)
Sets Row values at specified index to values matching column names in Naming. |
void |
setRowAt(int rowIndex,
java.lang.Object... orderedRowData)
Sets row values at specified index to values. |
| Methods inherited from class com.partnersoft.workbench.model.AbstractWorkbenchFileEditor |
|---|
doAction, doAction, getFile, getGui, getName, getWorkbench, loadCog, loadObject, saveCog, saveObject, setFile, setWorkbench |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.JTable table
| Constructor Detail |
|---|
public TableEditor()
Internal JTable is generated with a DefaultTableModel, and a TableModelListener passing all tableChanged events to saveWrapper().
| Method Detail |
|---|
public java.util.List<Naming> getAllData()
public void addColumn(java.lang.String name)
name -
public void addPicklistColumn(java.lang.String name,
java.lang.String... options)
name - options -
public void setColumnCellEditor(java.lang.String colName,
javax.swing.table.TableCellEditor editor)
colName - editor -
public void setColumnCellEditor(int colIndex,
javax.swing.table.TableCellEditor editor)
colIndex - - 0 based index of cells.editor -
public void setColumnCellRenderer(java.lang.String colName,
javax.swing.table.TableCellRenderer renderer)
colName - renderer -
public void setColumnCellRenderer(int colIndex,
javax.swing.table.TableCellRenderer renderer)
colIndex - - 0 based index of cells.renderer - public void removeColumn(java.lang.String colName)
colName - public void removeColumn(int colIndex)
colIndex - - O based column index.public void deleteRow(int rowIndex)
rowIndex - - 0 based row index.
public java.lang.Object getCellValueAt(int colIndex,
int rowIndex)
colIndex - - 0 based index of columns.rowIndex - - 0 based index of rows.
public void setCellValueAt(java.lang.Object value,
int colIndex,
int rowIndex)
value - - Object to set in cell.colIndex - - 0 based index of columns.rowIndex - - 0 based index of rows.
public void setRowAt(int rowIndex,
Naming rowData)
rowIndex - - O based row index.rowData - - Naming of column names mapped to values.
public void setRowAt(int rowIndex,
java.lang.Object... orderedRowData)
Calls deleteRow(int) and insertRowAt(int,
rowIndex - - 0 based row index.orderedRowData - - Object[] of column values.public Naming getRowAt(int rowIndex)
rowIndex - - 0 based row index.
public java.util.Vector getRowVectorAt(int rowIndex)
rowIndex - - 0 based row index.
public void insertRowAt(int rowIndex,
Naming rowData)
Calls insertRowAt(int, Object[])
rowIndex - - 0 based row index.rowData - - Naming with column names as keys.
public void insertRowAt(int rowIndex,
java.lang.Object... orderedRowData)
rowIndex - - 0 based row indexorderedRowData - public void addBlankRow()
public void insertBlankRow(int rowIndex)
rowIndex - - 0 based row index.public void addRow(Naming rowData)
rowData - - Naming of column names mapped to values.public void addRow(java.lang.Object... orderedRowData)
orderedRowData - public java.lang.String[] getColumnNames()
public void clear()
public abstract void load()
throws java.io.IOException
java.io.IOException
public abstract void save()
throws java.io.IOException
java.io.IOExceptionpublic void saveWrapper()
public void setLine(int line)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||