KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > AbstractUpdatePolicy


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.debug.internal.ui.viewers;
12
13
14 /**
15  * An update policy updates a viewer based on deltas reported by a model proxy.
16  *
17  * @since 3.2
18  *
19  */

20 public abstract class AbstractUpdatePolicy {
21
22     private AsynchronousViewer fViewer = null;
23
24     /* (non-Javadoc)
25      * @see org.eclipse.debug.ui.viewers.IUpdatePolicy#init(org.eclipse.debug.ui.viewers.update.IPresentation)
26      */

27     public void init(AsynchronousViewer viewer) {
28         fViewer = viewer;
29     }
30     
31     /* (non-Javadoc)
32      * @see org.eclipse.debug.ui.viewers.IUpdatePolicy#dispose()
33      */

34     public synchronized void dispose() {
35         fViewer = null;
36     }
37
38     /**
39      * Returns the viewer this policy is installed on or <code>null</code>
40      * if disposed.
41      *
42      * @return presentation to update
43      */

44     public AsynchronousViewer getViewer() {
45         return fViewer;
46     }
47     
48     protected synchronized boolean isDisposed() {
49         return fViewer == null;
50     }
51
52 }
53
Popular Tags