KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > INavigatorFilterService


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11
12 package org.eclipse.ui.navigator;
13
14 import org.eclipse.jface.viewers.ViewerFilter;
15
16 /**
17  * Provides support for managing the filters defined for a Common Navigator
18  * viewer.
19  *
20  * <p>
21  * An INavigatorFilterService manages the available common filters and their
22  * current activation state for a particular INavigatorContentService. An
23  * INavigatorFilterService cannot be acquired without an
24  * INavigatorContentService (through
25  * {@link INavigatorContentService#getFilterService}). Each instance will
26  * provide information specific to the content service associated with it.
27  * </p>
28  * <p>
29  * The visibility of commonFilters is controlled through matching
30  * <b>viewerContentBinding</b>s. That is, like content extensions, the id of a
31  * commonFilter must match an includes expression for at least one
32  * <b>viewerContentBinding</b> element for the corresponding
33  * INavigatorContentService.
34  * </p>
35  * <p>
36  * The activation of each filter should be persisted from session to session.
37  * Clients of this interface have control over when the persistence occurs. In
38  * particular, clients should call {@link #persistFilterActivationState()}
39  * after each call to {@link #setActiveFilterIds(String[])}.
40  * </p>
41  *
42  * <p>
43  * This interface is not intended to be implemented by clients.
44  * </p>
45  *
46  * @see INavigatorContentService#getFilterService()
47  * @see ViewerFilter
48  * @since 3.2
49  *
50  */

51 public interface INavigatorFilterService {
52
53     /**
54      *
55      * Determine the set of filters which are <i>visible</i> to the
56      * content service associated with this filter service.
57      *
58      * @param toReturnOnlyActiveFilters
59      * True indicates that only active filters should be returned.
60      * @return An array of ViewerFilters that should be applied to the viewer
61      * rendering the content from this INavigatorContentService
62      */

63     ViewerFilter[] getVisibleFilters(boolean toReturnOnlyActiveFilters);
64
65     /**
66      *
67      * <i>Visible</i> filters are filters whose ids match a
68      * <b>viewerContentBinding</b> for the corresponding viewer.
69      *
70      * @return An array of all visible filter descriptors.
71      */

72     ICommonFilterDescriptor[] getVisibleFilterDescriptors();
73
74     /**
75      * @param aFilterId
76      * Check the activation of aFilterId for the content service
77      * corresponding to this filter service.
78      * @return True if the filter specified by the id is active for the content
79      * service corresponding to this filter service.
80      */

81     boolean isActive(String JavaDoc aFilterId);
82
83     /**
84      * Activate the set of given filters. An <i>active</i> filter will always be
85      * returned from {@link #getVisibleFilters(boolean)}. An <i>inactive</i> filter will
86      * only be returned from {@link #getVisibleFilters(boolean)} when it is
87      * called with <b>false</b>.
88      *
89      *
90      * @param theFilterIds
91      * An array of filter ids to activate.
92      *
93      */

94     void setActiveFilterIds(String JavaDoc[] theFilterIds);
95
96     /**
97      * Persist the current activation state for visible filters.
98      */

99     void persistFilterActivationState();
100     
101     /**
102      *
103      * Return the viewer filter for the given descriptor
104      *
105      * @param theDescriptor
106      * A non-null filter descriptor.
107      * @return the viewer filter for the given descriptor
108      * @since 3.3
109      */

110     ViewerFilter getViewerFilter(ICommonFilterDescriptor theDescriptor);
111     
112 }
113
Popular Tags