Adding a user-defined business attribute to the system window
Properties of predefined business objects in the system window
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 add attributes to the System window through the properties listed in the following table.
CSS Property | Type of Value | Default | Usage |
visibleInSystemWindow | boolean | false | Indicates that the attribute should be displayed in the System window. |
label | String | null | Indicates the value to be used to represent the attribute in the System window. |
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 properties listed in the following table.
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. |
Important An attribute is only added to the System window if the value visibleInSystemWindow is set and if the label property is defined with a meaningful value.
Important Predefined attributes such as Name or ObjectState are not added to the System window, since they are already graphically represented by other decorations.
How to extend a predefined business class
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 CSS file is provided as part of the
JViews TGO demonstration software at
<installdir> /samples/network/customClasses/data/customClasses.xml.
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>
How to display an attribute in the system window
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 © 2018, Rogue Wave Software, Inc. All Rights Reserved.