wt.templateutil.table
Class AssociationTableModel

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

public class AssociationTableModel
extends Object
implements TableModelStub, AddColumn, TableHeaderSetter

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

RESOURCE

private static final String RESOURCE
Deprecated. 
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Deprecated. 

wtAttribute

private WTAttribute wtAttribute
Deprecated. 

mode

private String mode
Deprecated. 

linkObjects

private Vector linkObjects
Deprecated. 

otherSideObjects

private Vector otherSideObjects
Deprecated. 

linkColumns

private Vector linkColumns
Deprecated. 

otherSideColumns

private Vector otherSideColumns
Deprecated. 

role

private String role
Deprecated. 

otherSideClass

private Class otherSideClass
Deprecated. 

linkClassName

private String linkClassName
Deprecated. 

locale

private Locale locale
Deprecated. 

queryResults

private QueryResult queryResults
Deprecated. 

COLUMNTYPE

public static final String COLUMNTYPE
Deprecated. 
See Also:
Constant Field Values

OTHERSIDE

public static final String OTHERSIDE
Deprecated. 
See Also:
Constant Field Values

LINK

public static final String LINK
Deprecated. 
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE
Deprecated. 

combinedColumns

protected Vector combinedColumns
Deprecated. 

targetClass

private Properties targetClass
Deprecated. 

resourceBundle

private Properties resourceBundle
Deprecated. 

resourceKey

private Properties resourceKey
Deprecated. 

setValues

private Vector setValues
Deprecated. 
Constructor Detail

AssociationTableModel

public AssociationTableModel()
Deprecated. 
Method Detail

getWtAttribute

public WTAttribute getWtAttribute()
Deprecated. 
Gets the WTAttribute object used by the getValueAt method

Supported API: false

Returns:
wt.templateutil.table.WTAttribute

setWtAttribute

public void setWtAttribute(WTAttribute a_WtAttribute)
Deprecated. 
Sets the WTAttribute object used by the getValueAt method

Supported API: false

Parameters:
a_WtAttribute -

getMode

public String getMode()
Deprecated. 
Gets the mode of the Table. The mode should be one of the static Strings defined by the wt.templateutil.components.HTMLComponent class as defining the current mode.

Supported API: false

Returns:
String

setMode

public void setMode(String a_Mode)
Deprecated. 
Sets the mode of the table. Is the table to present information in a View mode, an Update mode, or a Create mode.

Not currently implemented.

Supported API: false

Parameters:
a_Mode -

getLinkObjects

public Vector getLinkObjects()
Deprecated. 
Gets the Vector of BinaryLinks from the navigation.

The BinaryLink at position i in the Vector is the BinaryLink for row i.

Supported API: false

Returns:
Vector

setLinkObjects

public void setLinkObjects(Vector a_LinkObjects)
Deprecated. 
Sets the Vector of BinaryLinks from the navigation.

The BinaryLink at position i in the Vector is the BinaryLink for row i.

Supported API: false

Parameters:
a_LinkObjects -

getOtherSideObjects

public Vector getOtherSideObjects()
Deprecated. 
Gets the Vector of OtherSide object from the BinaryLink objects.

The OtherSide object at position i in the Vector is the OtherSide object for row i.

Supported API: false

Returns:
Vector

setOtherSideObjects

public void setOtherSideObjects(Vector a_OtherSideObjects)
Deprecated. 
Sets the Vector of OtherSide object from the BinaryLink objects.

The OtherSide object at position i in the Vector is the OtherSide object for row i.

Supported API: false

Parameters:
a_OtherSideObjects -

getLinkColumns

public Vector getLinkColumns()
Deprecated. 
Gets the list of column names/handles for the BinaryLinks.

Supported API: false

Returns:
Vector

setLinkColumns

public void setLinkColumns(Vector a_LinkColumns)
Deprecated. 
Sets the list of column names/handles for the BinaryLinks.

Supported API: false

Parameters:
a_LinkColumns -

getOtherSideColumns

public Vector getOtherSideColumns()
Deprecated. 
Gets the list of column names/handles for the OtherSide objects.

Supported API: false

Returns:
Vector

setOtherSideColumns

public void setOtherSideColumns(Vector a_OtherSideColumns)
Deprecated. 
Sets the list of column names/handles for the OtherSide objects.

Supported API: false

Parameters:
a_OtherSideColumns -

getRole

public String getRole()
Deprecated. 
Gets the Role of the OtherSide classes in the navigation.

Supported API: false

Returns:
String

setRole

public void setRole(String a_Role)
Deprecated. 
Sets the Role of the OtherSide classes in the navigation.

Supported API: false

Parameters:
a_Role -

getOtherSideClass

public Class getOtherSideClass()
Deprecated. 
Gets the Class of the OtherSide objects.

Supported API: false

Returns:
Class

setOtherSideClass

public void setOtherSideClass(Class a_OtherSideClass)
Deprecated. 
Sets the Class of the OtherSide objects.

Supported API: false

Parameters:
a_OtherSideClass -

getLinkClassName

public String getLinkClassName()
Deprecated. 
Gets a String that is the fully qualified class name of the BinaryLinks

Supported API: false

Returns:
String

setLinkClassName

public void setLinkClassName(String a_LinkClassName)
Deprecated. 
Sets a String that is the fully qualified class name of the BinaryLinks

Supported API: false

Parameters:
a_LinkClassName -

getLocale

public Locale getLocale()
Deprecated. 
Gets the Locale used to initialize the WTAttrbute.

Supported API: false

Returns:
Locale

setLocale

public void setLocale(Locale a_Locale)
Deprecated. 
Sets the Locale used to initialize the WTAttrbute.

Supported API: false

Parameters:
a_Locale -

getQueryResults

public QueryResult getQueryResults()
Deprecated. 
Gets the QueryResult used to initialize the AssociationTableModel, if one was used.

Supported API: false

Returns:
QueryResult

setQueryResults

public void setQueryResults(QueryResult a_QueryResults)
Deprecated. 
Sets the QueryResult to be used initialize the AssociationTableModel. This method assumes that the QueryResult is a list of BinaryLink objects. This method will use the QueryResult to initialize the OtherSide objects based on the settings of the Role.

Supported API: false

Parameters:
a_QueryResults -

getLinkObject

public Object getLinkObject(int rowIndex)
Deprecated. 
Returns the BinaryLink associated with row rowIndex.

Supported API: false

Parameters:
rowIndex -
Returns:
Object

getOtherSideObject

public Object getOtherSideObject(int rowIndex)
Deprecated. 
Returns the OtherSide object associated with row rowIndex.

Supported API: false

Parameters:
rowIndex -
Returns:
Object

setLinkCheckboxColumn

public void setLinkCheckboxColumn()
Deprecated.  

Changes the checkbox to use the link object for it's context.

Supported API: false


setLinkRowContextObject

public void setLinkRowContextObject()
Deprecated.  

Changes the row context object to use the link object.

Supported API: false


addTableModelListener

public void addTableModelListener(TableModelListener l)
Deprecated. 
Not implemented for the AssociationTableModel

Supported API: false

Specified by:
addTableModelListener in interface TableModelStub
Parameters:
l -

getColumnClass

public Class getColumnClass(int columnIndex)
Deprecated. 
Returns the class of the column.

Currently, only a java.lang.Object class object is returned.

Supported API: false

Specified by:
getColumnClass in interface TableModelStub
Parameters:
columnIndex -
Returns:
Class

getColumnCount

public int getColumnCount()
Deprecated. 
Returns the tolal number of columns in the TableModel, including the BinaryLink objects and the OtherSide objects.

Supported API: false

Specified by:
getColumnCount in interface TableModelStub
Returns:
int

getColumnName

public String getColumnName(int columnIndex)
Deprecated. 
There are several possible return values. Here are the possibilities

Supported API: false

Specified by:
getColumnName in interface TableModelStub
Parameters:
columnIndex -
Returns:
String

getRowCount

public 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.

Supported API: false

Specified by:
getRowCount in interface TableModelStub
Returns:
int

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Deprecated. 
Returns the value for the cell at position ( rowIndex , 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

Specified by:
getValueAt in interface TableModelStub
Parameters:
rowIndex -
columnIndex -
Returns:
Object

isCellEditable

public 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.

Supported API: false

Specified by:
isCellEditable in interface TableModelStub
Parameters:
rowIndex -
columnIndex -
Returns:
boolean

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Deprecated. 
Currently not implemented.

Supported API: false

Specified by:
removeTableModelListener in interface TableModelStub
Parameters:
l -

setValueAt

public void setValueAt(Object value,
                       int rowIndex,
                       int columnIndex)
Deprecated. 
Sets value at the position ( rowIndex , columnIndex).

Currently, if the position is not formally in the table, that value is set and no exception is thrown.

Supported API: false

Specified by:
setValueAt in interface TableModelStub
Parameters:
value -
rowIndex -
columnIndex -

addColumn

public void addColumn(Properties props)
               throws WTException
Deprecated. 
Adds a column to the AssociationTableModel using the information in the parameters props.

The required values passed in the props parameter are :

If either one of these is not passed in the props parameter, and exception will be thrown.

Supported API: false

Specified by:
addColumn in interface AddColumn
Parameters:
props -
Throws:
WTException

getIdentifier

public Object getIdentifier(int columnIndex)
Deprecated. 
Returns the name/handle of the column at columnIndex.

Supported API: false

Specified by:
getIdentifier in interface ColumnIdentifier
Parameters:
columnIndex -
Returns:
Object

setHeaderFromResource

public 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.

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

Specified by:
setHeaderFromResource in interface TableHeaderSetter
Parameters:
resourceBundleName -
resourceBundleKey -
columnId -

setHeaderFromTargetClass

public 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.

Supported API: false

Specified by:
setHeaderFromTargetClass in interface TableHeaderSetter
Parameters:
targetClassName -
columnId -

getColumnName

public String getColumnName(String attribute,
                            Object target)
Deprecated. 

getSetValues

protected Vector getSetValues()
Deprecated. 

setSetValues

protected void setSetValues(Vector newSetValues)
Deprecated. 

setResultVector

public void setResultVector(Vector resultsVector)
Deprecated. 
Set the Vector of BinaryLink objects and consquently the Vector of OtherSide objects.

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.

Parameters:
resultsVector -

newWTAttribute

protected WTAttribute newWTAttribute()
Deprecated.