1 /*******************************************************************************
2  * Copyright (c) 2005, 2008 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.ltk.internal.ui.refactoring.model;
15 
16 import org.eclipse.team.core.diff.IThreeWayDiff;
17 import org.eclipse.team.core.diff.ITwoWayDiff;
18 
19 import org.eclipse.core.runtime.Assert;
20 import org.eclipse.core.runtime.IPath;
21 
22 import org.eclipse.ltk.core.refactoring.history.RefactoringHistory;
23 
24 /**
25  * Diff of a refactoring history.
26  *
27  * @since 3.2
28  */
29 public final class RefactoringHistoryDiff implements IThreeWayDiff {
30 
31 	/** The diff direction */
32 	private final int fDirection;
33 
34 	/** The refactoring history */
35 	private final RefactoringHistory fHistory;
36 
37 	/** The diff kind */
38 	private final int fKind;
39 
40 	/**
41 	 * Creates a new refactoring history diff.
42 	 *
43 	 * @param history
44 	 *            the refactoring descriptor
45 	 * @param kind
46 	 *            the diff kind
47 	 * @param direction
48 	 *            the diff direction
49 	 */
RefactoringHistoryDiff(final RefactoringHistory history, final int kind, final int direction)50 	public RefactoringHistoryDiff(final RefactoringHistory history, final int kind, final int direction) {
51 		Assert.isNotNull(history);
52 		fHistory= history;
53 		fKind= kind;
54 		fDirection= direction;
55 	}
56 
57 	@Override
getDirection()58 	public int getDirection() {
59 		return fDirection;
60 	}
61 
62 	@Override
getKind()63 	public int getKind() {
64 		return fKind;
65 	}
66 
67 	@Override
getLocalChange()68 	public ITwoWayDiff getLocalChange() {
69 		return null;
70 	}
71 
72 	@Override
getPath()73 	public IPath getPath() {
74 		return null;
75 	}
76 
77 	/**
78 	 * Returns the refactoring history.
79 	 *
80 	 * @return the refactoring history
81 	 */
getRefactoringHistory()82 	public RefactoringHistory getRefactoringHistory() {
83 		return fHistory;
84 	}
85 
86 	@Override
getRemoteChange()87 	public ITwoWayDiff getRemoteChange() {
88 		return null;
89 	}
90 
91 	@Override
toDiffString()92 	public String toDiffString() {
93 		return ModelMessages.RefactoringHistoryDiff_diff_string;
94 	}
95 }
96