KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.eclipse.core.resources.IResource;
14 import org.eclipse.core.resources.mapping.ResourceTraversal;
15 import org.eclipse.team.core.diff.*;
16 import org.eclipse.team.core.mapping.provider.ResourceDiffTree;
17
18 /**
19  * A resource diff tree provides access to a tree of {@link IDiff} instances
20  * that either contain {@link IResourceDiff}
21  * nodes or {@link IThreeWayDiff} nodes that contain
22  * {@link IResourceDiff} nodes as the local and
23  * remote changes. For efficiency reasons, the tree only provides diffs for
24  * resources that have changes. Resources that do not contain a change but are
25  * returned from the tree will contain children in the set.
26  * <p>
27  * Clients may not implement this interface but can use {@link ResourceDiffTree}
28  * instead.
29  *
30  * @since 3.2
31  */

32 public interface IResourceDiffTree extends IDiffTree {
33
34     /**
35      * Return the diff for the given resource. This method is a convenience
36      * method that uses the path of the resource to access the diff.
37      *
38      * @param resource a resource
39      * @return the diff associated with the resource or <code>null</code> if
40      * the resource does not have any changes.
41      */

42     IDiff getDiff(IResource resource);
43
44     /**
45      * Return the resource associated with the given diff. This method will only
46      * return meaningful results for diffs which were obtained from this tree.
47      *
48      * @param diff a diff
49      * @return the resource associated with the given diff
50      */

51     IResource getResource(IDiff diff);
52
53     /**
54      * Visit all diffs in this tree that are covered by the given traversals.
55      * @param traversals the set of traversals whose diffs are to be visited
56      * @param visitor a diff visitor
57      *
58      */

59     void accept(ResourceTraversal[] traversals, IDiffVisitor visitor);
60
61     /**
62      * Return all the diffs in the tree that are contained in the given
63      * traversals.
64      *
65      * @param traversals the traversals
66      * @return all the diffs in the tree that are contained in the given
67      * traversals
68      */

69     IDiff[] getDiffs(ResourceTraversal[] traversals);
70
71     /**
72      * Return all the diffs in the tree that are found for
73      * the given resource when traversed to the given depth.
74      *
75      * @param resource the resource
76      * @param depth the depth
77      * @return all the diffs in the tree that are found for
78      * the given resource when traversed to the given depth
79      */

80     IDiff[] getDiffs(IResource resource, int depth);
81     
82     /**
83      * Return the members of the given resource that either have diffs in this
84      * tree of contain descendants that have diffs in this tree.
85      *
86      * @param resource a resource
87      * @return the members of the given resource that either have diffs in this
88      * tree of contain descendants that have diffs in this tree
89      */

90     IResource[] members(IResource resource);
91
92     /**
93      * Return all resources that contain diffs in this
94      * diff tree.
95      * @return all resources that contain diffs in this
96      * diff tree
97      */

98     IResource[] getAffectedResources();
99     
100     /**
101      * Return whether the this diff tree contains any diffs that match the given filter
102      * within the given traversals.
103      * @param traversals the traversals
104      * @param filter the diff node filter
105      * @return whether the given diff tree contains any deltas that match the given filter
106      */

107     public boolean hasMatchingDiffs(ResourceTraversal[] traversals, final FastDiffFilter filter);
108
109 }
110
Popular Tags