| Styling > Customizing Network Elements > Customizing Network Element Functions |
Customizing Network Element Functions |
INDEX
PREVIOUS
NEXT
|
This section explains how to create new network element functions and their related icons. This operation is performed in three steps:
IltNetworkElement.Function enumeration by instantiating the class IltNetworkElement.Function.
Image corresponding to the icon that will be associated with the new function is created.
SetValue member function in the class IltSettings.
The following example shows how to add a Router function and associate it with an icon, which is stored in a file called router.gif.
IlpContext context = IltSystem.GetDefaultContext();
IltNetworkElement.Function router = new IltNetworkElement.Function("router");
Image routerIcon = context.getImageRepository().getImage("router.gif");
IltSettings.SetValue("NetworkElement.Function.Router.Icon", routerIcon);
You can also create new network element functions by using global CSS settings (see Using Global Settings in Chapter 2, Using Cascading Style Sheets for more information):
setting."ilog.tgo.model.IltNetworkElement"{
functions[0]: @+neFunction0;
}
Subobject#neFunction0 {
class: 'ilog.tgo.model.IltNetworkElement.Function';
name: "router";
}
Likewise, you can customize the icon using global CSS settings. To do so, you need to specify the full path to the object to be customized, as well as the value of its name attribute in order to match the right object in the system. The CSS property to customize here is icon.
setting."ilog.tgo.model.IltNetworkElement.Function"[name="router"] {
icon: '@|image("router.gif")';
}
The following property is used to customize the display of network element functions:
Property Name |
Type |
Default Value |
Description |
|---|---|---|---|
functionVisible | boolean | true |
Controls whether the function icon of a network element is shown or not |
Network element functions provide a default tooltip which is retrieved from the JViews TGO resource bundle (see About Internationalization in the Context and Deployment Descriptor documentation).
The resource that applies to network element functions is:
For the predefined network element functions, you can edit the value directly in the JViews TGO resource bundle file.
For newly created network element functions, the tooltip information will also be retrieved from this resource bundle. As you declare new network element functions, register the corresponding entries into the resource bundle file.
Considering that you have created the network element function "router", you should declare the entry in the resource bundle file as follows:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |