KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > variants > IResourceVariantTree


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.variants;
12 import org.eclipse.core.resources.IResource;
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.team.core.TeamException;
15
16 /**
17  * A handle that provides access to locally cached resource variants that
18  * represent a resource line-up such as a project version or branch.
19  * <p>
20  * This interface is not intended to be implemented by clients. However,
21  * clients may subclass {@link AbstractResourceVariantTree} or {@link ResourceVariantTree}.
22  * </p>
23  *
24  * @see AbstractResourceVariantTree
25  * @see ResourceVariantTree
26  * @since 3.0
27  */

28 public interface IResourceVariantTree {
29     
30     /**
31      * Returns the list of root resources for which this tree may have resource
32      * variants.
33      * @return the list of root resources.
34      */

35     public abstract IResource[] roots();
36     
37     /**
38      * Returns the members of the local resource that have resource variants in this tree.
39      * The members may or may not exist locally. The resource variants corresponding to the
40      * members can be retrieved using <code>getResourceVariant(IResource)</code>.
41      * @param resource the local resource
42      * @return the members of the local resource for which this tree contains resource variants
43      * @throws TeamException
44      */

45     public abstract IResource[] members(IResource resource) throws TeamException;
46     
47     /**
48      * Return the resource variant corresponding to the local resource. Return
49      * <code>null</code> if there is no variant for the resource.
50      * @param resource the local resource
51      * @return the resource's variant in this tree
52      * @throws TeamException
53      */

54     public abstract IResourceVariant getResourceVariant(IResource resource) throws TeamException;
55     
56     /**
57      * Return whether the local resource has a variant in this tree.
58      * @param resource the local resource
59      * @return <code>true</code> if the tree contains a variant for the resource
60      * @throws TeamException
61      */

62     public boolean hasResourceVariant(IResource resource) throws TeamException;
63     
64     /**
65      * Refreshes the resource variant tree for the specified resources and possibly
66      * their descendants, depending on the depth.
67      * @param resources the resources whose variants should be refreshed
68      * @param depth the depth of the refresh (one of <code>IResource.DEPTH_ZERO</code>,
69      * <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
70      * @param monitor a progress monitor
71      * @return the array of resources whose corresponding variants have changed
72      * as a result of the refresh
73      * @throws TeamException
74      */

75     public IResource[] refresh(
76             IResource[] resources,
77             int depth,
78             IProgressMonitor monitor) throws TeamException;
79
80     /**
81      * Flush any variants in the tree for the given resource to the depth
82      * specified.
83      * @param resource the resource
84      * @param depth the flush depth (one of <code>IResource.DEPTH_ZERO</code>,
85      * <code>IResource.DEPTH_ONE</code>, or <code>IResource.DEPTH_INFINITE</code>)
86      * @throws TeamException
87      */

88     public void flushVariants(IResource resource, int depth) throws TeamException;
89 }
90
Popular Tags