public class DBRecordTable<C extends ApplicationContext,T extends DBRecord> extends AbstractObjectTable<T> implements ApplicationObject<C>, Loadable, RecordCollection<T>, ReorderEvent.Source
DBRecordTableModel
in order to store DBRecord
s. It provides
convenience methods to access the table records as DBRecord
instances.DBRecordTableModel
,
Serialized Formjavax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
javax.swing.JComponent.AccessibleJComponent
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DBRecordTable(DBRecordTableModel<C,T> model) |
Modifier and Type | Method and Description |
---|---|
int |
addRecord(T newRecord)
Delegates to the DBTableModel.
|
int |
addRecord(T newRecord,
boolean isScrollVisible) |
void |
addReorderListener(ReorderEvent.Listener l) |
protected int |
configurePreferredDumpDialogRows() |
protected DBTableCellRenderer |
createCellRenderer() |
protected DBTableHeaderRenderer |
createHeaderRenderer() |
void |
createNewRecord()
Pops up the
RecordEditor for creating a new record. |
protected void |
deleteRow(int rowIndex)
Overridden to delete the record from the database
|
void |
editRecord()
Pops up the
RecordEditor for modifying an existing record. |
protected void |
fireOrderChanged(int colnumIndex,
boolean sortDir)
Notify all listeners that have registered interest for
notification on this event type.
|
de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyClearTableAction |
getActionClearTable() |
de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyNewRecordAction |
getActionRecordCreate()
Pops up the RecordEditor for entering a new record.
|
de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyDeleteRecordAction |
getActionRecordDelete()
Removes the record from the database and from the tablemodel.
|
de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyEditRecordAction |
getActionRecordEdit()
Pops up the RecordEditor for modifying the selected record.
|
de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyRehashRecordAction |
getActionRecordRehash() |
T[] |
getAllRecords()
Returns all DBRecords contained in the TableModel as an array.
|
C |
getApplicationContext() |
T |
getMasterRecord() |
DBRecordTableModel<C,T> |
getModel() |
DBRecord |
getParentRecord() |
T |
getRecord(int index)
Delegates to the DBTableModel.
|
T |
getRecord(java.lang.String dboId)
Delegates to the DBTableModel.
|
T |
getSelectedRecord()
Returns the DBRecord in column 0 at the currently selected row.
|
T[] |
getSelectedRecords()
Returns the selected rows as an array of DBRecords.
|
int |
indexOf(java.lang.String dboId)
Delegates to the DBTableModel.
|
int |
indexOf(T dbo)
Delegates to the DBTableModel.
|
boolean |
isEditOnDoubleClick()
Tells whether an edit form is popped up on double click.
|
void |
load(SqlCondition condition)
Delegates to the DBTableModel.
|
void |
load(SqlCondition condition,
SqlOrder order)
Delegates to the DBTableModel.
|
protected RecordEditor |
makeRecordCreateDialog(T masterRec)
Returns an instance of
RecordEditor for creating a record. |
protected RecordEditor |
makeRecordEditDialog(T masterRec)
Returns an instance of
RecordEditor for editing a record. |
protected RecordTypeChooser |
makeRecordTypeChooser() |
protected void |
performDeleteRequest(T record,
RecordCollection recColl)
Performs a database request in order to delete the given record.
|
protected void |
performRehashRequest(T record,
RecordCollection recColl)
Performs a database request in order to rehash the record.
|
int |
removeRecord(T dbo)
Delegates to the DBTableModel.
|
int |
removeRecord(T dbo,
boolean isAdjustSelection) |
void |
removeReorderListener(ReorderEvent.Listener l) |
void |
removeSelectedRecord()
Deletes the selected record from the TableModel.
|
boolean |
replaceRecord(T dbo)
Delegates to the DBTableModel.
|
void |
search(SqlCondition condition,
SqlOrder order)
Delegates to the DBTableModel.
|
T |
selectRecord(int index)
Selects the record at the given index and scrolls it ti be visible.
|
T |
selectRecord(java.lang.String dboId)
Selects the record with the given primary key.
|
T |
selectRecord(T dbo)
Searches the given
DBRecord in the TableModel and selects it. |
void |
setEditOnDoubleClick(boolean editOnDoubleClick)
Enables/disables popping up and edit form on double click.
|
void |
setParentRecord(DBRecord parentRec) |
void |
setRecord(int index,
T dbo)
Sets the record at the given index.
|
addActionListener, addDataLoadListener, addEnvProperties, addIndexChangeListener, addListSelectionListener, addObject, addObjects, addObjects, addTableModelListener, adjustSelection, clear, configurePreferredDumpDialogColumns, deleteObject, deleteRow, dropObject, dropObject, dropObject, dumpSelectedObject, first, getActionClearContent, getActionClearSelection, getActionDeleteSelectedRow, getActionDropSelectedRow, getActionDumpTableData, getActionLoadTableData, getActionRowDetails, getAllObjects, getCurrentIndex, getEnvKey, getObject, getPreferredScrollableViewportSize, getRecordCount, getSelectedIndex, getSelectedObject, getSelectedObjects, getSelectionModel, hasRangeSelected, hasSelection, indexOf, initFromEnvStore, isChangeConfirmed, isEmpty, isSelectionEmpty, isSortAscending, last, load, matchesTypedString, next, previous, removeActionListener, removeDataLoadListener, removeIndexChangeListener, removeListSelectionListener, removeTableModelListener, scrollToRow, selectObject, selectObject, selectRow, selectRow, setCurrentIndex, setHeaderRenderer, setObject, setSelectionMode, setSortAscending, toDumpString, toDumpString, toString, toString
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public DBRecordTable(DBRecordTableModel<C,T> model)
public DBRecord getParentRecord()
public void setParentRecord(DBRecord parentRec)
public final C getApplicationContext()
getApplicationContext
in interface ApplicationObject<C extends ApplicationContext>
public DBRecordTableModel<C,T> getModel()
getModel
in class AbstractObjectTable<T extends DBRecord>
public T getMasterRecord()
getMasterRecord
in interface RecordCollection<T extends DBRecord>
protected int configurePreferredDumpDialogRows()
configurePreferredDumpDialogRows
in class AbstractObjectTable<T extends DBRecord>
public void editRecord()
RecordEditor
for modifying an existing record.getActionRecordEdit()
protected RecordEditor makeRecordEditDialog(T masterRec)
RecordEditor
for editing a record.
Note that the returned instance is cached automatically, thus this method
will be called only once!public void createNewRecord()
RecordEditor
for creating a new record.getActionRecordCreate()
protected RecordEditor makeRecordCreateDialog(T masterRec)
RecordEditor
for creating a record.
Note that the returned instance is cached automatically, thus this method
will be called only once!protected RecordTypeChooser makeRecordTypeChooser()
protected DBTableCellRenderer createCellRenderer()
protected DBTableHeaderRenderer createHeaderRenderer()
public void setRecord(int index, T dbo)
public T selectRecord(T dbo)
DBRecord
in the TableModel and selects it.
DBRecords are compared with their equals() method.public T selectRecord(int index)
public T selectRecord(java.lang.String dboId)
public T getSelectedRecord()
getSelectedRecord
in interface RecordCollection<T extends DBRecord>
public T[] getSelectedRecords()
public T[] getAllRecords()
public T getRecord(int index)
getRecord
in interface RecordCollection<T extends DBRecord>
DBRecordTableModel.getRecord(int)
public T getRecord(java.lang.String dboId)
DBRecordTableModel.getRecord(String)
public int indexOf(T dbo)
public int indexOf(java.lang.String dboId)
DBRecordTableModel.indexOf(String)
public void load(SqlCondition condition) throws java.lang.Exception
java.lang.Exception
DBRecordTableModel.load(SqlCondition)
public void load(SqlCondition condition, SqlOrder order) throws java.lang.Exception
java.lang.Exception
DBRecordTableModel.load(SqlCondition, SqlOrder)
public void search(SqlCondition condition, SqlOrder order) throws java.lang.Exception
java.lang.Exception
DBRecordTableModel.search(SqlCondition, SqlOrder)
public boolean replaceRecord(T dbo)
replaceRecord
in interface RecordCollection<T extends DBRecord>
DBRecordTableModel.replaceRecord(DBRecord)
public void removeSelectedRecord()
public int removeRecord(T dbo)
removeRecord
in interface RecordCollection<T extends DBRecord>
DBRecordTableModel.removeRecord(DBRecord)
public int removeRecord(T dbo, boolean isAdjustSelection)
removeRecord
in interface RecordCollection<T extends DBRecord>
public int addRecord(T newRecord)
addRecord
in interface RecordCollection<T extends DBRecord>
public int addRecord(T newRecord, boolean isScrollVisible)
addRecord
in interface RecordCollection<T extends DBRecord>
public void addReorderListener(ReorderEvent.Listener l)
addReorderListener
in interface ReorderEvent.Source
public void removeReorderListener(ReorderEvent.Listener l)
removeReorderListener
in interface ReorderEvent.Source
protected void fireOrderChanged(int colnumIndex, boolean sortDir)
protected void performRehashRequest(T record, RecordCollection recColl) throws java.lang.Exception
java.lang.Exception
protected void performDeleteRequest(T record, RecordCollection recColl) throws java.lang.Exception
java.lang.Exception
public de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyNewRecordAction getActionRecordCreate()
public de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyEditRecordAction getActionRecordEdit()
public de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyDeleteRecordAction getActionRecordDelete()
public de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyRehashRecordAction getActionRecordRehash()
public de.esprit.appsuite.database.dbgui.table.DBRecordTable.MyClearTableAction getActionClearTable()
public boolean isEditOnDoubleClick()
public void setEditOnDoubleClick(boolean editOnDoubleClick)
protected void deleteRow(int rowIndex) throws java.lang.Exception
deleteRow
in class AbstractObjectTable<T extends DBRecord>
java.lang.Exception
AbstractObjectTable.dropObject(int)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.