Rogue Wave Views Data Access Package API Reference Guide |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/dataccess/gadgets/dbtree.h>
Public Member Functions | |
IliDbTreeGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
This constructor creates a tree gadget that can be connected to a set of data sources. More... | |
void | addErrorSink (IliErrorSink *sink) |
Adds an error sink. More... | |
void | dontContinueProcess () |
Stops the current process (deleting, inserting or editing). | |
void | enableItemDeletion (IlBoolean enable) |
Enables/disables the items deletion. More... | |
void | enableItemEdition (IlBoolean enable) |
Enables/disables the items editing. More... | |
void | enableItemInsertion (IlBoolean enable) |
Enables/disables the items insertion. More... | |
const char * | getBitmapColumnName (IlInt dsi) const |
Returns the bitmap item column name. More... | |
IlInt | getDeletedItemDataSourceIndex () const |
Returns the data source index of the deleted item. More... | |
const IliValue & | getDeletedItemIdentifier () const |
Returns the identifier of the deleted item. More... | |
IliErrorReporter * | getErrorReporter () const |
Returns the error reporter that is used by reportErrors member function. More... | |
const IliFormat & | getFormat (IlInt dsi=0) const |
Returns the format used to display the item. More... | |
const char * | getIdentifierColumnName (IlInt dsi) const |
Returns the identifier item column name. More... | |
IlInt | getItemDataSourceIndex (IlvTreeGadgetItem *) const |
Returns the data source index of the item. More... | |
const char * | getItemDialogModelName () const |
Returns the model that is used to create the item dialog. More... | |
IlInt | getItemRowIndex (IlvTreeGadgetItem *) const |
Returns the row index of the item. More... | |
const char * | getLabelColumnName (IlInt dsi) const |
Returns the label item column name. More... | |
const char * | getModel () const |
Returns the model that is used to build the tree gadget data. More... | |
const char * | getModelName () const |
Returns the model that is used to build the tree gadget data. More... | |
const char * | getNewItemBitmap () const |
Returns the bitmap of the new item. More... | |
IlInt | getNewItemDataSourceIndex () const |
Returns the data source index of the new item. More... | |
const IliValue & | getNewItemIdentifier () const |
Returns the identifier of the new item. More... | |
const char * | getNewItemLabel () const |
Returns the label of the new item. More... | |
const IliValue & | getNewItemParent () const |
Returns the parent identifier of the new item. More... | |
const char * | getParentColumnName (IlInt dsi) const |
Returns the parent item column name. More... | |
const char * | getPopupMenuModelName () const |
Returns the model that is used to create the item popup menu. More... | |
IlInt | getSelectedItemDataSourceIndex () const |
Returns the data source index of the selected item. More... | |
const IliValue & | getSelectedItemIdentifier () const |
Returns the identifier of the selected item. More... | |
IliDataSource * | getTreeDataSource (IlInt dsi) const |
Returns the data source for a tree. More... | |
IlInt | getTreeDataSourceCount () const |
Returns the data source count for a tree. More... | |
const char * | getTreeDataSourceName (IlInt dsi) const |
Returns the data source name for a tree. More... | |
IlBoolean | isConfirmOnDeleteRequired () const |
Returns IlTrue if the confirmation deletion is enabled. More... | |
IlBoolean | isItemDeletionEnabled () const |
Returns IlTrue if the items deletion is enabled. More... | |
IlBoolean | isItemDialogUsed () const |
Returns IlTrue if the item dialog is enabled. More... | |
IlBoolean | isItemEditionEnabled () const |
Returns IlTrue if the items editing is enabled. More... | |
IlBoolean | isItemInsertionEnabled () const |
Returns IlTrue if the items insertion is enabled. More... | |
IlBoolean | isItemPopupMenuUsed () const |
Returns IlTrue if the items popup menu is enabled. More... | |
IlBoolean | isItemsSorted () const |
Returns IlTrue if the items are sorted. More... | |
IlBoolean | isRecursiveDeletion () const |
Returns IlTrue if the recursive deletion is enabled. More... | |
virtual IlBoolean | onDeleteItem () |
Called when an item is deleted. | |
virtual IlBoolean | onEditItem () |
Called when an item is deleted. | |
virtual void | onIncoherentTreeData () |
Called when an error occurs during the building of the tree. | |
virtual IlBoolean | onInsertChildItem () |
Called when an child item is inserted. | |
virtual IlBoolean | onInsertSiblingItem () |
Called when a sibling item is inserted. | |
virtual void | refreshAll () |
Called to build and to display the tree. More... | |
void | removeErrorSink (IliErrorSink *sink) |
Removes an error sink from the tree gadget. More... | |
void | reportErrors (const IliErrorList &list) const |
Reports the errors that are contained in a list. More... | |
void | requireConfirmOnDelete (IlBoolean require) |
Enables/disables the deletion confirmation. More... | |
void | setBitmapColumnName (IlInt dsi, const char *name) |
Sets the bitmap item column name. More... | |
void | setErrorReporter (IliErrorReporter *reporter) |
Sets the error reporter. More... | |
void | setFormat (const IliFormat &fmt, IlInt dsi=-1) |
Sets the format used to display the item. More... | |
void | setIdentifierColumnName (IlInt dsi, const char *name) |
Sets the identifier item column name. More... | |
void | setItemDialogModelName (const char *name) |
Sets the model that is used to create the item dialog. More... | |
void | setLabelColumnName (IlInt dsi, const char *name) |
Sets the label item column name. More... | |
void | setModel (const char *name) |
Sets the model that is used to build the tree gadget data. More... | |
void | setModelName (const char *name) |
Sets the model that is used to build the tree gadget data. More... | |
void | setNewItemBitmap (const char *bitmap) |
Sets the bitmap of the new item. More... | |
void | setNewItemDataSourceIndex (IlInt dsi) |
Sets the data source index of the new item. More... | |
void | setNewItemIdentifier (const IliValue &id) |
Sets the identifier of the new item. More... | |
void | setNewItemLabel (const char *label) |
Sets the label of the new item. More... | |
void | setNewItemParent (const IliValue &id) |
Sets the parent identifier of the new item. More... | |
void | setParentColumnName (IlInt dsi, const char *name) |
Sets the parent item column name. More... | |
void | setPopupMenuModelName (const char *name) |
Sets the model that is used to create the item popup menu. More... | |
void | setRecursiveDeletion (IlBoolean enable) |
Enables/disables the recursive deletion. More... | |
void | setTreeDataSource (IlInt dsi, IliDataSource *ds) |
Sets a data source for a tree. More... | |
void | setTreeDataSourceCount (IlInt count) |
Sets the data source count for a tree. More... | |
void | setTreeDataSourceName (IlInt dsi, const char *name) |
Sets a data source name for a tree. More... | |
void | sortItems (IlBoolean enable) |
Enables/disables the items sort. More... | |
void | thereIsIncoherentTreeData () |
Called to indicate that the tree is not valid. | |
virtual void | treeRowChanged (IlInt dsi, IlInt rowno) |
Called immediately after a row has been changed. More... | |
virtual void | treeRowDeleted (IlInt dsi, IlInt rowno) |
Called immediately after a row has been deleted. More... | |
virtual void | treeRowFetched (IlInt dsi, IlInt rowno) |
Called immediately after a new row has been fetched from a remote database and inserted. More... | |
virtual void | treeRowInserted (IlInt dsi, IlInt rowno) |
Called immediately after a new row has been inserted. More... | |
virtual void | treeRowMoved (IlInt dsi, IlInt from, IlInt to) |
Called immediately after a row has been moved. More... | |
virtual void | treeRowToBeChanged (IlInt dsi, IlInt rowno) |
Called just before a row is changed. More... | |
virtual void | treeRowToBeDeleted (IlInt dsi, IlInt rowno) |
Called just before a row is deleted. More... | |
virtual void | treeTableChanged (IlInt dsi) |
Called when the object has undergone a significant number of changes. More... | |
virtual void | treeTableDeleted (IlInt dsi) |
Called when the schema or the table of the gadget data source is deleted. More... | |
void | useItemDialog (IlBoolean enable) |
Enables/disables the item dialog. More... | |
void | useItemPopupMenu (IlBoolean enable) |
Enables/disables the items popup menu. More... | |
Static Public Member Functions | |
static IlvSymbol * | DeleteItemSymbol () |
Returns the name of the callback that will be called by the virtual onDeleteItem function. More... | |
static IlvSymbol * | EditItemSymbol () |
Returns the name of the callback that will be called by the virtual onEditItem function. More... | |
static IlvSymbol * | IncoherentTreeDataSymbol () |
Returns the name of the callback that will be called by the virtual onIncoherentTreeData function. More... | |
static IlvSymbol * | InsertChildItemSymbol () |
Returns the name of the callback that will be called by the virtual onInsertChildItem function. More... | |
static IlvSymbol * | InsertSiblingItemSymbol () |
Returns the name of the callback that will be called by the virtual onInsertSiblingItem function. More... | |
Friends | |
class | IliDbTreePopupMenuModel |
Gadget class.
Library: dbgadget
The IliDbTreeGadget
class defines a tree gadget that works with a data source or several data sources (depending on the model). This gadget displays the links between the children and their parents. Each data source row defines a tree gadget item. To define a tree gadget, you have four columns:
null
, the identifier is used as the label. To provide the data to the tree gadget, you can use the following models:
IliDbTreeRecursiveModel
)-All items of the tree gadget are defined by only one data source. IliDbTreeStructuralModel
)-Each tree gadget level has its own data source with its columns. The Parent column is not used for the first level.About child - parent Each child has only one parent, but a parent may have several children. If there is not a root parent (a parent that is not in the children list), the tree gadget displays nothing. If there is a circular relation, it is broken. When an error occurs, the callback defined for the IncoherentTreeDataSymbol
symbol is called.
IliDbTreeGadget::IliDbTreeGadget | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
This constructor creates a tree gadget that can be connected to a set of data sources.
display | The display. |
rect | The location. |
thickness | The border thickness. |
palette | The palette. |
void IliDbTreeGadget::addErrorSink | ( | IliErrorSink * | sink | ) |
Adds an error sink.
All errors that occur on the tree gadget will be forwarded to this error sink. Note that the tree gadget will not delete the error sink at destruction time, so the same error sink can be shared safely by many tree gadgets.
sink | The error sink. |
|
static |
Returns the name of the callback that will be called by the virtual onDeleteItem
function.
|
static |
Returns the name of the callback that will be called by the virtual onEditItem
function.
void IliDbTreeGadget::enableItemDeletion | ( | IlBoolean | enable | ) |
Enables/disables the items deletion.
enable | If IlTrue the items deletion is enabled. |
void IliDbTreeGadget::enableItemEdition | ( | IlBoolean | enable | ) |
Enables/disables the items editing.
enable | If IlTrue the items editing is enabled. |
void IliDbTreeGadget::enableItemInsertion | ( | IlBoolean | enable | ) |
Enables/disables the items insertion.
enable | If IlTrue the items insertion is enabled. |
const char* IliDbTreeGadget::getBitmapColumnName | ( | IlInt | dsi | ) | const |
Returns the bitmap item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
IlInt IliDbTreeGadget::getDeletedItemDataSourceIndex | ( | ) | const |
Returns the data source index of the deleted item.
const IliValue& IliDbTreeGadget::getDeletedItemIdentifier | ( | ) | const |
Returns the identifier of the deleted item.
IliErrorReporter* IliDbTreeGadget::getErrorReporter | ( | ) | const |
Returns the error reporter that is used by reportErrors
member function.
Initially, this property is NULL
.
NULL
, a default error reporter is used. Returns the format used to display the item.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
const char* IliDbTreeGadget::getIdentifierColumnName | ( | IlInt | dsi | ) | const |
Returns the identifier item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
IlInt IliDbTreeGadget::getItemDataSourceIndex | ( | IlvTreeGadgetItem * | ) | const |
Returns the data source index of the item.
const char* IliDbTreeGadget::getItemDialogModelName | ( | ) | const |
Returns the model that is used to create the item dialog.
IlInt IliDbTreeGadget::getItemRowIndex | ( | IlvTreeGadgetItem * | ) | const |
Returns the row index of the item.
const char* IliDbTreeGadget::getLabelColumnName | ( | IlInt | dsi | ) | const |
Returns the label item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
const char* IliDbTreeGadget::getModel | ( | ) | const |
Returns the model that is used to build the tree gadget data.
Obsolete function
const char* IliDbTreeGadget::getModelName | ( | ) | const |
Returns the model that is used to build the tree gadget data.
const char* IliDbTreeGadget::getNewItemBitmap | ( | ) | const |
Returns the bitmap of the new item.
IlInt IliDbTreeGadget::getNewItemDataSourceIndex | ( | ) | const |
Returns the data source index of the new item.
const IliValue& IliDbTreeGadget::getNewItemIdentifier | ( | ) | const |
Returns the identifier of the new item.
const char* IliDbTreeGadget::getNewItemLabel | ( | ) | const |
Returns the label of the new item.
const IliValue& IliDbTreeGadget::getNewItemParent | ( | ) | const |
Returns the parent identifier of the new item.
const char* IliDbTreeGadget::getParentColumnName | ( | IlInt | dsi | ) | const |
Returns the parent item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
const char* IliDbTreeGadget::getPopupMenuModelName | ( | ) | const |
Returns the model that is used to create the item popup menu.
IlInt IliDbTreeGadget::getSelectedItemDataSourceIndex | ( | ) | const |
Returns the data source index of the selected item.
const IliValue& IliDbTreeGadget::getSelectedItemIdentifier | ( | ) | const |
Returns the identifier of the selected item.
IliDataSource* IliDbTreeGadget::getTreeDataSource | ( | IlInt | dsi | ) | const |
Returns the data source for a tree.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
IlInt IliDbTreeGadget::getTreeDataSourceCount | ( | ) | const |
Returns the data source count for a tree.
const char* IliDbTreeGadget::getTreeDataSourceName | ( | IlInt | dsi | ) | const |
Returns the data source name for a tree.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
|
static |
Returns the name of the callback that will be called by the virtual onIncoherentTreeData
function.
|
static |
Returns the name of the callback that will be called by the virtual onInsertChildItem
function.
|
static |
Returns the name of the callback that will be called by the virtual onInsertSiblingItem
function.
IlBoolean IliDbTreeGadget::isConfirmOnDeleteRequired | ( | ) | const |
Returns IlTrue
if the confirmation deletion is enabled.
IlTrue
if the confirmation deletion is enabled. IlBoolean IliDbTreeGadget::isItemDeletionEnabled | ( | ) | const |
Returns IlTrue
if the items deletion is enabled.
IlTrue
if the items deletion is enabled. IlBoolean IliDbTreeGadget::isItemDialogUsed | ( | ) | const |
Returns IlTrue
if the item dialog is enabled.
IlTrue
if the item dialog is enabled. IlBoolean IliDbTreeGadget::isItemEditionEnabled | ( | ) | const |
Returns IlTrue
if the items editing is enabled.
IlTrue
if the items editing is enabled. IlBoolean IliDbTreeGadget::isItemInsertionEnabled | ( | ) | const |
Returns IlTrue
if the items insertion is enabled.
IlTrue
if the items insertion is enabled. IlBoolean IliDbTreeGadget::isItemPopupMenuUsed | ( | ) | const |
Returns IlTrue
if the items popup menu is enabled.
IlTrue
if the items popup menu is enabled. IlBoolean IliDbTreeGadget::isItemsSorted | ( | ) | const |
Returns IlTrue
if the items are sorted.
IlTrue
if the items are sorted. IlBoolean IliDbTreeGadget::isRecursiveDeletion | ( | ) | const |
Returns IlTrue
if the recursive deletion is enabled.
IlTrue
if the recursive deletion is enabled.
|
virtual |
Called to build and to display the tree.
If the tree is not valid, it calls the onIncoherentTreeData
function.
void IliDbTreeGadget::removeErrorSink | ( | IliErrorSink * | sink | ) |
Removes an error sink from the tree gadget.
sink | The error sink. |
void IliDbTreeGadget::reportErrors | ( | const IliErrorList & | list | ) | const |
Reports the errors that are contained in a list.
This member function makes use of the error reporter returned by getErrorReporter
, if any. Otherwise, it uses a default error reporter.
list | The error list. |
void IliDbTreeGadget::requireConfirmOnDelete | ( | IlBoolean | require | ) |
Enables/disables the deletion confirmation.
require | If IlTrue the deletion confirmation is enabled. |
void IliDbTreeGadget::setBitmapColumnName | ( | IlInt | dsi, |
const char * | name | ||
) |
Sets the bitmap item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
name | The column name. |
void IliDbTreeGadget::setErrorReporter | ( | IliErrorReporter * | reporter | ) |
Sets the error reporter.
Note that the tree gadget will not delete the error reporter at destruction time, so the same error reporter can be shared safely by many tree gadgets.
reporter | The error reporter. |
Sets the format used to display the item.
fmt | The format. |
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 .If the dsi parameter is equal to -1 , the format is applied to all levels. |
void IliDbTreeGadget::setIdentifierColumnName | ( | IlInt | dsi, |
const char * | name | ||
) |
Sets the identifier item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
name | The column name. |
void IliDbTreeGadget::setItemDialogModelName | ( | const char * | name | ) |
Sets the model that is used to create the item dialog.
name | The model name. |
void IliDbTreeGadget::setLabelColumnName | ( | IlInt | dsi, |
const char * | name | ||
) |
Sets the label item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
name | The column name. |
void IliDbTreeGadget::setModel | ( | const char * | name | ) |
Sets the model that is used to build the tree gadget data.
Obsolete function
name | The model name, the possible models are:
|
void IliDbTreeGadget::setModelName | ( | const char * | name | ) |
Sets the model that is used to build the tree gadget data.
name | The model name, the possible models are:
|
void IliDbTreeGadget::setNewItemBitmap | ( | const char * | bitmap | ) |
Sets the bitmap of the new item.
bitmap | The bitmap file name. |
void IliDbTreeGadget::setNewItemDataSourceIndex | ( | IlInt | dsi | ) |
Sets the data source index of the new item.
dsi | The data source index. |
void IliDbTreeGadget::setNewItemIdentifier | ( | const IliValue & | id | ) |
Sets the identifier of the new item.
id | The identifier. |
void IliDbTreeGadget::setNewItemLabel | ( | const char * | label | ) |
Sets the label of the new item.
label | The label. |
void IliDbTreeGadget::setNewItemParent | ( | const IliValue & | id | ) |
Sets the parent identifier of the new item.
id | The parent identifier. |
void IliDbTreeGadget::setParentColumnName | ( | IlInt | dsi, |
const char * | name | ||
) |
Sets the parent item column name.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
name | The column name. |
void IliDbTreeGadget::setPopupMenuModelName | ( | const char * | name | ) |
Sets the model that is used to create the item popup menu.
name | The model name. |
void IliDbTreeGadget::setRecursiveDeletion | ( | IlBoolean | enable | ) |
Enables/disables the recursive deletion.
enable | If IlTrue the recursive deletion is enabled. |
void IliDbTreeGadget::setTreeDataSource | ( | IlInt | dsi, |
IliDataSource * | ds | ||
) |
Sets a data source for a tree.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
ds | The data source. |
void IliDbTreeGadget::setTreeDataSourceCount | ( | IlInt | count | ) |
Sets the data source count for a tree.
count | The data source count. |
void IliDbTreeGadget::setTreeDataSourceName | ( | IlInt | dsi, |
const char * | name | ||
) |
Sets a data source name for a tree.
dsi | The tree level (starting at 0). If the model is recursive, the value must be 0 . |
name | The data source name. |
void IliDbTreeGadget::sortItems | ( | IlBoolean | enable | ) |
Enables/disables the items sort.
enable | If IlTrue the items are sorted. |
Called immediately after a row has been changed.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
Called immediately after a row has been deleted.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
Called immediately after a new row has been fetched from a remote database and inserted.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
Called immediately after a new row has been inserted.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
Called immediately after a row has been moved.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
from | The source row position. |
to | The destination row position. |
Called just before a row is changed.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
Called just before a row is deleted.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
rowno | The row position. |
|
virtual |
Called when the object has undergone a significant number of changes.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
|
virtual |
Called when the schema or the table of the gadget data source is deleted.
dsi | The tree level or data source index (starting at 0). If the model is IliDbTreeRecursiveModel , the value is always 0 . |
void IliDbTreeGadget::useItemDialog | ( | IlBoolean | enable | ) |
Enables/disables the item dialog.
enable | If IlTrue the item dialog is enabled. |
void IliDbTreeGadget::useItemPopupMenu | ( | IlBoolean | enable | ) |
Enables/disables the items popup menu.
enable | If IlTrue the items popup menu is enabled. |
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.