JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource
Class IdeDataTable

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--com.klg.jclass.datasource.DataSourceTreeNode
              |
              +--com.klg.jclass.datasource.BaseDataTable
                    |
                    +--com.klg.jclass.datasource.IdeDataTable
All Implemented Interfaces:
Cloneable, DataModelListener, DataTableAbstractionLayer, DataTableModel, EventListener, IdeDataTableModel, MutableTreeNode, ReadOnlyBindingListener, Serializable, TreeNode
Direct Known Subclasses:
DataTable

public abstract class IdeDataTable
extends BaseDataTable
implements IdeDataTableModel, DataModelListener

This class extends BaseDataTable to provide functionality common to IDE implementations.

See Also:
Serialized Form

Field Summary
 long bookmarkOfLastRowAdded
           
protected  Hashtable ideRowIndexToBookmarkMap
           
 
Fields inherited from class com.klg.jclass.datasource.BaseDataTable
bookmark, currentColumn, cursor, eventQueue, initialHashtableSize, insertedRows, internalData, logicallyDeletedRows, metaData, parentRow, rowCaches, rowIndexBeforeEvent, store, updatedRows, userData
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface com.klg.jclass.datasource.DataTableModel
COMMITTED, CURSOR_BEFORE_FIRST, DELETED, INSERTED, NONEXISTENT, ROOT_BOOKMARK, ROW_NOT_FOUND, UPDATED
 
Constructor Summary
IdeDataTable(com.klg.jclass.datasource.MetaDataModel metaData)
          Root-level constructor.
IdeDataTable(com.klg.jclass.datasource.MetaDataModel metaData, long parentRow)
          Constructor to call after root-level BaseDataTable has been created.
 
Method Summary
 long addRow2(int newRowIndex)
          Called by IDE event handler in meta data.
 void afterChangeOfRowData(com.klg.jclass.datasource.DataModelEvent e)
          A row has changed; re-read all its cells and its status to reflect the new values.
 void afterDeleteRow(com.klg.jclass.datasource.DataModelEvent e)
          Removes the row from the display.
 void afterInsertRow(com.klg.jclass.datasource.DataModelEvent e)
          A new row has been added to the datasource.
 void afterMoveToCurrentRow(com.klg.jclass.datasource.DataModelEvent e)
          The global cursor has moved to a new row.
 void afterRequeryRowAndDetails(com.klg.jclass.datasource.DataModelEvent e)
          Re-reads the indicated row and refreshes all open children under this row.
 void afterRequeryTable(com.klg.jclass.datasource.DataModelEvent e)
          Re-read this table and refreshes all open children in this table.
 void afterReset(com.klg.jclass.datasource.DataModelEvent e)
          Listeners must close all expanded views and reset/reread the root node.
 void beforeCancelAll(com.klg.jclass.datasource.DataModelEvent e)
          Called before all changes are cancelled.
 void beforeCancelRowChanges(com.klg.jclass.datasource.DataModelEvent e)
          Called before all edits to a row are undone.
 void beforeCommitAll(com.klg.jclass.datasource.DataModelEvent e)
          Called before all changes are committed.
 void beforeCommitConditional(com.klg.jclass.datasource.DataModelEvent e)
          Called when the root-level bookmark for a subtree changes.
 void beforeCommitRow(com.klg.jclass.datasource.DataModelEvent e)
          Called before single row is committed to data source.
 void beforeDeleteRow(com.klg.jclass.datasource.DataModelEvent e)
          Called before a row is [logically] deleted.
 void beforeDeleteTable(com.klg.jclass.datasource.DataModelEvent e)
          The indicated DataTable will be deleted and flushed from the cache.
 void beforeEditCell(com.klg.jclass.datasource.DataModelEvent e)
          Called before a cell is edited.
 void beforeInsertRow(com.klg.jclass.datasource.DataModelEvent e)
          Called before a row is inserted.
 void beforeMoveToCurrentRow(com.klg.jclass.datasource.DataModelEvent e)
          The global cursor will move to a new row.
 void beforeRequery(com.klg.jclass.datasource.DataModelEvent e)
          Called when either DataTableModel.requeryRowAndDetails() or DataTableModel.requeryRow() is called.
 void beforeReset(com.klg.jclass.datasource.DataModelEvent e)
          Called before entire grid is reset.
 void beginEvents(com.klg.jclass.datasource.DataModelEvent e)
          Notification that multiple events are coming.
 void commitRow2(long bookmark)
           
 void deleteRow2(long bookmark)
           
 void endEvents(com.klg.jclass.datasource.DataModelEvent e)
          Notification that multiple events are complete.
 long getBookmarkFromIdeIndex(int ideIndex)
          Converts between an IDE index and our bookmark.
 void initialize(com.klg.jclass.datasource.DataModelEvent e)
          For internal use only.
 void originatorNavigateRow(com.klg.jclass.datasource.DataModelEvent e)
          The current row has been deleted and the originator of the deletion should now reposition the global cursor to a new, valid row.
 void removeRowFromIdeMap(long bookmark)
          For internal use only.
 void requeryFromIdeDataSource()
          Requeries from the IDE data soruce, that is, not from the server.
 void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator, long bookmark)
          Overrides BaseDataTable.requeryRowAndDetails, adds an extra call which refreshes child data sets.
 void setValueAt2(long bookmark, String col_id, Object value)
          Calls super.setValueAt since setValueAt is overridden to call IDE update methods.
 
Methods inherited from class com.klg.jclass.datasource.BaseDataTable
absolute, addInternalRow, addInternalRow, addRow, addRow, addRow, addRow, afterLast, beforeFirst, cancelAllRowChanges, cancelChanges, cancelRowChanges, clearEventQueue, cloneRow, columnModified, commitAll, commitRow, commitSubTree, conditionallyCommitYourselfAndChildren, createDataTableModelFromProviderData, createNewRow, createTable, deleteCacheChildren, deleteRow, fireDataModelEvent, fireOriginatorDataModelEvent, first, getAncestors, getCell, getCurrentBookmark, getCursor, getDeletedRow, getDeletedRowBookmarks, getInsertedRowBookmarks, getInternalData, getMetaData, getNextBookmark, getOriginalRow, getParentBookmark, getResultData, getRootAncestorBookmark, getRowCount, getRowFromCache, getRowIdentifier, getRowIndex, getRowStatus, getTable, getUpdatedRowBookmarks, getUserData, hasValueChanged, isAfterLast, isBeforeFirst, isModified, isSubTreeModified, isTableOrChildrenModified, last, materializeTable, moveCursorToRow, moveToRow, next, originalCellWasNull, prepareCellUpdate, previous, processEventQueue, recursivelyDeleteChildren, refreshRow, relative, removeRowFromInsertedTable, removeRowFromLogicallyDeletedTable, removeRowFromOriginalRowTable, removeRowFromUpdatedTable, requeryLevel, requeryRow, requeryTable, restoreRow, saveRow, setInternalData, setRowDirty, setUserData, setValueAt, tableIsAncestor, updateCell
 
Methods inherited from class com.klg.jclass.datasource.DataSourceTreeNode
getChildren, getFirstChild, getIterator, getIterator, getIterator, getIterator, getLastChild, getNextChild, getPreviousChild, hasChildren, insert, isChildOf, toString
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstLeaf, getIndex, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.klg.jclass.datasource.IdeDataTableModel
copyTable, duplicateRow, getCell2
 
Methods inherited from interface com.klg.jclass.datasource.DataTableModel
absolute, addRow, addRow, addRow, addRow, afterLast, beforeFirst, cancelAllRowChanges, cancelRowChanges, clearEventQueue, commitAll, commitRow, commitSubTree, conditionallyCommitYourselfAndChildren, createNewRow, createTable, deleteCacheChildren, deleteRow, first, getAncestors, getCurrentBookmark, getCursor, getDeletedRowBookmarks, getInsertedRowBookmarks, getInternalData, getMetaData, getParentBookmark, getResultData, getRootAncestorBookmark, getRowCount, getRowIdentifier, getRowIndex, getRowStatus, getTable, getUpdatedRowBookmarks, getUserData, isAfterLast, isBeforeFirst, isModified, isSubTreeModified, isTableOrChildrenModified, last, moveCursorToRow, moveToRow, next, previous, processEventQueue, relative, requeryLevel, requeryRow, requeryTable, setInternalData, setUserData, tableIsAncestor, updateCell
 

Field Detail

bookmarkOfLastRowAdded

public long bookmarkOfLastRowAdded

ideRowIndexToBookmarkMap

protected Hashtable ideRowIndexToBookmarkMap
Constructor Detail

IdeDataTable

public IdeDataTable(com.klg.jclass.datasource.MetaDataModel metaData)
Root-level constructor. Should be called only once to set the data table that will be the root of the data table tree. Subsequent nodes should be created using the constructor below.

Parameters:
metaData - the MetaDataModel which provides the column structure for this data table.

IdeDataTable

public IdeDataTable(com.klg.jclass.datasource.MetaDataModel metaData,
                    long parentRow)
Constructor to call after root-level BaseDataTable has been created. These tables will be sub-root level nodes in the data table tree.

Parameters:
metaData - the MetaDataModel, which provides the column structure for this data table.
parentRow - an int indicating to which parent bookmark this data table relates.
Method Detail

setValueAt2

public void setValueAt2(long bookmark,
                        String col_id,
                        Object value)
                 throws DataModelException
Description copied from interface: IdeDataTableModel
Calls super.setValueAt since setValueAt is overridden to call IDE update methods.

Specified by:
setValueAt2 in interface IdeDataTableModel
Throws:
DataModelException - If set fails.

addRow2

public long addRow2(int newRowIndex)
             throws DataModelException
Called by IDE event handler in meta data.

Specified by:
addRow2 in interface IdeDataTableModel
Throws:
DataModelException - If row can't be added.

deleteRow2

public void deleteRow2(long bookmark)
Specified by:
deleteRow2 in interface IdeDataTableModel

commitRow2

public void commitRow2(long bookmark)
Specified by:
commitRow2 in interface IdeDataTableModel

getBookmarkFromIdeIndex

public long getBookmarkFromIdeIndex(int ideIndex)
Converts between an IDE index and our bookmark.

Specified by:
getBookmarkFromIdeIndex in interface IdeDataTableModel

requeryFromIdeDataSource

public void requeryFromIdeDataSource()
Requeries from the IDE data soruce, that is, not from the server.

Specified by:
requeryFromIdeDataSource in interface IdeDataTableModel

removeRowFromIdeMap

public void removeRowFromIdeMap(long bookmark)
For internal use only. Remove the mapping between ide row indexs and bookmarks.


requeryRowAndDetails

public void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator,
                                 long bookmark)
                          throws DataModelException
Overrides BaseDataTable.requeryRowAndDetails, adds an extra call which refreshes child data sets. Requeries a DataTable row and deletes all children from the cache. Calls requeryRow(). Refetches all rows in this DataTable from the originating data source and deletes all child nodes from the cache.

Specified by:
requeryRowAndDetails in interface DataTableModel
Overrides:
requeryRowAndDetails in class BaseDataTable
Parameters:
originator - the DataModelListener which initiated this action
Returns:
this data table model
Throws:
DataModelException - If requery from server fails.
See Also:
BaseDataTable.requeryRow(com.klg.jclass.datasource.DataModelListener, long)

beforeInsertRow

public void beforeInsertRow(com.klg.jclass.datasource.DataModelEvent e)
Called before a row is inserted. Can be cancelled. If not cancelled, will be followed by afterInsertRow().

Specified by:
beforeInsertRow in interface DataModelListener
See Also:
DataTableModel.addRow(com.klg.jclass.datasource.DataModelListener)

beforeReset

public void beforeReset(com.klg.jclass.datasource.DataModelEvent e)
Called before entire grid is reset. Can be cancelled. If not cancelled, will be followed by afterReset(). This will result from a call to DataModel.requeryAll().

Specified by:
beforeReset in interface DataModelListener
See Also:
DataModel.requeryAll(com.klg.jclass.datasource.DataModelListener)

beforeRequery

public void beforeRequery(com.klg.jclass.datasource.DataModelEvent e)
Called when either DataTableModel.requeryRowAndDetails() or DataTableModel.requeryRow() is called. If not cancelled will be followed by an

Specified by:
beforeRequery in interface DataModelListener
See Also:
DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long), DataTableModel.requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener, long)

beforeEditCell

public void beforeEditCell(com.klg.jclass.datasource.DataModelEvent e)
Called before a cell is edited. Can be cancelled.

Specified by:
beforeEditCell in interface DataModelListener
See Also:
DataTableModel.updateCell(com.klg.jclass.datasource.DataModelListener, long, java.lang.String, java.lang.Object)

beforeDeleteRow

public void beforeDeleteRow(com.klg.jclass.datasource.DataModelEvent e)
Called before a row is [logically] deleted. Can be cancelled. If not cancelled will be followed by an afterDeleteRow() or an afterChangeOfRowData() if the commit policy is COMMIT_MANUALLY or COMMIT_LEAVING_ANCESTOR.

Specified by:
beforeDeleteRow in interface DataModelListener
See Also:
DataTableModel.deleteRow(com.klg.jclass.datasource.DataModelListener, long), MetaDataModel.getCommitPolicy()

beforeCommitAll

public void beforeCommitAll(com.klg.jclass.datasource.DataModelEvent e)
Called before all changes are committed. Can be cancelled. All modified, deleted and inserted rows at all levels are about to be committed. beforeDeleteRow() and afterChangeOfRowData() will follow depending on the operations performed on the modified rows being saved. Results from a call to DataModel.updateAll.

Specified by:
beforeCommitAll in interface DataModelListener
See Also:
DataModel.updateAll(com.klg.jclass.datasource.DataModelListener)

beforeCancelAll

public void beforeCancelAll(com.klg.jclass.datasource.DataModelEvent e)
Called before all changes are cancelled. Can be cancelled. afterInsertRow() and afterChangeOfRowData() can follow this event.

Specified by:
beforeCancelAll in interface DataModelListener
See Also:
DataModel.cancelAll(com.klg.jclass.datasource.DataModelListener)

beforeCancelRowChanges

public void beforeCancelRowChanges(com.klg.jclass.datasource.DataModelEvent e)
Called before all edits to a row are undone. Can be cancelled. An afterDeleteRow() or afterChangeOfRowData() will follow.

Specified by:
beforeCancelRowChanges in interface DataModelListener
See Also:
DataTableModel.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long)

beforeCommitConditional

public void beforeCommitConditional(com.klg.jclass.datasource.DataModelEvent e)
Called when the root-level bookmark for a subtree changes. When this happens those nodes in the previous subtree which are not COMMIT_MANUALLY are committed. Can be cancelled. If cancelled, the cursor moves but the changes are automatically committed.

Specified by:
beforeCommitConditional in interface DataModelListener

beforeCommitRow

public void beforeCommitRow(com.klg.jclass.datasource.DataModelEvent e)
Called before single row is committed to data source. Can be cancelled, in which case the row edits are not written to the datasource and the row's status remains modified. afterDeleteRow() or afterChangeOfRowData() will follow, depending on the status of the row to be committed.

Specified by:
beforeCommitRow in interface DataModelListener
See Also:
DataTableModel.commitRow(com.klg.jclass.datasource.DataModelListener, long)

beforeMoveToCurrentRow

public void beforeMoveToCurrentRow(com.klg.jclass.datasource.DataModelEvent e)
The global cursor will move to a new row. Can be cancelled.

Specified by:
beforeMoveToCurrentRow in interface DataModelListener

beforeDeleteTable

public void beforeDeleteTable(com.klg.jclass.datasource.DataModelEvent e)
The indicated DataTable will be deleted and flushed from the cache. Can be cancelled.

Specified by:
beforeDeleteTable in interface DataModelListener

afterChangeOfRowData

public void afterChangeOfRowData(com.klg.jclass.datasource.DataModelEvent e)
A row has changed; re-read all its cells and its status to reflect the new values. If this event is the result of a cell edit, call DataModelEvent.getColumn() to get the name of the column which changed. If getColumn() returns "", re-read the entire row. Called when

Specified by:
afterChangeOfRowData in interface ReadOnlyBindingListener

afterInsertRow

public void afterInsertRow(com.klg.jclass.datasource.DataModelEvent e)
A new row has been added to the datasource. Listeners need to display the row. Rows are always added to the end of DataTableModels.

Specified by:
afterInsertRow in interface ReadOnlyBindingListener

afterDeleteRow

public void afterDeleteRow(com.klg.jclass.datasource.DataModelEvent e)
Removes the row from the display. A row has been physically deleted and needs to be removed from the display, or has been logically deleted but the showDeletedRows property has been set to false. Called when

Specified by:
afterDeleteRow in interface ReadOnlyBindingListener

afterReset

public void afterReset(com.klg.jclass.datasource.DataModelEvent e)
Listeners must close all expanded views and reset/reread the root node. The previous pointer to the root node is no longer valid. Call DataModel.getDataTableTree().getRoot() for the new root table. Called when the datasource has been reset.

Specified by:
afterReset in interface ReadOnlyBindingListener
See Also:
DataModel.requeryAll(com.klg.jclass.datasource.DataModelListener)

afterMoveToCurrentRow

public void afterMoveToCurrentRow(com.klg.jclass.datasource.DataModelEvent e)
The global cursor has moved to a new row. Listeners should position their cursor on the indicated row. In a master-detail relationship, child levels should refresh themselves to reflect data sets which correspond to the new parent row by calling DataModel.getCurrentDataTable() or for field controls, DataModel.getCurrentDataItem().

Specified by:
afterMoveToCurrentRow in interface ReadOnlyBindingListener

afterRequeryRowAndDetails

public void afterRequeryRowAndDetails(com.klg.jclass.datasource.DataModelEvent e)
Re-reads the indicated row and refreshes all open children under this row.

Specified by:
afterRequeryRowAndDetails in interface ReadOnlyBindingListener

afterRequeryTable

public void afterRequeryTable(com.klg.jclass.datasource.DataModelEvent e)
Re-read this table and refreshes all open children in this table.

Specified by:
afterRequeryTable in interface ReadOnlyBindingListener

beginEvents

public void beginEvents(com.klg.jclass.datasource.DataModelEvent e)
Notification that multiple events are coming. Multiple events will be nested between beginEvents() and endEvents(). Allows listeners to treat the events as a batch, for example, to reduce repaints.

Specified by:
beginEvents in interface ReadOnlyBindingListener

endEvents

public void endEvents(com.klg.jclass.datasource.DataModelEvent e)
Notification that multiple events are complete. Multiple events will be nested between beginEvents() and endEvents(). Allows listeners to treat the events as a batch, for example, to reduce repaints. Called when

Specified by:
endEvents in interface ReadOnlyBindingListener

originatorNavigateRow

public void originatorNavigateRow(com.klg.jclass.datasource.DataModelEvent e)
The current row has been deleted and the originator of the deletion should now reposition the global cursor to a new, valid row.

Specified by:
originatorNavigateRow in interface DataModelListener

initialize

public void initialize(com.klg.jclass.datasource.DataModelEvent e)
For internal use only. Used by the JCData bean.

Specified by:
initialize in interface ReadOnlyBindingListener

Copyright © 2004 Quest Software Inc..
All rights reserved.