KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > history > IFileHistoryProvider


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
12 package org.eclipse.team.core.history;
13
14 import org.eclipse.core.filesystem.IFileStore;
15 import org.eclipse.core.resources.IResource;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.team.core.history.provider.FileHistoryProvider;
18
19 /**
20  * This is API to access individual file histories.
21  *
22  * <p>
23  * This interface is not intended to be implemented by clients. Clients can
24  * instead subclass {@link FileHistoryProvider}.
25  * @since 3.2
26  *
27  */

28 public interface IFileHistoryProvider {
29     
30     /**
31      * Constant flag used with
32      * {@link #getFileHistoryFor(IResource, int, IProgressMonitor)} to indicate
33      * no flags.
34      */

35     public static final int NONE = 0;
36     
37     /**
38      * Constant flag used with {@link #getFileHistoryFor(IResource, int, IProgressMonitor)}
39      * to indicate that only a single revision is desired.
40      */

41     public static final int SINGLE_REVISION = 1;
42     
43     /**
44      * Constant flag used with
45      * {@link #getFileHistoryFor(IResource, int, IProgressMonitor)} to indicate
46      * that the resulting history will be restricted to a single line-of-descent
47      * (e.g. a single branch). In this mode, the
48      * {@link IFileHistory#getContributors(IFileRevision)} and
49      * {@link IFileHistory#getTargets(IFileRevision)} should either return zero
50      * or one revision.
51      */

52     public static final int SINGLE_LINE_OF_DESCENT = 2;
53
54     /**
55      * Returns the file history for the given in resource. If the flags contains
56      * {@link #SINGLE_REVISION} then only the revision corresponding to the base
57      * corresponding to the local resource is fetched. If the flags contains
58      * {@link #SINGLE_LINE_OF_DESCENT} the resulting history will be restricted
59      * to a single line-of-descent (e.g. a single branch). In this mode, the
60      * {@link IFileHistory#getContributors(IFileRevision)} and
61      * {@link IFileHistory#getTargets(IFileRevision)} should either return zero
62      * or one revision. If both flags are present, {@link #SINGLE_REVISION}
63      * should take precedence.
64      *
65      * @param resource
66      * the resource
67      * @param flags
68      * to indicate what revisions should be included in the history
69      * @param monitor
70      * a progress monitor
71      * @return the history of the file
72      */

73     public abstract IFileHistory getFileHistoryFor(IResource resource, int flags, IProgressMonitor monitor);
74     
75
76     /**
77      * Returns the file revision of the passed in resource or null if that file revision cannot be
78      * determined
79      *
80      * @param resource the resource
81      * @return the file revision belonging to the passed in resource or null
82      */

83     public abstract IFileRevision getWorkspaceFileRevision(IResource resource);
84     
85     /**
86      * Returns an {@link IFileHistory} for the specified {@link IFileStore}.
87      * @param store an IFileStore
88      * @param flags {@link #SINGLE_REVISION} or {@link #SINGLE_LINE_OF_DESCENT}
89      * @param monitor a progress monitor
90      * @return the history for the IFileStore
91      */

92     public abstract IFileHistory getFileHistoryFor(IFileStore store, int flags, IProgressMonitor monitor);
93     
94 }
95
Popular Tags