blob: 6177cd4d9c1aa542c135893a116871c00d5e9d9e [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2006 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
* <p>
* <strong>EXPERIMENTAL</strong>. This interface has been added as
* part of a work in progress. There is no guarantee that this API will
* remain unchanged during the 3.3 release cycle. Please do not use this API
* without consulting with the Platform/Debug team.
* </p>
*/
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();
}