|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for data storage for the JClass DataSource datamodel. This data model will request data from instances of this table and will manipulate that data through this interface. That is, rows can then be added, deleted or updated through instances of its implementation.
To allow sorting of rows and columns, all operations access cell data using unique identifiers for rows and columns, rather than using row-column indexes.
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. These methods do not cause the global cursor to change, only this table's private cursor.
first()
,
last()
,
next()
,
previous()
,
beforeFirst()
,
afterLast()
,
isBeforeFirst()
,
isAfterLast()
,
relative(int)
,
absolute(int)
,
getCurrentBookmark()
,
DataModel.moveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long)
Field Summary | |
static int |
COMMITTED
This row has no changes pending and is identical to the data source row. |
static int |
CURSOR_BEFORE_FIRST
Table's private cursor is before the first row |
static int |
DELETED
This row has been logically deleted, but the delete has not yet been committed to the data source. |
static int |
INSERTED
This is a new (uncommitted) row. |
static int |
NONEXISTENT
This row does not exist in the model. |
static long |
ROOT_BOOKMARK
Root-level rows are a special case since they do not have parent rows. |
static int |
ROW_NOT_FOUND
ROW_NOT_FOUND during lookup |
static int |
UPDATED
One or more of this row's cells have been modified. |
Method Summary | |
void |
absolute(int ordinal_position)
Moves this table's private cursor to this ordinal position. |
long |
addRow(com.klg.jclass.datasource.DataModelListener originator)
Adds a empty 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()
Positions this table's private cursor after the last row. |
void |
beforeFirst()
Positions this table's private cursor before the first row. |
void |
cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator)
Do not use this internal method; call DataModel.cancelAll() instead. |
void |
cancelRowChanges(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Cancels uncommited row changes. |
void |
clearEventQueue()
Recursively clears pending events from a transaction. |
void |
commitAll(com.klg.jclass.datasource.DataModelListener originator)
Do not use: internal method, call DataModel.updateAll() instead. |
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. |
void |
conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator)
Do not use: internal method. |
Object |
createNewRow()
Creates a new (blank) row that can be used as an argument to one of the addRow() methods. |
com.klg.jclass.datasource.DataTableModel |
createTable(com.klg.jclass.datasource.DataModelListener originator,
long bookmark,
TreeNode node)
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 rooted with this DataTable as its root. |
void |
deleteRow(com.klg.jclass.datasource.DataModelListener originator,
long bookmark)
Deletes a row. |
boolean |
first()
Positions this table's private cursor on the first row. |
void |
getAncestors(Vector ancestors)
Returns a list of this DataTable's ancestor bookmarks. |
long |
getCurrentBookmark()
Returns the bookmark of the row on which this table's private cursor is located. |
int |
getCursor()
Gets the cursor of the data table model. |
long[] |
getDeletedRowBookmarks()
Return 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 MetaDataModel for this table. |
long |
getParentBookmark()
Returns the parent bookmark for this table. |
Object |
getResultData(long bookmark,
String column_identifer)
Returns the object specified by the given bookmark and column identifier name. |
long |
getRootAncestorBookmark(long bookmark)
Recurses up the tree and determine the row number of its ultimate ancestor. |
int |
getRowCount()
Returns the number of rows in this DataTable. |
long |
getRowIdentifier(int row)
Returns a long 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 which 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 |
isAfterLast()
Returns true if this table's private cursor is positioned after the last row. |
boolean |
isBeforeFirst()
Returns true if this table's private 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 the row at subTreeRootBookmark or any 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()
Position this table's private cursor on the last row. |
void |
moveCursorToRow(long bookmark)
Moves the cursor to the row indicated by the bookmark. |
void |
moveToRow(long bookmark)
Internal method, do not use. |
boolean |
next()
Advances this table's private cursor by one row. |
boolean |
previous()
Positions this table's private cursor to the previous row. |
void |
processEventQueue(com.klg.jclass.datasource.DataModelListener originator)
Recursively processes pending events from a transaction. |
void |
relative(int rows)
Moves this table's private cursor forward or backward by "n" rows from the current position. |
com.klg.jclass.datasource.DataTableModel |
requeryLevel()
Do not use: internal method. |
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 clear all its children. |
void |
requeryTable(com.klg.jclass.datasource.DataModelListener originator)
Requery all rows in this table and collapse its child nodes. |
void |
setInternalData(Object user,
Object data)
For internal use only Sets internal data. |
void |
setUserData(Object user,
Object data)
Sets user data. |
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_identifer,
Object value)
Updates a cell. |
Field Detail |
public static final int UPDATED
public static final int INSERTED
public static final int DELETED
public static final int COMMITTED
public static final int NONEXISTENT
public static final long ROOT_BOOKMARK
public static final int CURSOR_BEFORE_FIRST
public static final int ROW_NOT_FOUND
Method Detail |
public int getRowCount()
public int getRowStatus(long bookmark)
bookmark
- a long which uniquely identifies this row
public long getRowIdentifier(int row)
public Object getResultData(long bookmark, String column_identifer) throws DataModelException
bookmark
- a long which uniquely identifies this row
DataModelException
- If getResultData() fails.public com.klg.jclass.datasource.DataTableModel createTable(com.klg.jclass.datasource.DataModelListener originator, long bookmark, TreeNode node) throws DataModelException
originator
- the DataModelListener which initiated this actionbookmark
- a long which uniquely identifies a row
DataModelException
- If createTable() fails.getTable(long, javax.swing.tree.TreeNode)
public com.klg.jclass.datasource.DataTableModel getTable(long bookmark, TreeNode node)
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()
public long getParentBookmark()
getRootAncestorBookmark(long)
,
getAncestors(java.util.Vector)
public Object createNewRow() throws DataModelException
DataModelException
- If create fails.public long addRow(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
Fires BEFORE_INSERT_ROW and upon a successful row add AFTER_INSERT_ROW.
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.
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.
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.
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
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating the row to be deleted.
DataModelException
- If logical delete fails.public void updateCell(com.klg.jclass.datasource.DataModelListener originator, long bookmark, String column_identifer, Object value) throws DataModelException
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating in which row
the change was madecolumn_identifer
- a unique String indicating in which
column the change occurred.value
- the Object to be placed in the cell
DataModelException
- If error occurs updating a cell.DataTableAbstractionLayer.setValueAt(long, java.lang.String, java.lang.Object)
public boolean commitRow(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating which row
to commit to the datasource.
DataModelException
- If commit fails.DataTableAbstractionLayer.saveRow(long)
public void commitAll(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If any row fails to commit.DataModel.updateAll(com.klg.jclass.datasource.DataModelListener)
public void conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If write to data source fails.public void cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If changes can't be canceled.public void cancelRowChanges(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
originator
- the DataModelListener which initiated this actionbookmark
- a unique long indicating which row to uncommit.
DataModelException
- If changes can't be canceled.DataTableAbstractionLayer.restoreRow(long)
,
requeryRow(com.klg.jclass.datasource.DataModelListener, long)
public long getRootAncestorBookmark(long bookmark)
bookmark
- a unique long for which the ultimate
ancestor bookmark is to be determined
getAncestors(java.util.Vector)
public void getAncestors(Vector ancestors)
ancestors
- the Vector to be populated with
ancestor bookmarks
public void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator, long bookmark) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If requery from server fails.public void requeryRow(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 requery from server fails.public com.klg.jclass.datasource.DataTableModel requeryLevel() throws DataModelException
DataModelException
- If requery fails.public boolean first()
public boolean last()
public boolean next()
public boolean previous()
public void beforeFirst()
public void afterLast()
public boolean isBeforeFirst()
public boolean isAfterLast()
getCurrentBookmark()
public void relative(int rows) throws DataModelException
DataModelException
- If move fails.getCurrentBookmark()
public void absolute(int ordinal_position) throws DataModelException
ordinal_position
- an int indicating to which row to move
DataModelException
- If move fails.getCurrentBookmark()
public long getCurrentBookmark() throws DataModelException
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.
DataModelException
- If there are no rows or
or an error occurs.first()
,
last()
,
next()
,
previous()
,
beforeFirst()
,
afterLast()
,
isBeforeFirst()
,
isAfterLast()
,
relative(int)
,
absolute(int)
,
DataModel.moveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long)
public Object getUserData(Object user)
user
- an Object, a reference to the user.
public void setUserData(Object user, Object data)
user
- an Object, a reference to the user.data
- an Object, an arbitrary reference to an Object.public Object getInternalData(Object user)
user
- an Object, a reference to the user.
public void setInternalData(Object user, Object data)
user
- an Object, a reference to the user.public void processEventQueue(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If changes can't be canceled.public void clearEventQueue()
public void moveCursorToRow(long bookmark) throws DataModelException
bookmark
- a long which uniquely identifies a row
DataModelException
- If move fails.public int getCursor()
public int getRowIndex(long bookmark)
bookmark
- a long which uniquely identifies a row
public void deleteCacheChildren(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
DataModelException
- If the subtree can't be deleted.MetaDataModel.getCacheChildren()
public void moveToRow(long bookmark) throws DataModelException
bookmark
- a long which uniquely identifies a row.
DataModelException
- If move fails.public boolean isSubTreeModified(long subTreeRootBookmark)
subTreeRootBookmark
- a long, the bookmark of the row which is
the root of the subtree to be checked.
public boolean isTableOrChildrenModified()
public void commitSubTree(com.klg.jclass.datasource.DataModelListener originator, long subTreeRootBookmark) throws DataModelException
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()
public long[] getUpdatedRowBookmarks()
public long[] getInsertedRowBookmarks()
public long[] getDeletedRowBookmarks()
public boolean tableIsAncestor(com.klg.jclass.datasource.DataTableModel table)
table
- a DataTable which may be an ancestor
public void requeryTable(com.klg.jclass.datasource.DataModelListener originator) throws DataModelException
originator
- the DataModelListener which initiated this action
DataModelException
- If requery fails.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |