|
||||||||||
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 FormField 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 ColumnDefinition s
which have been specified. |
int |
getColumnCount()
Gets the count of added
ColumnDefinition s. |
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 ColumnDefinition s with the given
names. |
ColumnDefinition[] |
getColumnDefinitions()
Gets all added ColumnDefinition s as array. |
java.lang.String[] |
getColumnNames()
Gets the names of all added ColumnDefinition s. |
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 IControl s. |
IDataBook[] |
getDataBooks()
Gets the array if IDataBook s 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 ColumnDefinition s 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 ColumnDefinition s 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 IRowDefinition
pDataBook
- 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 IRowDefinition
pDataBook
- the IDataBook
to remove.IRowDefinition.addDataBook(IDataBook)
,
IRowDefinition.getDataBooks()
public IDataBook[] getDataBooks()
IDataBook
s which have been added.
getDataBooks
in interface IRowDefinition
IDataBook
s 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 ColumnDefinition
s
which have been specified.
If the given column names is null
this instance is returned,
additionally the instances of the IRowDefinition
s can be cached,
so that they same instance is returned for the same column names.
createRowDefinition
in interface IRowDefinition
pColumnNames
- the names of the ColumnDefinition
s to copy.
IRowDefinition
with only the ColumnDefinition
s
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 IRowDefinition
pColumnDefinition
- 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 IRowDefinition
pColumnName
- 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 IRowDefinition
pColumnIndex
- 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 IRowDefinition
pColumnName
- name of the ColumnDefinition
.
ColumnDefinition
with the given name,
-1
if there is none.IRowDefinition.getColumnDefinitionIndexes(String[])
public int[] getColumnDefinitionIndexes(java.lang.String[] pColumnNames)
ColumnDefinition
s 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 IRowDefinition
pColumnNames
- the names of the ColumnDefinition
s.
ColumnDefinition
s with the given
names, -1
for non existing names.IRowDefinition.getColumnDefinitionIndex(String)
public int getColumnCount()
added
ColumnDefinition
s.
getColumnCount
in interface IRowDefinition
added
ColumnDefinition
s.IRowDefinition.addColumnDefinition(ColumnDefinition)
public ColumnDefinition[] getColumnDefinitions()
ColumnDefinition
s as array.
The returned array is a copy, so changing the array will not change
the IRowDefinition
.
getColumnDefinitions
in interface IRowDefinition
ColumnDefinition
s as array.public java.lang.String[] getColumnNames()
added
ColumnDefinition
s.
getColumnNames
in interface IRowDefinition
added
ColumnDefinition
s.IRowDefinition.addColumnDefinition(ColumnDefinition)
public java.lang.String[] getPrimaryKeyColumnNames()
added
ColumnDefinition
s which represent a primary key column.
getPrimaryKeyColumnNames
in interface IRowDefinition
added
ColumnDefinition
s.IRowDefinition.getPrimaryKeyColumnNames()
public void setPrimaryKeyColumnNames(java.lang.String[] pColumnNames) throws ModelException
added
ColumnDefinition
s which represent a primary key column.
setPrimaryKeyColumnNames
in interface IRowDefinition
pColumnNames
- 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 IRowDefinition
IRowDefinition.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 IRowDefinition
pTargetControl
- 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 IRowDefinition
pTargetControl
- 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 IRowDefinition
pColumnNames
- 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 IRowDefinition
IRowDefinition.setReadOnly(String[])
public void addControl(IControl pControl)
IControl
so that it is
notified
if the IRowDefinition
changes.
addControl
in interface IRowDefinition
pControl
- the IControl
to add.IRowDefinition.getControls()
,
IRowDefinition.removeControl(IControl)
public void removeControl(IControl pControl)
IControl
.
removeControl
in interface IRowDefinition
pControl
- the IControl
to remove.IRowDefinition.addControl(IControl)
,
IRowDefinition.getControls()
public IControl[] getControls()
IControl
s.
getControls
in interface IRowDefinition
IControl
s.IRowDefinition.addControl(IControl)
,
IRowDefinition.removeControl(IControl)
public java.lang.String toString()
toString
in class java.lang.Object
public 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 |