KickJava   Java API By Example, From Geeks To Geeks.

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


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
20 package org.netbeans.modules.refactoring.api;
21
22 import org.openide.util.Lookup;
23
24 /**
25  * This class is just holder for parameters of Move Refactoring.
26  * Refactoring itself is implemented in plugins.
27  *
28  * @see org.netbeans.modules.refactoring.spi.RefactoringPlugin
29  * @see org.netbeans.modules.refactoring.spi.RefactoringPluginFactory
30  * @see AbstractRefactoring
31  * @see RefactoringSession
32  * @author Jan Becicka
33  */

34 public final class MoveRefactoring extends AbstractRefactoring {
35
36     private Lookup target;
37
38     /**
39      * Public constructor takes Lookup containing objects to refactor as parameter.
40      * Move Refactoring implementations currently understand following types:
41      * <table border="1">
42      * <tr><th>Module</th><th>Types the Module Understands</th><th>Implementation</th></tr>
43      * <tr><td>Refactoring API (Default impl.)</td><td>{@link org.openide.filsuystems.FileObject}(s)</td><td>Does file(s) move</td></tr>
44      * <tr><td>Java Refactoring</td><td>{@link org.openide.filsuystems.FileObject}(s) with content type text/x-java</td><td>Does refactoring inside .java files</td></tr>
45      * </table>
46      * @param objectsToMove store your objects into Lookup
47      */

48     public MoveRefactoring (Lookup objectsToMove) {
49         super(objectsToMove);
50     }
51
52     /**
53      * Target for moving.
54      * Move Refactoring implementations currently understand following types:
55      * <table border="1">
56      * <tr><th>Module</th><th>Types the Module Understands</th><th>Implementation</th></tr>
57      * <tr><td>Refactoring API (Default impl.)</td><td>{@link java.net.URL}</td>
58      * <td>Creates direstory corresponding to specified {@link java.net.URL} if does not
59      * exist and moves all FileObjects into this folder.</td></tr>
60      * <tr><td>Java Refactoring</td><td>{@link java.net.URL}</td><td>Does move refactoring inside .java files</td></tr>
61      * </table>
62      * @param target
63      */

64     public void setTarget(Lookup target) {
65         this.target = target;
66     }
67
68     /**
69      * Target for moving
70      * @see #setTarget
71      * @return target
72      */

73     public Lookup getTarget() {
74         return this.target;
75     }
76 }
77
Popular Tags