|
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 | +--com.klg.jclass.datasource.TreeData
An implementation of DataModel. Implements trees and listener functions.
| Field Summary | |
protected long |
currentBookmark
Previous row_identifier, used for cursor |
protected com.klg.jclass.datasource.DataTableModel |
currentDataTable
Previous data table, used for cursor |
protected com.klg.jclass.datasource.DataSourceTreeModel |
data_tree
DataSourceTreeModel for DataTables. |
protected boolean |
eventsEnabled
enable events? |
protected com.klg.jclass.util.JCListenerList |
listeners
Listeners |
protected com.klg.jclass.datasource.DataSourceTreeModel |
meta_tree
DataSourceTreeModel for metadata. |
protected String |
modelName
This model's name |
protected static int |
nameCounter
Static counter used to create default names for instances of this class. |
| Constructor Summary | |
TreeData()
A constructor for TreeData, an implementation of DataModel which can be extened. |
|
| Method Summary | |
void |
addDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
Implements DataModel method addDataModelListener. |
void |
cancelAll(com.klg.jclass.datasource.DataModelListener originator)
Cancels all pending changes in all DataTables. |
void |
clearCurrentPath(com.klg.jclass.datasource.MetaDataModel parentMeta)
Clear the current path of all children of this MetaDataModel. |
void |
clearDataTableTreeInternalData(Object user)
For internal use only. |
void |
clearDataTableTreeUserData(Object user)
Clears all user data. |
void |
enableDataModelEvents(boolean value)
Enable or disable data model events. |
boolean |
fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
Passes event on to listeners of this DataModel. |
boolean |
fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
Passes event on to a single specific listener of this DataModel. |
protected void |
fireDataModelEventInternal(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
Sends event on to a single specific listener of this DataModel (internal version) |
Object |
getCurrentDataItem(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.MetaDataModel myLevel,
String column)
Returns the data item at the specified MetaData level and column for the current row. |
com.klg.jclass.datasource.DataTableModel |
getCurrentDataTable(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.MetaDataModel myLevel)
Returns the DataTable at the specified MetaData level based on the current bookmark. |
long |
getCurrentGlobalBookmark()
Return the bookmark of the row which has the global cursor's focus. |
com.klg.jclass.datasource.DataTableModel |
getCurrentGlobalTable()
Return the DataTableModel currently in focus. |
TreeModel |
getDataTableTree()
Implements DataModel method getDataTree. |
boolean |
getEventsEnabled()
Return true if events are enabled, false otherwise. |
Object |
getListeners()
Returns a list of listeners |
com.klg.jclass.datasource.MetaDataModel |
getMetaData(String metaDataName)
Get a MetaDataModel instance by name, or null if not found. |
TreeModel |
getMetaDataTree()
Implements DataModel method getMetaDataTree. |
String |
getModelName()
Get this model's name. |
boolean |
isModified()
Are there any pending modifications in any rows in this entire data model? |
boolean |
moveToRow(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.DataTableModel data_table,
long bookmark)
Called by observers to tell this data model to which row it should move. |
boolean |
moveToRow(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.DataTableModel data_table,
long bookmark,
boolean moveIdeCursor)
For internal use only. |
void |
removeDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
Implements DataModel method removeDataModelListener. |
void |
requeryAll(com.klg.jclass.datasource.DataModelListener originator)
Requeries all DataTables. |
protected boolean |
sendDataModelEvent(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
Sends event on to listeners of this DataModel (internal version) |
void |
setModelName(String modelName)
Set this model's name. |
void |
updateAll(com.klg.jclass.datasource.DataModelListener originator)
Writes all pending changes in all DataTables to the data source. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected com.klg.jclass.datasource.DataSourceTreeModel meta_tree
protected transient com.klg.jclass.datasource.DataSourceTreeModel data_tree
protected com.klg.jclass.util.JCListenerList listeners
protected transient com.klg.jclass.datasource.DataTableModel currentDataTable
protected long currentBookmark
protected boolean eventsEnabled
protected static int nameCounter
protected String modelName
| Constructor Detail |
public TreeData()
| Method Detail |
public TreeModel getMetaDataTree()
getMetaDataTree in interface DataModelpublic TreeModel getDataTableTree()
getDataTableTree in interface DataModelpublic void addDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
addDataModelListener in interface DataModelDataModelListenerpublic void removeDataModelListener(com.klg.jclass.datasource.DataModelListener listener)
removeDataModelListener in interface DataModelDataModelListenerpublic Object getListeners()
getListeners in interface DataModel
public boolean moveToRow(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.DataTableModel data_table,
long bookmark)
throws DataModelException
Upon intialization of the data model the current data table is the root data table and the current bookmark is the first row.
Fires a BEFORE_MOVE_TO_CURRENT_ROW which if cancelled, cancels the move and an AFTER_MOVE_TO_CURRENT_ROW on a sucessful move.
During the move if the row or subtree which is being left is modified a BEFORE_COMMIT_ROW or a BEFORE_COMMIT_CONDITIONAL message will be sent. If either of these is cancelled, the move will fail.
moveToRow in interface DataModeloriginator - the DataModelListener which initiated this actiondata_table - the DataTable to which the cursor should be movedbookmark - a long uniquely identify to which row the cursor
should move
DataModelException - If moveToRow fails.
public boolean moveToRow(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.DataTableModel data_table,
long bookmark,
boolean moveIdeCursor)
throws DataModelException
moveToRow in interface DataModeloriginator - the DataModelListener which initiated this actiondata_table - the DataTable to which the cursor should be movedbookmark - a long uniquely identify to which row the cursor
should movemoveIdeCursor - a boolean indicating if this move should also cause
the ide's cursor to move
DataModelException - If move to row fails.
public void updateAll(com.klg.jclass.datasource.DataModelListener originator)
throws DataModelException
updateAll in interface DataModeloriginator - the DataModelListener which initiated this action
DataModelException - If updateAll fails.
public void cancelAll(com.klg.jclass.datasource.DataModelListener originator)
throws DataModelException
cancelAll in interface DataModeloriginator - the DataModelListener which initiated this action.
DataModelException - If an exception occurs while canceling pending changes.
public void requeryAll(com.klg.jclass.datasource.DataModelListener originator)
throws DataModelException
requeryAll in interface DataModeloriginator - the DataModelListener which initiated this action
DataModelException - If requeryAll fails.public void clearCurrentPath(com.klg.jclass.datasource.MetaDataModel parentMeta)
clearCurrentPath in interface DataModelparentMeta - the MetaDataModel whose children are to be
cleared.
public boolean fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
fireDataModelEvent in interface DataModelevent - a DataModelEventlistener - the DataModelListener
public boolean fireDataModelEvent(com.klg.jclass.datasource.DataModelEvent event)
fireDataModelEvent in interface DataModelevent - a DataModelEvent
protected boolean sendDataModelEvent(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
event - a DataModelEventlistener - the DataModelListener
protected void fireDataModelEventInternal(com.klg.jclass.datasource.DataModelEvent event,
com.klg.jclass.datasource.DataModelListener listener)
event - a DataModelEventlistener - the DataModelListener
public void enableDataModelEvents(boolean value)
This is different from the DataModelEvent BEGIN_EVENTS and END_EVENTS events where events are still sent but the listener having received the BEGIN_EVENTS event knows it may choose to disregard the events until the END_EVENTS event is received. They are given the choice.
Temporarily disabling events is more efficient than using the BEGIN/END_EVENTS method since the events are not dispatched to all listeners.
enableDataModelEvents in interface DataModelDataModelEvent,
getEventsEnabled()public boolean getEventsEnabled()
getEventsEnabled in interface DataModelenableDataModelEvents(boolean)public void setModelName(String modelName)
setModelName in interface DataModelmodelName - a String which is to be this model's namepublic String getModelName()
getModelName in interface DataModelpublic com.klg.jclass.datasource.DataTableModel getCurrentGlobalTable()
getCurrentGlobalTable in interface DataModelmoveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long),
getCurrentGlobalBookmark()public long getCurrentGlobalBookmark()
getCurrentGlobalBookmark in interface DataModelmoveToRow(com.klg.jclass.datasource.DataModelListener, com.klg.jclass.datasource.DataTableModel, long),
getCurrentGlobalTable()
public com.klg.jclass.datasource.DataTableModel getCurrentDataTable(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.MetaDataModel myLevel)
throws DataModelException
Will create the table if it does not exist. In this case it will be the child of the current row in the parent, and so on.
getCurrentDataTable in interface DataModeloriginator - the DataModelListener which initiated this action
DataModelException - If get fails.
public Object getCurrentDataItem(com.klg.jclass.datasource.DataModelListener originator,
com.klg.jclass.datasource.MetaDataModel myLevel,
String column)
throws DataModelException
Will create the table if it does not exist. In this case it will be the child of the current row in the parent, and so on.
getCurrentDataItem in interface DataModeloriginator - the DataModelListener which initiated this action
DataModelException - If get fails.public com.klg.jclass.datasource.MetaDataModel getMetaData(String metaDataName)
getMetaData in interface DataModelmetaDataName - a String which is the name of the MetaDataModel object
MetaDataModel.setDescription(java.lang.String),
MetaDataModel.getDescription()public boolean isModified()
isModified in interface DataModelpublic void clearDataTableTreeUserData(Object user)
clearDataTableTreeUserData in interface DataModeluser - an Object, a reference to the user.public void clearDataTableTreeInternalData(Object user)
clearDataTableTreeInternalData in interface DataModeluser - an Object, a reference to the user.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||