KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > model > RefactoringHistoryDiff


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.ltk.internal.ui.refactoring.model;
12
13 import org.eclipse.team.core.diff.IThreeWayDiff;
14 import org.eclipse.team.core.diff.ITwoWayDiff;
15
16 import org.eclipse.core.runtime.Assert;
17 import org.eclipse.core.runtime.IPath;
18
19 import org.eclipse.ltk.core.refactoring.history.RefactoringHistory;
20
21 /**
22  * Diff of a refactoring history.
23  *
24  * @since 3.2
25  */

26 public final class RefactoringHistoryDiff implements IThreeWayDiff {
27
28     /** The diff direction */
29     private final int fDirection;
30
31     /** The refactoring history */
32     private final RefactoringHistory fHistory;
33
34     /** The diff kind */
35     private final int fKind;
36
37     /**
38      * Creates a new refactoring history diff.
39      *
40      * @param history
41      * the refactoring descriptor
42      * @param kind
43      * the diff kind
44      * @param direction
45      * the diff direction
46      */

47     public RefactoringHistoryDiff(final RefactoringHistory history, final int kind, final int direction) {
48         Assert.isNotNull(history);
49         fHistory= history;
50         fKind= kind;
51         fDirection= direction;
52     }
53
54     /**
55      * {@inheritDoc}
56      */

57     public int getDirection() {
58         return fDirection;
59     }
60
61     /**
62      * {@inheritDoc}
63      */

64     public int getKind() {
65         return fKind;
66     }
67
68     /**
69      * {@inheritDoc}
70      */

71     public ITwoWayDiff getLocalChange() {
72         return null;
73     }
74
75     /**
76      * {@inheritDoc}
77      */

78     public IPath getPath() {
79         return null;
80     }
81
82     /**
83      * Returns the refactoring history.
84      *
85      * @return the refactoring history
86      */

87     public RefactoringHistory getRefactoringHistory() {
88         return fHistory;
89     }
90
91     /**
92      * {@inheritDoc}
93      */

94     public ITwoWayDiff getRemoteChange() {
95         return null;
96     }
97
98     /**
99      * {@inheritDoc}
100      */

101     public String JavaDoc toDiffString() {
102         return ModelMessages.RefactoringHistoryDiff_diff_string;
103     }
104 }
105
Popular Tags