Class AssociationTableModel

java.lang.Object
wt.templateutil.table.AssociationTableModel
All Implemented Interfaces:
TableModel, AddColumn, ColumnIdentifier, TableHeaderSetter, TableModelStub
Direct Known Subclasses:
UpdateDocumentTableModel

public class AssociationTableModel extends Object implements TableModelStub, AddColumn, TableHeaderSetter
Deprecated.
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