Customizing link media

This operation is similar to adding a new function or family for network elements.

How to create a new link medium (using the API)

To create a new link medium, you must extend the IltLink.Media enumeration. You can map the new medium to an icon.
IltLink.Media satellite = new IltLink.Media("satellite");
IlpContext context = IltSystem.GetDefaultContext();
IlpImageRepository imageRep = context.getImageRepository();
Image satelliteImage = imageRep.getImage("sat.png");
IltSettings.SetValue("Link.Media.satellite.Icon", satelliteImage);

How to create a new link medium (using CSS)

You can create new link media by using global CSS settings.
setting."ilog.tgo.model.IltLink"{
  media[0]: @+linkMedia0;
}
Subobject#linkMedia0 {
  class: 'ilog.tgo.model.IltLink.Media'; 
  name: "satellite";
}
For more information, see Using global settings.

How to customize a link medium (using CSS)

You can obtain the same customization as with the API by 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.IltLink.Media"[name="satellite"] {
   icon: '@|image("sat.png")';
}
The following properties allow you to customize the representation of link media:
CSS properties for link media
Property Name
Type
Set
Default Value
Description
mediaVisible
boolean
No
true
Defines whether the media icon is visible or not.
mediaIcon
Image
Yes
The image defined for each media value in IltSettings
Defines the image to be used to represent the media in a given link.

How to hide link media

You can show or hide link media using the property mediaVisible as follows:
object."ilog.tgo.model.IltLink" {
  mediaVisible: false;
}

Tooltips for link media

Link media are associated with a default tooltip which is retrieved from the JViews TGO resource bundle (see About globalization in the Context and Deployment Descriptor documentation).
The resource that applies to link media is:
  • ilog.tgo.Link_Media_<MEDIA NAME>_ToolTip : link media tooltips
For the predefined link media, you can edit this value directly in the JViews TGO resource bundle file.
For newly created media values, the tooltip information will also be retrieved from this resource bundle. As you declare new media, register the corresponding entry in the resource bundle file so that tooltips can be automatically displayed.
Considering that you have created the link media "satellite" , you should declare the entry in the resource bundle file as follows:
  • ilog.tgo.Link_Media_satellite_ToolTip=Satellite