Perforce JViews TGO Sample: Table Component - Custom Attributes
Description
This sample shows how to add custom attributes to a JViews TGO table component.
How to Use the Sample
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
table-customAttributes.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
-
Basic initialization and usage.
See the table/basic sample for details. - Creating reference and computed attributes.
- Adding custom attributes to the table component.
- Using fixed table columns.
- Configuring a table component using cascading style sheets.
Detailed Description
This sample differs from the basic sample in that:
- It shows instances of custom business classes, and that it adds reference and computed attributes dynamically. These attributes are not defined in the class, but added to the individual table.
- The first two columns of the table are fixed.
Installation Directory
The Table Component - Custom Attributes sample is installed here.
Classes Involved
-
ilog.tgo.IltSystem
The class that initializes a JViews TGO application.
-
ilog.tgo.datasource.IltDefaultDataSource
The default datasource implementation.
-
ilog.cpl.IlpTable
The table component.
-
ilog.cpl.model.IlpComputedAttribute
The attribute that is computed from another business attribute.
-
ilog.cpl.model.IlpReferenceAttribute
The attribute that refers to another business attribute.
-
ilog.cpl.css.function.IlpResourceFunction
The CSS function that retrieves a resource from a resource bundle.
Source Files
-
customAttributes.Main
The entry point of the sample.