|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.rad.model.RowDefinition
public class RowDefinition
A RowDefinition contains all ColumnDefintion's of a
DataRow.
Example:
// construct a RowDefinition
RowDefinition rdRowDefinition = new RowDefinition();
// construct some ColumnDefinitions
ColumnDefinition cdId = new ColumnDefinition("id");
ColumnDefinition cdName = new ColumnDefinition("name");
rdRowDefinition.addColumnDefinition(cdId);
rdRowDefinition.addColumnDefinition(cdName);
IRowDefinition,
ColumnDefinition,
Serialized Form| Field Summary |
|---|
| Fields inherited from interface javax.rad.model.IRowDefinition |
|---|
ALL_COLUMNS |
| Constructor Summary | |
|---|---|
RowDefinition()
|
|
| Method Summary | |
|---|---|
void |
addColumnDefinition(ColumnDefinition pColumnDefinition)
Adds the given ColumnDefinition. |
void |
addControl(IControl pControl)
Adds the given IControl so that it is
notified if the IRowDefinition
changes. |
void |
addDataBook(IDataBook pDataBook)
Adds the given IDataBook at this IRowDefinition, which
means that the given IDataBook is using this
IRowDefinition. |
IRowDefinition |
createRowDefinition(java.lang.String[] pColumnNames)
Creates a IRowDefinition with only the ColumnDefinitions
which have been specified. |
int |
getColumnCount()
Gets the count of added
ColumnDefinitions. |
ColumnDefinition |
getColumnDefinition(int pColumnIndex)
Gets the ColumnDefinition with the given index. |
ColumnDefinition |
getColumnDefinition(java.lang.String pColumnName)
Gets the ColumnDefinition with the given name. |
int |
getColumnDefinitionIndex(java.lang.String pColumnName)
Gets the index of the ColumnDefinition with the given name. |
int[] |
getColumnDefinitionIndexes(java.lang.String[] pColumnNames)
Returns the indexes of the ColumnDefinitions with the given
names. |
ColumnDefinition[] |
getColumnDefinitions()
Gets all added ColumnDefinitions as array. |
java.lang.String[] |
getColumnNames()
Gets the names of all added ColumnDefinitions. |
ColumnView |
getColumnView(java.lang.Class<? extends IControl> pTargetControl)
Gets the ColumnView to use for the given IControl. |
java.lang.Class<? extends IControl>[] |
getColumnViewClasses()
Gets the classes for which ColumnViews are set. |
IControl[] |
getControls()
Returns all added IControls. |
IDataBook[] |
getDataBooks()
Gets the array if IDataBooks which have been added. |
ColumnView |
getDefaultColumnView()
Returns the default table columns names. |
static java.lang.String[] |
getDefaultIgnoredColumnNames()
Gets the list of columns which are not included in the table columns when no specific table columns are set. |
ReferenceDefinition |
getLinkReference(java.lang.String pColumnName)
Gets the link reference of the column name. |
java.lang.String[] |
getLinkReferenceColumnNames(java.lang.String pColumnName)
Gets all columns with a LinkReference including pColumnName. |
ReferenceDefinition |
getMasterReference()
Gets the master reference. |
java.lang.String[] |
getPrimaryKeyColumnNames()
Gets the names of all added ColumnDefinitions which represent a primary key column. |
java.lang.String[] |
getReadOnly()
Gets the names of the columns which are read only. |
static boolean |
isColumnIgnored(java.lang.String pColumnName)
Gets whether a column name is ignored through the default ignored column names. |
boolean |
isMasterLinkColumn(java.lang.String pColumnName)
Gets true, if the column is a LinkReferenceColumn for the MasterReference definition. |
void |
removeControl(IControl pControl)
Removes the given IControl. |
void |
removeDataBook(IDataBook pDataBook)
Removes the given IDataBook from this IRowDefinition. |
void |
setColumnView(java.lang.Class<? extends IControl> pTargetControl,
ColumnView pColumnView)
Sets the ColumnView for the given IControl. |
static void |
setDefaultIgnoredColumnNames(java.lang.String... pColumnNames)
Sets a list of columns which are excluded from the table columns when no specific table columns are set. |
void |
setPrimaryKeyColumnNames(java.lang.String[] pColumnNames)
Sets the names of all added ColumnDefinitions which represent a primary key column. |
void |
setReadOnly(java.lang.String[] pColumnNames)
Sets that specified columns as read only. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RowDefinition()
| Method Detail |
|---|
public void addDataBook(IDataBook pDataBook)
throws ModelException
IDataBook at this IRowDefinition, which
means that the given IDataBook is using this
IRowDefinition.
The added IDataBook has to remove itself when appropriate.
addDataBook in interface IRowDefinitionpDataBook - the IDataBook to register.
ModelException - if adding it was not possible.IRowDefinition.getDataBooks(),
IRowDefinition.removeDataBook(IDataBook)public void removeDataBook(IDataBook pDataBook)
IDataBook from this IRowDefinition.
The registered IDataBook has to remove itself when appropriate.
removeDataBook in interface IRowDefinitionpDataBook - the IDataBook to remove.IRowDefinition.addDataBook(IDataBook),
IRowDefinition.getDataBooks()public IDataBook[] getDataBooks()
IDataBooks which have been added.
getDataBooks in interface IRowDefinitionIDataBooks which have been added. Note that
this array is only a clone and changing it won't change the
internal state of the IRowDefinition.IRowDefinition.addDataBook(IDataBook),
IRowDefinition.removeDataBook(IDataBook)
public IRowDefinition createRowDefinition(java.lang.String[] pColumnNames)
throws ModelException
IRowDefinition with only the ColumnDefinitions
which have been specified.
If the given column names is null this instance is returned,
additionally the instances of the IRowDefinitions can be cached,
so that they same instance is returned for the same column names.
createRowDefinition in interface IRowDefinitionpColumnNames - the names of the ColumnDefinitions to copy.
IRowDefinition with only the ColumnDefinitions
which have been specified.
ModelException - if the IRowDefinition couldn't be
constructed.
public void addColumnDefinition(ColumnDefinition pColumnDefinition)
throws ModelException
ColumnDefinition.
Implementations need to check that the given ColumnDefinition is
not added to another
IRowDefinition. Also it is not allowed to add a
ColumnDefinition after an IDataBook has been
added.
addColumnDefinition in interface IRowDefinitionpColumnDefinition - the ColumnDefinition to add.
ModelException - if there is already a ColumnDefinition
with that name or if the given ColumnDefinition is
already added to another IRowDefinition or a
IDataBook has already been
added.
public ColumnDefinition getColumnDefinition(java.lang.String pColumnName)
throws ModelException
ColumnDefinition with the given name.
getColumnDefinition in interface IRowDefinitionpColumnName - name of the ColumnDefinition to get.
ColumnDefinition with the given name.
ModelException - if there is no ColumnDefinition with that
name.public ColumnDefinition getColumnDefinition(int pColumnIndex)
ColumnDefinition with the given index.
getColumnDefinition in interface IRowDefinitionpColumnIndex - index of the ColumnDefinition.
ColumnDefinition with the given index.public int getColumnDefinitionIndex(java.lang.String pColumnName)
ColumnDefinition with the given name.
Returns -1 if there is no ColumnDefinition with the given
name.
getColumnDefinitionIndex in interface IRowDefinitionpColumnName - name of the ColumnDefinition.
ColumnDefinition with the given name,
-1 if there is none.IRowDefinition.getColumnDefinitionIndexes(String[])public int[] getColumnDefinitionIndexes(java.lang.String[] pColumnNames)
ColumnDefinitions with the given
names.
If any of the given names does not exist, the resulting array will
contain -1 at that position.
getColumnDefinitionIndexes in interface IRowDefinitionpColumnNames - the names of the ColumnDefinitions.
ColumnDefinitions with the given
names, -1 for non existing names.IRowDefinition.getColumnDefinitionIndex(String)public int getColumnCount()
added
ColumnDefinitions.
getColumnCount in interface IRowDefinitionadded
ColumnDefinitions.IRowDefinition.addColumnDefinition(ColumnDefinition)public ColumnDefinition[] getColumnDefinitions()
ColumnDefinitions as array.
The returned array is a copy, so changing the array will not change
the IRowDefinition.
getColumnDefinitions in interface IRowDefinitionColumnDefinitions as array.public java.lang.String[] getColumnNames()
added ColumnDefinitions.
getColumnNames in interface IRowDefinitionadded ColumnDefinitions.IRowDefinition.addColumnDefinition(ColumnDefinition)public java.lang.String[] getPrimaryKeyColumnNames()
added ColumnDefinitions which represent a primary key column.
getPrimaryKeyColumnNames in interface IRowDefinitionadded ColumnDefinitions.IRowDefinition.getPrimaryKeyColumnNames()
public void setPrimaryKeyColumnNames(java.lang.String[] pColumnNames)
throws ModelException
added ColumnDefinitions which represent a primary key column.
setPrimaryKeyColumnNames in interface IRowDefinitionpColumnNames - the new String[] with the column names to set the
primary key
ModelException - if an IDataBook has already been
added.IRowDefinition.getPrimaryKeyColumnNames()public java.lang.Class<? extends IControl>[] getColumnViewClasses()
getColumnViewClasses in interface IRowDefinitionIRowDefinition.getColumnView(Class),
IRowDefinition.setColumnView(Class, ColumnView)public ColumnView getColumnView(java.lang.Class<? extends IControl> pTargetControl)
ColumnView to use for the given IControl. The
given IControl class can also be null to get the default
ColumnView.
If there is no ColumnView for the given class the default one
will be returned.
The ColumnView is stored to the base interface, so it does not
matter if you use the interface or the implementing class.
getColumnView in interface IRowDefinitionpTargetControl - the class of the IControl for which to get
the ColumnView, can be null for the default
one.
ColumnView for the given IControl class.IRowDefinition.getColumnViewClasses(),
IRowDefinition.setColumnView(Class, ColumnView)
public void setColumnView(java.lang.Class<? extends IControl> pTargetControl,
ColumnView pColumnView)
throws ModelException
ColumnView for the given IControl. The given
IControl class can also be null to set the default
ColumnView.
The ColumnView is stored to the base interface, so it does not
matter if you use the interface or the implementing class.
setColumnView in interface IRowDefinitionpTargetControl - the class of the IControl for which to set
the ColumnView, can be null to set the default
one.pColumnView - the ColumnView for the given IControl
class.
ModelException - if any of the column names specified in the
ColumnView does not exist in this
IRowDefinition.IRowDefinition.getColumnViewClasses(),
IRowDefinition.getColumnView(Class)
public void setReadOnly(java.lang.String[] pColumnNames)
throws ModelException
setReadOnly in interface IRowDefinitionpColumnNames - the names of all read only columns, null for
all.
ModelException - if any of the column names does not exist.IRowDefinition.getReadOnly()public java.lang.String[] getReadOnly()
getReadOnly in interface IRowDefinitionIRowDefinition.setReadOnly(String[])public void addControl(IControl pControl)
IControl so that it is
notified if the IRowDefinition
changes.
addControl in interface IRowDefinitionpControl - the IControl to add.IRowDefinition.getControls(),
IRowDefinition.removeControl(IControl)public void removeControl(IControl pControl)
IControl.
removeControl in interface IRowDefinitionpControl - the IControl to remove.IRowDefinition.addControl(IControl),
IRowDefinition.getControls()public IControl[] getControls()
IControls.
getControls in interface IRowDefinitionIControls.IRowDefinition.addControl(IControl),
IRowDefinition.removeControl(IControl)public java.lang.String toString()
toString in class java.lang.Objectpublic ColumnView getDefaultColumnView()
public java.lang.String[] getLinkReferenceColumnNames(java.lang.String pColumnName)
pColumnName - the column name.
public ReferenceDefinition getLinkReference(java.lang.String pColumnName)
pColumnName - the column name.
public ReferenceDefinition getMasterReference()
public boolean isMasterLinkColumn(java.lang.String pColumnName)
pColumnName - the column name.
public static void setDefaultIgnoredColumnNames(java.lang.String... pColumnNames)
pColumnNames - a list of column names to ignorepublic static java.lang.String[] getDefaultIgnoredColumnNames()
setDefaultIgnoredColumnNames(String...)public static boolean isColumnIgnored(java.lang.String pColumnName)
pColumnName - the column name to check
true when the column is ignored, false if it is not ignored
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||