<?xml version="1.0"?> <tgo xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation = "ilog/cpl/schema/project.xsd" style="configurationFile1.css,configurationFile2.css"> <datasource javaClass="ilog.tgo.datasource.IltDefaultDataSource" fileName="table.xml"/> </tgo>
IlpTable.setStyleSheets
as follows:
tableComponent = new IlpTable(); try { tableComponent.setStyleSheets(new String[] { myConfigurationFile1,myConfigurationFile2 }); } catch (Exception e) { }
<installdir>
is the directory where you have installed JViews TGO.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Table Component configuration // Type: Table // // This is the main selector when customizing // a table component. It identifies the // sub-components that will be addressed in the // CSS customization. In the Table Component, it // is possible to customize the view, controller // and adapter using CSS. // // List of available properties: // - view: boolean // - interactor: boolean // - adapter: boolean // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Table { view: true; interactor: true; }
adapter
is not taken into account unless
adapter: true
is declared in the Table rule.
CSS
property |
Type
of value |
Default
|
Usage
|
---|---|---|---|
view
|
boolean
|
false
|
Enables
the customization of the table view. |
interactor
|
boolean
|
false
|
Enables
the customization of the table interactors. |
adapter
|
boolean
|
false
|
Enables
the customization of the table adapter. |
CSS
property |
Type
of value |
Default
|
Usage
|
---|---|---|---|
autoResizeMode
|
AUTO_RESIZE_OFF
|
Resize
mode of the table. Possible values are:
AUTO_RESIZE_OFF
AUTO_RESIZE_ALL_COLUMNS
AUTO_RESIZE_LAST_COLUMN
.
|
|
background
|
Color
|
null
|
Color
to be used in the background of the table view. By default,
the color is gray. |
gridColor
|
Color
|
null
|
Color
to be used for the table grid. |
showGrid
|
Boolean
|
true
|
Determines
whether the grid is displayed or not. |
showHorizontalLines
|
Boolean
|
true
|
Determines
whether the grid horizontal lines are displayed or not. |
showVerticalLines
|
Boolean
|
true
|
Determines
whether the grid vertical lines are displayed or not. |
rowMargin
|
Integer
|
1
|
Height
in pixels of the margin between each row. |
columnMargin
|
Integer
|
1
|
Width
in pixels of the margin between each column. |
reorderingAllowed
|
Boolean
|
true
|
Determines
whether the user is allowed to reorder the columns of the
table. |
fixedColumnCount
|
Integer
|
0
|
Defines
the number of fixed columns. |
headerRenderer
|
The
renderer used to perform the graphic representation of the
headers of the table columns. |
||
defaultRenderer
|
The
renderer used to perform the graphic representation of the
table cells. |
||
selectionMode
|
MULTIPLE_OBJECTS_SELECTION
|
Selection
mode of the table. Possible values are:
EMPTY_SELECTION
SINGLE_OBJECT_SELECTION
MULTIPLE_OBJECTS_SELECTION
SINGLE_ATTRIBUTE_SELECTION
MULTIPLE_ATTRIBUTES_SELECTION
SINGLE_CELL_SELECTION
MULTIPLE_CELLS_SELECTION
|
Table { view: true; }
View { reorderingAllowed : true; autoResizeMode : AUTO_RESIZE_OFF; selectionMode : MULTIPLE_OBJECTS_SELECTION; fixedColumnCount: 1; }
Property
name |
Type |
Default
value |
Usage
|
---|---|---|---|
viewInteractor
|
Defines
the interactor that handles events in the view. |
||
headerInteractor
|
Defines
the interactor that handles events in the table header. |
Table { interactor: true; }
Interactor { viewInteractor: @+viewInt; headerInteractor: @+headerInt; } Subobject#viewInt { class: 'ilog.cpl.table.interactor.IlpDefaultTableViewInteractor'; } Subobject#headerInt { class: 'ilog.cpl.table.interactor.IlpDefaultTableHeaderInteractor'; }
Property
name |
Property
type |
---|---|
filter
|
ilog.cpl.util.IlpFilter
|
acceptedClass
|
String
|
excludedClasses
|
list of IlpClass
|
representationObjectFactory
|
ilog.cpl.table.IlpTableRowFactory
|
Table { adapter: true; }
Adapter { filter: @+tableFilter; acceptedClass: ’ilog.tgo.model.IltNetworkElement; representationObjectFactory: @+repObjFactory; } Subobject#tableFilter { class: MyTableFilter; } Subobject#repObjFactory { class: MyRepresentationObjectFactory; }
getMutableStyleSheet()
method in the table adapter API:
IlpMutableStyleSheet mutable = adapter.getMutableStyleSheet();
setStyleSheet()
API:
IlpMutableStyleSheet mutable = new IlpMutableStyleSheet(adapter); try { adapter.setStyleSheets(new String[] { mutable.toString() }); } catch (Exception x) { x.printStackTrace(); }
mutable.setDeclaration("#myObjectId", "expansion", "NO_EXPANSION");
#myObjectId { expansion: NO_EXPANSION; }
setStyleSheet()
method:
try { adapter.setStyleSheets(new String[] { mutable.toString() }); } catch (Exception x) { x.printStackTrace(); }
// Update the expansion type for 'myObjectId' mutable.setDeclaration("#myObjectId", "expansion", "IN_PLACE"); // Add a new declaration mutable.setDeclaration("#myOtherId", "expansion", "IN_PLACE");
setStyleSheet()
API is invoked and a new set of style sheets is applied to
the adapter.
setUpdateMask()
and
setAdjusting()
.
setUpdateMask()
Adapter { origins[0]: id0; origins[1]: id1; showOrigin: true; filter: @+myFilter; }
#myObjectId { expansion: IN_PLACE; }
setUpdateMask()
are:
IlpStylable.UPDATE_COMPONENT_MASK
: Only the adapter part is recustomized.
IlpStylable.UPDATE_OBJECTS_MASK
: Only the representation object part is recustomized.
IlpStylable.UPDATE_ALL_MASK
: Bot the adapter and representation object parts are
recustomized.
IlpStylable.UPDATE_NONE_MASK
: Nothing is recustomized.
UPDATE_OBJECTS_MASK
as there is no need to reapply the CSS configuration for the
adapter part:
mutable.setUpdateMask(IlpStylable.UPDATE_OBJECTS_MASK); mutable.setDeclaration("object", "expansion", "IN_PLACE");
setAdjusting()
true
, the mutable style sheet puts all the calls to
setDeclaration()
into a queue. When the method is set back to
false
, all the queued declarations are processed in a batch:
mutable.setAdjusting(true); mutable.setDeclaration("#myObjectId", "expansion", "IN_PLACE"); mutable.setDeclaration("#myOtherId", "expansion", "IN_PLACE"); mutable.setAdjusting(false);