Interface INavigatorFilterService
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 Summary
Modifier and TypeMethodDescriptionvoid
activateFilterIdsAndUpdateViewer
(String[] theFilterIds) Cause the specified set of filters to be activated, and any filters not specified to be deactivated.getViewerFilter
(ICommonFilterDescriptor theDescriptor) Return the viewer filter for the given descriptorVisible filters are filters whose ids match a viewerContentBinding for the corresponding viewer.getVisibleFilters
(boolean toReturnOnlyActiveFilters) Determine the set of filters which are visible to the content service associated with this filter service.boolean
void
Persist the current activation state for visible filters.void
setActiveFilterIds
(String[] theFilterIds) Activate the set of given filters.
-
Method Details
-
getVisibleFilters
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
- 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
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 tosetActiveFilterIds(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
Activate the set of given filters. An active filter will always be returned fromgetVisibleFilters(boolean)
. An inactive filter will only be returned fromgetVisibleFilters(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.
-