The following example shows you how to
extend a table component with new attributes.
// Create a table component
IlpTable tableComponent = new IlpTable();
// Get the Alarm class
IlpClass alarmClass = context.getClassManager().getClass("Alarm");
// Set the datasource to the component, and show instances
// of the Alarm class
tableComponent.setDataSource(dataSource, alarmClass);
// Add custom attributes
// Get the existing severity attribute
IlpAttribute severity = alarmClass.getAttribute("perceivedSeverity");
// Create a 'Short severity' attribute that represents the severity
// in a concise way
IlpAttribute shortSeverityAttribute =
new IlpReferenceAttribute("shortSeverity", severity);
tableComponent.addAttribute(shortSeverityAttribute);
IlpReferenceAttribute models an attribute
instance that is a reference to another attribute. In this
example, the value returned from querying
perceivedSeverity
and
shortSeverity
is the same.