KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > refactoring > experimental > CopyClassRefactoring


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.refactoring.experimental;
20 import org.netbeans.jmi.javamodel.Resource;
21 import org.netbeans.modules.refactoring.api.AbstractRefactoring;
22 import org.netbeans.modules.refactoring.classpath.Util;
23 import org.openide.filesystems.FileObject;
24
25 /** Copy Class Refactoring implementation class.
26  *
27  * @author Jan Becicka
28  */

29 public final class CopyClassRefactoring extends AbstractRefactoring {
30
31     private Resource resource;
32     private FileObject targetFolder;
33     private String JavaDoc targetPackageName;
34     private String JavaDoc newName;
35     
36     /** Creates a new instance of CopyClassRefactoring
37      * @param sourceType Type the members of which should be pulled up.
38      */

39     public CopyClassRefactoring(Resource resource) {
40         this.resource = resource;
41     }
42     
43     protected void setClassPath() {
44         // leave the complete classpath
45
Util.setDefaultClassPath();
46     }
47
48     public Resource getResource() {
49         return resource;
50     }
51
52     // --- PARAMETERS ----------------------------------------------------------
53

54     public FileObject getTargetClassPathRoot() {
55         return targetFolder;
56     }
57
58     public void setTargetClassPathRoot(FileObject targetFolder) {
59         this.targetFolder = targetFolder;
60     }
61     
62     public String JavaDoc getTargetPackageName() {
63         return targetPackageName;
64     }
65     
66     public void setTargetPackageName(String JavaDoc newName) {
67         this.targetPackageName = newName;
68     }
69     
70     public String JavaDoc getNewName() {
71         return newName;
72     }
73     
74     public void setNewName(String JavaDoc newName) {
75         this.newName = newName;
76     }
77 }
78
Popular Tags