|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.tree.DefaultMutableTreeNode | +--com.klg.jclass.datasource.DataSourceTreeNode | +--com.klg.jclass.datasource.BaseDataTable
This class provides a default implementation of DataTableModel and DataTableAbstractionLayer interfaces.
Instances of this class provide basic storage, retrieval and manipulation operations on data rows.
This class can be used without extending it. In this case you must create and populate rows "manually". For example,
BaseDataTable root = new BaseDataTable(rootMetaData);
data_tree.setRoot((TreeNode) root);
int row1 = root.addRow();
root.updateCell(row1, column1, value1);
root.updateCell(row1, column2, value2); // etc ...
Extensions of this class, for example the JClass DataSource jdbc implementation,
"automatically" creates/populates data tables based on data returned from
datasource queries.
In the case of ide-specific implementaions, they extend this class and override the data storage and retrieval mechanisms.
Users wishing to extend this class should look at overriding some or all of the methods defined in the DataTableAbstractionLayer interface. These are the methods most likely to need overriding.
Each instance of this class has its own cursor which can be navigated independently of the DataModel's global cursor. Only the global cursor (controlled by DataModel.moveToRow) causes commits to occur when the current row is changed. The navigation methods here do not cause the global cursor to change, only this table's private cursor.
first()
,
last()
,
next()
,
previous()
,
beforeFirst()
,
afterLast()
,
isAfterLast()
,
isBeforeFirst()
,
relative(int)
,
absolute(int)
,
getCurrentBookmark()
,
DataModel.moveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long)
,
Serialized FormField Summary | |
protected static long |
bookmark
|
protected String |
currentColumn
|
protected int |
cursor
|
protected Vector |
eventQueue
|
protected int |
initialHashtableSize
|
protected Hashtable |
insertedRows
|
protected Hashtable |
internalData
|
protected Hashtable |
logicallyDeletedRows
|
protected com.klg.jclass.datasource.MetaDataModel |
metaData
|
protected long |
parentRow
|
protected Hashtable[] |
rowCaches
|
protected Hashtable |
rowIndexBeforeEvent
|
protected com.klg.jclass.datasource.StoreModel |
store
|
protected Hashtable |
updatedRows
|
protected Hashtable |
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 | |
BaseDataTable(com.klg.jclass.datasource.MetaDataModel metaData)
Root level constructor. |
|
BaseDataTable(com.klg.jclass.datasource.MetaDataModel metaData,
long parentRow)
Constructor to call after root-level BaseDataTable has been created. |
Method Summary | |
void |
absolute(int ordinal_position)
Move the cursor to this ordinal position. |
long |
addInternalRow(Object row)
Adds an internal row appending it to the end of the in-memory data store. |
long |
addInternalRow(Object row,
int ordinal)
Adds an internal row inserting it into ordinal
position in the in-memory data store. |
long |
addRow(com.klg.jclass.datasource.DataModelListener originator)
Adds a row whose status will be INSERTED. |
long |
addRow(com.klg.jclass.datasource.DataModelListener originator,
Object row)
Adds a populated row whose status will be INSERTED. |
long |
addRow(com.klg.jclass.datasource.DataModelListener originator,
Object row,
int status)
Adds a populated row whose status will be 'status'. |
long |
addRow(com.klg.jclass.datasource.DataModelListener originator,
Object row,
int status,
int ordinal)
Adds a populated row whose status will be 'status'. |
void |
afterLast()
Position the cursor after the last row. |
void |
beforeFirst()
Position the cursor before the first row. |
void |
cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator)
Cancels all uncommited rows. |
void |
cancelChanges(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Internal method, do not use. |
void |
cancelRowChanges(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Cancels uncommited row changes. |
void |
clearEventQueue()
Recursively clear pending events from a transaction. |
Object |
cloneRow(long bookmark)
For internal use only. |
boolean |
columnModified(long bookmark,
String col_id)
Returns true if a column value has been modified. |
void |
commitAll(com.klg.jclass.datasource.DataModelListener originator)
Commits all uncommited rows. |
boolean |
commitRow(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Commits the row. |
void |
commitSubTree(com.klg.jclass.datasource.DataModelListener originator,
long subTreeRootBookmark)
Commit all pending changes in this subtree including this row. |
void |
conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator)
Recurse on this node and each of its children and commit all changes in each if commitPolicy does not equal COMMIT_MANUALLY commitAll does not check commit policy before committing. |
static com.klg.jclass.datasource.DataTableModel |
createDataTableModelFromProviderData(com.klg.jclass.datasource.MetaDataModel metaData,
long parentRow,
Object[][] data)
Build a DataTableModel from the matrix returned the the ProviderModel. |
Object |
createNewRow()
Creates a new row, called by addRow(). |
com.klg.jclass.datasource.DataTableModel |
createTable(com.klg.jclass.datasource.DataModelListener originator,
long bookmark,
TreeNode child)
Creates and returns the DataTable which corresponds to the specifed row of this parent for the indicated child MetaData object. |
void |
deleteCacheChildren(com.klg.jclass.datasource.DataModelListener originator)
Deletes the subtree of DataTables with this DataTable as its root, as well as itself. |
void |
deleteRow(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Deletes a row. |
boolean |
fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
Lets listeners of the data model know this table has changed. |
boolean |
fireOriginatorDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
Fire this event only to the originator. |
boolean |
first()
Position this table's cursor on the first row. |
void |
getAncestors(Vector ancestors)
Returns a list of this DataTable's ancestor bookmarks. |
Object |
getCell(long bookmark,
String col_id)
For internal use only. |
long |
getCurrentBookmark()
Returns the bookmark of the current row. |
int |
getCursor()
Gets the cursor of the data table. |
Object |
getDeletedRow(long bookmark)
Return the logically deleted row. |
long[] |
getDeletedRowBookmarks()
Retrun a long array of logically deleted row bookmarks. |
long[] |
getInsertedRowBookmarks()
Return a long array of inserted row bookmarks. |
Object |
getInternalData(Object user)
For internal use only. |
com.klg.jclass.datasource.MetaDataModel |
getMetaData()
Returns the MetaData for this DataTable. |
protected long |
getNextBookmark()
Returns the next unique row identifier. |
Object |
getOriginalRow(long bookmark)
Given a bookmark, returns the original row as it was before any changes where made. |
long |
getParentBookmark()
Returns the bookmark of the parent row for this table. |
Object |
getResultData(long bookmark,
String col_id)
Returns a value for a given row/column. |
long |
getRootAncestorBookmark(long bookmark)
Recurses up the tree and determines the row number of the ultimate ancestor. |
int |
getRowCount()
Returns the number of rows in this DataTable. |
Object |
getRowFromCache(long bookmark)
Returns a row Object from the store. |
long |
getRowIdentifier(int row_index)
Returns an int which will uniquely identify this row. |
int |
getRowIndex(long bookmark)
Given a bookmark, return the zero-relative row index in this table |
int |
getRowStatus(long bookmark)
Returns the status of a row, and will be one of INSERTED, UPDATED, DELETED, COMMITTED, NONEXISTENT. |
com.klg.jclass.datasource.DataTableModel |
getTable(long bookmark,
TreeNode node)
Searches the existing children of this node for a child node which matches the input criteria. |
long[] |
getUpdatedRowBookmarks()
Return a long array of updated row bookmarks. |
Object |
getUserData(Object user)
Gets user data. |
boolean |
hasValueChanged(Object newValue,
Object oldValue)
Return true if the newValue is different than the oldValue |
boolean |
isAfterLast()
Return true if the cursor is positioned afte the last row. |
boolean |
isBeforeFirst()
Return true if the cursor is positioned before first row. |
boolean |
isModified()
Does this DataTableModel contain any pending inserts, updates or deletes? |
boolean |
isSubTreeModified(long subTreeRootBookmark)
Does the subtree rooted at subTreeRootBookmark contain modified nodes? Modified means this row or at least one of its child nodes has pending insert, update or delete changes. |
boolean |
isTableOrChildrenModified()
Are there any modifications to this table or any of its child nodes? |
boolean |
last()
Positions this table's cursor on the last row. |
com.klg.jclass.datasource.DataTableModel |
materializeTable(com.klg.jclass.datasource.DataModelListener originator,
long bookmark,
TreeNode node)
Called by DataTableModel.createTable to create a new table based on the input criteria. |
void |
moveCursorToRow(long bookmark)
Move the cursor to the row indicated by the bookmark. |
void |
moveToRow(long bookmark)
For internal use only. |
boolean |
next()
Advances the cursor by one row. |
boolean |
originalCellWasNull(int idx,
Vector columns,
Object[] original_row)
Returns true if the original cell value is null. |
boolean |
prepareCellUpdate(com.klg.jclass.datasource.DataModelListener originator,
long bookmark,
String column_id)
If column is not in logically deleted row, and is not a virtual column and permissions on its table don't disallow edits and no listeners cancel this event, return true, false otherwise. |
boolean |
previous()
Positions this table's cursor to the previous row. |
void |
processEventQueue(com.klg.jclass.datasource.DataModelListener originator)
Recursive flushing of pending events from a transaction. |
protected boolean |
recursivelyDeleteChildren(com.klg.jclass.datasource.BaseDataTable node,
com.klg.jclass.datasource.DataModelListener originator)
Checks recursively to determine if any listener objects to the deletion of the passed subtree. |
void |
refreshRow(long bookmark)
Re-reads a row from the originating data source. |
void |
relative(int rows)
Move the cursor forward or backward by "n" rows from the current position. |
void |
removeRowFromInsertedTable(long bookmark)
Removes a row from the insertedRows table. |
protected void |
removeRowFromLogicallyDeletedTable(long bookmark)
Removes a row from the logicallyDeletedRows table. |
protected void |
removeRowFromOriginalRowTable(long bookmark)
Removes a row from the originalRow cache table. |
void |
removeRowFromUpdatedTable(long bookmark)
Removes a row from the updatedRows table. |
com.klg.jclass.datasource.DataTableModel |
requeryLevel()
Requeries the data for the root level DataTable. |
void |
requeryRow(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Re-reads a row from the originating data source. |
void |
requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Requeries a DataTable row and deletes all children from the cache. |
void |
requeryTable(com.klg.jclass.datasource.DataModelListener originator)
Requery all rows in this table and collapse its child nodes. |
void |
restoreRow(long bookmark)
For internal use only. |
void |
saveRow(long bookmark)
Saves row changes to originating data source. |
void |
setInternalData(Object user,
Object data)
For internal use only. |
void |
setRowDirty(long bookmark)
Clone the row and add it to the table of updated rows so its status will now be UPDATED, but only if the row is not already in the INSERTED table. |
void |
setUserData(Object user,
Object data)
Sets user data. |
void |
setValueAt(long bookmark,
String col_id,
Object value)
For internal use only. |
boolean |
tableIsAncestor(com.klg.jclass.datasource.DataTableModel table)
Given a DataTable, returns whether it is an ancestor of (or equal to) itself |
void |
updateCell(com.klg.jclass.datasource.DataModelListener originator,
long bookmark,
String column_id,
Object value)
Updates a cell. |
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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected com.klg.jclass.datasource.MetaDataModel metaData
protected long parentRow
protected com.klg.jclass.datasource.StoreModel store
protected int initialHashtableSize
protected Hashtable updatedRows
protected Hashtable insertedRows
protected Hashtable rowIndexBeforeEvent
protected Hashtable[] rowCaches
protected int cursor
protected Hashtable logicallyDeletedRows
protected Hashtable userData
protected Hashtable internalData
protected Vector eventQueue
protected static long bookmark
protected String currentColumn
Constructor Detail |
public BaseDataTable(com.klg.jclass.datasource.MetaDataModel metaData)
metaData
- the MetaDataModel which provides the column structure
for this data table.public BaseDataTable(com.klg.jclass.datasource.MetaDataModel metaData, long parentRow)
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 |
public int getRowCount()
getRowCount
in interface DataTableModel
public int getRowStatus(long bookmark)
getRowStatus
in interface DataTableModel
bookmark
- a unique long indicating for which row
status should be retrieved
public long getRowIdentifier(int row_index)
getRowIdentifier
in interface DataTableModel
public Object getResultData(long bookmark, String col_id) throws DataModelException
getResultData
in interface DataTableModel
bookmark
- a unique long representing a rowcol_id
- a unique String representing a column
DataModelException
- If get fails.public com.klg.jclass.datasource.DataTableModel createTable(com.klg.jclass.datasource.DataModelListener originator, long bookmark, TreeNode child) throws DataModelException
To provide data you can either subclass this class and override this method to return a DataTableModel, or you can set the ProviderModel for this table's MetaDataModel. The creation of data is then delegated to this class. If set, this method calls that class.
createTable
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a long which uniquely identifies a rowchild
- the MetaDataModel object which will drive the next query
DataModelException
- If createTable() fails.getTable(long, javax.swing.tree.TreeNode)
public static com.klg.jclass.datasource.DataTableModel createDataTableModelFromProviderData(com.klg.jclass.datasource.MetaDataModel metaData, long parentRow, Object[][] data)
public com.klg.jclass.datasource.DataTableModel getTable(long bookmark, TreeNode node)
getTable
in interface DataTableModel
bookmark
- a long which uniquely identifies a row
createTable(com.klg.jclass.datasource.DataModelListener, long, javax.swing.tree.TreeNode)
public com.klg.jclass.datasource.MetaDataModel getMetaData()
getMetaData
in interface DataTableModel
public long getParentBookmark()
getParentBookmark
in interface DataTableModel
getRootAncestorBookmark(long)
,
getAncestors(java.util.Vector)
public long addRow(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
Fires BEFORE_INSERT_ROW and upon a successful row add AFTER_INSERT_ROW.
addRow
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If row fails to be added.public long addRow(com.klg.jclass.datasource.DataModelListener originator, Object row, int status) throws DataModelException
Fires BEFORE_INSERT_ROW and upon a successful row add AFTER_INSERT_ROW.
addRow
in interface DataTableModel
row
- an Object as defined by the interface, but used as an array
by this implementation.status
- an int, one of,
DataModelException
- If row fails to be added.public long addRow(com.klg.jclass.datasource.DataModelListener originator, Object row, int status, int ordinal) throws DataModelException
Fires BEFORE_INSERT_ROW and upon a successful row add AFTER_INSERT_ROW.
addRow
in interface DataTableModel
row
- an Object as defined by the interface, but used as an array
by this implementation.status
- an int, one of,
ordinal
- the index position into which the row should be inserted
DataModelException
- If row fails to be added.public long addRow(com.klg.jclass.datasource.DataModelListener originator, Object row) throws DataModelException
Fires BEFORE_INSERT_ROW and upon a successful row add AFTER_INSERT_ROW.
addRow
in interface DataTableModel
originator
- the DataModelListener which initiated this actionrow
- an Object as defined by the interface, but used as an array
by this implementation.
DataModelException
- If row fails to be added.public void deleteRow(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
In the case of a logical delete, if the showDeletedRows
has been
set to false, the row will disappear from the display. It will be deleted
permanently upon commit, or restored on cancel or requery. The default is
for logically deleted rows to be shown.
Any pending changes to the row are automatically undone before any deletion.
deleteRow
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating the row to be deleted.
DataModelException
- If the logical delete fails.MetaDataModel.getShowDeletedRows()
,
MetaDataModel.setShowDeletedRows(boolean)
,
MetaDataModel.setCommitPolicy(int)
,
MetaDataModel.getCommitPolicy()
public void updateCell(com.klg.jclass.datasource.DataModelListener originator, long bookmark, String column_id, Object value) throws DataModelException
updateCell
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating in which row
the change was madevalue
- the Object to be placed in the cellcolumn_id
- a unique String indicating in which
column the change occurred.
DataModelException
- If a cell update fails.DataTableAbstractionLayer.setValueAt(long, java.lang.String, java.lang.Object)
public boolean commitRow(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
commitRow
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating which row
to commit to the datasource.
DataModelException
- If commit fails.saveRow(long)
public void commitAll(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
commitAll
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If commit of any row fails.DataModel.updateAll(com.klg.jclass.datasource.DataModelListener)
public void conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
conditionallyCommitYourselfAndChildren
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If commit fails.public void cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
cancelAllRowChanges
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If the changes can't be canceled.public void cancelRowChanges(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
cancelRowChanges
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a unique long which identifies this row
DataModelException
- If the changes can't be canceled.DataTableAbstractionLayer.restoreRow(long)
,
DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long)
public long getRootAncestorBookmark(long bookmark)
getRootAncestorBookmark
in interface DataTableModel
bookmark
- a unique long for which the ultimate
ancestor bookmark is to be determined
DataTableModel.getAncestors(java.util.Vector)
public void getAncestors(Vector ancestors)
getAncestors
in interface DataTableModel
ancestors
- the Vector to be populated with
ancestor bookmarks
public void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
requeryRowAndDetails
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If requery from server fails.requeryRow(com.klg.jclass.datasource.DataModelListener, long)
public com.klg.jclass.datasource.DataTableModel requeryLevel() throws DataModelException
requeryLevel
in interface DataTableModel
DataModelException
- If requery from server fails.public boolean first()
first
in interface DataTableModel
public boolean last()
last
in interface DataTableModel
public boolean next()
next
in interface DataTableModel
public boolean previous()
previous
in interface DataTableModel
public void beforeFirst()
beforeFirst
in interface DataTableModel
public void afterLast()
afterLast
in interface DataTableModel
public boolean isBeforeFirst()
isBeforeFirst
in interface DataTableModel
public boolean isAfterLast()
isAfterLast
in interface DataTableModel
DataTableModel.getCurrentBookmark()
public void relative(int rows) throws DataModelException
relative
in interface DataTableModel
DataModelException
- If move fails.DataTableModel.getCurrentBookmark()
public void absolute(int ordinal_position) throws DataModelException
absolute
in interface DataTableModel
ordinal_position
- an int indicating to which row to move
DataModelException
- If the operation fails.DataTableModel.getCurrentBookmark()
public long getCurrentBookmark() throws DataModelException
getCurrentBookmark
in interface DataTableModel
DataModelException
- If there are no rows or
or an error occurs.DataTableModel.first()
,
DataTableModel.last()
,
DataTableModel.next()
,
DataTableModel.previous()
,
DataTableModel.beforeFirst()
,
DataTableModel.afterLast()
,
DataTableModel.isBeforeFirst()
,
DataTableModel.isAfterLast()
,
DataTableModel.relative(int)
,
DataTableModel.absolute(int)
,
DataModel.moveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long)
public Object getUserData(Object user)
getUserData
in interface DataTableModel
user
- an Object, a reference to the user.
public void setUserData(Object user, Object data)
setUserData
in interface DataTableModel
user
- an Object, a reference to the user.data
- an Object, a reference to an Object.public Object getInternalData(Object user)
getInternalData
in interface DataTableModel
user
- an Object, a reference to the user.
public void setInternalData(Object user, Object data)
setInternalData
in interface DataTableModel
user
- an Object, a reference to the user.data
- an Object, an arbitrary reference to an Object.public void processEventQueue(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
processEventQueue
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If an exception occurs while flushing events.public void clearEventQueue()
clearEventQueue
in interface DataTableModel
public void moveCursorToRow(long bookmark) throws DataModelException
moveCursorToRow
in interface DataTableModel
bookmark
- a long which uniquely identifies a row
DataModelException
- If cursor move fails.public int getCursor()
getCursor
in interface DataTableModel
public int getRowIndex(long bookmark)
getRowIndex
in interface DataTableModel
bookmark
- a long which uniquely identifies a row
public void deleteCacheChildren(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
deleteCacheChildren
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If the subtree can't be deleted.MetaDataModel.getCacheChildren()
protected boolean recursivelyDeleteChildren(com.klg.jclass.datasource.BaseDataTable node, com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
node
- the DataTable to identify the subtree's rootoriginator
- the DataModelListener which initiated this action
DataModelException
- If the subtree can't be deleted.public void moveToRow(long bookmark) throws DataModelException
There is only one path from the root to a child node in some subtree. For each meta data level, this method sets the data tables which comprise this path to this table as well as the bookmarks at each level which, when expanded, ultimately lead to this table.
moveToRow
in interface DataTableModel
bookmark
- a long which uniquely identifies a row.
DataModeolException
- If move fails.
DataModelException
- If move fails.MetaDataModel.getCurrentDataTable()
,
MetaDataModel.getCurrentBookmark()
public boolean isSubTreeModified(long subTreeRootBookmark)
isSubTreeModified
in interface DataTableModel
subTreeRootBookmark
- a long, the bookmark of the row which is
the root of the subtree to be checked.
public boolean isTableOrChildrenModified()
isTableOrChildrenModified
in interface DataTableModel
public void commitSubTree(com.klg.jclass.datasource.DataModelListener originator, long subTreeRootBookmark) throws DataModelException
commitSubTree
in interface DataTableModel
originator
- the DataModelListener which initiated this actionsubTreeRootBookmark
- a long, the bookmark of the row which is
the root of the subtree to be checked.
DataModelException
- If commit fails.public boolean isModified()
isModified
in interface DataTableModel
public long[] getUpdatedRowBookmarks()
getUpdatedRowBookmarks
in interface DataTableModel
public long[] getInsertedRowBookmarks()
getInsertedRowBookmarks
in interface DataTableModel
public long[] getDeletedRowBookmarks()
getDeletedRowBookmarks
in interface DataTableModel
public void requeryTable(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
requeryTable
in interface DataTableModel
originator
- the DataModelListener which initiated this action
DataModelException
- If requery fails.public Object cloneRow(long bookmark) throws DataModelException
cloneRow
in interface DataTableAbstractionLayer
bookmark
- a long uniquely identifying this row.
DataModelException
- If clone fails.public void setValueAt(long bookmark, String col_id, Object value) throws DataModelException
setValueAt
in interface DataTableAbstractionLayer
bookmark
- a long indicating the rowcol_id
- a String indicating the column
DataModelException
- If setValueAt fails.DataTableModel.updateCell(com.klg.jclass.datasource.DataModelListener, long, java.lang.String, java.lang.Object)
public void restoreRow(long bookmark)
restoreRow
in interface DataTableAbstractionLayer
bookmark
- a long which uniquely identifies a rowDataTableModel.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long)
,
DataModel.cancelAll(com.klg.jclass.datasource.DataModelListener)
public Object createNewRow() throws DataModelException
createNewRow
in interface DataTableModel
DataModelException
- If create fails.public void refreshRow(long bookmark) throws DataModelException
refreshRow
in interface DataTableAbstractionLayer
bookmark
- a long which uniquely identifies a row
DataModelException
- If requery from server fails.DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long)
public void saveRow(long bookmark) throws DataModelException
saveRow
in interface DataTableAbstractionLayer
bookmark
- a unique long indicating which row
to commit to the datasource.
DataModelException
- If save fails.DataTableModel.commitRow(com.klg.jclass.datasource.DataModelListener, long)
public Object getCell(long bookmark, String col_id) throws DataModelException
getCell
in interface DataTableAbstractionLayer
bookmark
- a unique long representing a rowcol_id
- a unique String representing a column
DataModelException
- If get fails.DataTableModel.getResultData(long, java.lang.String)
public com.klg.jclass.datasource.DataTableModel materializeTable(com.klg.jclass.datasource.DataModelListener originator, long bookmark, TreeNode node) throws DataModelException
materializeTable
in interface DataTableAbstractionLayer
originator
- the DataModelListener which initiated this actionbookmark
- a long which uniquely identifies a rownode
- a MetaDataModel, this tells this table
what structure the child table it is creating should have
DataModelException
- If materializeTable fails.public boolean fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
public boolean fireOriginatorDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
protected long getNextBookmark()
public long addInternalRow(Object row)
THIS METHOD IS NOT INTENDED FOR REGULAR USE. Use
addRow()
instead. This method is provided
as a "back-door" into the datasource and is intended
to allow fast population of a datasource during initialization.
It does not fire BEFORE_INSERT_ROW nor AFTER_INSERT_ROW nor
will the row be flagged as INSERTED.
row
- an Object which is the original row.
public long addInternalRow(Object row, int ordinal)
ordinal
position in the in-memory data store.
THIS METHOD IS NOT INTENDED FOR REGULAR USE. Use
addRow()
instead. This method is provided
as a "back-door" into the datasource and is intended
to allow fast population of a datasource during initialization.
It does not fire BEFORE_INSERT_ROW nor AFTER_INSERT_ROW nor
will the row be flagged as INSERTED.
row
- an Object which is the original row.ordinal
- the index position into which the row should be inserted
public Object getRowFromCache(long bookmark) throws DataModelException
bookmark
- a long uniquely identifying a row.
DataModelException
- If row not found in cache.protected void removeRowFromLogicallyDeletedTable(long bookmark)
bookmark
- a long uniquely identifying a rowpublic void removeRowFromUpdatedTable(long bookmark)
bookmark
- a long uniquely identifying a rowpublic void removeRowFromInsertedTable(long bookmark)
bookmark
- a long uniquely identifying a rowprotected void removeRowFromOriginalRowTable(long bookmark)
bookmark
- a long uniquely identifying a rowpublic void cancelChanges(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
originator
- the DataModelListener which initiated this actionbookmark
- a long which uniquely identifies a row.
DataModelException
- If the changes can't be canceled.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long)
,
deleteRow(com.klg.jclass.datasource.DataModelListener, long)
,
getRowIdentifier(int)
public void requeryRow(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
requeryRow
in interface DataTableModel
originator
- the DataModelListener which initiated this actionbookmark
- a long which uniquely identifies a row
DataModelException
- If requery from server fails.public boolean originalCellWasNull(int idx, Vector columns, Object[] original_row)
public boolean columnModified(long bookmark, String col_id) throws DataModelException
bookmark
- a long uniquely identifying a rowcol_id
- a unique String representing a column
DataModelException
- If the operation fails.public boolean hasValueChanged(Object newValue, Object oldValue)
public Object getOriginalRow(long bookmark)
bookmark
- a unique long indicating which row to uncommit
public Object getDeletedRow(long bookmark)
bookmark
- a long which uniquely identifies a row
public boolean tableIsAncestor(com.klg.jclass.datasource.DataTableModel table)
tableIsAncestor
in interface DataTableModel
table
- a DataTable which may be an ancestor
public boolean prepareCellUpdate(com.klg.jclass.datasource.DataModelListener originator, long bookmark, String column_id) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If prepare fails.public void setRowDirty(long bookmark)
bookmark
- a long which uniquely identifies a row
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |