KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > IContentProvider


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.jface.viewers;
12
13 /**
14  * A content provider mediates between the viewer's model
15  * and the viewer itself.
16  *
17  * @see org.eclipse.jface.viewers.ContentViewer#setContentProvider(IContentProvider)
18  */

19 public interface IContentProvider {
20     /**
21      * Disposes of this content provider.
22      * This is called by the viewer when it is disposed.
23      * <p>
24      * The viewer should not be updated during this call, as it is in the process
25      * of being disposed.
26      * </p>
27      */

28     public void dispose();
29
30     /**
31      * Notifies this content provider that the given viewer's input
32      * has been switched to a different element.
33      * <p>
34      * A typical use for this method is registering the content provider as a listener
35      * to changes on the new input (using model-specific means), and deregistering the viewer
36      * from the old input. In response to these change notifications, the content provider
37      * should update the viewer (see the add, remove, update and refresh methods on the viewers).
38      * </p>
39      * <p>
40      * The viewer should not be updated during this call, as it might be in the process
41      * of being disposed.
42      * </p>
43      *
44      * @param viewer the viewer
45      * @param oldInput the old input element, or <code>null</code> if the viewer
46      * did not previously have an input
47      * @param newInput the new input element, or <code>null</code> if the viewer
48      * does not have an input
49      */

50     public void inputChanged(Viewer viewer, Object JavaDoc oldInput, Object JavaDoc newInput);
51 }
52
Popular Tags