Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a929d3334fc099f421c3006ffc0fc338c23ff136 (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
/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.core.mapping;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceMapping;

/**
 * A scope participant is responsible for ensuring that the resources contained
 * within an {@link ISynchronizationScope} that overlap with the participant's
 * model provider stay up-to-date with the model elements (represented as
 * {@link ResourceMapping} instances) contained in the scope.
 *
 * <p>
 * Clients may implement this interface.
 *
 * @see org.eclipse.core.resources.mapping.ResourceMapping
 * @see ISynchronizationScopeManager
 *
 * @since 3.2
 */
public interface ISynchronizationScopeParticipant {

	/**
	 * Callback that the manager makes to participants when the state of
	 * resources that are contained in the resource mapping context of the
	 * manager change. This method will only be invoked when the context of the
	 * manager is a {@link RemoteResourceMappingContext} and the state of one or
	 * more resources changes w.r.t. the context. It is the responsibility of the
	 * participant to react to local changes that affect the resources in the
	 * scope by calling
	 * {@link ISynchronizationScope#refresh(ResourceMapping[])}.
	 *
	 * @param scope
	 *            the scope
	 * @param resources
	 *            the changed resources
	 * @param projects
	 *            projects that were either added or removed
	 * @return the resource mappings that need to be refreshed.
	 */
	ResourceMapping[] handleContextChange(
			ISynchronizationScope scope, IResource[] resources, IProject[] projects);

	/**
	 * Callback from the scope manager when the scope is no longer needed.
	 * This si done to give participants a chance to remove a
	 * registered {@link IResourceChangeListener} or any other listeners.
	 */
	void dispose();

}

Back to the top