KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > progress > PendingUpdateAdapter


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 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.ui.internal.progress;
12
13 import org.eclipse.core.runtime.IAdaptable;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.ui.model.IWorkbenchAdapter;
16
17 /**
18  * The PendingUpdateAdapter is a convenience object that can be used
19  * by a BaseWorkbenchContentProvider that wants to show a pending update.
20  */

21 public class PendingUpdateAdapter implements IWorkbenchAdapter, IAdaptable {
22
23     boolean removed = false;
24
25     /**
26      * Return whether or not this has been removed from the tree.
27      * @return boolean
28      */

29     public boolean isRemoved() {
30         return removed;
31     }
32
33     /**
34      * Set whether or not this has been removed from the tree.
35      * @param removedValue boolean
36      */

37     public void setRemoved(boolean removedValue) {
38         this.removed = removedValue;
39     }
40
41     /**
42      * Create a new instance of the receiver.
43      */

44     public PendingUpdateAdapter() {
45         //No initial behavior
46
}
47
48     /* (non-Javadoc)
49      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
50      */

51     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
52         if (adapter == IWorkbenchAdapter.class)
53             return this;
54         return null;
55     }
56
57     /* (non-Javadoc)
58      * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
59      */

60     public Object JavaDoc[] getChildren(Object JavaDoc o) {
61         return new Object JavaDoc[0];
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
66      */

67     public ImageDescriptor getImageDescriptor(Object JavaDoc object) {
68         return null;
69     }
70
71     /* (non-Javadoc)
72      * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
73      */

74     public String JavaDoc getLabel(Object JavaDoc o) {
75         return ProgressMessages.PendingUpdateAdapter_PendingLabel;
76     }
77
78     /* (non-Javadoc)
79      * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
80      */

81     public Object JavaDoc getParent(Object JavaDoc o) {
82         return null;
83     }
84 }
85
Popular Tags