Filtering

The network component allows you to filter the nodes that are displayed. To do so, attach an instance of IlpFilter to the network component by using the method setFilter . The accept() method of the filter object will be invoked whenever the network is prompted to display an IlpObject. If the method returns false , the object will not be shown in the network. In the same way, an object will not be shown if its parent is not displayed.
For example, write the following code to show only objects of the class IltNetworkElement.

How to filter objects to be shown in the network component

IlpNetwork network = // ...
// Create a new IlpFilter instance
IlpFilter filter = new IlpFilter(){
  // This method is called for every object in the data source
  public boolean accept (Object object){
    IlpObject ilpObject = (IlpObject)object;
    IlpClass clz = ilpObject.getIlpClass();
    // Check if the class == IltNetworkElement
    return clz.equals(IltNetworkElement.GetIlpClass());
  }
// Set the filter to the network
network.setFilter(filter);
All the objects are refiltered whenever a new filter is set. If the filter is null (which is the default), all the objects under the root nodes will be displayed.
To retrieve the active filter, use the method getFilter.
Note
The filtering takes actually place at the adapter level.
To see how to configure filtering through CSS, refer to The Adapter rule.