KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > mapping > ISynchronizationScopeParticipant


1 /*******************************************************************************
2  * Copyright (c) 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.team.core.mapping;
12
13 import org.eclipse.core.resources.*;
14 import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
15 import org.eclipse.core.resources.mapping.ResourceMapping;
16
17 /**
18  * A scope participant is responsible for ensuring that the resources contained
19  * within an {@link ISynchronizationScope} that overlap with the participant's
20  * model provider stay up-to-date with the model elements (represented as
21  * {@link ResourceMapping} instances) contained in the scope.
22  *
23  * <p>
24  * Clients may implement this interface.
25  *
26  * @see org.eclipse.core.resources.mapping.ResourceMapping
27  * @see ISynchronizationScopeManager
28  *
29  * @since 3.2
30  */

31 public interface ISynchronizationScopeParticipant {
32
33     /**
34      * Callback that the manager makes to participants when the state of
35      * resources that are contained in the resource mapping context of the
36      * manager change. This method will only be invoked when the context of the
37      * manager is a {@link RemoteResourceMappingContext} and the state of one or
38      * more resources changes w.r.t. the context. It is the responsibility of the
39      * participant to react to local changes that affect the resources in the
40      * scope by calling
41      * {@link ISynchronizationScope#refresh(ResourceMapping[])}.
42      *
43      * @param scope
44      * the scope
45      * @param resources
46      * the changed resources
47      * @param projects
48      * projects that were either added or removed
49      * @return the resource mappings that need to be refreshed.
50      */

51     ResourceMapping[] handleContextChange(
52             ISynchronizationScope scope, IResource[] resources, IProject[] projects);
53
54     /**
55      * Callback from the scope manager when the scope is no longer needed.
56      * This si done to give participants a chance to remove a
57      * registered {@link IResourceChangeListener} or any other listeners.
58      */

59     void dispose();
60
61 }
62
Popular Tags