Perforce JViews TGO Sample: Equipment Component - Styling
Description
This sample shows how to customize the rendering of the business objects in the equipment using cascading style sheets (CSS).
How to Use the Sample
A checkbox list is available to enable/disable specific CSS customizations. Enabling a checkbox will make the application parse a specific CSS file so that the corresponding customization is applied. Disabling a checkbox will remove the CSS customization. In this sample, the configuration of the following elements is illustrated:
- Adapter: sets the filter and origins on the equipment component adapter.
- Toolbar: adds buttons to the toolbar.
See the ilog.cpl.equipment.renderer.IlpToolBarRenderer class. - View: customizes properties in the equipment view.
See the ilog.cpl.equipment.renderer.IlpViewRenderer class. - Overview: customizes the visibility and availability of the overview window.
See the ilog.cpl.equipment.renderer.IlpOverviewRenderer class. - Interactor: customizes the default interactor to use.
This should be the name of one of the buttons of the toolbar or the default view interactor instance. See the ilog.cpl.equipment.renderer.IlpInteractorRenderer class. - Zooming: customizes the zoom policy applied to the equipment view.
See the ilog.cpl.equipment.renderer.IlpZoomingRenderer class. - Graph Layout: applies a graph layout to the equipment component.
Please note that once the node layout is performed in the equipment component, the nodes are repositioned. Resetting the node layout does not turn the equipment objects to their original position. To return to the original state, reload the business objects in the equipment component. See the ilog.cpl.equipment.renderer.IlpGraphLayoutRenderer class. - Link Layout: applies a link layout to the equipment component.
See the ilog.cpl.equipment.renderer.IlpLinkLayoutRenderer class. - Label Layout: configures a label layout for the equipment component.
Please note that the label layout is not applied automatically to the equipment component. You can perform the label layout by clicking on the Perform Label Layout button that is available in the equipment component toolbar. See the ilog.cpl.equipment.renderer.IlpLabelLayoutRenderer class. - Backgrounds: configures a background for the equipment component.
See the ilog.cpl.equipment.renderer.IlpBackgroundsRenderer class.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
equipment-styling.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
- Initializing a JTGO application using a deployment descriptor
- Creating a data source
- Reading data from an XML file into a data source
- Creating an equipment component and configuring it using multiple CSS configuration files
- Associating the data source with the equipment component
Detailed Description
This sample differs from the basic sample in that it allows the user to interact with the CSS files being applied on the equipment view, equipment adapter and the business objects.
Installation Directory
The Equipment Component - Styling 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.IlpEquipment
The equipment component.
-
ilog.cpl.equipment.renderer.IlpToolBarRenderer
This class gives control over the toolbar of an equipment component.
-
ilog.cpl.equipment.renderer.IlpBackgroundsRenderer
This class gives control over the backgrounds of an equipment component.
-
ilog.cpl.equipment.renderer.IlpViewRenderer
This class gives control over the view of an equipment component.
-
ilog.cpl.equipment.renderer.IlpOverviewRenderer
This class gives control over the overview of an equipment component.
-
ilog.cpl.equipment.renderer.IlpInteractorRenderer
This class gives control over the interactors of an equipment component.
-
ilog.cpl.equipment.renderer.IlpZoomingRenderer
This class gives control over the zoom policy of an equipment component.
-
ilog.cpl.equipment.renderer.IlpGraphLayoutRenderer
This class gives control over the graph layout of an equipment component.
-
ilog.cpl.equipment.renderer.IlpLinkLayoutRenderer
This class gives control over the link layout of an equipment component.
-
ilog.cpl.equipment.renderer.IlpLabelLayoutRenderer
This class gives control over the label layout of an equipment component.
-
ilog.cpl.equipment.renderer.IlpPositioningRenderer
This class gives control over the position of an equipment component.
Source Files
-
styling.Main
The entry point of the sample.
-
styling.CustomFilter
The adapter filter custom implementation.
-
styling.CustomPopupMenuFactory
The factory that creates the pop-up menu in the objects.