|
||||||||||
| 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| Constructor Summary | |
|---|---|
RowDefinition()
|
|
| 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 rowDefinitionListener)
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 the classes for which ColumnViews are set. |
IControl[] |
getControls()
Returns all IControl's from the IRowDefinition. |
IDataBook[] |
getDataBooks()
It returns the list of IDataBooks corresponding to this IRowDefintion. |
ColumnView |
getDefaultColumnView()
Returns the default table columns names. |
static String[] |
getDefaultIgnoredColumnNames()
Gets the list of columns which are not included in the table columns when no specific table columns are set. |
ReferenceDefinition |
getLinkReference(String pColumnName)
Gets the link reference of the column name. |
String[] |
getLinkReferenceColumnNames(String pColumnName)
Gets all columns with a LinkReference including pColumnName. |
ReferenceDefinition |
getMasterReference()
Gets the master reference. |
String[] |
getPrimaryKeyColumnNames()
Returns the String[] of all column names in the primary key. |
String[] |
getReadOnly()
Returns all read only (true) column names. |
static boolean |
isColumnIgnored(String pColumnName)
Gets whether a column name is ignored through the default ignored column names. |
boolean |
isMasterLinkColumn(String pColumnName)
Gets true, if the column is a LinkReferenceColumn for the MasterReference definition. |
void |
removeControl(IControl pControl)
Removes the IControl from the IRowDefinition. |
void |
removeDataBook(IDataBook rowDefinitionListener)
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. |
static void |
setDefaultIgnoredColumnNames(String... pColumnNames)
Sets a list of columns which are excluded from the table columns when no specific table columns are set. |
void |
setPrimaryKeyColumnNames(String[] pColumnNames)
Sets all primary key column names. |
void |
setReadOnly(String[] pColumnNames)
Sets the specified column names as read only true. |
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 rowDefinitionListener)
throws ModelException
addDataBook in interface IRowDefinitionrowDefinitionListener - the IDataBook to add
ModelException - if the xxxColumnsName (eg.xxx=Table) are not existing in the IRowDefinition.public void removeDataBook(IDataBook rowDefinitionListener)
removeDataBook in interface IRowDefinitionrowDefinitionListener - the IDataBook to removepublic IDataBook[] getDataBooks()
getDataBooks in interface IRowDefinition
public IRowDefinition createRowDefinition(String[] pColumnNames)
throws ModelException
IRowDefinition with only a subset of
ColumnDefinitions, specified by a column name String[].
createRowDefinition in interface IRowDefinitionpColumnNames - column names to use
IRowDefinition with only a subset column names
String[].
ModelException - if the IRowDefinition couldn't constructed
public void addColumnDefinition(ColumnDefinition pColumnDefinition)
throws ModelException
ColumnDefinition to this IRowDefinition.ColumnDefinition is only
added in one IRowDefinition. After an IDataBook is registered (at open())
to this IRowDefinition, it is not allowed to add columns.
addColumnDefinition in interface IRowDefinitionpColumnDefinition - the new ColumnDefinition
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.
public ColumnDefinition getColumnDefinition(String pColumnName)
throws ModelException
ColumnDefinition by name.
getColumnDefinition in interface IRowDefinitionpColumnName - name of the ColumnDefinition
ColumnDefinition by name.
ModelException - if the ColumnDefinition name not exists.public ColumnDefinition getColumnDefinition(int pColumnIndex)
ColumnDefinition by index.
getColumnDefinition in interface IRowDefinitionpColumnIndex - index of the ColumnDefinition
ColumnDefinition by index.public int getColumnDefinitionIndex(String pColumnName)
ColumnDefinition name of this
IRowDefinition.
getColumnDefinitionIndex in interface IRowDefinitionpColumnName - name of the ColumnDefinition
ColumnDefinition name of this
IRowDefinition, or -1 if it does not exist.public int getColumnCount()
IRowDefintion.
getColumnCount in interface IRowDefinitionIRowDefintion.public String[] getColumnNames()
IRowDefintion.
getColumnNames in interface IRowDefinitionIRowDefintion.public String[] getPrimaryKeyColumnNames()
getPrimaryKeyColumnNames in interface IRowDefinition
public void setPrimaryKeyColumnNames(String[] pColumnNames)
throws ModelException
DataBook or if the DataRow is in use.
setPrimaryKeyColumnNames in interface IRowDefinitionpColumnNames - the new String[] with the column names to set the primary key
ModelException - if an IDataBook already registered (at open()) to this
IRowdDefinition.public Class<? extends IControl>[] getColumnViewClasses()
getColumnViewClasses in interface IRowDefinitionpublic ColumnView getColumnView(Class<? extends IControl> pTargetControl)
ColumnView to use for GUI controls.IControl
(eg. ITableControl, ITreeControl, IEditorControl)
or null for default.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.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.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.
getColumnView in interface IRowDefinitionpTargetControl - the type of target class.
public void setColumnView(Class<? extends IControl> pTargetControl,
ColumnView pColumnView)
throws ModelException
IControl
(eg. ITableControl, ITreeControl, IEditorControl)
or null for default.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.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.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.
setColumnView in interface IRowDefinitionpTargetControl - the type of target class.pColumnView - the column view to use for GUI controls.
ModelException - if the xxxColumnsName (eg.xxx=Table) are not existing in the IRowDefinition.
public void setReadOnly(String[] pColumnNames)
throws ModelException
setReadOnly in interface IRowDefinitionpColumnNames - the column names to use. if null or empty, then all columns are used.
ModelException - if one column name doesn't exist.public String[] getReadOnly()
getReadOnly in interface IRowDefinitionpublic void addControl(IControl pControl)
IControl to the IRowDefinition.IRowDefinition has changed.
addControl in interface IRowDefinitionpControl - the IControlIControlpublic void removeControl(IControl pControl)
IControl from the IRowDefinition.
removeControl in interface IRowDefinitionpControl - the IControlIControlpublic IControl[] getControls()
IControl's from the IRowDefinition.
getControls in interface IRowDefinitionIControl's from the IRowDefinition.public String toString()
toString in class Objectpublic ColumnView getDefaultColumnView()
public String[] getLinkReferenceColumnNames(String pColumnName)
pColumnName - the column name.
public ReferenceDefinition getLinkReference(String pColumnName)
pColumnName - the column name.
public ReferenceDefinition getMasterReference()
public boolean isMasterLinkColumn(String pColumnName)
pColumnName - the column name.
public static void setDefaultIgnoredColumnNames(String... pColumnNames)
pColumnNames - a list of column names to ignorepublic static String[] getDefaultIgnoredColumnNames()
setDefaultIgnoredColumnNames(String...)public static boolean isColumnIgnored(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 | |||||||||