KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > DeferredDebugElementWorkbenchAdapter


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.debug.ui;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.core.runtime.jobs.ISchedulingRule;
15 import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
16 import org.eclipse.ui.progress.IElementCollector;
17
18
19 /**
20  * Common function for a deferred workbench adapter for a debug element.
21  * <p>
22  * Clients may subclass this class to provide custom adapters for elements in a debug
23  * model. The debug platform provides <code>IDeferredWorkbenchAdapters</code> for the standard debug
24  * elements. Clients may override the default content in the debug view by providing an
25  * <code>IWorkbenchAdapter</code> or <code>IDeferredWorkbenchAdapter</code> for a debug
26  * element.
27  * </p>
28  * @since 3.1
29  */

30 public abstract class DeferredDebugElementWorkbenchAdapter extends DebugElementWorkbenchAdapter implements IDeferredWorkbenchAdapter {
31     
32     /**
33      * An empty collection of children
34      */

35     protected static final Object JavaDoc[] EMPTY = new Object JavaDoc[0];
36
37     /* (non-Javadoc)
38      * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
39      */

40     public boolean isContainer() {
41         return true;
42     }
43
44     /* (non-Javadoc)
45      * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
46      */

47     public ISchedulingRule getRule(Object JavaDoc object) {
48         return null;
49     }
50
51     /* (non-Javadoc)
52      * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(java.lang.Object, org.eclipse.ui.progress.IElementCollector, org.eclipse.core.runtime.IProgressMonitor)
53      */

54     public void fetchDeferredChildren(Object JavaDoc object, IElementCollector collector, IProgressMonitor monitor) {
55         if (monitor.isCanceled()) {
56             return;
57         }
58         Object JavaDoc[] children = getChildren(object);
59         if (monitor.isCanceled()) {
60             return;
61         }
62         if (children.length > 0) {
63             collector.add(children, monitor);
64         }
65         collector.done();
66     }
67
68
69 }
70
Popular Tags