KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > core > refactoring > history > RefactoringDescriptorProxyAdapter


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.core.refactoring.history;
12
13 import org.eclipse.core.runtime.Assert;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
17 import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy;
18
19 /**
20  * Adapter class which adapts refactoring descriptors to refactoring descriptor
21  * proxies.
22  *
23  * @since 3.2
24  */

25 public final class RefactoringDescriptorProxyAdapter extends RefactoringDescriptorProxy {
26
27     /** The encapsulated descriptor */
28     private final RefactoringDescriptor fDescriptor;
29
30     /**
31      * Creates a new refactoring descriptor proxy adapter.
32      *
33      * @param descriptor
34      * the descriptor to encapsulate
35      */

36     public RefactoringDescriptorProxyAdapter(final RefactoringDescriptor descriptor) {
37         Assert.isNotNull(descriptor);
38         fDescriptor= descriptor;
39     }
40
41     /**
42      * {@inheritDoc}
43      */

44     public int compareTo(final Object JavaDoc object) {
45         return fDescriptor.compareTo(object);
46     }
47
48     /**
49      * {@inheritDoc}
50      */

51     public String JavaDoc getDescription() {
52         return fDescriptor.getDescription();
53     }
54
55     /**
56      * {@inheritDoc}
57      */

58     public String JavaDoc getProject() {
59         return fDescriptor.getProject();
60     }
61
62     /**
63      * {@inheritDoc}
64      */

65     public long getTimeStamp() {
66         return fDescriptor.getTimeStamp();
67     }
68
69     /**
70      * {@inheritDoc}
71      */

72     public RefactoringDescriptor requestDescriptor(final IProgressMonitor monitor) {
73         return fDescriptor;
74     }
75
76     /**
77      * {@inheritDoc}
78      */

79     public String JavaDoc toString() {
80         return fDescriptor.toString();
81     }
82 }
Popular Tags