|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataBook
The IDataBook
is a storage independent representation of table and
handles all the operations to load, save and change the data.
An IDataBook
does have at least one IDataPage
which then
holds all the IDataRow
s.
If the IDataBook
has an associated master, the current
IDataPage
is selected according to the selection in the master
databook.
The IDataBook
also implements the IChangeableDataRow
, which
means that the databook is always its own currently selected IDataRow
.
IDataPage
,
IRowDefinition
,
IChangeableDataRow
,
IDataSource
Nested Class Summary | |
---|---|
static class |
IDataBook.SelectionMode
The IDataBook.SelectionMode specifies which row should be selected after a
reload or after the master row has changed. |
static class |
IDataBook.WriteBackIsolationLevel
The IDataBook.WriteBackIsolationLevel specifies when the changes in the
IDataBook will be (implicitly) saved. |
Method Summary | |
---|---|
void |
addDetailDataBook(IDataBook pDataBook)
Registers the given IDataBook as a detail IDataBook . |
void |
close()
Closes this IDataBook . |
void |
delete()
Deletes the currently selected row. |
void |
deleteAllDataRows()
Deprecated. since 2.5, use deleteAllRows() instead. |
void |
deleteAllRows()
Deletes all IDataRow s which are currently available, it is the
same as delete() except that it is a mass operation on all rows. |
DataBookHandler |
eventAfterColumnSelected()
Gets the DataBookHandler for after column selected event. |
DataBookHandler |
eventAfterDeleted()
Gets the DataBookHandler for after deleted event. |
DataBookHandler |
eventAfterDeleting()
Gets the DataBookHandler for after deleting event. |
DataBookHandler |
eventAfterFilterChanged()
Gets the DataBookHandler for after filter changed event. |
DataBookHandler |
eventAfterInserted()
Gets the DataBookHandler for after inserted event. |
DataBookHandler |
eventAfterInserting()
Gets the DataBookHandler for after inserting event. |
DataBookHandler |
eventAfterReload()
Gets the DataBookHandler for after reload event. |
DataBookHandler |
eventAfterRestore()
Gets the DataBookHandler for after restore event. |
DataBookHandler |
eventAfterRowSelected()
Gets the DataBookHandler for after row selected event. |
DataBookHandler |
eventAfterSortChanged()
Gets the DataBookHandler for after sort changed event. |
DataBookHandler |
eventAfterUpdated()
Gets the DataBookHandler for after updated event. |
DataBookHandler |
eventAfterUpdating()
Gets the DataBookHandler for after updating event. |
DataBookHandler |
eventBeforeColumnSelected()
Gets the DataBookHandler for before column selected event. |
DataBookHandler |
eventBeforeDeleted()
Gets the DataBookHandler for before deleted event. |
DataBookHandler |
eventBeforeDeleting()
Gets the DataBookHandler for before deleting event. |
DataBookHandler |
eventBeforeFilterChanged()
Gets the DataBookHandler for before filter changed event. |
DataBookHandler |
eventBeforeInserted()
Gets the DataBookHandler for before inserted event. |
DataBookHandler |
eventBeforeInserting()
Gets the DataBookHandler for before inserting event. |
DataBookHandler |
eventBeforeReload()
Gets the DataBookHandler for before reload event. |
DataBookHandler |
eventBeforeRestore()
Gets the DataBookHandler for before restore event. |
DataBookHandler |
eventBeforeRowSelected()
Gets the DataBookHandler for before row selected event. |
DataBookHandler |
eventBeforeSortChanged()
Gets the DataBookHandler for before sort changed event. |
DataBookHandler |
eventBeforeUpdated()
Gets the DataBookHandler for before updated event. |
DataBookHandler |
eventBeforeUpdating()
Gets the DataBookHandler for before updating event. |
IDataRow |
getAdditionalDataRow()
Returns the additional data row. |
IDataPage |
getDataPage(IDataRow pMasterRow)
Returns the corresponding IDataPage to specified master row
from the master DataBook . |
IDataPage |
getDataPage(IDataRow pRootRow,
TreePath pTreePath)
Gets the IDataPage for the given TreePath and the given
root row . |
IDataPage |
getDataPage(TreePath pTreePath)
Gets the IDataPage for the given TreePath . |
IDataPage |
getDataPageWithRootRow(IDataRow pRootRow)
Returns the corresponding IDataPage to specified root row
from the root DataBook . |
IDataSource |
getDataSource()
Gets the IDataSource that is used. |
IDataBook[] |
getDetailDataBooks()
Gets all detail IDataBook s as array. |
ICondition |
getFilter()
Gets the used filter . |
ReferenceDefinition |
getMasterReference()
Gets the master reference that is used. |
java.lang.String |
getName()
Gets the name that is used. |
IReadOnlyChecker |
getReadOnlyChecker()
Gets the IReadOnlyChecker . |
IDataBook |
getRootDataBook()
Gets the root data book. |
ReferenceDefinition |
getRootReference()
Gets the tree root reference. |
IRowCalculator |
getRowCalculator()
Gets the IRowCalculator . |
java.lang.String |
getSelectedColumn()
Gets the name of the selected column. |
int |
getSelectedDataPageRow()
Returns the selected row index relatively to the current IDataPage . |
int |
getSelectedRow()
Gets the index of the selected row. |
IDataBook.SelectionMode |
getSelectionMode()
Gets the IDataBook.SelectionMode that is used. |
SortDefinition |
getSort()
Gets the used SortDefinition . |
TreePath |
getTreePath()
Gets the tree current tree path. |
IDataBook.WriteBackIsolationLevel |
getWritebackIsolationLevel()
Gets the IDataBook.WriteBackIsolationLevel that is used. |
boolean |
hasDataPage(IDataRow pMasterDataRow)
Returns true if an IDataPage to specified master row from
the master DataBook exists. |
int |
insert(boolean pBeforeRow)
Inserts a new IDataRow at the current position. |
boolean |
isAdditionalDataRowVisible()
True, if the additional data row is visible. |
boolean |
isDeleteAllowed()
Gets if it is possible to delete an already existing
row. |
boolean |
isDeleteCascade()
Gets if a delete on a master IDataBook should also delete all
rows associated with the master row in this IDataBook . |
boolean |
isDeleteEnabled()
Gets if deleting a row is enabled. |
boolean |
isInsertAllowed()
Gets if it is possible to insert(boolean) a new row. |
boolean |
isInsertEnabled()
Gets if inserting is enabled. |
boolean |
isOpen()
Gets if this IDataBook is open. |
boolean |
isOutOfSync()
Gets if this IDataBook is out of sync with its master. |
boolean |
isReadOnly()
Gets if this IDataBook is read only. |
boolean |
isSelfJoined()
Gets if this IDataBook has been joined with itself. |
boolean |
isUpdateAllowed()
Gets if it is possible to update an
already existing row. |
boolean |
isUpdateEnabled()
Gets if IDataRow.setValue(String, Object) updating a row is enabled. |
void |
notifyDetailChanged()
Notifies the master IDataBook that one or more detail rows have
changed. |
void |
notifyMasterChanged()
Notifies this IDataBook that its master IDataBook has
changed. |
void |
open()
Opens this IDataBook . |
void |
reload()
Reloads all rows from the storage, any changes are discarded. |
void |
reload(IDataBook.SelectionMode pSelectionMode)
Reloads all rows from the storage (any changes are discarded) and applies the given IDataBook.SelectionMode to this reload operation. |
void |
removeDataPage(IDataRow pMasterDataRow,
TreePath pTreePath)
Removes the DataPage to the specified master DataRow or TreePath. e.g. |
void |
removeDetailDataBook(IDataBook pDataBook)
Unregisters the given IDataBook as a detail IDataBook . |
void |
restoreAllRows()
Restores all rows to a state without changes. |
void |
restoreSelectedRow()
Restores the currently selected row to a state without changes. |
void |
saveAllRows()
Saves all IDataRow s which have been changed, it is the same as
saveSelectedRow() except that it is a mass operation on all
rows. |
void |
saveDataPage()
Saves all rows in the current DataPage. |
void |
saveSelectedRow()
Saves the currently selected row. |
void |
setAdditionalDataRowVisible(boolean pVisible)
Set true, if the additional data row is visible. |
void |
setDataSource(IDataSource pDataSource)
Sets the IDataSource to use, which allows the IDataBook
to retrieve and set data. |
void |
setDeleteCascade(boolean pDeleteCascade)
Sets if a delete on a master IDataBook should also delete all
rows associated with the master row in this IDataBook . |
void |
setDeleteEnabled(boolean pDeleteEnabled)
Sets if deleting a row is enabled. |
void |
setFilter(ICondition pFilter)
Sets the filter that is used. |
void |
setInsertEnabled(boolean pInsertEnabled)
Sets if inserting is enabled. |
void |
setMasterReference(ReferenceDefinition pReferenceDefinitionToMasterBook)
Sets the master reference that is going to be
used. |
void |
setName(java.lang.String pName)
Sets the name to use. |
void |
setReadOnly(boolean pReadOnlyEnabled)
Sets if this IDataBook is read only. |
void |
setReadOnlyChecker(IReadOnlyChecker pReadOnlyChecker)
Sets the IReadOnlyChecker . |
void |
setRootReference(ReferenceDefinition pReferenceDefinition)
Sets the tree root reference. |
void |
setRowCalculator(IRowCalculator pRowCalculator)
Sets the IRowCalculator . |
void |
setRowDefinition(IRowDefinition pRowDefinition)
Sets the RowDefinition to use. |
void |
setSelectedColumn(java.lang.String pSelectedColumn)
Sets the selected column based on the given name. |
void |
setSelectedDataPageRow(int pDataRowIndex)
Sets the selected row index relatively to the current IDataPage . |
void |
setSelectedRow(int pDataRowIndex)
Sets the selected IDataRow to the given index. |
void |
setSelectionMode(IDataBook.SelectionMode pSelectionMode)
Sets the IDataBook.SelectionMode that should be used. |
void |
setSort(SortDefinition pSort)
Sets the SortDefinition that is used. |
void |
setTreePath(TreePath pTreePath)
Sets the tree current tree path. |
void |
setUpdateEnabled(boolean pUpdateEnabled)
Sets if IDataRow.setValue(String, Object) updating a row is enabled. |
void |
setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
Sets the IDataBook.WriteBackIsolationLevel to use. |
void |
update()
Sets the currently selected row as "updating". |
Methods inherited from interface javax.rad.model.IChangeableDataRow |
---|
getDataPage, getOriginalDataRow, getOriginalRow, getRowIndex, getUID, isDeleting, isDetailChanged, isInserting, isUpdating, isWritableColumnChanged |
Methods inherited from interface javax.rad.model.IDataRow |
---|
addControl, cancelEditingControls, compareTo, createDataRow, createEmptyDataRow, createEmptyRow, equals, eventValuesChanged, eventValuesChanged, getControls, getRowDefinition, getValue, getValue, getValueAsString, getValues, getValuesAsString, notifyRepaintControls, removeControl, saveEditingControls, setValue, setValues |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface javax.rad.model.IDataPage |
---|
fetchAll, getChangedDataRows, getChangedRows, getDataBook, getDataRow, getMasterDataRow, getRowCount, isAllFetched, searchNext, searchNext, searchPrevious, searchPrevious |
Method Detail |
---|
void setRowDefinition(IRowDefinition pRowDefinition) throws ModelException
RowDefinition
to use.
The IRowDefinition
contains all the information about the columns
and it can only be set if the IDataBook
is not already
open
.
pRowDefinition
- the RowDefinition
to use.
ModelException
- if the IDataBook
is already
open
.IDataRow.getRowDefinition()
,
IRowDefinition
void setDataSource(IDataSource pDataSource) throws ModelException
IDataSource
to use, which allows the IDataBook
to retrieve and set data.
The IDataSource
can only be set if the IDataBook
is not
already open
.
pDataSource
- the IDataSource
to use.
ModelException
- if the IDataBook
is already
open
.getDataSource()
,
IDataSource
IDataSource getDataSource()
IDataSource
that is used.
IDataSource
that is used.setDataSource(IDataSource)
,
IDataSource
void setName(java.lang.String pName) throws ModelException
The name can only be set if the IDataBook
is not already
open
.
setName
in interface INamedObject
pName
- the name to use.
ModelException
- if the IDataBook
is already
open
.getName()
java.lang.String getName()
getName
in interface INamedObject
setName(String)
void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel) throws ModelException
IDataBook.WriteBackIsolationLevel
to use.
The default value should be IDataBook.WriteBackIsolationLevel.DATA_ROW
.
pIsolationLevel
- the IDataBook.WriteBackIsolationLevel
to use.
ModelException
- if setting DATAROW level fails, because saveAllRows fails.getWritebackIsolationLevel()
,
IDataBook.WriteBackIsolationLevel
IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
IDataBook.WriteBackIsolationLevel
that is used.
The default value should be IDataBook.WriteBackIsolationLevel.DATA_ROW
.
IDataBook.WriteBackIsolationLevel
that is used.setWritebackIsolationLevel(WriteBackIsolationLevel)
,
IDataBook.WriteBackIsolationLevel
void setMasterReference(ReferenceDefinition pReferenceDefinitionToMasterBook) throws ModelException
master reference
that is going to be
used.
The master reference
defines that this
IDataBook
is a detail of the defined master. If the masters
selection changes, the current IDataPage
will change accordingly.
The master will also be notified if any change that occurs (like that a
row is inserted
/ updated
/
deleted
.
The master reference
can only be set if the
IDataBook
is not already open
.
pReferenceDefinitionToMasterBook
- the master reference
that is going to be used.
ModelException
- if the IDataBook
is already
open
.getMasterReference()
,
ReferenceDefinition
ReferenceDefinition getMasterReference()
master reference
that is used.
The master reference
defines that this
IDataBook
is a detail of the defined master. If the masters
selection changes, the current IDataPage
will change accordingly.
master reference
that is used.boolean isSelfJoined()
IDataBook
has been joined with itself.
true
if this IDataBook
has been joined with
itself.IDataPage getDataPage(TreePath pTreePath) throws ModelException
IDataPage
for the given TreePath
.
pTreePath
- the TreePath
.
IDataPage
for the given TreePath
.
ModelException
- if the pRootRow or pTreePath don't contains the
master columns from the master
ReferenceDefinition
IDataPage getDataPage(IDataRow pRootRow, TreePath pTreePath) throws ModelException
IDataPage
for the given TreePath
and the given
root row
.
pRootRow
- the root row
.pTreePath
- the TreePath
.
IDataPage
for the given TreePath
and
root row
.
ModelException
- if the pRootRow or pTreePath don't contains the
master columns from the master
ReferenceDefinition
IDataPage getDataPageWithRootRow(IDataRow pRootRow) throws ModelException
IDataPage
to specified root row
from the root DataBook
. If it doesn't exists, it will be
created and returned.
pRootRow
- the root IDataRow
of the root
DataBook
.
IDataPage
to specified master row
from the master DataBook
.
ModelException
- if the pRootRow don't contains the master columns
from the master ReferenceDefinition
ReferenceDefinition getRootReference()
IDataBook getRootDataBook()
void setRootReference(ReferenceDefinition pReferenceDefinition) throws ModelException
pReferenceDefinition
- the tree root reference.
ModelException
- if the IDataBook
is openTreePath getTreePath()
void setTreePath(TreePath pTreePath) throws ModelException
pTreePath
- the tree root reference.
ModelException
- if the IDataBook
is openIDataPage getDataPage(IDataRow pMasterRow) throws ModelException
IDataPage
to specified master row
from the master DataBook
. If it doesn't exists, it will be
created and returned.
pMasterRow
- the master IDataRow
of the master
DataBook
.
IDataPage
to specified master row
from the master DataBook
.
ModelException
- if the pMasterRow don't contains the master
columns from the master ReferenceDefinition
boolean hasDataPage(IDataRow pMasterDataRow) throws ModelException
IDataPage
to specified master row from
the master DataBook
exists.
pMasterDataRow
- the master IDataRow
of the master
DataBook
.
IDataPage
to specified master row from
the master DataBook
exists.
ModelException
- if the pMasterRow don't contains the master
columns from the master ReferenceDefinition
IDataBook.SelectionMode getSelectionMode()
IDataBook.SelectionMode
that is used.
IDataBook.SelectionMode
that is used.setSelectionMode(SelectionMode)
void setSelectionMode(IDataBook.SelectionMode pSelectionMode)
IDataBook.SelectionMode
that should be used.
pSelectionMode
- the IDataBook.SelectionMode
that should be used.getSelectionMode()
void setSelectedRow(int pDataRowIndex) throws ModelException
IDataRow
to the given index. If the given index
is less than zero or greater than the number of rows available, no row
will be selected (if there is already a row selected, it will be
unselected).
If the row at the given index is currently not in memory, it will be loaded from the storage.
Depending on the set IDataBook.WriteBackIsolationLevel
changing the
selection might save the previously selected row to the storage.
Before the selection is changed the
IControl.saveEditing()
method of all
registered IControl
s is invoked. Afterwards
the eventBeforeRowSelected()
and
eventAfterRowSelected()
events are fired in this order. The last
action is that the IControl.notifyRepaint()
method of all registered IControl
s is invoked.
pDataRowIndex
- the index of the IDataRow
to select. If it
is less than zero or greater than the number of rows
available, no row will be selected and an eventually already
selected row will be unselected.
ModelException
- if the IDataBook
is not open
or if the IDataRow
at the given index could not
be fetched from the storage or if the master
IDataBook
does not have a selected row or if the
synchronization with the master failed.getSelectedRow()
int getSelectedRow() throws ModelException
The index might -1
if there is no row selected or if this
IDataBook
is not isOpen()
.
-1
if there is none
selected or the IDataBook
is not open
.
ModelException
- if the synchronization with the master failed.setSelectedRow(int)
void setSelectedColumn(java.lang.String pSelectedColumn) throws ModelException
If the given column name is null
no column is selected (if there
is already a row selected, it will be unselected).
Before the selection changes the eventBeforeColumnSelected()
is
fired and afterwards the eventAfterColumnSelected()
is fired.
pSelectedColumn
- the name of the column to select, can be
null
to remove the selection (if any).
ModelException
- if the IDataBook
is not open
or if there is no column with the given name or if
synchronization with the master failed.getSelectedColumn()
java.lang.String getSelectedColumn() throws ModelException
The returned name might be null
if there is no column selected.
null
if there is none
selected.
ModelException
- if the synchronization with the master failed.setSelectedColumn(String)
void setDeleteCascade(boolean pDeleteCascade)
IDataBook
should also delete all
rows associated with the master row in this IDataBook
.
pDeleteCascade
- true
if the rows in this IDataBook
should be deleted if the master row is deleted.isDeleteCascade()
boolean isDeleteCascade()
IDataBook
should also delete all
rows associated with the master row in this IDataBook
.
true
if the rows in this IDataBook
should be
deleted if the master row is deleted.setDeleteCascade(boolean)
boolean isInsertAllowed() throws ModelException
insert(boolean)
a new row.
An insert might not be possible if it is either disabled
or if the storage does not allow an insert.
true
if it is possible to insert(boolean)
a row.
ModelException
- if the state could not be determined.isInsertEnabled()
,
setInsertEnabled(boolean)
boolean isInsertEnabled() throws ModelException
inserting
is enabled.
true
if inserting
is enabled.
ModelException
- if the state could not be determined.isInsertAllowed()
,
setInsertEnabled(boolean)
void setInsertEnabled(boolean pInsertEnabled)
inserting
is enabled.
pInsertEnabled
- true
if inserting
is enabled.isInsertAllowed()
,
isInsertEnabled()
boolean isUpdateAllowed() throws ModelException
update
an
already existing row.
An update might not be possible of the it is either
disabled
, no no row
is selected
or if the storage does not allow an update.
true
if it is possible to
update
a row.
ModelException
- if the state could not be determined.isUpdateEnabled()
,
setUpdateEnabled(boolean)
boolean isUpdateEnabled() throws ModelException
IDataRow.setValue(String, Object)
updating a row is enabled.
true
if IDataRow.setValue(String, Object)
updating a row
is enabled.
ModelException
- if the state could not be determined.isUpdateAllowed()
,
setUpdateEnabled(boolean)
void setUpdateEnabled(boolean pUpdateEnabled)
IDataRow.setValue(String, Object)
updating a row is enabled.
pUpdateEnabled
- true
if IDataRow.setValue(String, Object)
updating a row is enabled.isUpdateAllowed()
,
isUpdateEnabled()
boolean isDeleteAllowed() throws ModelException
delete
an already existing
row.
A delete might not be possible of the it is either
disabled
, no no row
is selected
or if the storage does not allow a delete.
true
if it is possible to delete
a row.
ModelException
- if the state could not be determined.isDeleteEnabled()
,
setDeleteEnabled(boolean)
boolean isDeleteEnabled() throws ModelException
deleting
a row is enabled.
true
if deleting
a row is enabled.
ModelException
- if the state could not be determined.isDeleteAllowed()
,
setDeleteCascade(boolean)
void setDeleteEnabled(boolean pDeleteEnabled)
deleting
a row is enabled.
pDeleteEnabled
- true
if deleting
a row is
enabled.isDeleteAllowed()
,
isDeleteEnabled()
boolean isReadOnly()
IDataBook
is read only.
true
this IDataBook
is read only.setReadOnly(boolean)
void setReadOnly(boolean pReadOnlyEnabled) throws ModelException
IDataBook
is read only.
If there are changes and the IDataBook
is set to read only, the
changed data is saved.
pReadOnlyEnabled
- true
if this IDataBook
is read
only.
ModelException
- if saving any changes failed.isReadOnly()
boolean isOpen()
IDataBook
is open.
true
if this IDataBook
is open.open()
void open() throws ModelException
IDataBook
.
"Open" means that all actions are performed which are needed to deliver
data to the user, an IDataBook
that is open can be used for
querying and changing data.
Implementations should perform all needed set up work in this method (like reading metadata from the storage).
ModelException
- if there is no name
set, or if
there is no column in the row
definition
, or if there is no getDataSource()
set.void close()
IDataBook
.
A closed IDataBook
has the same state as an not
open
IDataBook
. It can't be used to
query or change data, but it can be reopened
.
Implementations should performs all clean up in this method and the (cached) data can be discarded at this point.
int insert(boolean pBeforeRow) throws ModelException
IDataRow
at the current position. If there is
currently no IDataRow
is selected the row will be inserted at the
beginning. After this operation the new IDataRow
will be
selected.
Note that this is an selected row
changing
operation.
The following events are fired in the following order:
IControl.saveEditing()
is invoked on all
registered IControl
s.eventBeforeInserting()
eventAfterInserting()
eventAfterRowSelected()
IControl.notifyRepaint()
is invoked on all
registered IControl
s.
pBeforeRow
- if the new row should be inserted before the current
selection.
ModelException
- if the IDataBook
is not open
, or if saving of already existing changes failed, or if
isInsertAllowed()
is disabled, or if saving the row
to the storage failed.void update() throws ModelException
value is set
. If there
is no row selected a ModelException
is thrown.
The storage might want to reload and eventually lock the row that is being updated.
Before the update is executed the eventBeforeUpdating()
is fired
and afterwards the eventAfterUpdating()
is fired.
ModelException
- if the IDataBook
is not open
, or if isUpdateAllowed()
is disabled (for
example no row is selected), or if there was an error when
setting the state.void delete() throws ModelException
ModelException
is thrown. It deletes the selected.
Before the delete is executed the eventBeforeDeleting()
is fired
and afterwards the eventAfterDeleting()
is fired. As the row has
been deleted at that point, the selected row
is changed to the next row.
ModelException
- if the IDataBook
is not open
, or if isDeleteAllowed()
is disabled (for
example no row is selected), or if there was an error when
setting the state.void notifyDetailChanged()
IDataBook
that one or more detail rows have
changed.
void saveSelectedRow() throws ModelException
Depending on the state of the row, either eventBeforeInserted()
/
eventAfterInserted()
, eventBeforeUpdated()
/
eventAfterUpdated()
or eventBeforeDeleted()
/
eventAfterDeleted()
are fired. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
ModelException
- if the IDataBook
is not open
or if the changes could not be saved.saveAllRows()
void restoreSelectedRow() throws ModelException
"Restoring" means that all changes made by the user are reverted, if this
IDataBook
is backed by a database it would mean to refetch the
row.
Before the restore the eventBeforeRestore()
is fired and
afterwards the eventAfterRestore()
is fired. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
ModelException
- if the IDataBook
is not open
or if the row could not be restored.restoreAllRows()
void restoreAllRows() throws ModelException
"Restoring" means that all changes made by the user are reverted, if this
IDataBook
is backed by a database it would mean to refetch the
row.
Restoring all rows does restore all rows, including those which do not
match the currently set filter
.
Before the restore of each row the eventBeforeRestore()
is fired
and afterwards the eventAfterRestore()
is fired. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
ModelException
- if the IDataBook
is not open
or if the row could not be restored.restoreSelectedRow()
boolean isOutOfSync()
IDataBook
is out of sync with its master.
true
if this IDataBook
is out of sync with its
master.void reload() throws ModelException
If the backing instance is a database, it means that all data has to be refetched from the database.
Before the reload the IControl.cancelEditing()
of all registered IControl
s is invoked. After
that the eventBeforeReload()
is fired and afterwards the
eventAfterReload()
. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
ModelException
- if the IDataBook
is not open
or if the reload failed.reload(SelectionMode)
void reload(IDataBook.SelectionMode pSelectionMode) throws ModelException
IDataBook.SelectionMode
to this reload operation.
If the backing instance is a database, it means that all data has to be refetched from the database.
Before the reload the IControl.cancelEditing()
of all registered IControl
s is invoked. After
that the eventBeforeReload()
is fired and afterwards the
eventAfterReload()
. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
pSelectionMode
- the Selection mode to use
ModelException
- if the IDataBook
is not open
or if the reload failed.reload()
void setFilter(ICondition pFilter) throws ModelException
filter
that is used. If the given
filter
is null
no filter will be applied to
the data.
This call is schematically equal to reload()
with the exception
that changes are saved before the filter
is applied.
pFilter
- the filter
to apply.
ModelException
- if the IDataBook
is not open
or the data could not be reloaded.getFilter()
,
ICondition
ICondition getFilter()
filter
. Can be null
if none is
used or set.
filter
, null
if none used or
set.setFilter(ICondition)
,
ICondition
void setSort(SortDefinition pSort) throws ModelException
SortDefinition
that is used. The given
SortDefinition
can be null
for no sorting.
This is schematically equal top setFilter(ICondition)
.
pSort
- the SortDefinition
to use. Can be null
for
no sorting.
ModelException
- if the changes could not be stored.getSort()
,
SortDefinition
SortDefinition getSort()
SortDefinition
. Can be null
if there is
none set or used.
SortDefinition
, null
if there is none
set or used.setSort(SortDefinition)
,
SortDefinition
void addDetailDataBook(IDataBook pDataBook)
IDataBook
as a detail IDataBook
.
pDataBook
- the IDataBook
to register as a detail
IDataBook
.removeDetailDataBook(IDataBook)
,
getDetailDataBooks()
void removeDetailDataBook(IDataBook pDataBook)
IDataBook
as a detail IDataBook
.
pDataBook
- the IDataBook
to unregister as a detail
IDataBook
.addDetailDataBook(IDataBook)
,
getDetailDataBooks()
IDataBook[] getDetailDataBooks()
IDataBook
s as array. The returned array might be
empty if there are no detail IDataBook
s.
IDataBook
s as array, the array might be empty
if there are none.addDetailDataBook(IDataBook)
,
removeDetailDataBook(IDataBook)
void notifyMasterChanged()
IDataBook
that its master IDataBook
has
changed.
IRowCalculator getRowCalculator()
IRowCalculator
.
IRowCalculator
.void setRowCalculator(IRowCalculator pRowCalculator)
IRowCalculator
.
pRowCalculator
- the IRowCalculator
.IReadOnlyChecker getReadOnlyChecker()
IReadOnlyChecker
.
IReadOnlyChecker
.void setReadOnlyChecker(IReadOnlyChecker pReadOnlyChecker)
IReadOnlyChecker
.
pReadOnlyChecker
- the IReadOnlyChecker
..DataBookHandler eventBeforeRowSelected()
DataBookHandler
for before row selected event.
This event is fired before the selection of the
current row
changes.
This event fires every time the selection changes, not just if the selection is changed by the user.
DataBookHandler
for before row selected event.DataBookHandler eventAfterRowSelected()
DataBookHandler
for after row selected event.
This event is fired after the selection of the
current row
changes.
This event fires every time the selection changes, not just if the selection is changed by the user.
DataBookHandler
for after row selected event.DataBookHandler eventBeforeInserting()
DataBookHandler
for before inserting event.
This event is fired before a new row is inserted
.
DataBookHandler
for before inserting event.DataBookHandler eventAfterInserting()
DataBookHandler
for after inserting event.
This event is fired after a new row is inserted
.
DataBookHandler
for after inserting event.DataBookHandler eventBeforeInserted()
DataBookHandler
for before inserted event.
This event is fired before an inserted row
is
saved
.
DataBookHandler
for before inserted event.DataBookHandler eventAfterInserted()
DataBookHandler
for after inserted event.
This event is fired after an inserted row
is
saved
.
DataBookHandler
for after inserted event.DataBookHandler eventBeforeUpdating()
DataBookHandler
for before updating event.
This event is fired before a row is updated
.
DataBookHandler
for before updating event.DataBookHandler eventAfterUpdating()
DataBookHandler
for after updating event.
This event is fired after a row is updated
.
DataBookHandler
for after updating event.DataBookHandler eventBeforeUpdated()
DataBookHandler
for before updated event.
This event is fired before an updated row
is
saved
.
DataBookHandler
for before updated event.DataBookHandler eventAfterUpdated()
DataBookHandler
for after updated event.
This event is fired after an updated row
is
saved
.
DataBookHandler
for after updated event.DataBookHandler eventBeforeDeleting()
DataBookHandler
for before deleting event.
This event is fired before a row is deleted
.
DataBookHandler
for before deleting event.DataBookHandler eventAfterDeleting()
DataBookHandler
for after deleting event.
This event is fired after a row is deleted
.
DataBookHandler
for after deleting event.DataBookHandler eventBeforeDeleted()
DataBookHandler
for before deleted event.
This event is fired before a deleted row
is
saved
.
DataBookHandler
for before deleted event.DataBookHandler eventAfterDeleted()
DataBookHandler
for after deleted event.
This event is fired after a deleted row
is
saved
.
DataBookHandler
for after deleted event.DataBookHandler eventBeforeRestore()
DataBookHandler
for before restore event.
This event is fired before a row is
restored
.
DataBookHandler
for before restore event.DataBookHandler eventAfterRestore()
DataBookHandler
for after restore event.
This event is fired after a row is restored
.
DataBookHandler
for after restore event.DataBookHandler eventBeforeReload()
DataBookHandler
for before reload event.
This event is fired before the IDataBook
is reloaded
.
DataBookHandler
for before reload event.DataBookHandler eventAfterReload()
DataBookHandler
for after reload event.
This event is fired after the IDataBook
is reloaded
.
DataBookHandler
for after reload event.DataBookHandler eventBeforeFilterChanged()
DataBookHandler
for before filter changed event.
This event is fired before the filter
changes
.
DataBookHandler
for before filter changed event.DataBookHandler eventAfterFilterChanged()
DataBookHandler
for after filter changed event.
This event is fired after the filter
changes
.
DataBookHandler
for after filter changed event.DataBookHandler eventBeforeSortChanged()
DataBookHandler
for before sort changed event.
This event is fired before the sort
changes
.
DataBookHandler
for before sort changed event.DataBookHandler eventAfterSortChanged()
DataBookHandler
for after sort changed event.
This event is fired afterthe sort
changes
.
DataBookHandler
for after sort changed event.DataBookHandler eventBeforeColumnSelected()
DataBookHandler
for before column selected event.
This event is fired before the selected
column
changes.
DataBookHandler
for before column selected event.DataBookHandler eventAfterColumnSelected()
DataBookHandler
for after column selected event.
This event is fired after the selected
column
changes.
DataBookHandler
for after column selected event.void saveAllRows() throws ModelException
IDataRow
s which have been changed, it is the same as
saveSelectedRow()
except that it is a mass operation on all
rows.
Saving all rows does save all rows, including those which do not match
the currently set filter
.
Depending on the state of the rows, either eventBeforeInserted()
/ eventAfterInserted()
, eventBeforeUpdated()
/
eventAfterUpdated()
or eventBeforeDeleted()
/
eventAfterDeleted()
are fired. Afterwards the
IControl.notifyRepaint()
method of all
registered IControl
s is invoked.
These events are fired for all changed rows.
ModelException
- if the IDataBook
is not open
or if the changes could not be saved.saveSelectedRow()
@Deprecated void deleteAllDataRows() throws ModelException
deleteAllRows()
instead.
IDataRow
s which are currently available, it is the
same as delete()
except that it is a mass operation on all rows.
Deleting all rows does only delete the currently available rows, rows
which do not match the currently applied filter
will
not be deleted.
First the row is selected
and afterwards
deleted
.
These events are fired for all rows.
ModelException
- if the IDataBook
is not open
or if the changes (because of the selection change)
could not be saved.delete()
void deleteAllRows() throws ModelException
IDataRow
s which are currently available, it is the
same as delete()
except that it is a mass operation on all rows.
Deleting all rows does only delete the currently available rows, rows
which do not match the currently applied filter
will
not be deleted.
First the row is selected
and afterwards
deleted
.
These events are fired for all rows.
ModelException
- if the IDataBook
is not open
or if the changes (because of the selection change)
could not be saved.delete()
void removeDataPage(IDataRow pMasterDataRow, TreePath pTreePath) throws ModelException
pMasterDataRow
- the MasterDataRow to use.pTreePath
- the TreePath to use.
ModelException
- if the remove of the DataPage didn't worked out.void saveDataPage() throws ModelException
ModelException
- if saveSelected() failsIDataRow getAdditionalDataRow() throws ModelException
ModelException
- if the data book is not open.boolean isAdditionalDataRowVisible()
void setAdditionalDataRowVisible(boolean pVisible)
pVisible
- true, if the additional data row is visible.void setSelectedDataPageRow(int pDataRowIndex) throws ModelException
IDataPage
.
pDataRowIndex
- the selected row index relatively to the current
IDataPage
.
ModelException
- if the row with the iDataRowIndex couldn't get
from the storage or if the IDataBook
isn't open
or the master IDataBook
has no selected row.int getSelectedDataPageRow() throws ModelException
IDataPage
.
IDataPage
.
ModelException
- if a exception occurs during synchronize.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |