01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.services;
11:
12: import org.eclipse.ui.ISourceProvider;
13:
14: /**
15: * <p>
16: * A service that responds to changes in one or more sources. These sources can
17: * be plugged into the service. Sources represent a common event framework for
18: * services.
19: * </p>
20: * <p>
21: * Clients must not extend or implement.
22: * </p>
23: *
24: * @since 3.2
25: */
26: public interface IServiceWithSources extends IDisposable {
27:
28: /**
29: * Adds a source provider to this service. A source provider will notify the
30: * service when the source it provides changes. An example of a source might
31: * be an active editor or the current selection. This amounts to a pluggable
32: * state tracker for the service.
33: *
34: * @param provider
35: * The provider to add; must not be <code>null</code>.
36: */
37: public void addSourceProvider(ISourceProvider provider);
38:
39: /**
40: * Removes a source provider from this service. Most of the time, this
41: * method call is not required as source providers typically share the same
42: * life span as the workbench itself.
43: *
44: * @param provider
45: * The provider to remove; must not be <code>null</code>.
46: */
47: public void removeSourceProvider(ISourceProvider provider);
48: }
|