|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.tmaj.client.tables.data.TableData4
public class TableData4
The helper class for the InputPanel.
Field Summary | |
---|---|
static java.lang.Object |
DUMMY_ENUMERATION_OBJECT
|
protected java.awt.Component |
parentComponent
|
protected javax.swing.JScrollPane |
scrollPane
|
protected javax.swing.JTable |
table
|
protected BeanTableModel |
tableModel
|
Constructor Summary | |
---|---|
TableData4(JBean bean)
|
|
TableData4(JBean bean,
boolean useSearchDialogs)
|
|
TableData4(JBean bean,
boolean useSearchDialogs,
BeanTableModel tableModel)
Constructs this object. |
Method Summary | |
---|---|
void |
addDefaultValue(DatabaseField columnIdentifier,
java.lang.Object defaultValue)
Sets the default value to be assigned for a column when the user adds a new row |
void |
addRow()
|
void |
addRow(boolean copySelectedColumn)
Adds a row to the table. |
void |
addSearchTerm(SearchTerm searchTerm)
Add a SearchTerm to the list of fields the user can search. |
void |
clearDefaultValues()
|
void |
clearDirtyRows()
Indicates that no rows have been modified, and thus no rows need to be saved. |
void |
clearTableData()
Clears all data in this class. |
void |
deleteDirtyRows()
Deletes rows in the table that have been marked by the user. |
void |
deleteRow()
Marks a row for deletion. |
protected java.util.List |
determineColumnIdentifiers()
Returns a List containing the Column Identifiers for the Bean. |
void |
disableEditing()
Sets the tableModel such that the user can not edit the table cells. |
void |
displayHistory()
|
void |
displayHistory(int rowNumber)
|
void |
doSearch(Search search)
|
JBean |
getBean(int rowNumber)
Converts a row in the JTable to a JBean. |
java.lang.Object |
getCellValue(int rowNumber,
DatabaseField field)
|
java.util.List<java.lang.String> |
getExportList()
Returns a list of tab-delimited strings that will be written to a file |
JBean |
getGenericBean()
|
static java.util.Map<DatabaseField,java.lang.Object> |
getRowMap(int rowNumber,
GeneralTableModel tableModel)
Returns a Map containing ColumnIdentifiers as the key and the Object in the JTable's cell as the value |
javax.swing.JScrollPane |
getScrollPane()
|
java.util.List<SearchTerm> |
getSearchTerms()
A Convenience method for getSearchTermsForBean(bean) |
java.util.List<java.lang.Integer> |
getSelectedColumnIDs(java.lang.Object columnIdentifier)
|
static java.util.List<java.lang.Integer> |
getSelectedColumnIDs(java.lang.Object columnIdentifier,
javax.swing.JTable table,
GeneralTableModel tableModel)
|
java.lang.String |
getSelectedKeysString(java.lang.Object columnIdentifier)
Returns a comma-delimited String of the integers found in a specified ColumnIdentifier |
javax.swing.JTable |
getTable()
|
BeanTableModel |
getTableModel()
|
protected void |
newTableData()
Performs the finally initialization of the table after the columns have been determined. |
void |
save()
Saves any changes the user has made to the table. |
void |
search()
Performs a search on the database and fills the table with the found rows |
void |
setAllComboBoxes()
Sets enumerated columns to JComboBoxes containing the proper choices. |
void |
setCellValue(int rowNumber,
DatabaseField field,
java.lang.Object aValue)
|
static void |
setComboBox(javax.swing.JTable table,
int columnNumber,
java.util.List enumerationList)
Sets the cell editor of the specified column to a ComboBox containing all the choices in enumerationList. |
void |
setData(java.util.List beanList,
java.util.List columnIdentifiers)
|
static void |
stopCellEditting(javax.swing.JTable table)
Stop Table editting, such that if a user is editting a cell, the value typed-in in stored in the TableModel. |
static java.util.List |
translateBeanListToTableList(java.util.List<JBean> beanList,
java.util.List<DatabaseField> columnIdentifiers)
Converts a List of Beans to a List of Lists, making it ready to be inserted into a JTable |
void |
updateDirtyRows()
Inserts or Updates any rows that have had their data changed (by the user typing in data on one of the row's cells). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final javax.swing.JTable table
protected final javax.swing.JScrollPane scrollPane
protected final BeanTableModel tableModel
protected final java.awt.Component parentComponent
public static final java.lang.Object DUMMY_ENUMERATION_OBJECT
Constructor Detail |
---|
public TableData4(JBean bean, boolean useSearchDialogs)
public TableData4(JBean bean, boolean useSearchDialogs, BeanTableModel tableModel)
bean
- the generic bean to use for this InputPanel/TableDataparent_component
- a component for whom all dialogs will have as a parent (generally a JTabbedPane)useSearchDialogs
- true if pressing the search button should display a searchDialog. false if the
pressing the search button should automatically pull up every record for the beantableModel
- the BeanTableModel the JTable will usepublic TableData4(JBean bean)
Method Detail |
---|
public void displayHistory()
public void displayHistory(int rowNumber)
public BeanTableModel getTableModel()
public javax.swing.JTable getTable()
public javax.swing.JScrollPane getScrollPane()
public final java.util.List<SearchTerm> getSearchTerms()
public final void addSearchTerm(SearchTerm searchTerm)
public void save()
public static void stopCellEditting(javax.swing.JTable table)
public void deleteRow()
public void clearTableData()
protected void newTableData()
public final void addRow()
public final void addRow(boolean copySelectedColumn)
public void addDefaultValue(DatabaseField columnIdentifier, java.lang.Object defaultValue)
public void clearDefaultValues()
public void clearDirtyRows()
public void deleteDirtyRows()
public void updateDirtyRows()
public void setAllComboBoxes()
public static void setComboBox(javax.swing.JTable table, int columnNumber, java.util.List enumerationList)
public final JBean getBean(int rowNumber)
public static java.util.Map<DatabaseField,java.lang.Object> getRowMap(int rowNumber, GeneralTableModel tableModel)
protected java.util.List determineColumnIdentifiers()
public final void search()
public final void doSearch(Search search)
public final void setData(java.util.List beanList, java.util.List columnIdentifiers)
public final void setCellValue(int rowNumber, DatabaseField field, java.lang.Object aValue)
public final java.lang.Object getCellValue(int rowNumber, DatabaseField field)
public static java.util.List translateBeanListToTableList(java.util.List<JBean> beanList, java.util.List<DatabaseField> columnIdentifiers)
beanList
- a List of BeanscolumnIdentifiers
- a List of ColumnIdentifiers. Each element is a column in the table
public java.lang.String getSelectedKeysString(java.lang.Object columnIdentifier)
public java.util.List<java.lang.Integer> getSelectedColumnIDs(java.lang.Object columnIdentifier)
public static java.util.List<java.lang.Integer> getSelectedColumnIDs(java.lang.Object columnIdentifier, javax.swing.JTable table, GeneralTableModel tableModel)
public java.util.List<java.lang.String> getExportList()
public final JBean getGenericBean()
public void disableEditing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |