|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.templateutil.table.AssociationTableModel
Deprecation Notice: This class is still valid for this release, however
this serves as advance notice that it will be removed in the future.
All user interfaces built using the Windchill HTML Template Processing
client architecture will be rewritten using a different framework in
an upcoming release.
The AssociationTableModel provides a TableModel for presenting information
about
a set of QueryResults from a navigation. After initialization, the
BinaryLinks
objects and OtherSide objects are available to retrieve information
from. Each row
in the TableModel has a dual personality as it represents both the
BinaryLink
object and the OtherSide object. A given column determines whether
the information
in the column represents information about the BinaryLink or the OtherSide
object.
It is assumed that the name/handle of the column
is the name of a modeled attribute from either a BinaryLink object
or an OtherSide object.
This is not required, however.
There are several ways to initialize the AssociationTableModel. You can pass in the QueryResults from a navigation directly or pass in a Vector of BinaryLink objects. Before you pass in either, you will need to set the LinkClassName and the OtherSideClass attributes. This is so the AssociationTableModel can know how to retrive the OtherSide objects. This will initialize the rows of the AssociationTableModel.
To initialize the Columns of the AssociationTableModel, you will need to pass in a list of attributes/handles for the BinaryLink objects and a list of attributes/handles for the OtherSide objects.
Here is an example of how to initialize the AssociationTableModel :
AssociationTableModel tempTableModel = getAssociationTableModel();
tempTableModel.setLinkClassName( getAssociationsLogic().getLinkClassName()
);
tempTableModel.setOtherSideClass( getAssociationsLogic().getOtherSideClass()
);
tempTableModel.setRole( getAssociationsLogic().getRole() );
tempTableModel.setOtherSideColumns( otherSideAttributeVector );
tempTableModel.setLinkColumns( linkAttributeVector );
if ( getQueryResult() != null )
{
tempTableModel.setQueryResults( getQueryResult() );
}
else
{
tempTableModel.setResultVector( getVectorResults() );
}
tempTableModel.setLocale( locale );
To use the AssociationTableModel in an HTMLTable and have an HTMLComponent present the information of the cell, the real issue is what is returned from the getValueAt method. For the AssociationTableModel this depends on what object is being presented in the column. Is the object a BinaryLink or an OtherSide object.
A wt.templateutil.table.WTAttribute is always returned. Either the
BinaryLink object
of the row or the OtherSide object of the row is the source attribute
of the WTAttribute
object. The WTAttribute is also given the handle of the column. If
the name/handle of
the column is an attribute of the source object, the value of that
attrubute is available
with a call to the getDisplayObject method on the WTAttribute.
Supported API: true
Extendable: false
Field Summary | |
private static String |
CLASSNAME
Deprecated. |
static String |
COLUMNTYPE
Deprecated. |
protected Vector |
combinedColumns
Deprecated. |
static String |
LINK
Deprecated. |
private String |
linkClassName
Deprecated. |
private Vector |
linkColumns
Deprecated. |
private Vector |
linkObjects
Deprecated. |
private Locale |
locale
Deprecated. |
private String |
mode
Deprecated. |
static String |
OTHERSIDE
Deprecated. |
private Class |
otherSideClass
Deprecated. |
private Vector |
otherSideColumns
Deprecated. |
private Vector |
otherSideObjects
Deprecated. |
private QueryResult |
queryResults
Deprecated. |
private static String |
RESOURCE
Deprecated. |
private Properties |
resourceBundle
Deprecated. |
private Properties |
resourceKey
Deprecated. |
private String |
role
Deprecated. |
private Vector |
setValues
Deprecated. |
private Properties |
targetClass
Deprecated. |
private static boolean |
VERBOSE
Deprecated. |
private WTAttribute |
wtAttribute
Deprecated. |
Constructor Summary | |
AssociationTableModel()
Deprecated. |
Method Summary | |
void |
addColumn(Properties props)
Deprecated. Adds a column to the AssociationTableModel using the information in the parameters props. |
void |
addTableModelListener(TableModelListener l)
Deprecated. Not implemented for the AssociationTableModel Supported API: false |
Class |
getColumnClass(int columnIndex)
Deprecated. Returns the class of the column. |
int |
getColumnCount()
Deprecated. Returns the tolal number of columns in the TableModel, including the BinaryLink objects and the OtherSide objects. |
String |
getColumnName(int columnIndex)
Deprecated. There are several possible return values. |
String |
getColumnName(String attribute,
Object target)
Deprecated. |
Object |
getIdentifier(int columnIndex)
Deprecated. Returns the name/handle of the column at columnIndex. |
String |
getLinkClassName()
Deprecated. Gets a String that is the fully qualified class name of the BinaryLinks Supported API: false |
Vector |
getLinkColumns()
Deprecated. Gets the list of column names/handles for the BinaryLinks. |
Object |
getLinkObject(int rowIndex)
Deprecated. Returns the BinaryLink associated with row rowIndex. |
Vector |
getLinkObjects()
Deprecated. Gets the Vector of BinaryLinks from the navigation. |
Locale |
getLocale()
Deprecated. Gets the Locale used to initialize the WTAttrbute. |
String |
getMode()
Deprecated. Gets the mode of the Table. |
Class |
getOtherSideClass()
Deprecated. Gets the Class of the OtherSide objects. |
Vector |
getOtherSideColumns()
Deprecated. Gets the list of column names/handles for the OtherSide objects. |
Object |
getOtherSideObject(int rowIndex)
Deprecated. Returns the OtherSide object associated with row rowIndex. |
Vector |
getOtherSideObjects()
Deprecated. Gets the Vector of OtherSide object from the BinaryLink objects. |
QueryResult |
getQueryResults()
Deprecated. Gets the QueryResult used to initialize the AssociationTableModel, if one was used. |
String |
getRole()
Deprecated. Gets the Role of the OtherSide classes in the navigation. |
int |
getRowCount()
Deprecated. Returns the number rows to be presented which is defined be the number of BinaryLink objects (which is the same as the number of OtherSide objects) in the TableModel. |
protected Vector |
getSetValues()
Deprecated. |
Object |
getValueAt(int rowIndex,
int columnIndex)
Deprecated. Returns the value for the cell at position ( rowIndex , columnIndex). |
WTAttribute |
getWtAttribute()
Deprecated. Gets the WTAttribute object used by the getValueAt method Supported API: false |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Deprecated. Returns whether the current cell at position ( rowIndex , columnIndex) is editable based on the value of the mode attribute. |
protected WTAttribute |
newWTAttribute()
Deprecated. |
void |
removeTableModelListener(TableModelListener l)
Deprecated. Currently not implemented. |
void |
setHeaderFromResource(String resourceBundleName,
String resourceBundleKey,
Object columnId)
Deprecated. Sets the value returned from the getColumnName method for the column with name/handle columnId to be the localized String returned for the resource key, resourceBundleKey, from the resource bundle, resourceBundleName. |
void |
setHeaderFromTargetClass(String targetClassName,
Object columnId)
Deprecated. Sets the class that introspection is done on when the name/handle of the column is used to define the Column Name. |
void |
setLinkCheckboxColumn()
Deprecated. |
void |
setLinkClassName(String a_LinkClassName)
Deprecated. Sets a String that is the fully qualified class name of the BinaryLinks Supported API: false |
void |
setLinkColumns(Vector a_LinkColumns)
Deprecated. Sets the list of column names/handles for the BinaryLinks. |
void |
setLinkObjects(Vector a_LinkObjects)
Deprecated. Sets the Vector of BinaryLinks from the navigation. |
void |
setLinkRowContextObject()
Deprecated. |
void |
setLocale(Locale a_Locale)
Deprecated. Sets the Locale used to initialize the WTAttrbute. |
void |
setMode(String a_Mode)
Deprecated. Sets the mode of the table. |
void |
setOtherSideClass(Class a_OtherSideClass)
Deprecated. Sets the Class of the OtherSide objects. |
void |
setOtherSideColumns(Vector a_OtherSideColumns)
Deprecated. Sets the list of column names/handles for the OtherSide objects. |
void |
setOtherSideObjects(Vector a_OtherSideObjects)
Deprecated. Sets the Vector of OtherSide object from the BinaryLink objects. |
void |
setQueryResults(QueryResult a_QueryResults)
Deprecated. Sets the QueryResult to be used initialize the AssociationTableModel. |
void |
setResultVector(Vector resultsVector)
Deprecated. Set the Vector of BinaryLink objects and consquently the Vector of OtherSide objects. |
void |
setRole(String a_Role)
Deprecated. Sets the Role of the OtherSide classes in the navigation. |
protected void |
setSetValues(Vector newSetValues)
Deprecated. |
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
Deprecated. Sets value at the position ( rowIndex , columnIndex). |
void |
setWtAttribute(WTAttribute a_WtAttribute)
Deprecated. Sets the WTAttribute object used by the getValueAt method Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private WTAttribute wtAttribute
private String mode
private Vector linkObjects
private Vector otherSideObjects
private Vector linkColumns
private Vector otherSideColumns
private String role
private Class otherSideClass
private String linkClassName
private Locale locale
private QueryResult queryResults
public static final String COLUMNTYPE
public static final String OTHERSIDE
public static final String LINK
private static boolean VERBOSE
protected Vector combinedColumns
private Properties targetClass
private Properties resourceBundle
private Properties resourceKey
private Vector setValues
Constructor Detail |
public AssociationTableModel()
Method Detail |
public WTAttribute getWtAttribute()
public void setWtAttribute(WTAttribute a_WtAttribute)
a_WtAttribute
- public String getMode()
public void setMode(String a_Mode)
Not currently implemented.
Supported API: false
a_Mode
- public Vector getLinkObjects()
The BinaryLink at position i in the Vector is the BinaryLink
for row i.
Supported API: false
public void setLinkObjects(Vector a_LinkObjects)
The BinaryLink at position i in the Vector is the BinaryLink
for row i.
Supported API: false
a_LinkObjects
- public Vector getOtherSideObjects()
The OtherSide object at position i in the Vector is the OtherSide object
for row i.
Supported API: false
public void setOtherSideObjects(Vector a_OtherSideObjects)
The OtherSide object at position i in the Vector is the OtherSide object
for row i.
Supported API: false
a_OtherSideObjects
- public Vector getLinkColumns()
public void setLinkColumns(Vector a_LinkColumns)
a_LinkColumns
- public Vector getOtherSideColumns()
public void setOtherSideColumns(Vector a_OtherSideColumns)
a_OtherSideColumns
- public String getRole()
public void setRole(String a_Role)
a_Role
- public Class getOtherSideClass()
public void setOtherSideClass(Class a_OtherSideClass)
a_OtherSideClass
- public String getLinkClassName()
public void setLinkClassName(String a_LinkClassName)
a_LinkClassName
- public Locale getLocale()
public void setLocale(Locale a_Locale)
a_Locale
- public QueryResult getQueryResults()
public void setQueryResults(QueryResult a_QueryResults)
a_QueryResults
- public Object getLinkObject(int rowIndex)
rowIndex
-
public Object getOtherSideObject(int rowIndex)
rowIndex
-
public void setLinkCheckboxColumn()
public void setLinkRowContextObject()
public void addTableModelListener(TableModelListener l)
addTableModelListener
in interface TableModelStub
l
- public Class getColumnClass(int columnIndex)
Currently, only a java.lang.Object class object is returned.
Supported API: false
getColumnClass
in interface TableModelStub
columnIndex
-
public int getColumnCount()
getColumnCount
in interface TableModelStub
public String getColumnName(int columnIndex)
getColumnName
in interface TableModelStub
columnIndex
-
public int getRowCount()
getRowCount
in interface TableModelStub
public Object getValueAt(int rowIndex, int columnIndex)
If the value of the cell at position ( rowIndex , columnIndex) was set with the method setValueAt( value, rowIndex , columnIndex), then that value is returned.
Otherwise, a WTAttribute object that has either the BinaryLink associated with row rowIndex or the OtherSide object associated with row rowIndex as the source is returned.
Which is type of object is determined by the columnIndex and if the column was defined as presenting the BinaryLink or the OtherSide object.
The attribute field of the WTAttribute object is initialized with
the name/handle of the column at columnIndex.
Supported API: false
getValueAt
in interface TableModelStub
rowIndex
- columnIndex
-
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModelStub
rowIndex
- columnIndex
-
public void removeTableModelListener(TableModelListener l)
removeTableModelListener
in interface TableModelStub
l
- public void setValueAt(Object value, int rowIndex, int columnIndex)
Currently, if the position is not formally in the table,
that value is set and no exception is thrown.
Supported API: false
setValueAt
in interface TableModelStub
value
- rowIndex
- columnIndex
- public void addColumn(Properties props) throws WTException
The required values passed in the props parameter are :
addColumn
in interface AddColumn
props
-
WTException
public Object getIdentifier(int columnIndex)
getIdentifier
in interface ColumnIdentifier
columnIndex
-
public void setHeaderFromResource(String resourceBundleName, String resourceBundleKey, Object columnId)
This is a convenience method to allow overriding the either
the display name for an attribute or to allow setting the title
on a column when the name/handle of the column is not an attribute
of the BinaryLink or OtherSide object.
Supported API: false
setHeaderFromResource
in interface TableHeaderSetter
resourceBundleName
- resourceBundleKey
- columnId
- public void setHeaderFromTargetClass(String targetClassName, Object columnId)
setHeaderFromTargetClass
in interface TableHeaderSetter
targetClassName
- columnId
- public String getColumnName(String attribute, Object target)
protected Vector getSetValues()
protected void setSetValues(Vector newSetValues)
public void setResultVector(Vector resultsVector)
The parameter resultsVector will have to be a Vector of BinaryLink objects. Further, before calling this method, the Role attribute will have to be initialized.
resultsVector
- protected WTAttribute newWTAttribute()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |