KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > search > JavaSearchContentProvider


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.jdt.internal.ui.search;
12
13 import org.eclipse.jface.viewers.IStructuredContentProvider;
14 import org.eclipse.jface.viewers.Viewer;
15
16 public abstract class JavaSearchContentProvider implements IStructuredContentProvider {
17     protected final Object JavaDoc[] EMPTY_ARR= new Object JavaDoc[0];
18     
19     private JavaSearchResult fResult;
20     private JavaSearchResultPage fPage;
21
22     JavaSearchContentProvider(JavaSearchResultPage page) {
23         fPage= page;
24     }
25     
26     public void inputChanged(Viewer viewer, Object JavaDoc oldInput, Object JavaDoc newInput) {
27         initialize((JavaSearchResult) newInput);
28         
29     }
30     
31     protected void initialize(JavaSearchResult result) {
32         fResult= result;
33     }
34     
35     public abstract void elementsChanged(Object JavaDoc[] updatedElements);
36     public abstract void clear();
37
38     public void dispose() {
39         // nothing to do
40
}
41
42     JavaSearchResultPage getPage() {
43         return fPage;
44     }
45     
46     JavaSearchResult getSearchResult() {
47         return fResult;
48     }
49
50 }
51
Popular Tags