Filtering

The equipment component allows you to filter the nodes that are displayed. To do so, attach an instance of IlpFilter to the equipment component by using the method setFilter . The accept method of the filter object will be invoked whenever the equipment is prompted to display an IlpObject. If the method returns false , the object will not be shown in the equipment view. 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 IltShelf.

How to filter objects to be shown in the equipment component

IlpEquipment equipment = // ...
// 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 == IltShelf
    return clz.equals(IltShelf.GetIlpClass());
  }
// Set the filter to the equipment
equipment.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 .