KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > ui > text > FilterUpdateEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 package org.eclipse.search.ui.text;
12
13 import org.eclipse.search.ui.ISearchResult;
14 import org.eclipse.search.ui.SearchResultEvent;
15
16 /**
17  * An event object describing that the filter state of the given {@link Match matches} has been updated or
18  * {@link MatchFilter match filters} have been reconfigured.
19  * <p>
20  * Clients may instantiate or subclass this class.
21  * </p>
22  * @since 3.3
23  */

24 public class FilterUpdateEvent extends SearchResultEvent {
25
26     private static final long serialVersionUID = 6009335074727417443L;
27
28     private final Match[] fMatches;
29     private final MatchFilter[] fFilters;
30     
31     /**
32      * Constructs a new {@link FilterUpdateEvent}.
33      *
34      * @param searchResult the search result concerned
35      * @param matches the matches updated by the filter change
36      * @param filters the currently activated filters
37      */

38     public FilterUpdateEvent(ISearchResult searchResult, Match[] matches, MatchFilter[] filters) {
39         super(searchResult);
40         fMatches= matches;
41         fFilters= filters;
42     }
43     
44     /**
45      * Returns the matches updated by the filter update.
46      *
47      * @return the matches updated by the filter update
48      */

49     public Match[] getUpdatedMatches() {
50         return fMatches;
51     }
52     
53     /**
54      * Returns the the filters currently set, or <code>null</code> if filters have been disabled.
55      *
56      * @return the filters currently set
57      */

58     public MatchFilter[] getActiveFilters() {
59         return fFilters;
60     }
61 }
62
Popular Tags