KickJava   Java API By Example, From Geeks To Geeks.

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


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.RefactoringDescriptorProxy;
20
21 import org.eclipse.ltk.internal.ui.refactoring.Messages;
22
23 /**
24  * Diff of a refactoring.
25  *
26  * @since 3.2
27  */

28 public final class RefactoringDescriptorDiff implements IThreeWayDiff {
29
30     /** The refactoring descriptor */
31     private final RefactoringDescriptorProxy fDescriptor;
32
33     /** The diff direction */
34     private final int fDirection;
35
36     /** The diff kind */
37     private final int fKind;
38
39     /**
40      * Creates a new refactoring descriptor diff node.
41      *
42      * @param descriptor
43      * the refactoring descriptor
44      * @param kind
45      * the diff kind
46      * @param direction
47      * the diff direction
48      */

49     public RefactoringDescriptorDiff(final RefactoringDescriptorProxy descriptor, final int kind, final int direction) {
50         Assert.isNotNull(descriptor);
51         fDescriptor= descriptor;
52         fKind= kind;
53         fDirection= direction;
54     }
55
56     /**
57      * Returns the refactoring descriptor.
58      *
59      * @return the refactoring descriptor
60      */

61     public RefactoringDescriptorProxy getDescriptor() {
62         return fDescriptor;
63     }
64
65     /**
66      * {@inheritDoc}
67      */

68     public int getDirection() {
69         return fDirection;
70     }
71
72     /**
73      * {@inheritDoc}
74      */

75     public int getKind() {
76         return fKind;
77     }
78
79     /**
80      * {@inheritDoc}
81      */

82     public ITwoWayDiff getLocalChange() {
83         return null;
84     }
85
86     /**
87      * {@inheritDoc}
88      */

89     public IPath getPath() {
90         return null;
91     }
92
93     /**
94      * {@inheritDoc}
95      */

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

103     public String JavaDoc toDiffString() {
104         return Messages.format(ModelMessages.RefactoringDescriptorDiff_diff_string, fDescriptor.getDescription());
105     }
106 }
107
Popular Tags