JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid
Class SummaryMetaData

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--com.klg.jclass.datasource.DataSourceTreeNode
              |
              +--com.klg.jclass.higrid.SummaryMetaData
All Implemented Interfaces:
Cloneable, MetaDataModel, MutableTreeNode, Serializable, TreeNode
Direct Known Subclasses:
DetailsMetaData, FooterMetaData

public class SummaryMetaData
extends DataSourceTreeNode
implements MetaDataModel, Serializable

SummaryMetaData is the base class for the meta data for a summary record type.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface com.klg.jclass.datasource.MetaDataModel
COMMIT_LEAVING_ANCESTOR, COMMIT_LEAVING_RECORD, COMMIT_MANUALLY, TYPE_BIG_DECIMAL, TYPE_BOOLEAN, TYPE_BYTE, TYPE_BYTE_ARRAY, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_SHORT, TYPE_SQL_DATE, TYPE_SQL_TIME, TYPE_SQL_TIMESTAMP, TYPE_STRING, TYPE_UTIL_DATE
 
Constructor Summary
SummaryMetaData()
          SummaryMetaData Constructor.
 
Method Summary
 void addColumn(com.klg.jclass.datasource.ColumnModel column)
          Add a column to the list of column objects.
 void appendColumn(com.klg.jclass.higrid.SummaryColumn column)
          Append a column to the end of this table.
 void clear()
          Change the query for this data control.
 void commitTransaction()
          Commits the transaction.
 boolean getAutoCommit()
          Returns true if the transaction capabilities of the underlying data source should be used when saving modifications (transactions are supported and enabled).
 com.klg.jclass.datasource.BindingModel getBinding()
          Return the Binding object associated with this MetaData level.
 boolean getCacheChildren()
          Return a boolean flag indicating whether subtrees of DataTables rooted at this level are eligable for deletion.
 com.klg.jclass.higrid.SummaryColumn getColumn(String name)
          Return the summary column given the column identifier.
 int getColumnCount()
          Return number of columns in this result set
 String getColumnIdentifier(int column_index)
          Return a string which identifies this column.
 int getColumnIndex(String name)
          Given a column identifier get its index.
 com.klg.jclass.datasource.ColumnModel getColumnObject(String column_identifier)
          Return the ColumnModel for the given column.
 Vector getColumnObjects()
          Return the list of ColumnModel objects.
 int getCommitPolicy()
          Return the commit policy for this level.
 long getCurrentBookmark()
          Return the bookmark of the row currently in focus.
 com.klg.jclass.datasource.DataTableModel getCurrentDataTable()
          Return the data table which currently has focus.
 com.klg.jclass.datasource.DataModel getDataModel()
          Return the DataModel which encapsulates this MetaDataModel.
 boolean getDeleteAllowed(String table)
          Return true if this table can be deleted, false otherwise.
 String getDescription()
          Return the user-assigned description of this instance, or "" if the description has not been set.
 boolean getInsertAllowed(String table)
          Return true if this table can be inserted into, false otherwise.
 int getJavaColumnType(String column_identifier)
          Return the Java type for a column.
 int getMaxRows()
          Return the maximum number of rows which can be returned by a query.
 int getMetaID()
          Return an int which uniquely identifies this instance of the MetaDataModel.
 Object getNativeMetaData()
          Return the native meta data object.
 com.klg.jclass.datasource.ProviderModel getProvider()
          Get the provider (if any) for this level.
 boolean getShowDeletedRows()
          Show logically deleted rows?
 Class getStoreClass()
          Return the class responsible for data storage and retrieval (implements StoreModel).
 boolean getUpdateAllowed(String table)
          Return true if this table can be updated, false otherwise.
 void insertColumn(com.klg.jclass.higrid.SummaryColumn column, int index)
          Insert a column to this table.
 boolean isUpdateAllowedOnColumn(String column)
          Do permissions on the model allow this column to be editied?
 void removeColumn(int index)
          Remove a column from this table.
 void removeColumn(com.klg.jclass.higrid.SummaryColumn column)
          Remove a column from this table.
 void rollbackTransaction()
          Rolls back the transaction.
 void setAutoCommit(boolean value)
          Sets the auto commit flag.
 void setBinding(com.klg.jclass.datasource.BindingModel binding)
          Set the Binding object associated with this MetaData level.
 void setCacheChildren(boolean cacheChildren)
          Sets a boolean indicating whether subtrees of DataTables rooted at this level are eligable for deletion.
 void setCommitPolicy(int commit_policy)
          Set the commit policy for this level.
 void setCurrentBookmark(long currentBookmark)
           
 void setCurrentDataTable(com.klg.jclass.datasource.DataTableModel currentDataTable)
           
 void setDeleteAllowed(String table, boolean v)
          Set a boolean indicating if rows in this table is allowed to be deleted.
 void setDescription(String description)
          Set the user-assigned description of this instance.
 void setInsertAllowed(String table, boolean v)
          Set a boolean indicating if this table is allowed to be inserted into.
 void setMaxRows(int maxRows)
          Set the maximum number of rows a query at this level can return.
 void setMetaID(int metaID)
          Set an int which uniquely identifies this instance of the MetaDataModel.
 void setProviderClassName(String providerModelClassName)
          Set the ProviderModel class name which will provide data for this level.
 void setShowDeletedRows(boolean value)
          Indicate if logically deleted rows showld be shown
 void setStoreClass(String storeClassName)
          Set an alternate class to handle data storage and retrieval responsibilities.
 void setUpdateAllowed(String table, boolean v)
          Set a boolean indicating if this table is allowed to be updated.
protected  void setupIdentifiers()
          Setup the identifiers hashtable.
 void setupSumaryColumns(Vector columns)
          Setup the summary columns.
 
Methods inherited from class com.klg.jclass.datasource.DataSourceTreeNode
getChildren, getFirstChild, getIterator, getIterator, getIterator, getIterator, getLastChild, getNextChild, getPreviousChild, hasChildren, insert, isChildOf, toString
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstLeaf, getIndex, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Constructor Detail

SummaryMetaData

public SummaryMetaData()
SummaryMetaData Constructor.

Method Detail

setMetaID

public void setMetaID(int metaID)
Set an int which uniquely identifies this instance of the MetaDataModel. This id is the same one as the corresponding record meta data one.

Specified by:
setMetaID in interface MetaDataModel
Parameters:
metaID - An int which uniquely identifies this object.
See Also:
MetaDataModel.getMetaID()

appendColumn

public void appendColumn(com.klg.jclass.higrid.SummaryColumn column)
Append a column to the end of this table.

Parameters:
column - The summary column object.

insertColumn

public void insertColumn(com.klg.jclass.higrid.SummaryColumn column,
                         int index)
Insert a column to this table.

Parameters:
column - The summary column object.
index - The index position to insert the object.

removeColumn

public void removeColumn(com.klg.jclass.higrid.SummaryColumn column)
Remove a column from this table.

Parameters:
column - The summary column object.

removeColumn

public void removeColumn(int index)
Remove a column from this table.

Parameters:
index - The index position to insert the object.

getColumn

public com.klg.jclass.higrid.SummaryColumn getColumn(String name)
Return the summary column given the column identifier.

Parameters:
name - A String indicating the column's identifier
Returns:
The summary column.

setupSumaryColumns

public void setupSumaryColumns(Vector columns)
Setup the summary columns.

Parameters:
columns - The summary column vectors.

setupIdentifiers

protected void setupIdentifiers()
Setup the identifiers hashtable.


getColumnIndex

public int getColumnIndex(String name)
Given a column identifier get its index.

Specified by:
getColumnIndex in interface MetaDataModel
Parameters:
name - A String indicating the column's identifier
Returns:
An int which is this column's ordinal position.

clear

public void clear()
Change the query for this data control. Reset the summary column data.

Specified by:
clear in interface MetaDataModel

getColumnIdentifier

public String getColumnIdentifier(int column_index)
                           throws DataModelException
Return a string which identifies this column.

Specified by:
getColumnIdentifier in interface MetaDataModel
Parameters:
column_index - An int indicating the column for which an identifier should be returned.
Returns:
A String which identifies a column
Throws:
DataModelException - If the operation fails.

getColumnCount

public int getColumnCount()
Return number of columns in this result set

Specified by:
getColumnCount in interface MetaDataModel
Returns:
An int indicating the number of columns in table

getJavaColumnType

public int getJavaColumnType(String column_identifier)
                      throws DataModelException
Return the Java type for a column.

Specified by:
getJavaColumnType in interface MetaDataModel
Parameters:
column_identifier - An String uniquely identifying a column
Returns:
An int representing the Java type for this column
Throws:
DataModelException - If the operation fails.
See Also:
MetaDataModel

setCommitPolicy

public void setCommitPolicy(int commit_policy)
Set the commit policy for this level. Determines when changes are permanently written to the originating data source. Must be one of COMMIT_LEAVING_RECORD, COMMIT_LEAVING_PARENT, or COMMIT_MANUALLY.

Specified by:
setCommitPolicy in interface MetaDataModel
Parameters:
commit_policy - An int, one of COMMIT_LEAVING_RECORD, COMMIT_LEAVING_PARENT, or COMMIT_MANUALLY

getCommitPolicy

public int getCommitPolicy()
Return the commit policy for this level. Determines when changes are permanently written to the originating data source. Will be one of COMMIT_LEAVING_RECORD, COMMIT_LEAVING_PARENT, or COMMIT_MANUALLY.

Specified by:
getCommitPolicy in interface MetaDataModel
Returns:
An int, one of COMMIT_LEAVING_RECORD, COMMIT_LEAVING_PARENT, or COMMIT_MANUALLY

getDataModel

public com.klg.jclass.datasource.DataModel getDataModel()
Return the DataModel which encapsulates this MetaDataModel.

Specified by:
getDataModel in interface MetaDataModel
Returns:
the DataModel

setInsertAllowed

public void setInsertAllowed(String table,
                             boolean v)
Set a boolean indicating if this table is allowed to be inserted into. The default is to allow this.

Specified by:
setInsertAllowed in interface MetaDataModel
Parameters:
table - a String name of the table

setUpdateAllowed

public void setUpdateAllowed(String table,
                             boolean v)
Set a boolean indicating if this table is allowed to be updated. The default is to allow this.

Specified by:
setUpdateAllowed in interface MetaDataModel
Parameters:
table - a String name of the table

setDeleteAllowed

public void setDeleteAllowed(String table,
                             boolean v)
Set a boolean indicating if rows in this table is allowed to be deleted. The default is to allow this.

Specified by:
setDeleteAllowed in interface MetaDataModel
Parameters:
table - a String name of the table

getInsertAllowed

public boolean getInsertAllowed(String table)
Return true if this table can be inserted into, false otherwise. The default is to allow this.

Specified by:
getInsertAllowed in interface MetaDataModel
Parameters:
table - a String name of the table
Returns:
true if table can be updated

getUpdateAllowed

public boolean getUpdateAllowed(String table)
Return true if this table can be updated, false otherwise. The default is to allow this.

Specified by:
getUpdateAllowed in interface MetaDataModel
Parameters:
table - a String name of the table
Returns:
true if table can be updated

getDeleteAllowed

public boolean getDeleteAllowed(String table)
Return true if this table can be deleted, false otherwise. The default is to allow this.

Specified by:
getDeleteAllowed in interface MetaDataModel
Parameters:
table - a String name of the table
Returns:
true if rows in this table can be deleted.

getMetaID

public int getMetaID()
Return an int which uniquely identifies this instance of the MetaDataModel. This id is automatically generated.

Specified by:
getMetaID in interface MetaDataModel
Returns:
an int which uniquely identifies this object.
See Also:
MetaDataModel.setMetaID(int)

getDescription

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

Specified by:
getDescription in interface MetaDataModel
Returns:
a String which describes this instance.

setDescription

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

Specified by:
setDescription in interface MetaDataModel
Parameters:
description - a String which describles this instance.

getAutoCommit

public boolean getAutoCommit()
                      throws DataModelException
Returns true if the transaction capabilities of the underlying data source should be used when saving modifications (transactions are supported and enabled). If the underlying data source supports transactions and this capability has been enabled, data modifications will be wrapped in a transaction which can be committed or rolled back.

Specified by:
getAutoCommit in interface MetaDataModel
Throws:
DataModelException - If the operation fails.
See Also:
commitTransaction(), BaseMetaData.rollbackTransaction()

setAutoCommit

public void setAutoCommit(boolean value)
                   throws DataModelException
Sets the auto commit flag. If the underlying data source supports transactions and this flag is set to true, a transaction will wrap data modifications.

Specified by:
setAutoCommit in interface MetaDataModel
Parameters:
value - a boolean, true if transactions are to be used, false otherwise.
Throws:
DataModelException - If the operation fails.

rollbackTransaction

public void rollbackTransaction()
                         throws DataModelException
Rolls back the transaction. If the underlying data source supports transactions and transactions have been enabled, calling this method will rollback all pending transactions on the data source (on this connection).

Specified by:
rollbackTransaction in interface MetaDataModel
Throws:
DataModelException - If the operation fails.
See Also:
getAutoCommit()

commitTransaction

public void commitTransaction()
                       throws DataModelException
Commits the transaction. If the underlying data source supports transactions and transactions have been enabled, calling this method will commit all pending transactions on the data source (on this connection).

Specified by:
commitTransaction in interface MetaDataModel
Throws:
DataModelException - If the operation fails.

getColumnObjects

public Vector getColumnObjects()
Return the list of ColumnModel objects.

Specified by:
getColumnObjects in interface MetaDataModel
Returns:
a vector of ColumnModel objects.
See Also:
ColumnModel

isUpdateAllowedOnColumn

public boolean isUpdateAllowedOnColumn(String column)
Do permissions on the model allow this column to be editied?

Specified by:
isUpdateAllowedOnColumn in interface MetaDataModel
Returns:
true if edits are allowed, false otherwise
See Also:
setUpdateAllowed(java.lang.String, boolean), getUpdateAllowed(java.lang.String)

addColumn

public void addColumn(com.klg.jclass.datasource.ColumnModel column)
Add a column to the list of column objects.

Specified by:
addColumn in interface MetaDataModel
See Also:
ColumnModel

getColumnObject

public com.klg.jclass.datasource.ColumnModel getColumnObject(String column_identifier)
                                                      throws DataModelException
Return the ColumnModel for the given column.

Specified by:
getColumnObject in interface MetaDataModel
Parameters:
column_identifier - a String which uniquely identifies a column
Returns:
a ColumnModel
Throws:
DataModelException - If get fails.

getNativeMetaData

public Object getNativeMetaData()
Return the native meta data object. This is a DataSet in JBuilder and a RelationView in VisualCafe.

Specified by:
getNativeMetaData in interface MetaDataModel
Returns:
the native meta data object for this level.

setShowDeletedRows

public void setShowDeletedRows(boolean value)
Indicate if logically deleted rows showld be shown

Specified by:
setShowDeletedRows in interface MetaDataModel
Parameters:
value - a boolean: true to show rows, false otherwise

getShowDeletedRows

public boolean getShowDeletedRows()
Show logically deleted rows?

Specified by:
getShowDeletedRows in interface MetaDataModel
Returns:
show a boolean: true means show rows, false hide

setMaxRows

public void setMaxRows(int maxRows)
Set the maximum number of rows a query at this level can return. Useful for design time where only a sampling of rows is required. Set to -1 to have no limit.

Does not apply to ide-specific implmentations. Set the max rows directly on the ide data object instead.

Specified by:
setMaxRows in interface MetaDataModel
Parameters:
maxRows - an int indicating the max rows to be returned
See Also:
getMaxRows()

getMaxRows

public int getMaxRows()
Return the maximum number of rows which can be returned by a query.

Does not apply to ide-specific implmentations. Set the max rows directly on the ide data object instead.

Specified by:
getMaxRows in interface MetaDataModel
Returns:
the maximum number of rows which can be returned by a query
See Also:
setMaxRows(int)

setCacheChildren

public void setCacheChildren(boolean cacheChildren)
Sets a boolean indicating whether subtrees of DataTables rooted at this level are eligable for deletion.

Specified by:
setCacheChildren in interface MetaDataModel
Parameters:
cacheChildren - a boolean: true if deleteCacheChildren should be called on this level when it is collapsed, false otherwise.
See Also:
getCacheChildren(), DataTableModel.deleteCacheChildren(com.klg.jclass.datasource.DataModelListener)

getCacheChildren

public boolean getCacheChildren()
Return a boolean flag indicating whether subtrees of DataTables rooted at this level are eligable for deletion.

Specified by:
getCacheChildren in interface MetaDataModel
Returns:
true if deleteCacheChildren should be called on this level when it is collapsed, false otherwise.
See Also:
setCacheChildren(boolean), DataTableModel.deleteCacheChildren(com.klg.jclass.datasource.DataModelListener)

getCurrentDataTable

public com.klg.jclass.datasource.DataTableModel getCurrentDataTable()
Return the data table which currently has focus.

Specified by:
getCurrentDataTable in interface MetaDataModel
Returns:
a DataTableModel, the one currently in focus.

getCurrentBookmark

public long getCurrentBookmark()
Return the bookmark of the row currently in focus.

Specified by:
getCurrentBookmark in interface MetaDataModel
Returns:
the bookmark of the row currently in focus.

setCurrentDataTable

public void setCurrentDataTable(com.klg.jclass.datasource.DataTableModel currentDataTable)
Specified by:
setCurrentDataTable in interface MetaDataModel

setCurrentBookmark

public void setCurrentBookmark(long currentBookmark)
Specified by:
setCurrentBookmark in interface MetaDataModel

setStoreClass

public void setStoreClass(String storeClassName)
                   throws DataModelException
Set an alternate class to handle data storage and retrieval responsibilities. A "Class.forName()" will be done to load this alternate class.

If set, BaseDataTable instances will use this instances of this class rather than the default class ("Store") to store and retrieve data.

Specified by:
setStoreClass in interface MetaDataModel
Throws:
DataModelException - If an error occurs loading the class.
See Also:
StoreModel, getStoreClass()

getStoreClass

public Class getStoreClass()
                    throws DataModelException
Return the class responsible for data storage and retrieval (implements StoreModel). If not set, the default class (com.klg.jclass.datasource.Store) is loaded and used.

Specified by:
getStoreClass in interface MetaDataModel
Returns:
the class used to store/retrieve data
Throws:
DataModelException - If get fails.

getBinding

public com.klg.jclass.datasource.BindingModel getBinding()
Return the Binding object associated with this MetaData level.

Specified by:
getBinding in interface MetaDataModel
Returns:
the Binding object for this level.

setBinding

public void setBinding(com.klg.jclass.datasource.BindingModel binding)
Set the Binding object associated with this MetaData level.

Specified by:
setBinding in interface MetaDataModel

getProvider

public com.klg.jclass.datasource.ProviderModel getProvider()
Get the provider (if any) for this level.

Specified by:
getProvider in interface MetaDataModel
Returns:
ProviderModel the class which will provide matrix data for this level

See Also:
ProviderModel.getData(com.klg.jclass.datasource.DataModelListener, long, com.klg.jclass.datasource.MetaDataModel), DataTableModel.createTable(com.klg.jclass.datasource.DataModelListener, long, javax.swing.tree.TreeNode), DataTableModel.getTable(long, javax.swing.tree.TreeNode)

setProviderClassName

public void setProviderClassName(String providerModelClassName)
                          throws DataModelException
Set the ProviderModel class name which will provide data for this level. This class will be instantiated and to provide data.

Specified by:
setProviderClassName in interface MetaDataModel
Throws:
DataModelException - if the provider fails to be instantiated.

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