KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > refactoring > api > RenameRefactoring


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.api;
20
21 import org.openide.util.Lookup;
22
23 /**
24  * Refactoring used for renaming objects.
25  * @see org.netbeans.modules.refactoring.spi.RefactoringPlugin
26  * @see org.netbeans.modules.refactoring.spi.RefactoringPluginFactory
27  * @see AbstractRefactoring
28  * @see RefactoringSession
29  * @author Jan Becicka, Martin Matula, Pavel Flaska, Daniel Prusa
30  */

31 public final class RenameRefactoring extends AbstractRefactoring {
32     private String JavaDoc newName = null;
33     private boolean searchInComments;
34
35     /**
36      * Creates a new instance of RenameRefactoring.
37      * Rename Refactoring implementations currently understand following types:
38      * <table border="1">
39      * <tr><th>Module</th><th>Types the Module Understands</th><th>Implementation</th></tr>
40      * <tr><td>Refactoring API (Default impl.)</td><td>FileObject</td><td>Does file rename</td></tr>
41      * <tr><td>Java Refactoring</td><td><ul>
42      * <li>{@link org.openide.filesystems.FileObject}(s) with content type text/x-java (class rename)
43      * <li>{@link org.openide.filesystems.FileObject} (folder) folder rename
44      * <li>{@link org.netbeans.api.java.source.TreePathHandle} (class, field, method rename)
45      * <li>{@link org.netbeans.api.fileinfo.NonRecursiveFolder} package rename</td>
46      * </ul>
47      * <td>Does refactoring inside .java files.
48      * In case of FolderRename it also does corresponding file moves</td></tr>
49      * </table>
50      * @param item put object to rename into Lookup instance.
51      */

52     public RenameRefactoring(Lookup item) {
53         super(item);
54     }
55     
56     /**
57      * Getter for property newName
58      * @return Value of property newName
59      */

60     public String JavaDoc getNewName() {
61         return newName;
62     }
63     
64     /**
65      * Setter for propety newName
66      * @param newName New value of property newName
67      */

68     public void setNewName(String JavaDoc newName) {
69         this.newName = newName;
70     }
71     
72     /**
73      * Getter for boolean property searchInComments
74      * @return true if user selected search in comments
75      */

76     public boolean isSearchInComments() {
77         return searchInComments;
78     }
79
80     /**
81      * Setter for property searchInComments.
82      * @param searchInComments New value of property searchInComments
83      */

84     public void setSearchInComments(boolean searchInComments) {
85         this.searchInComments = searchInComments;
86     }
87 }
88
Popular Tags