KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 java.util.EventListener JavaDoc;
14
15 import org.eclipse.core.resources.mapping.ResourceMapping;
16 import org.eclipse.core.resources.mapping.ResourceTraversal;
17
18 /**
19  * Listener for synchronization scope changes.
20  * <p>
21  * Clients may implement this interface.
22  * </p>
23  *
24  * @see ISynchronizationScope
25  *
26  * @since 3.2
27  */

28 public interface ISynchronizationScopeChangeListener extends EventListener JavaDoc {
29
30     /**
31      * Notification that the scope has changed. The change may be the inclusion
32      * of new resource mappings, new resource traversals or both or the removal
33      * of mappings (in which case the given traversals will cover the set of
34      * resources that are no longer in the scope). This can be due to changes to
35      * the resource mappings used to calculate the traversals of the scope or
36      * because new resources have come under the control of the repository
37      * provider (or other entity) that generated the scope in the first place.
38      * Clients can determine whether a given mappings were removed by querying
39      * the scope for traversals. If the mapping has no traversals, the mapping
40      * represents a removal.
41      * <p>
42      * Clients can use the following rules to interpret the change:
43      * <ol>
44      * <li>If the mappings are not empty, clients should check to see if the
45      * the scope contains traversals for the any of the mappings. If it does,
46      * the given mappings have been added to the scope. If it doesn't the
47      * mappings represent removals. A change event will never include both new
48      * and removed mappings.
49      * <li>If the mappings are added mappings, and the traversals are empty,
50      * then the addition of the mappings did not change the resources covered by
51      * the scope.
52      * <li>If the mappings are added mappings, and the traversals are not
53      * empty, then the additional mappings also caused additional resources to
54      * be included in the scope. The given traversals cover the resources that
55      * have been added to the scope.
56      * <li>If the mappings are removed mappings, and the traversals are not
57      * empty, then the removed mappings also caused resources to be removed from
58      * the scope. The given traversals cover the resources that have been
59      * removed to the scope.
60      * <li>If the mappings are empty and the traversals are not, the traversals
61      * cover resources that have been added to the scope due to a change in the
62      * logical model or the resource under the control of the repository
63      * providers that manages the scope.
64      * </ol>
65      *
66      * @param scope
67      * the scope that has changed
68      * @param mappings
69      * the new mappings or removed mappings (may be empty)
70      * @param traversals
71      * the new traversals or removed traversals (may be empty)
72      */

73     void scopeChanged(ISynchronizationScope scope, ResourceMapping[] mappings,
74             ResourceTraversal[] traversals);
75 }
76
Popular Tags