| Styling > Using Cascading Style Sheets > Adding a User-defined Business Attribute to the System Window |
Adding a User-defined Business Attribute to the System Window |
INDEX
PREVIOUS
NEXT
|
This use case applies to the network and equipment graphic components.
In the network and equipment graphic components, predefined business objects can have a specific graphic called the System window, which displays a list of attribute values. You can easily add attributes to the System window through these properties:
You can also specify the description of the attribute. If the description is set, the attribute will be displayed in the System window in the format <description: value>.
The attribute description is configured with the following properties:
CSS Property |
Type of Value |
Default |
Usage |
|---|---|---|---|
captionLabel | String | null |
Indicates the label of the description. |
captionLabelVisible | boolean | true |
Indicates whether the description is displayed or not. |
The following example shows how to create a class that extends IltNetworkElement and to declare the new attributes site and vendor.
In this customization you see that the attribute site is added to the System window and is displayed in the format Site: value.
The following example is from the file:
<installdir>/samples/network/customClasses/data/customClasses.xml
where <installdir> is the directory where you have installed JViews TGO.
The following extract in XML shows how to define the business class.
<class>
<name>NMW</name>
<superClass>ilog.tgo.model.IltNetworkElement</superClass>
<attribute>
<name>site</name>
<javaClass>java.lang.String</javaClass>
</attribute>
<attribute>
<name>vendor</name>
<javaClass>java.lang.String</javaClass>
</attribute>
</class>
The following extract in CSS shows how to declare the new attribute, so that its content is displayed in the System window.
Attributes are configured in CSS with the type object and the CSS class formatted as business class/attribute name.
object."NMW/site" {
label: @site;
visibleInSystemWindow: true;
captionLabel: Site;
captionLabelVisible: true;
}
The property visibleInSystemWindow indicates that the attribute is to be displayed inside the System window graphic.
The property label indicates that the attribute site is to be represented as text with the value of the attribute.
The properties captionLabelVisible and captionLabel indicate whether or not the attribute is to be displayed with a description in the System window.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |