Interface INavigatorFilterService


public interface INavigatorFilterService
Provides support for managing the filters defined for a Common Navigator viewer.

An INavigatorFilterService manages the available common filters and their current activation state for a particular INavigatorContentService. An INavigatorFilterService cannot be acquired without an INavigatorContentService (through INavigatorContentService.getFilterService()). Each instance will provide information specific to the content service associated with it.

The visibility of commonFilters is controlled through matching viewerContentBindings. That is, like content extensions, the id of a commonFilter must match an includes expression for at least one viewerContentBinding element for the corresponding INavigatorContentService.

The activation of each filter should be persisted from session to session. Clients of this interface have control over when the persistence occurs. In particular, clients should call persistFilterActivationState() after each call to setActiveFilterIds(String[]).

Since:
3.2
See Also:
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Method Details

    • getVisibleFilters

      ViewerFilter[] getVisibleFilters(boolean toReturnOnlyActiveFilters)
      Determine the set of filters which are visible to the content service associated with this filter service.
      Parameters:
      toReturnOnlyActiveFilters - True indicates that only active filters should be returned.
      Returns:
      An array of ViewerFilters that should be applied to the viewer rendering the content from this INavigatorContentService
    • getVisibleFilterDescriptors

      ICommonFilterDescriptor[] getVisibleFilterDescriptors()
      Visible filters are filters whose ids match a viewerContentBinding for the corresponding viewer.
      Returns:
      An array of all visible filter descriptors.
    • isActive

      boolean isActive(String aFilterId)
      Parameters:
      aFilterId - Check the activation of aFilterId for the content service corresponding to this filter service.
      Returns:
      True if the filter specified by the id is active for the content service corresponding to this filter service.
    • activateFilterIdsAndUpdateViewer

      void activateFilterIdsAndUpdateViewer(String[] theFilterIds)
      Cause the specified set of filters to be activated, and any filters not specified to be deactivated. Updates the viewer filters for the associated viewer. This is a higher level operation that handles the filter activation completely, in contrast to setActiveFilterIds(String[]) which does not set the viewer filter state. This is probably the one you want if you are changing filters.
      Parameters:
      theFilterIds - An array of filter ids to activate.
      Since:
      3.5
    • setActiveFilterIds

      void setActiveFilterIds(String[] theFilterIds)
      Activate the set of given filters. An active filter will always be returned from getVisibleFilters(boolean). An inactive filter will only be returned from getVisibleFilters(boolean) when it is called with false.
      Parameters:
      theFilterIds - An array of filter ids to activate.
    • persistFilterActivationState

      void persistFilterActivationState()
      Persist the current activation state for visible filters.
    • getViewerFilter

      ViewerFilter getViewerFilter(ICommonFilterDescriptor theDescriptor)
      Return the viewer filter for the given descriptor
      Parameters:
      theDescriptor - A non-null filter descriptor.
      Returns:
      the viewer filter for the given descriptor
      Since:
      3.3