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.jface.viewers;
11:
12: /**
13: * A content provider mediates between the viewer's model
14: * and the viewer itself.
15: *
16: * @see org.eclipse.jface.viewers.ContentViewer#setContentProvider(IContentProvider)
17: */
18: public interface IContentProvider {
19: /**
20: * Disposes of this content provider.
21: * This is called by the viewer when it is disposed.
22: * <p>
23: * The viewer should not be updated during this call, as it is in the process
24: * of being disposed.
25: * </p>
26: */
27: public void dispose();
28:
29: /**
30: * Notifies this content provider that the given viewer's input
31: * has been switched to a different element.
32: * <p>
33: * A typical use for this method is registering the content provider as a listener
34: * to changes on the new input (using model-specific means), and deregistering the viewer
35: * from the old input. In response to these change notifications, the content provider
36: * should update the viewer (see the add, remove, update and refresh methods on the viewers).
37: * </p>
38: * <p>
39: * The viewer should not be updated during this call, as it might be in the process
40: * of being disposed.
41: * </p>
42: *
43: * @param viewer the viewer
44: * @param oldInput the old input element, or <code>null</code> if the viewer
45: * did not previously have an input
46: * @param newInput the new input element, or <code>null</code> if the viewer
47: * does not have an input
48: */
49: public void inputChanged(Viewer viewer, Object oldInput,
50: Object newInput);
51: }
|