KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > model > provisional > IModelProxy


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 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.debug.internal.ui.viewers.model.provisional;
12
13 import org.eclipse.jface.viewers.Viewer;
14
15 /**
16  * A model proxy represents a model for a specific presentation context and
17  * fires deltas to notify listeners of changes in the model. A model proxy
18  * is created by a model proxy factory.
19  * <p>
20  * When an element is added to an asynchronous viewer, its associated model proxy
21  * factory is queried to create a model proxy for that element. The model proxy
22  * is then installed into the viewer and the viewer listens to model deltas
23  * in order to update that element. Generally, a model proxy factory creates
24  * model proxies for root elements in a model, and then represents all elements
25  * within that model for a specific presentation context.
26  * </p>
27  * <p>
28  * Clients may implement this interface. Implementation of this interface
29  * must subclass {@link AbstractModelProxy}.
30  * </p>
31  * @see IModelDelta
32  * @see IModelProxyFactory
33  * @see IModelChangedListener
34  * @since 3.2
35  */

36 public interface IModelProxy {
37
38     /**
39      * Notification this model proxy has been created and is about to be installed
40      * in the following context. This is the first method called after a model proxy
41      * is created.
42      * <p>
43      * This method is called by the asynchronous viewer framework and should not
44      * be called by clients.
45      * </p>
46      * @param context presentation context in which the proxy will be installed
47      */

48     public void init(IPresentationContext context);
49     
50     /**
51      * Notification this model proxy has been installed in the specified
52      * viewer. This indicates that the model proxy has been created and registered
53      * model change listeners are ready to process deltas.
54      * <p>
55      * This method is called by the asynchronous viewer framework and should not
56      * be called by clients.
57      * </p>
58      * @param viewer viewer
59      * @since 3.3
60      */

61     public void installed(Viewer viewer);
62     
63     /**
64      * Disposes this model proxy.
65      * <p>
66      * This method is called by the asynchronous viewer framework and should not
67      * be called by clients.
68      * </p>
69      */

70     public void dispose();
71     
72     /**
73      * Registers the given listener for model delta notification.
74      *
75      * @param listener model delta listener
76      */

77     public void addModelChangedListener(IModelChangedListener listener);
78     
79     /**
80      * Unregisters the given listener from model delta notification.
81      *
82      * @param listener model delta listener
83      */

84     public void removeModelChangedListener(IModelChangedListener listener);
85     
86     /**
87      * Returns whether this proxy has been disposed.
88      *
89      * @return whether this proxy has been disposed
90      * @since 3.3
91      */

92     public boolean isDisposed();
93     
94 }
95
Popular Tags