01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.search;
11:
12: import org.eclipse.jface.viewers.IStructuredContentProvider;
13: import org.eclipse.jface.viewers.Viewer;
14:
15: public abstract class JavaSearchContentProvider implements
16: IStructuredContentProvider {
17: protected final Object[] EMPTY_ARR = new Object[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 oldInput,
27: Object newInput) {
28: initialize((JavaSearchResult) newInput);
29:
30: }
31:
32: protected void initialize(JavaSearchResult result) {
33: fResult = result;
34: }
35:
36: public abstract void elementsChanged(Object[] updatedElements);
37:
38: public abstract void clear();
39:
40: public void dispose() {
41: // nothing to do
42: }
43:
44: JavaSearchResultPage getPage() {
45: return fPage;
46: }
47:
48: JavaSearchResult getSearchResult() {
49: return fResult;
50: }
51:
52: }
|