Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8674566734af58436d561a9da5c716a445858ff5 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*******************************************************************************
 * Copyright (c) 2000, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.core.mapping;

import org.eclipse.core.resources.IFileState;
import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.diff.IDiffTree;
import org.eclipse.team.core.diff.ITwoWayDiff;
import org.eclipse.team.core.history.IFileRevision;

/**
 * A resource diff represents the changes between two resources. The diff can be
 * used to describe the change between an ancestor and remote, an ancestor and
 * local or between the local and a remote for two-way comparisons.
 * 
 * @see IDiffTree
 * 
 * @since 3.2
 * @noimplement This interface is not intended to be implemented by clients.
 *              Clients that need to create deltas should instead use or
 *              subclass
 *              {@link org.eclipse.team.core.mapping.provider.ResourceDiff}
 */
public interface IResourceDiff extends ITwoWayDiff {

	/**
	 * Change constant (bit mask) indicating that the resource was opened or closed.
	 * For example, if the current state of the resource is open then 
	 * it was previously closed.
	 * 
	 * @see ITwoWayDiff#getFlags()
	 * @see org.eclipse.core.resources.IResourceDelta#OPEN
	 */
	public static final int OPEN = 0x10000;
	
	/**
	 * Change constant (bit mask) indicating that a project's description has changed. 
	 * 
	 * @see ITwoWayDiff#getFlags()
	 * @see org.eclipse.core.resources.IResourceDelta#DESCRIPTION
	 */
	public static final int DESCRIPTION = 0x20000;
	
	/**
	 * Return the local resource to which this diff applies.
	 * @return the local resource to which this diff applies
	 */
	public IResource getResource();
	
	/**
	 * Return a handle to the file state representing the "before" state
	 * of the file used to calculate this diff. A <code>null</code> is
	 * returned if the resource is not a file or if the file does not exist in
	 * the before state. If a file state is returned, clients should still
	 * check the {@link IFileState#exists()} method to see if the file 
	 * existed in the before state.
	 * 
	 * @return a handle to the file state representing the "before" state
	 *         used to calculate this diff
	 */
	public IFileRevision getBeforeState();
	
	/**
	 * Return a handle to the file state representing the "after" state
	 * of the file used to calculate this diff. A <code>null</code> is
	 * returned if the resource is not a file or if the file does not exist in
	 * the after state. If a file state is returned, clients should still
	 * check the {@link IFileState#exists()} method to see if the file 
	 * existed in the after state.
	 * 
	 * @return a handle to the file state representing the "before" state
	 *         used to calculate this diff
	 */
	public IFileRevision getAfterState();
}

Back to the top