Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 579569f00b426b5e4cdf999f828295a8935e214c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************
 * Copyright (c) 2005, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.ui.contexts;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;

/**
 * Interface common to all objects that provide a debug context. A context provider
 * is registered with a debug context service associated with a specific window.
 * <p>
 * A context provider can provide context information for a specific workbench part.
 * There can only be one context provider registered per part with a context
 * service. When there is more than one context provider per window, the context provider
 * associated with the most recently active part provides the context for that window.
 * </p>
 * <p>
 * A context provider does not have to be associated with a part. In this case the provider
 * specifies <code>null</code> for its part, and provides context information for the window.
 * There can only be one context provider without an associated part registered per context
 * service (i.e. per window). A context provider that provides context without an associated
 * part is only active (i.e. used to provide context information) when there are no other
 * context providers with associated parts registered with that service.
 * </p>
 * <p>
 * Clients may implement this interface.
 * </p>
 * @see IDebugContextManager
 * @see IDebugContextService
 * @see IDebugContextListener
 * @since 3.3
 */
public interface IDebugContextProvider {

	/**
	 * Returns the part associated with this context provider or <code>null</code>
	 * if none.
	 *
	 * @return part associated with this context provider or <code>null</code>
	 */
	public IWorkbenchPart getPart();

    /**
     * Registers the given listener for debug context events.
     *
     * @param listener event listener
     */
	public void addDebugContextListener(IDebugContextListener listener);

    /**
     * Unregisters the given listener for debug context events.
     *
     * @param listener event listener
     */
	public void removeDebugContextListener(IDebugContextListener listener);

    /**
     * Returns the currently active context, possibly empty or <code>null</code>.
     *
     * @return active context, possibly empty or <code>null</code>.
     */
	public ISelection getActiveContext();

}

Back to the top