JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource.beans
Class JCData

java.lang.Object
  |
  +--com.klg.jclass.datasource.TreeData
        |
        +--com.klg.jclass.datasource.beans.JCData
All Implemented Interfaces:
DataModel, DataTableModel, Serializable
Direct Known Subclasses:
IdeJCData

public class JCData
extends TreeData
implements DataTableModel, Serializable

A component that creates data connectivity with different data source objects.

See Also:
NodeProperties, Serialized Form

Field Summary
protected  Applet applet
          The parent applet.
protected  String label
          Label for bean
protected  com.klg.jclass.datasource.beans.MetaDataCreator metaDataCreator
           
protected  String name
          Name of the Bean.
 
Fields inherited from class com.klg.jclass.datasource.TreeData
currentBookmark, currentDataTable, data_tree, eventsEnabled, listeners, meta_tree, modelName, nameCounter
 
Fields inherited from interface com.klg.jclass.datasource.DataTableModel
COMMITTED, CURSOR_BEFORE_FIRST, DELETED, INSERTED, NONEXISTENT, ROOT_BOOKMARK, ROW_NOT_FOUND, UPDATED
 
Constructor Summary
JCData()
          Creates an empty data Bean of JDBC type.
JCData(Applet applet, String name)
          Creates a JCData which reads parameters from the applet's HTML file.
JCData(int type)
          Creates a JCData using a data source type.
 
Method Summary
 void absolute(int ordinal_position)
          Moves the cursor to this ordinal position.
 void addDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
          Adds a data model listener.
 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()
          Positions the cursor after the last row.
 void beforeFirst()
          Positions the cursor before the first row.
 void cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator)
          Cancels uncommited row changes.
 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)
          Commits all uncommited rows.
 boolean commitRow(com.klg.jclass.datasource.DataModelListener originator, long bookmark)
          Commits a row.
 void commitSubTree(com.klg.jclass.datasource.DataModelListener originator, long subTreeRootBookmark)
          Commits all pending changes in this subtree.
 void conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator)
          Since JCData has no child, it commits all of its changes if commitPolicy does not equal COMMIT_MANUALLY.
protected  void createMetaData()
           
 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()
          Moves to the first row.
 String getAbout()
          Gets the about property.
 void getAncestors(Vector ancestors)
          Returns a list of this DataTable's ancestor bookmarks.
 AppletContext getAppletContext()
          Gets the Bean's applet's context.
static AppletContext getAppletContext(Applet applet)
          Gets the bean's applet's context.
 int getCommitPolicy()
          Gets commitPolicy property.
 long getCurrentBookmark()
          Returns the bookmark of the current row.
 int getCurrentRowStatus()
          Returns the status of the current row, will be one of
 int getCursor()
          Gets the cursor of the data table.
 long[] getDeletedRowBookmarks()
          Returns a long array of logically deleted row bookmarks.
 String getDescription()
          Returns the user-assigned description of this instance, or "" if the description has not been set.
 long[] getInsertedRowBookmarks()
          Returns a long array of inserted row bookmarks.
 Object getInternalData(Object user)
          For internal use only.
 String getLabel()
          Returns the value of the label property
 com.klg.jclass.datasource.MetaDataModel getMetaData()
          Returns the meta-data of this data Bean.
 String getName()
          Gets the name of the Bean, as set in the constructor or by setName.
 com.klg.jclass.datasource.beans.NodeProperties getNodeProperties()
          Gets the data bean component.
protected  void getParameters()
          Reads the parameter values from the HTML page using the data Bean's applet.
 void getParameters(Applet applet)
          Reads the parameter values from the HTML page using the specified applet.
 void getParameters(Applet applet, String file)
          Reads the parameter values from the file.
 long getParentBookmark()
          Since JCData has no parent, it always returns -1.
 Object getResultData(long bookmark, String column_identifier)
          Returns the object specified by the given bookmark and column identifier name.
 long getRootAncestorBookmark(long i)
          Since JCData
 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, returns the zero-relative row index in this table.
 int getRowStatus(long bookmark)
          Returns the status of a row, will be one of:
 com.klg.jclass.datasource.DataTableModel getTable(long bookmark, TreeNode node)
          Since JCData has no child, it always returns null.
 long[] getUpdatedRowBookmarks()
          Returns a long array of updated row bookmarks.
 Object getUserData(Object user)
          Gets user data.
 String getVersion()
          Gets the value of the Version property.
 boolean isAfterLast()
          Returns true if the cursor is positioned after the last row.
 boolean isBeforeFirst()
          Returns true if the cursor is positioned before first row.
 boolean isModified()
          Asks if this DataTableModel contains 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()
          Asks if there are any modifications to this table or any of its child nodes.
 boolean last()
          Moves to the last row.
 void moveCursorToRow(long bookmark)
          Moves the cursor to the row indicated by the bookmark.
 void moveToRow(long bookmark)
          Moves the ide cursor to this row.
 boolean next()
          Moves to the next row.
 boolean previous()
          Moves to the previous row.
 void processEventQueue(com.klg.jclass.datasource.DataModelListener originator)
          Recursively processes pending events from a transaction.
 void relative(int rows)
          Moves the cursor forward or backward by "n" rows from the current position.
 com.klg.jclass.datasource.DataTableModel requeryLevel()
          Requery 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)
          Re-reads a row from the originating data source.
 void requeryTable(com.klg.jclass.datasource.DataModelListener originator)
          Requery all rows in this table and collapse its child nodes.
 void setAbout(String s)
          about property is read-only.
 void setCommitPolicy(int commit_policy)
          Sets the commit policy for this level.
 void setDescription(String description)
          Sets the user-assigned description of this instance.
 void setInternalData(Object user, Object data)
          For internal use only Sets internal data.
 void setLabel(String label)
          Sets the value of the label property.
 void setModelName(String s)
          Sets the model name of the data Bean.
 void setName(String name)
          Sets the name of the Bean.
 void setNodeProperties(com.klg.jclass.datasource.beans.NodeProperties comp)
          Sets data bean component information from an existing data bean component.
 void setNodeProperties(String resource_name, ClassLoader cl)
          Sets the data bean component using a serialized file.
 void setUserData(Object user, Object data)
          Sets user data.
 void setVersion(String s)
          Version property is read-only.
 boolean tableIsAncestor(com.klg.jclass.datasource.DataTableModel table2)
          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_identifier, Object value)
          Updates a cell.
 
Methods inherited from class com.klg.jclass.datasource.TreeData
cancelAll, clearCurrentPath, clearDataTableTreeInternalData, clearDataTableTreeUserData, enableDataModelEvents, fireDataModelEvent, fireDataModelEvent, fireDataModelEventInternal, getCurrentDataItem, getCurrentDataTable, getCurrentGlobalBookmark, getCurrentGlobalTable, getDataTableTree, getEventsEnabled, getListeners, getMetaData, getMetaDataTree, getModelName, moveToRow, moveToRow, removeDataModelListener, requeryAll, sendDataModelEvent, updateAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applet

protected transient Applet applet
The parent applet.


name

protected String name
Name of the Bean.


label

protected String label
Label for bean


metaDataCreator

protected com.klg.jclass.datasource.beans.MetaDataCreator metaDataCreator
Constructor Detail

JCData

public JCData()
Creates an empty data Bean of JDBC type.


JCData

public JCData(int type)
Creates a JCData using a data source type.

Parameters:
type - data source type

JCData

public JCData(Applet applet,
              String name)
Creates a JCData which reads parameters from the applet's HTML file.

Parameters:
applet - the applet whose PARAM tags are to be read
name - if this is not null, only parameters preceded by this name are read
See Also:
Applet.getParameter(java.lang.String)
Method Detail

getName

public String getName()
Gets the name of the Bean, as set in the constructor or by setName. .

Returns:
See Also:
setName(java.lang.String)

setName

public void setName(String name)
Sets the name of the Bean.

Parameters:
name -

getParameters

public void getParameters(Applet applet)
Reads the parameter values from the HTML page using the specified applet. The values will override those previously set.

Parameters:
applet -
See Also:
Applet.getParameter(java.lang.String)

getParameters

public void getParameters(Applet applet,
                          String file)
Reads the parameter values from the file. The values will override those previously set.

Parameters:
applet - if not null and in a browser, its documentBase() is used to construct a complete filename, if necessary
file - if an http protocol is not specified (if a ":" is not present), the current working directory is used

getAppletContext

public AppletContext getAppletContext()
Gets the Bean's applet's context. The applet context lets an applet control the applet's environment, which is usually the browser or the applet viewer.

Returns:
null if the component is not in an applet or the applet is not in a browser
See Also:
Applet.getAppletContext()

getAppletContext

public static AppletContext getAppletContext(Applet applet)
Gets the bean's applet's context. The applet context lets an applet control the applet's environment, which is usually the browser or the applet viewer.

Parameters:
applet -
Returns:
null if the component is not in an applet or the applet is not in a browser
See Also:
Applet.getAppletContext()

createMetaData

protected void createMetaData()
                       throws DataModelException
DataModelException

setNodeProperties

public void setNodeProperties(com.klg.jclass.datasource.beans.NodeProperties comp)
                       throws DataModelException
Sets data bean component information from an existing data bean component.

Parameters:
comp -
Throws:
DataModelException - If meta data cannot be created.

getNodeProperties

public com.klg.jclass.datasource.beans.NodeProperties getNodeProperties()
Gets the data bean component.

Returns:
See Also:
setNodeProperties(com.klg.jclass.datasource.beans.NodeProperties)

setNodeProperties

public void setNodeProperties(String resource_name,
                              ClassLoader cl)
                       throws DataModelException
Sets the data bean component using a serialized file.

Parameters:
resource_name - resource name relative to a class loader to the data bean component
cl - class loader used to get the resource
Throws:
DataModelException - If meta data cannot be created.

getCommitPolicy

public int getCommitPolicy()
Gets commitPolicy property.

Returns:
See Also:
setCommitPolicy(int)

setCommitPolicy

public void setCommitPolicy(int commit_policy)
                     throws DataModelException
Sets the commit policy for this level. Determines when changes are permanently written to the originating data source. Must be one of the following:

Parameters:
commit_policy - an int, one of

  • MetaDataModel.COMMIT_LEAVING_RECORD
  • MetaDataModel.COMMIT_LEAVING_ANCESTOR
  • MetaDataModel.COMMIT_MANUALLY

Throws:
DataModelException - If commit policy cannot be set.

getDescription

public String getDescription()
Returns the user-assigned description of this instance, or "" if the description has not been set.

Returns:
a String which describes this instance

setDescription

public void setDescription(String description)
Sets the user-assigned description of this instance.

Parameters:
description - a String which describles this instance

setModelName

public void setModelName(String s)
Sets the model name of the data Bean.

Specified by:
setModelName in interface DataModel
Overrides:
setModelName in class TreeData
Parameters:
s -

getAbout

public String getAbout()
Gets the about property. The about property displays contact information for Quest Software.

Returns:

setAbout

public void setAbout(String s)
about property is read-only.

Parameters:
s -

getVersion

public String getVersion()
Gets the value of the Version property. The Version property specifies the JClass datasource version number.

Returns:

setVersion

public void setVersion(String s)
Version property is read-only.

Parameters:
s -

addDataModelListener

public void addDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
Adds a data model listener.

Specified by:
addDataModelListener in interface DataModel
Overrides:
addDataModelListener in class TreeData
Parameters:
listener -
See Also:
DataModelListener

getCurrentRowStatus

public int getCurrentRowStatus()
                        throws DataModelException
Returns the status of the current row, will be one of

Returns:
an int row status, will be one of

  • DataTableModel.INSERTED
  • DataTableModel.UPDATED
  • DataTableModel.DELETED
  • DataTableModel.COMMITTED

Throws:
DataModelException - If getCurrentRowStatus() fails.
See Also:
DataTableModel.getRowStatus(long), DataTableModel

getRowCount

public int getRowCount()
Description copied from interface: DataTableModel
Returns the number of rows in this DataTable.

Specified by:
getRowCount in interface DataTableModel
Returns:
See Also:
DataTableModel.getRowStatus(long)

getRowStatus

public int getRowStatus(long bookmark)
Returns the status of a row, will be one of:

Specified by:
getRowStatus in interface DataTableModel
Parameters:
bookmark - a long which uniquely identifies this row
Returns:
an int row status, will be one of

  • DataTableModel.INSERTED
  • DataTableModel.UPDATED
  • DataTableModel.DELETED
  • DataTableModel.COMMITTED

See Also:
DataTableModel.getRowStatus(long)

getRowIdentifier

public long getRowIdentifier(int row)
Returns a long which will uniquely identify this row. Facilitates sorting: index changes, identifier remains constant.

Specified by:
getRowIdentifier in interface DataTableModel
Parameters:
row - an int for the original index of this row
Returns:
a unique int to identify this row from now on
See Also:
DataTableModel.getRowIdentifier(int)

getResultData

public Object getResultData(long bookmark,
                            String column_identifier)
                     throws DataModelException
Description copied from interface: DataTableModel
Returns the object specified by the given bookmark and column identifier name.

Specified by:
getResultData in interface DataTableModel
Parameters:
bookmark -
column_identifier -
Returns:
an result object
Throws:
DataModelException - If getResultData() fails.
See Also:
DataTableModel.getResultData(long, java.lang.String)

createTable

public com.klg.jclass.datasource.DataTableModel createTable(com.klg.jclass.datasource.DataModelListener originator,
                                                            long bookmark,
                                                            TreeNode node)
                                                     throws DataModelException
Description copied from interface: DataTableModel
Creates and returns the DataTable which corresponds to the specifed row of this parent for the indicated child MetaData object. Always returns a non-null DataTable. Creates new bookmarks for all returned rows. To retrieve an existing DataTable (and preserve bookmarks) call getTable() instead.

Specified by:
createTable in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark -
node -
Returns:
the child DataTableModel of results
Throws:
DataModelException - If createTable() fails.
See Also:
DataTableModel.createTable(com.klg.jclass.datasource.DataModelListener, long, javax.swing.tree.TreeNode)

getTable

public com.klg.jclass.datasource.DataTableModel getTable(long bookmark,
                                                         TreeNode node)
Since JCData has no child, it always returns null.

Specified by:
getTable in interface DataTableModel
Parameters:
bookmark - a long which uniquely identifies a row
node - the MetaDataModel object
Returns:
null
See Also:
DataTableModel.getTable(long, javax.swing.tree.TreeNode)

getMetaData

public com.klg.jclass.datasource.MetaDataModel getMetaData()
Returns the meta-data of this data Bean.

Specified by:
getMetaData in interface DataTableModel
Returns:
the MetaDataModel Object for this table
See Also:
DataTableModel.getMetaData()

getParentBookmark

public long getParentBookmark()
Since JCData has no parent, it always returns -1.

Specified by:
getParentBookmark in interface DataTableModel
Returns:
See Also:
DataTableModel.getParentBookmark()

deleteRow

public void deleteRow(com.klg.jclass.datasource.DataModelListener originator,
                      long bookmark)
               throws DataModelException
Deletes a row.

Specified by:
deleteRow in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark - a unique long indicating the row to be deleted
Throws:
DataModelException - If logical delete fails.
See Also:
DataTableModel.deleteRow(com.klg.jclass.datasource.DataModelListener, long)

updateCell

public void updateCell(com.klg.jclass.datasource.DataModelListener originator,
                       long bookmark,
                       String column_identifier,
                       Object value)
                throws DataModelException
Updates a cell.

Specified by:
updateCell in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark - a unique long indicating in which row the change was made
column_identifier - a unique String indicating in which column the change occurred
value - the Object to be placed in the cell
Throws:
DataModelException - If error occurs updating a cell.
See Also:
DataTableModel.updateCell(com.klg.jclass.datasource.DataModelListener, long, java.lang.String, java.lang.Object)

commitRow

public boolean commitRow(com.klg.jclass.datasource.DataModelListener originator,
                         long bookmark)
                  throws DataModelException
Commits a row.

Specified by:
commitRow in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark - a unique long indicating which row to commit to the datasource
Returns:
true if commit succeeds, false if it fails or was cancelled
Throws:
DataModelException - If commit fails.
See Also:
DataTableModel.commitRow(com.klg.jclass.datasource.DataModelListener, long)

commitAll

public void commitAll(com.klg.jclass.datasource.DataModelListener originator)
               throws DataModelException
Commits all uncommited rows.

Specified by:
commitAll in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Throws:
DataModelException - If any row fails to commit.
See Also:
DataTableModel.commitAll(com.klg.jclass.datasource.DataModelListener)

cancelRowChanges

public void cancelRowChanges(com.klg.jclass.datasource.DataModelListener originator,
                             long bookmark)
                      throws DataModelException
Cancels uncommited row changes.

Specified by:
cancelRowChanges in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark - a unique long indicating which row to uncommit
Throws:
DataModelException - If changes can't be canceled.
See Also:
DataTableModel.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long)

cancelAllRowChanges

public void cancelAllRowChanges(com.klg.jclass.datasource.DataModelListener originator)
                         throws DataModelException
Cancels uncommited row changes.

Specified by:
cancelAllRowChanges in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Throws:
DataModelException - If changes can't be canceled.
See Also:
DataTableModel.cancelRowChanges(com.klg.jclass.datasource.DataModelListener, long)

getAncestors

public void getAncestors(Vector ancestors)
Returns a list of this DataTable's ancestor bookmarks.

Specified by:
getAncestors in interface DataTableModel
Parameters:
ancestors -
Returns:
a Vector of ancestor bookmarks.
See Also:
DataTableModel.getAncestors(java.util.Vector)

getRootAncestorBookmark

public long getRootAncestorBookmark(long i)
Since JCData
Specified by:
getRootAncestorBookmark in interface DataTableModel
Parameters:
i -
Returns:
See Also:
DataTableModel.getRootAncestorBookmark(long)

requeryRowAndDetails

public void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator,
                                 long bookmark)
                          throws DataModelException
Re-reads a row from the originating data source. There is no detail to requery.

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

requeryRow

public void requeryRow(com.klg.jclass.datasource.DataModelListener originator,
                       long bookmark)
                throws DataModelException
Re-reads a row from the originating data source.

Specified by:
requeryRow in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
bookmark - a long which uniquely identifies a row
Throws:
DataModelException - If requery from server fails.
See Also:
DataTableModel.requeryRow(com.klg.jclass.datasource.DataModelListener, long)

requeryLevel

public com.klg.jclass.datasource.DataTableModel requeryLevel()
                                                      throws DataModelException
Requery the data for the root level DataTable.

Specified by:
requeryLevel in interface DataTableModel
Returns:
Throws:
DataModelException - If requery from server fails.
See Also:
DataTableModel.requeryLevel()

getCursor

public int getCursor()
Gets the cursor of the data table.

Specified by:
getCursor in interface DataTableModel
Returns:

moveCursorToRow

public void moveCursorToRow(long bookmark)
                     throws DataModelException
Moves the cursor to the row indicated by the bookmark.

Specified by:
moveCursorToRow in interface DataTableModel
Parameters:
bookmark -
Throws:
DataModelException - If move fails.

relative

public void relative(int rows)
              throws DataModelException
Moves the cursor forward or backward by "n" rows from the current position. Positive numbers move forward, negative backwards.

Specified by:
relative in interface DataTableModel
Parameters:
rows - an int indicating the number of rows to move
Throws:
DataModelException - If move fails.
See Also:
DataTableModel.getCurrentBookmark()

absolute

public void absolute(int ordinal_position)
              throws DataModelException
Moves the cursor to this ordinal position. Ordinal positions start at 1.

Specified by:
absolute in interface DataTableModel
Parameters:
ordinal_position - an int indicating to which row to move
Throws:
DataModelException - If move fails.
See Also:
DataTableModel.getCurrentBookmark()

first

public boolean first()
Moves to the first row.

Specified by:
first in interface DataTableModel
Returns:

previous

public boolean previous()
Moves to the previous row.

Specified by:
previous in interface DataTableModel
Returns:

next

public boolean next()
Moves to the next row.

Specified by:
next in interface DataTableModel
Returns:

last

public boolean last()
Moves to the last row.

Specified by:
last in interface DataTableModel
Returns:

beforeFirst

public void beforeFirst()
Positions the cursor before the first row.

Specified by:
beforeFirst in interface DataTableModel

afterLast

public void afterLast()
Positions the cursor after the last row.

Specified by:
afterLast in interface DataTableModel

isBeforeFirst

public boolean isBeforeFirst()
Returns true if the cursor is positioned before first row.

Specified by:
isBeforeFirst in interface DataTableModel
Returns:
true if cursor is positioned before first row, false otherwise

isAfterLast

public boolean isAfterLast()
Returns true if the cursor is positioned after the last row.

Specified by:
isAfterLast in interface DataTableModel
Returns:
true if the cursor is positioned after the last row, false otherwise
See Also:
DataTableModel.getCurrentBookmark()

getCurrentBookmark

public long getCurrentBookmark()
                        throws DataModelException
Returns the bookmark of the current row.

Specified by:
getCurrentBookmark in interface DataTableModel
Returns:
the bookmark of the current row
Throws:
DataModelException - If there are no rows or or an error occurs.
See Also:
DataTableModel.getCurrentBookmark()

getUserData

public Object getUserData(Object user)
Gets user data. Returns the Object which was arbitrarily associated with this table.

Specified by:
getUserData in interface DataTableModel
Parameters:
user - an Object, a reference to the user
Returns:
See Also:
DataTableModel.getUserData(java.lang.Object)

setUserData

public void setUserData(Object user,
                        Object data)
Sets user data. Allows users to augment this table by associating an arbitrary Object reference with it.

Specified by:
setUserData in interface DataTableModel
Parameters:
user - an Object, a reference to the user
data - an Object, an arbitrary reference to an Object
See Also:
DataTableModel.setUserData(java.lang.Object, java.lang.Object)

conditionallyCommitYourselfAndChildren

public void conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener originator)
                                            throws DataModelException
Since JCData has no child, it commits all of its changes if commitPolicy does not equal COMMIT_MANUALLY.

Specified by:
conditionallyCommitYourselfAndChildren in interface DataTableModel
Parameters:
originator -
Throws:
DataModelException - If write to data source fails.
See Also:
DataTableModel.conditionallyCommitYourselfAndChildren(com.klg.jclass.datasource.DataModelListener)

processEventQueue

public void processEventQueue(com.klg.jclass.datasource.DataModelListener originator)
                       throws DataModelException
Recursively processes pending events from a transaction.

Specified by:
processEventQueue in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Throws:
DataModelException - If changes can't be processed.
See Also:
DataTableModel.processEventQueue(com.klg.jclass.datasource.DataModelListener)

clearEventQueue

public void clearEventQueue()
Recursively clears pending events from a transaction. Called when an exception occurs. Events are not dispatched they are simply deleted.

Specified by:
clearEventQueue in interface DataTableModel
See Also:
DataTableModel.clearEventQueue()

getRowIndex

public int getRowIndex(long bookmark)
Given a bookmark, returns the zero-relative row index in this table.

Specified by:
getRowIndex in interface DataTableModel
Parameters:
bookmark - a long which uniquely identifies a row
Returns:
rowIndex an int which is the ordinal position of the row in this table
See Also:
DataTableModel.getRowIndex(long)

deleteCacheChildren

public void deleteCacheChildren(com.klg.jclass.datasource.DataModelListener originator)
                         throws DataModelException
Deletes the subtree of DataTables rooted with this DataTable as its root.

Specified by:
deleteCacheChildren in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Throws:
DataModelException - If tables can't be deleted.
See Also:
DataTableModel.deleteCacheChildren(com.klg.jclass.datasource.DataModelListener)

getInternalData

public Object getInternalData(Object user)
For internal use only. Gets internal data. Returns the Object which was arbitrarily associated with this table.

Specified by:
getInternalData in interface DataTableModel
Parameters:
user - an Object, a reference to the user.
Returns:
the internal Object associated with this table.
See Also:
DataTableModel.getInternalData(java.lang.Object)

setInternalData

public void setInternalData(Object user,
                            Object data)
For internal use only Sets internal data. Allows component writers to augment this table by associating an arbitrary Object reference with it.

Specified by:
setInternalData in interface DataTableModel
Parameters:
user - an Object, a reference to the user
data - an Object, an arbitrary reference to an Object
See Also:
DataTableModel.setInternalData(java.lang.Object, java.lang.Object)

moveToRow

public void moveToRow(long bookmark)
               throws DataModelException
Moves the ide cursor to this row.

Specified by:
moveToRow in interface DataTableModel
Parameters:
bookmark - a long which uniquely identifies a row
Throws:
DataModelException - If move fails.
See Also:
DataTableModel.moveToRow(long)

isSubTreeModified

public 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.

Specified by:
isSubTreeModified in interface DataTableModel
Parameters:
subTreeRootBookmark - a long, the bookmark of the row which is the root of the subtree to be checked
Returns:
true if this subtree contains at least one modified node, false otherwise

isTableOrChildrenModified

public boolean isTableOrChildrenModified()
Asks if there are any modifications to this table or any of its child nodes.

Specified by:
isTableOrChildrenModified in interface DataTableModel
Returns:
true if there are modifications to this table or any of its child nodes

commitSubTree

public void commitSubTree(com.klg.jclass.datasource.DataModelListener originator,
                          long subTreeRootBookmark)
                   throws DataModelException
Commits all pending changes in this subtree. Commits this row and all child nodes.

Specified by:
commitSubTree in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
subTreeRootBookmark - a long, the bookmark of the row which is the root of the subtree to be checked
Throws:
DataModelException - If commit fails.

isModified

public boolean isModified()
Asks if this DataTableModel contains any pending inserts, updates or deletes.

Specified by:
isModified in interface DataTableModel
Overrides:
isModified in class TreeData
Returns:
true if there are pending modifications, false otherwise

getUpdatedRowBookmarks

public long[] getUpdatedRowBookmarks()
Returns a long array of updated row bookmarks. These are the rows which have updates pending.

Specified by:
getUpdatedRowBookmarks in interface DataTableModel
Returns:
a long[] of updated row bookmarks

getInsertedRowBookmarks

public long[] getInsertedRowBookmarks()
Returns a long array of inserted row bookmarks. These are the rows which are inserted into the data model, but not yet persisted.

Specified by:
getInsertedRowBookmarks in interface DataTableModel
Returns:
a long[] of inserted row bookmarks

getDeletedRowBookmarks

public long[] getDeletedRowBookmarks()
Returns a long array of logically deleted row bookmarks. These are the rows which are logically deleted, but not yet physically deleted from the originating data source.

Specified by:
getDeletedRowBookmarks in interface DataTableModel
Returns:
a long[] of logically deleted row bookmarks

tableIsAncestor

public boolean tableIsAncestor(com.klg.jclass.datasource.DataTableModel table2)
Given a DataTable, returns whether it is an ancestor of (or equal to) itself.

Specified by:
tableIsAncestor in interface DataTableModel
Parameters:
table2 - a DataTable which may be an ancestor
Returns:
true if the table is an ancestor

getParameters

protected void getParameters()
Reads the parameter values from the HTML page using the data Bean's applet. The values will override those previously set. Subclasses may override this method to set their own values - in this case, the method should first call super.getParameters().


addRow

public long addRow(com.klg.jclass.datasource.DataModelListener originator)
            throws DataModelException
Adds a row whose status will be INSERTED. Adds a blank row into which the user can input column data. The record is appended to this ResultSet. The record is saved to datasource when the user commits the surrounding transaction.

Fires BEFORE_INSERT_ROW and upon a successful row adds AFTER_INSERT_ROW.

Specified by:
addRow in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Returns:
Throws:
DataModelException - If row fails to be added.

addRow

public long addRow(com.klg.jclass.datasource.DataModelListener originator,
                   Object row,
                   int status)
            throws DataModelException
Adds a populated row whose status will be status. Adds a pre-populated row whose status is dictated by the status parameter.

Fires BEFORE_INSERT_ROW and upon a successful row adds AFTER_INSERT_ROW.

Specified by:
addRow in interface DataTableModel
Parameters:
row - an Object as defined by the interface, but used as an array by this implementation
status - an int, one of:
  • DataTableModel.COMMITTED
  • DataTableModel.DELETED
  • DataTableModel.INSERTED
originator -
Returns:
Throws:
DataModelException - If row fails to be added.

addRow

public long addRow(com.klg.jclass.datasource.DataModelListener originator,
                   Object row,
                   int status,
                   int ordinal)
            throws DataModelException
Adds a populated row whose status will be status. Adds a pre-populated row whose status is dictated by the status parameter.

Fires BEFORE_INSERT_ROW and upon a successful row adds AFTER_INSERT_ROW.

Specified by:
addRow in interface DataTableModel
Parameters:
row - an Object as defined by the interface, but used as an array by this implementation
status - an int, one of:
  • DataTableModel.COMMITTED
  • DataTableModel.DELETED
  • DataTableModel.INSERTED
ordinal - the index position into which the row should be inserted
originator -
Returns:
Throws:
DataModelException - If row fails to be added.

addRow

public long addRow(com.klg.jclass.datasource.DataModelListener originator,
                   Object row)
            throws DataModelException
Adds a populated row whose status will be INSERTED. Adds a pre-populated row. The record is appended to this ResultSet. The record is saved to datasource when the user commits the surrounding transaction.

Fires BEFORE_INSERT_ROW and upon a successful row adds AFTER_INSERT_ROW.

Specified by:
addRow in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
row - an Object as defined by the interface, but used as an array by this implementation
Returns:
Throws:
DataModelException - If row fails to be added.

createNewRow

public Object createNewRow()
                    throws DataModelException
Creates a new (blank) row that can be used as an argument to one of the addRow() methods.

Specified by:
createNewRow in interface DataTableModel
Returns:
an Object which is the new row just added
Throws:
DataModelException - If create fails.

requeryTable

public void requeryTable(com.klg.jclass.datasource.DataModelListener originator)
                  throws DataModelException
Requery all rows in this table and collapse its child nodes.

Specified by:
requeryTable in interface DataTableModel
Parameters:
originator - the DataModelListener which initiated this action
Throws:
DataModelException - If requery fails.

getLabel

public String getLabel()
Returns the value of the label property

Returns:
String

setLabel

public void setLabel(String label)
Sets the value of the label property.

Parameters:
label -

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