javax.rad.model
Interface IRowDefinition

All Superinterfaces:
Cloneable
All Known Implementing Classes:
RowDefinition

public interface IRowDefinition
extends Cloneable

An IRowDefinition contains all ColumnDefinition's of a IDataRow.

See Also:
ColumnDefinition

Method Summary
 void addColumnDefinition(ColumnDefinition pColumnDefinition)
          Adds an ColumnDefinition to this IRowDefinition.
 void addControl(IControl pControl)
          Adds a IControl to the IRowDefinition.
 void addDataBook(IDataBook pRowDefinitionListener)
          It register and adds a IDataBook to this IRowDefinition, which uses this IRowDefintion.
 IRowDefinition createRowDefinition(String[] pColumnNames)
          Returns a cloned IRowDefinition with only a subset of ColumnDefinitions, specified by a column name String[].
 int getColumnCount()
          Returns the column count of this IRowDefintion.
 ColumnDefinition getColumnDefinition(int pColumnIndex)
          Returns the ColumnDefinition by index.
 ColumnDefinition getColumnDefinition(String pColumnName)
          Returns the ColumnDefinition by name.
 int getColumnDefinitionIndex(String pColumnName)
          Returns the index of the ColumnDefinition name of this IRowDefinition.
 String[] getColumnNames()
          Returns the String[] of all column names in this IRowDefintion.
 ColumnView getColumnView(Class<? extends IControl> pTargetControl)
          Gets the ColumnView to use for GUI controls.
 Class<? extends IControl>[] getColumnViewClasses()
          Gets all classes, for which column views are set.
 IControl[] getControls()
          Returns all IControl's from the IRowDefinition.
 IDataBook[] getDataBooks()
          It returns the list of IDataBooks corresponding to this IRowDefintion.
 String[] getPrimaryKeyColumnNames()
          Returns the String[] of all column names in the primary key.
 String[] getReadOnly()
          Returns all read only (true) column names.
 void removeControl(IControl pControl)
          Removes the IControl from the IRowDefinition.
 void removeDataBook(IDataBook pRowDefinitionListener)
          It removes the DataBook reference to this IRowDefinition, which used this IRowDefintion before.
 void setColumnView(Class<? extends IControl> pTargetControl, ColumnView pColumnView)
          Sets the column view to use for GUI controls.
 void setPrimaryKeyColumnNames(String[] pColumnNames)
          Sets all primary key column names.
 void setReadOnly(String[] pColumnNames)
          Sets the specified column names as read only true.
 

Method Detail

addDataBook

void addDataBook(IDataBook pRowDefinitionListener)
                 throws ModelException
It register and adds a IDataBook to this IRowDefinition, which uses this IRowDefintion. The IDataBook implementations has to remove their self in the close() method.

Parameters:
pRowDefinitionListener - the IDataBook to add
Throws:
ModelException - if the xxxColumnsName (eg.xxx=Table) are not existing in the IRowDefinition.

removeDataBook

void removeDataBook(IDataBook pRowDefinitionListener)
It removes the DataBook reference to this IRowDefinition, which used this IRowDefintion before. The IDataBook implementations has to remove their self in the close() method.

Parameters:
pRowDefinitionListener - the IDataBook to remove

getDataBooks

IDataBook[] getDataBooks()
It returns the list of IDataBooks corresponding to this IRowDefintion.

Returns:
An IDataBook array of currently using this IRowDefinition.

createRowDefinition

IRowDefinition createRowDefinition(String[] pColumnNames)
                                   throws ModelException
Returns a cloned IRowDefinition with only a subset of ColumnDefinitions, specified by a column name String[].

Parameters:
pColumnNames - column names to use
Returns:
a cloned IRowDefinition with only a subset column names String[].
Throws:
ModelException - if the IRowDefinition couldn't constructed

addColumnDefinition

void addColumnDefinition(ColumnDefinition pColumnDefinition)
                         throws ModelException
Adds an ColumnDefinition to this IRowDefinition.
Implementation need to check, that this ColumnDefinition is only added in one IRowDefinition. After an IDataBook is registered (at open()) to this IRowDefinition, it is not allowed to add columns.

Parameters:
pColumnDefinition - the new ColumnDefinition
Throws:
ModelException - if the ColumnDefinition name already exists or it is already added to another IRowDefintion or if an IDataBook is registered (at open()) to the IRowDefinition.

getColumnDefinition

ColumnDefinition getColumnDefinition(String pColumnName)
                                     throws ModelException
Returns the ColumnDefinition by name.

Parameters:
pColumnName - name of the ColumnDefinition
Returns:
the ColumnDefinition by name.
Throws:
ModelException - if the ColumnDefinition name not exists.

getColumnDefinition

ColumnDefinition getColumnDefinition(int pColumnIndex)
Returns the ColumnDefinition by index.

Parameters:
pColumnIndex - index of the ColumnDefinition
Returns:
the ColumnDefinition by index.
Throws:
IndexOutOfBoundsException - if the index is out of bounds

getColumnDefinitionIndex

int getColumnDefinitionIndex(String pColumnName)
Returns the index of the ColumnDefinition name of this IRowDefinition.

Parameters:
pColumnName - name of the ColumnDefinition
Returns:
the index of the ColumnDefinition name of this IRowDefinition, or -1 if it does not exist.

getColumnCount

int getColumnCount()
Returns the column count of this IRowDefintion.

Returns:
the column count of this IRowDefintion.

getColumnNames

String[] getColumnNames()
Returns the String[] of all column names in this IRowDefintion.

Returns:
the String[] of all column names in this IRowDefintion.

getPrimaryKeyColumnNames

String[] getPrimaryKeyColumnNames()
Returns the String[] of all column names in the primary key.

Returns:
the String[] of all column names in the primary key.

setPrimaryKeyColumnNames

void setPrimaryKeyColumnNames(String[] pColumnNames)
                              throws ModelException
Sets all primary key column names.
It isn't allowed to change the primary key after open() the corresponding DataBook or if the DataRow is in use.

Parameters:
pColumnNames - the new String[] with the column names to set the primary key
Throws:
ModelException - if an IDataBook already registered (at open()) to this IRowdDefinition.

getColumnViewClasses

Class<? extends IControl>[] getColumnViewClasses()
Gets all classes, for which column views are set.

Returns:
all classes, for which column views are set.

getColumnView

ColumnView getColumnView(Class<? extends IControl> pTargetControl)
Gets the ColumnView to use for GUI controls.
The target control class has to be instance of IControl (eg. ITableControl, ITreeControl, IEditorControl) or null for default.
The ColumnView is stored to the base interface or class that is instance of IControl. So it does not matter if you use getColumnView(ITableControl) or getColumnView(ITable), getColumnView(UITable) because they are all base on ITableControl.
The default is used as long as no ColumnView is set for a specific type of IControl.
eg:
if you set: rowDef.setColumnView(null, new ColumnView("NAME")) then rowDef.getColumnView(null) and rowDef.getColumnView(ITableControl) and rowDef.getColumnView(ITreeControl)... are returning the same instance set before.
if you set: rowDef.setColumnView(UITree, new ColumnView("NAME")) then rowDef.getColumnView(null) and rowDef.getColumnView(ITableControl) are returning the default.
rowDef.getColumnView(ITreeControl) and rowDef.getColumnView(UITree) are returning the same instance set with UITree.

Parameters:
pTargetControl - the type of target class.
Returns:
the column view to use for GUI controls.

setColumnView

void setColumnView(Class<? extends IControl> pTargetControl,
                   ColumnView pColumnView)
                   throws ModelException
Sets the column view to use for GUI controls. The target control class has to be instance of IControl (eg. ITableControl, ITreeControl, IEditorControl) or null for default.
The ColumnView is stored to the base interface or class that is instance of IControl. So it does not matter if you use getColumnView(ITableControl) or getColumnView(ITable), getColumnView(UITable) because they are all base on ITableControl.
The default is used as long as no ColumnView is set for a specific type of IControl.
eg:
if you set: rowDef.setColumnView(null, new ColumnView("NAME")) then rowDef.getColumnView(null) and rowDef.getColumnView(ITableControl) and rowDef.getColumnView(ITreeControl)... are returning the same instance set before.
if you set: rowDef.setColumnView(UITree, new ColumnView("NAME")) then rowDef.getColumnView(null) and rowDef.getColumnView(ITableControl) are returning the default.
rowDef.getColumnView(ITreeControl) and rowDef.getColumnView(UITree) are returning the same instance set with UITree.

Parameters:
pTargetControl - the type of target class.
pColumnView - the column view to use for GUI controls.
Throws:
ModelException - if the xxxColumnsName (eg.xxx=Table) are not existing in the IRowDefinition.

setReadOnly

void setReadOnly(String[] pColumnNames)
                 throws ModelException
Sets the specified column names as read only true.

Parameters:
pColumnNames - the column names to use. if null or empty, then all columns are used.
Throws:
ModelException - if one column name doesn't exist.

getReadOnly

String[] getReadOnly()
Returns all read only (true) column names.

Returns:
all read only (true) column names.

addControl

void addControl(IControl pControl)
Adds a IControl to the IRowDefinition.
The registered IControl methods will be called if IRowDefinition has changed.

Parameters:
pControl - the IControl
See Also:
IControl

removeControl

void removeControl(IControl pControl)
Removes the IControl from the IRowDefinition.

Parameters:
pControl - the IControl
See Also:
IControl

getControls

IControl[] getControls()
Returns all IControl's from the IRowDefinition.

Returns:
all IControl's from the IRowDefinition.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.