This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 205696
Collapse All | Expand All

(-)a/refactoring.api/apichanges.xml (+18 lines)
Lines 49-54 Link Here
49
    <apidef name="refactoring">Refactoring API</apidef>
49
    <apidef name="refactoring">Refactoring API</apidef>
50
</apidefs>
50
</apidefs>
51
<changes>
51
<changes>
52
    <change id="MoveMembers">
53
        <api name="refactoring"/>
54
        <summary>Removed the final keyword from the class.</summary>
55
        <version major="1" minor="21"/>
56
        <date day="30" month="11" year="2011"/>
57
        <author login="ralphbenjamin"/>
58
        <compatibility addition="yes"/>
59
        <description>
60
            <p>
61
                The new Java Refactoring "Move Members" needs more configuration
62
                settings, but is still a Move Refactoring. The extra settings
63
                are needed for the java module, but refactoring plugins do not
64
                need this information.
65
            </p>
66
        </description>
67
        <class package="org.netbeans.modules.refactoring.api" name="MoveRefactoring"/>
68
        <issue numbe="205696"/>
69
    </change>
52
    <change id="Scope">
70
    <change id="Scope">
53
        <api name="refactoring"/>
71
        <api name="refactoring"/>
54
        <summary>Scope added to allow to specify a limited scope for WhereUsedQuery</summary>
72
        <summary>Scope added to allow to specify a limited scope for WhereUsedQuery</summary>
(-)a/refactoring.api/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.refactoring.api
2
OpenIDE-Module: org.netbeans.modules.refactoring.api
3
OpenIDE-Module-Layer: org/netbeans/modules/refactoring/api/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/refactoring/api/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/api/resources/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/api/resources/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.20
5
OpenIDE-Module-Specification-Version: 1.21
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)a/refactoring.api/src/org/netbeans/modules/refactoring/api/MoveRefactoring.java (-2 / +3 lines)
Lines 58-65 Link Here
58
 * @see AbstractRefactoring
58
 * @see AbstractRefactoring
59
 * @see RefactoringSession
59
 * @see RefactoringSession
60
 * @author Jan Becicka
60
 * @author Jan Becicka
61
 */
61
  */
62
public final class MoveRefactoring extends AbstractRefactoring {
62
public class MoveRefactoring extends AbstractRefactoring {
63
63
64
    private Lookup target;
64
    private Lookup target;
65
65
Lines 70-75 Link Here
70
     *   <tr><th>Module</th><th>Types the Module Understands</th><th>Implementation</th></tr>
70
     *   <tr><th>Module</th><th>Types the Module Understands</th><th>Implementation</th></tr>
71
     *   <tr><td>Refactoring API (Default impl.)</td><td>{@link org.openide.filsuystems.FileObject}(s)</td><td>Does file(s) move</td></tr>
71
     *   <tr><td>Refactoring API (Default impl.)</td><td>{@link org.openide.filsuystems.FileObject}(s)</td><td>Does file(s) move</td></tr>
72
     *   <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>
72
     *   <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>
73
     *   <tr><td></td><td>{@link org.netbeans.api.java.source.TreePathHandle}(s)</td><td>Does refactoring of members in .java files</td></tr>
73
     * </table>
74
     * </table>
74
     * @param objectsToMove store your objects into Lookup
75
     * @param objectsToMove store your objects into Lookup
75
     */
76
     */
(-)a/refactoring.java/apichanges.xml (+15 lines)
Lines 49-54 Link Here
49
    <apidef name="JavaRefactoringAPI">Java Refactoring API</apidef>
49
    <apidef name="JavaRefactoringAPI">Java Refactoring API</apidef>
50
</apidefs>
50
</apidefs>
51
<changes>
51
<changes>
52
    <change id="MoveMembersRefactoring">
53
            <api name="refactoring"/>
54
            <summary>Added new refactoring: Move Members Refactoring.</summary>
55
            <version major="1" minor="31"/>
56
            <date day="30" month="11" year="2011"/>
57
            <author login="ralphbenjamin"/>
58
            <compatibility addition="yes"/>
59
            <description>
60
                <p>
61
                    Add an api for the Move Members Refactoring.
62
                </p>    
63
            </description>
64
            <class package=" org.netbeans.modules.refactoring.java.api" name="MoveMembersRefactoring"/>
65
            <issue number="205696"/>
66
    </change>
52
    <change id="IntroduceParameterRefactoring">
67
    <change id="IntroduceParameterRefactoring">
53
            <api name="refactoring"/>
68
            <api name="refactoring"/>
54
            <summary>Added new refactoring and dependent change in ChangeParameterRefactoring.</summary>
69
            <summary>Added new refactoring and dependent change in ChangeParameterRefactoring.</summary>
(-)a/refactoring.java/nbproject/project.properties (-1 / +1 lines)
Lines 1-7 Link Here
1
javac.source=1.6
1
javac.source=1.6
2
javadoc.arch=${basedir}/arch.xml
2
javadoc.arch=${basedir}/arch.xml
3
3
4
spec.version.base=1.30.0
4
spec.version.base=1.31.0
5
#test configs
5
#test configs
6
test.config.find.includes=\
6
test.config.find.includes=\
7
    **/FindUsagesSuite.class
7
    **/FindUsagesSuite.class
(-)a/refactoring.java/src/org/netbeans/modules/refactoring/java/api/MoveMembersRefactoring.java (+197 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.refactoring.java.api;
43
44
import org.netbeans.modules.refactoring.api.MoveRefactoring;
45
import org.openide.util.Lookup;
46
47
/**
48
 * This class is just holder for parameters of Move Members Refactoring.
49
 * Refactoring itself is implemented in plugins.
50
 *
51
 * @see org.netbeans.modules.refactoring.api.MoveRefactoring
52
 * @see org.netbeans.modules.refactoring.spi.RefactoringPlugin
53
 * @see org.netbeans.modules.refactoring.spi.RefactoringPluginFactory
54
 * @see AbstractRefactoring
55
 * @see RefactoringSession
56
 * @author Ralph Ruijs
57
 * @since 1.31
58
 */
59
public class MoveMembersRefactoring extends MoveRefactoring {
60
61
    private Visibility visibility;
62
    private boolean delegate;
63
    private boolean addDeprecated;
64
    private boolean updateJavaDoc;
65
66
    /**
67
     * Public constructor takes Lookup containing objects to refactor as
68
     * parameter.
69
     *
70
     * @param objectsToMove store your objects into Lookup
71
     */
72
    public MoveMembersRefactoring(Lookup objectsToMove) {
73
        super(objectsToMove);
74
    }
75
76
    /**
77
     *
78
     * @param moveRefactoring
79
     */
80
    public MoveMembersRefactoring(MoveRefactoring moveRefactoring) {
81
        super(moveRefactoring.getRefactoringSource());
82
        setTarget(moveRefactoring.getTarget());
83
        this.visibility = Visibility.ESCALATE;
84
    }
85
86
    /**
87
     * The new visibility of the members.
88
     *
89
     * @return visibility
90
     */
91
    public Visibility getVisibility() {
92
        return visibility;
93
    }
94
95
    /**
96
     * The new visibility of the members.
97
     *
98
     * @param visibility the visibility to use
99
     */
100
    public void setVisibility(Visibility visibility) {
101
        this.visibility = visibility;
102
    }
103
104
    /**
105
     * Leave the old method in place and let it delegate to the new location.
106
     * All references to the method will not be touched.
107
     *
108
     * @return true if the old method will delegate to the new location, false
109
     * otherwise
110
     */
111
    public boolean isDelegate() {
112
        return delegate;
113
    }
114
115
    /**
116
     * Leave the old method in place and let it delegate to the new location.
117
     * All references to the method will not be touched.
118
     *
119
     * @param delegate true if the old method needs delegate to the new location
120
     */
121
    public void setDelegate(boolean delegate) {
122
        this.delegate = delegate;
123
    }
124
125
    /**
126
     * Add a deprecated tag to the JavaDoc of the delegating method.
127
     *
128
     * @return true if the old method will delegate to the new location and a
129
     * deprecated tag will be added, false otherwise
130
     */
131
    public boolean isAddDeprecated() {
132
        return delegate && addDeprecated;
133
    }
134
135
    /**
136
     * Add a deprecated tag to the JavaDoc of the delegating method.
137
     *
138
     * @param addDeprecated true if a deprecated tag has to be added to the
139
     * delegate method
140
     */
141
    public void setAddDeprecated(boolean addDeprecated) {
142
        this.addDeprecated = addDeprecated;
143
    }
144
145
    /**
146
     * Update or create the JavaDoc for moved methods.
147
     *
148
     * @return true if JavaDoc will be created or the existing will be updated,
149
     * false otherwise
150
     */
151
    public boolean isUpdateJavaDoc() {
152
        return updateJavaDoc;
153
    }
154
155
    /**
156
     * Add a deprecated tag to the javadoc of the delegating method.
157
     *
158
     * @param updateJavaDoc true if the method's JavaDoc needs to be created or
159
     * updated.
160
     */
161
    public void setUpdateJavaDoc(boolean updateJavaDoc) {
162
        this.updateJavaDoc = updateJavaDoc;
163
    }
164
165
    /**
166
     * Used to specify visibility level. It can either be set explicitly, or set
167
     * to Escalate to automatically raise it to a necessary level.
168
     */
169
    public static enum Visibility {
170
171
        /**
172
         * Escalate, automatically raise the visibility to a necessary level,
173
         * based on usages.
174
         */
175
        ESCALATE,
176
        /**
177
         * As is, keep the current visibility level of the member.
178
         */
179
        ASIS,
180
        /**
181
         * Change to, or keep, the visibility public.
182
         */
183
        PUBLIC,
184
        /**
185
         * Change to, or keep, the visibility protected.
186
         */
187
        PROTECTED,
188
        /**
189
         * Change to, or keep, the visibility the default level.
190
         */
191
        DEFAULT,
192
        /**
193
         * Change to, or keep, the visibility private.
194
         */
195
        PRIVATE
196
    }
197
}

Return to bug 205696