skip to main content
Programmers documentation > Styling > Customizing network elements > Customizing network element functions
 
Customizing network element functions
You need to do the following:
*Add a new entry to the IltNetworkElement.Function enumeration by instantiating the class IltNetworkElement.Function.
*Create an Image corresponding to the icon that will be associated with the new function.
*Map the icon to the function instance. Refer to the SetValue member function in the class IltSettings.
You can also customize the functions
How to add a function and associate It with an Icon (using the API)
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);
How to add a function, associate It with an icon, and customize the icon (using CSS)
You can create new network element functions by using global CSS settings.
 
setting."ilog.tgo.model.IltNetworkElement"{
  functions[0]: @+neFunction0;
}
Subobject#neFunction0 {
  class: 'ilog.tgo.model.IltNetworkElement.Function';
  name: "router";
}
You can also 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")';
}
See Using global settings for more information.
Showing and hiding function icons
The following property is used to customize the display of network element functions:
CSS Properties for 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
Declaring tooltips for function icons
Network element functions provide a default tooltip which is retrieved from the JViews TGO resource bundle. See About globalization.
The resource that applies to network element functions is:
*ilog.tgo.NetworkElement_Function_<FUNCTION NAME>_ToolTip : network element function tooltips
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 in 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:
*ilog.tgo.NetworkElement_Function_router_ToolTip=Router

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.