| Graphic Components > Table Component > Configuring the Table Component > Loading a Project File |
Loading a Project File |
INDEX
PREVIOUS
NEXT
|
A project is a combination of style sheets that supply rendering information and a data source that supplies the data to be represented in a table component. A project is saved as an XML file with extension .itpr.
Loading a project file is the recommended way to configure a graphic component in Java as it is the fastest.
The following code sample shows how to load a project file into a table component, using the method setProject.
IlpTable table = new IlpTable();
table.setProject(new URL("file:project.itpr");
The project is represented by the IlpTGOProject class, included in the package ilog.cpl.project. When a new project is created, the style sheet and data source are both null.
The following code sample shows how to create a new project file by setting the style sheets and data source, then saving the project.
IlpTGOProject project = new IlpTGOProject();
project.setStyleSheet(new URL("file:example.css");
IltDefaultDataSource dataSource = new IltDefaultDataSource();
dataSource.setFileName("data.xml");
project.setDataSource(dataSource);
project.write(new URL("file:example.itpr");
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |