KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > services > IServiceWithSources


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.ui.services;
12
13 import org.eclipse.ui.ISourceProvider;
14
15 /**
16  * <p>
17  * A service that responds to changes in one or more sources. These sources can
18  * be plugged into the service. Sources represent a common event framework for
19  * services.
20  * </p>
21  * <p>
22  * Clients must not extend or implement.
23  * </p>
24  *
25  * @since 3.2
26  */

27 public interface IServiceWithSources extends IDisposable {
28
29     /**
30      * Adds a source provider to this service. A source provider will notify the
31      * service when the source it provides changes. An example of a source might
32      * be an active editor or the current selection. This amounts to a pluggable
33      * state tracker for the service.
34      *
35      * @param provider
36      * The provider to add; must not be <code>null</code>.
37      */

38     public void addSourceProvider(ISourceProvider provider);
39
40     /**
41      * Removes a source provider from this service. Most of the time, this
42      * method call is not required as source providers typically share the same
43      * life span as the workbench itself.
44      *
45      * @param provider
46      * The provider to remove; must not be <code>null</code>.
47      */

48     public void removeSourceProvider(ISourceProvider provider);
49 }
50
Popular Tags