Eclipse Platform
Release 3.3

org.eclipse.ui.navigator
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[]).

This interface is not intended to be implemented by clients.

Since:
3.2
See Also:
INavigatorContentService.getFilterService(), ViewerFilter

Method Summary
 ViewerFilter getViewerFilter(ICommonFilterDescriptor theDescriptor)
          Return the viewer filter for the given descriptor
 ICommonFilterDescriptor[] getVisibleFilterDescriptors()
          Visible filters are filters whose ids match a viewerContentBinding for the corresponding viewer.
 ViewerFilter[] getVisibleFilters(boolean toReturnOnlyActiveFilters)
          Determine the set of filters which are visible to the content service associated with this filter service.
 boolean isActive(String aFilterId)
           
 void persistFilterActivationState()
          Persist the current activation state for visible filters.
 void setActiveFilterIds(String[] theFilterIds)
          Activate the set of given filters.
 

Method Detail

getVisibleFilters

public 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

public ICommonFilterDescriptor[] getVisibleFilterDescriptors()
Visible filters are filters whose ids match a viewerContentBinding for the corresponding viewer.

Returns:
An array of all visible filter descriptors.

isActive

public 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.

setActiveFilterIds

public 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

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


getViewerFilter

public 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

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.