KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > changes > CompilationUnitDescriptorChange


1 /*******************************************************************************
2  * Copyright (c) 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.jdt.internal.corext.refactoring.changes;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.ltk.core.refactoring.ChangeDescriptor;
16 import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor;
17 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
18
19 import org.eclipse.jdt.core.ICompilationUnit;
20
21 /**
22  * Compilation unit change with a refactoring descriptor.
23  *
24  * @since 3.2
25  */

26 public final class CompilationUnitDescriptorChange extends CompilationUnitChange {
27
28     /** The refactoring descriptor */
29     private final RefactoringDescriptor fDescriptor;
30
31     /**
32      * Creates a new compilation unit descriptor change.
33      *
34      * @param descriptor
35      * the refactoring descriptor
36      * @param name
37      * the name
38      * @param unit
39      * the compilation unit
40      */

41     public CompilationUnitDescriptorChange(final RefactoringDescriptor descriptor, final String JavaDoc name, final ICompilationUnit unit) {
42         super(name, unit);
43         Assert.isNotNull(descriptor);
44         fDescriptor= descriptor;
45     }
46
47     /**
48      * {@inheritDoc}
49      */

50     public ChangeDescriptor getDescriptor() {
51         return new RefactoringChangeDescriptor(fDescriptor);
52     }
53 }
54
Popular Tags