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 137191
Collapse All | Expand All

(-)a/projectapi/apichanges.xml (-2 / +24 lines)
Lines 2-8 Link Here
2
<!--
2
<!--
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
4
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5
Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
6
6
7
7
8
The contents of this file are subject to the terms of either the GNU
8
The contents of this file are subject to the terms of either the GNU
Lines 26-32 Link Here
26
Contributor(s):
26
Contributor(s):
27
27
28
The Original Software is NetBeans. The Initial Developer of the Original
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
30
Microsystems, Inc. All Rights Reserved.
30
Microsystems, Inc. All Rights Reserved.
31
31
32
If you wish your version of this file to be governed by only the CDDL
32
If you wish your version of this file to be governed by only the CDDL
Lines 104-109 Link Here
104
    <!-- ACTUAL CHANGES BEGIN HERE: -->
104
    <!-- ACTUAL CHANGES BEGIN HERE: -->
105
105
106
    <changes>
106
    <changes>
107
108
        <change id="test-single-method">
109
            <api name="general"/>
110
            <summary>Added class <code>SingleMethod</code></summary>
111
            <version major="1" minor="19"/>
112
            <date day="9" month="7" year="2008"/>
113
            <author login="mpetras"/>
114
            <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
115
            <description>
116
                <p>
117
                    Added class <code>ActionProvider.SingleMethod</code>,
118
                    which represents identification of a single method/function
119
                    in a file. The new class also contains new constants
120
                    (<code>COMMAND_RUN_SINGLE_TEST_METHOD</code> and
121
                    <code>COMMAND_DEBUG_SINGLE_TEST_METHOD</code>) corresponding
122
                    to commands for running debugging test methods.
123
                </p>
124
            </description>
125
            <class package="org.netbeans.spi.project" name="SingleMethod"/>
126
            <issue number="137191"/>
127
        </change>
128
107
        <change id="ProjectUtils.getAuxiliaryConfiguration">
129
        <change id="ProjectUtils.getAuxiliaryConfiguration">
108
            <api name="general"/>
130
            <api name="general"/>
109
            <summary>Added <code>ProjectUtils.getAuxiliaryConfiguration</code></summary>
131
            <summary>Added <code>ProjectUtils.getAuxiliaryConfiguration</code></summary>
(-)a/projectapi/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.projectapi/1
2
OpenIDE-Module: org.netbeans.modules.projectapi/1
3
OpenIDE-Module-Install: org/netbeans/modules/projectapi/Installer.class
3
OpenIDE-Module-Install: org/netbeans/modules/projectapi/Installer.class
4
OpenIDE-Module-Specification-Version: 1.18
4
OpenIDE-Module-Specification-Version: 1.19
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties
6
6
(-)a/projectapi/src/org/netbeans/spi/project/ActionProvider.java (-2 / +7 lines)
Lines 1-7 Link Here
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
3
 *
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
4
 * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
5
 *
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
7
 * General Public License Version 2 only ("GPL") or the Common
Lines 24-30 Link Here
24
 * Contributor(s):
24
 * Contributor(s):
25
 *
25
 *
26
 * The Original Software is NetBeans. The Initial Developer of the Original
26
 * The Original Software is NetBeans. The Initial Developer of the Original
27
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
27
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
28
 * Microsystems, Inc. All Rights Reserved.
28
 * Microsystems, Inc. All Rights Reserved.
29
 *
29
 *
30
 * If you wish your version of this file to be governed by only the CDDL
30
 * If you wish your version of this file to be governed by only the CDDL
Lines 49-54 Link Here
49
 * @see org.netbeans.api.project.Project#getLookup
49
 * @see org.netbeans.api.project.Project#getLookup
50
 * @see <a href="@org-apache-tools-ant-module@/org/apache/tools/ant/module/api/support/ActionUtils.html"><code>ActionUtils</code></a>
50
 * @see <a href="@org-apache-tools-ant-module@/org/apache/tools/ant/module/api/support/ActionUtils.html"><code>ActionUtils</code></a>
51
 * @see <a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/support/ProjectSensitiveActions.html#projectCommandAction(java.lang.String,%20java.lang.String,%20javax.swing.Icon)"><code>ProjectSensitiveActions.projectCommandAction(...)</code></a>
51
 * @see <a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/support/ProjectSensitiveActions.html#projectCommandAction(java.lang.String,%20java.lang.String,%20javax.swing.Icon)"><code>ProjectSensitiveActions.projectCommandAction(...)</code></a>
52
 * @see SingleMethod
52
 * @author Jesse Glick
53
 * @author Jesse Glick
53
 */
54
 */
54
public interface ActionProvider {
55
public interface ActionProvider {
Lines 80-85 Link Here
80
81
81
    /** 
82
    /** 
82
     * Standard command for running one file
83
     * Standard command for running one file
84
     *
85
     * @see  SingleMethod#COMMAND_RUN_SINGLE_METHOD
83
     */
86
     */
84
    String COMMAND_RUN_SINGLE = "run.single"; // NOI18N
87
    String COMMAND_RUN_SINGLE = "run.single"; // NOI18N
85
    
88
    
Lines 100-105 Link Here
100
    
103
    
101
    /**
104
    /**
102
     * Standard command for running single file in debugger
105
     * Standard command for running single file in debugger
106
     *
107
     * @see  SingleMethod#COMMAND_DEBUG_SINGLE_METHOD
103
     */    
108
     */    
104
    String COMMAND_DEBUG_SINGLE = "debug.single"; // NOI18N
109
    String COMMAND_DEBUG_SINGLE = "debug.single"; // NOI18N
105
    
110
    
(-)a/projectapi/src/org/netbeans/spi/project/SingleMethod.java (+127 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.spi.project;
41
42
import org.openide.filesystems.FileObject;
43
44
/**
45
 * Structure representing an identification of a single method/function
46
 * in a file.
47
 *
48
 * @since 1.19
49
 */
50
public final class SingleMethod {
51
52
    private FileObject file;
53
    private String methodName;
54
55
    /**
56
     * Creates a new instance holding the specified identification
57
     * of a method/function in a file.
58
     *
59
     * @param file file to be kept in the object
60
     * @param methodName name of a method inside the file
61
     * @exception  java.lang.IllegalArgumentException
62
     *             if the file or method name is {@code null}
63
     * @since 1.19
64
     */
65
    public SingleMethod(FileObject file, String methodName) {
66
        super();
67
        if (file == null) {
68
            throw new IllegalArgumentException("file is <null>");
69
        }
70
        if (methodName == null) {
71
            throw new IllegalArgumentException("methodName is <null>");
72
        }
73
        this.file = file;
74
        this.methodName = methodName;
75
    }
76
77
    /**
78
     * Returns the file identification.
79
     *
80
     * @return file held by this object
81
     * @since 1.19
82
     */
83
    public FileObject getFile() {
84
        return file;
85
    }
86
87
    /**
88
     * Returns name of a method/function within the file.
89
     *
90
     * @return method/function name held by this object
91
     * @since 1.19
92
     */
93
    public String getMethodName() {
94
        return methodName;
95
    }
96
97
    /**
98
     * Standard command for running single method/function
99
     *
100
     * @since 1.19
101
     */
102
    public static final String COMMAND_RUN_SINGLE_METHOD = "run.single.method";
103
104
    /**
105
     * Standard command for running single method/function in debugger
106
     *
107
     * @since 1.19
108
     */
109
    public static final String COMMAND_DEBUG_SINGLE_METHOD = "debug.single.method";
110
111
    @Override
112
    public boolean equals(Object obj) {
113
        if ((obj == null) || (obj.getClass() != SingleMethod.class)) {
114
            return false;
115
        }
116
        SingleMethod other = (SingleMethod) obj;
117
        return other.file.equals(file) && other.methodName.equals(methodName);
118
    }
119
120
    @Override
121
    public int hashCode() {
122
        int hash = 7;
123
        hash = 29 * hash + this.file.hashCode();
124
        hash = 29 * hash + this.methodName.hashCode();
125
        return hash;
126
    }
127
}

Return to bug 137191