KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > contexts > IDebugContextProvider


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.ui.contexts;
12
13 import org.eclipse.jface.viewers.ISelection;
14 import org.eclipse.ui.IWorkbenchPart;
15
16 /**
17  * Interface common to all objects that provide a debug context. A context provider
18  * is registered with a debug context service associated with a specific window.
19  * <p>
20  * A context provider can provide context information for a specific workbench part.
21  * There can only be one context provider registered per part with a context
22  * service. When there is more than one context provider per window, the context provider
23  * associated with the most recently active part provides the context for that window.
24  * </p>
25  * <p>
26  * A context provider does not have to be associated with a part. In this case the provider
27  * specifies <code>null</code> for its part, and provides context information for the window.
28  * There can only be one context provider without an associated part registered per context
29  * service (i.e. per window). A context provider that provides context without an associated
30  * part is only active (i.e. used to provide context information) when there are no other
31  * context providers with associated parts registered with that service.
32  * </p>
33  * <p>
34  * Clients may implement this interface.
35  * </p>
36  * @see IDebugContextManager
37  * @see IDebugContextService
38  * @see IDebugContextListener
39  * @since 3.3
40  */

41 public interface IDebugContextProvider {
42     
43     /**
44      * Returns the part associated with this context provider or <code>null</code>
45      * if none.
46      *
47      * @return part associated with this context provider or <code>null</code>
48      */

49     public IWorkbenchPart getPart();
50     
51     /**
52      * Registers the given listener for debug context events.
53      *
54      * @param listener event listener
55      */

56     public void addDebugContextListener(IDebugContextListener listener);
57     
58     /**
59      * Unregisters the given listener for debug context events.
60      *
61      * @param listener event listener
62      */

63     public void removeDebugContextListener(IDebugContextListener listener);
64     
65     /**
66      * Returns the currently active context, possibly empty or <code>null</code>.
67      *
68      * @return active context, possibly empty or <code>null</code>.
69      */

70     public ISelection getActiveContext();
71
72 }
73
Popular Tags