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

(-)a/extexecution.destroy/build.xml (-2 / +2 lines)
Lines 1-5 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project basedir="." default="netbeans" name="extexecution.destroy">
2
<project basedir="." default="netbeans" name="extexecution.impl">
3
    <description>Builds, tests, and runs the project org.netbeans.modules.extexecution.destroy</description>
3
    <description>Builds, tests, and runs the project org.netbeans.modules.extexecution.impl</description>
4
    <import file="../nbbuild/templates/projectized.xml"/>
4
    <import file="../nbbuild/templates/projectized.xml"/>
5
</project>
5
</project>
(-)a/extexecution.destroy/manifest.mf (-3 / +3 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
AutoUpdate-Show-In-Client: false
2
AutoUpdate-Show-In-Client: false
3
OpenIDE-Module: org.netbeans.modules.extexecution.destroy
3
OpenIDE-Module: org.netbeans.modules.extexecution.impl
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/destroy/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/impl/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.13
5
OpenIDE-Module-Specification-Version: 1.13
6
6
OpenIDE-Module-Provides: org.netbeans.spi.extexecution.open.OptionOpenHandler
(-)a/extexecution.destroy/nbproject/project.xml (-3 / +52 lines)
Lines 3-9 Link Here
3
    <type>org.netbeans.modules.apisupport.project</type>
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>org.netbeans.modules.extexecution.destroy</code-name-base>
6
            <code-name-base>org.netbeans.modules.extexecution.impl</code-name-base>
7
            <module-dependencies>
7
            <module-dependencies>
8
                <dependency>
8
                <dependency>
9
                    <code-name-base>org.apache.commons.io</code-name-base>
9
                    <code-name-base>org.apache.commons.io</code-name-base>
Lines 17-23 Link Here
17
                    <compile-dependency/>
17
                    <compile-dependency/>
18
                    <run-dependency>
18
                    <run-dependency>
19
                        <release-version>1</release-version>
19
                        <release-version>1</release-version>
20
                        <specification-version>1.3</specification-version>
20
                        <specification-version>1.23</specification-version>
21
                    </run-dependency>
21
                    </run-dependency>
22
                </dependency>
22
                </dependency>
23
                <dependency>
23
                <dependency>
Lines 26-32 Link Here
26
                    <compile-dependency/>
26
                    <compile-dependency/>
27
                    <run-dependency>
27
                    <run-dependency>
28
                        <release-version>2</release-version>
28
                        <release-version>2</release-version>
29
                        <specification-version>1.15</specification-version>
29
                        <specification-version>1.33</specification-version>
30
                    </run-dependency>
31
                </dependency>
32
                <dependency>
33
                    <code-name-base>org.netbeans.modules.options.api</code-name-base>
34
                    <build-prerequisite/>
35
                    <compile-dependency/>
36
                    <run-dependency>
37
                        <release-version>1</release-version>
38
                        <specification-version>1.8</specification-version>
39
                    </run-dependency>
40
                </dependency>
41
                <dependency>
42
                    <code-name-base>org.openide.awt</code-name-base>
43
                    <build-prerequisite/>
44
                    <compile-dependency/>
45
                    <run-dependency>
46
                        <specification-version>7.2</specification-version>
47
                    </run-dependency>
48
                </dependency>
49
                <dependency>
50
                    <code-name-base>org.openide.filesystems</code-name-base>
51
                    <build-prerequisite/>
52
                    <compile-dependency/>
53
                    <run-dependency>
54
                        <specification-version>7.3.1</specification-version>
55
                    </run-dependency>
56
                </dependency>
57
                <dependency>
58
                    <code-name-base>org.openide.loaders</code-name-base>
59
                    <build-prerequisite/>
60
                    <compile-dependency/>
61
                    <run-dependency>
62
                        <specification-version>6.7.1</specification-version>
63
                    </run-dependency>
64
                </dependency>
65
                <dependency>
66
                    <code-name-base>org.openide.nodes</code-name-base>
67
                    <build-prerequisite/>
68
                    <compile-dependency/>
69
                    <run-dependency>
70
                        <specification-version>7.2.1.1</specification-version>
71
                    </run-dependency>
72
                </dependency>
73
                <dependency>
74
                    <code-name-base>org.openide.text</code-name-base>
75
                    <build-prerequisite/>
76
                    <compile-dependency/>
77
                    <run-dependency>
78
                        <specification-version>6.16.1</specification-version>
30
                    </run-dependency>
79
                    </run-dependency>
31
                </dependency>
80
                </dependency>
32
                <dependency>
81
                <dependency>
(-)a/extexecution.destroy/src/org/netbeans/modules/extexecution/destroy/ProcessDestroyPerformerImpl.java (-1 / +1 lines)
Lines 52-58 Link Here
52
 * @author mkleint
52
 * @author mkleint
53
 */
53
 */
54
@ServiceProvider(service=ProcessDestroyPerformer.class)
54
@ServiceProvider(service=ProcessDestroyPerformer.class)
55
public class ProcessDestroyPerformerImpl implements ProcessDestroyPerformer {
55
public class ProcessTreeDestroyPerformer implements ProcessDestroyPerformer {
56
56
57
    public void destroy(Process process, Map<String, String> env) {
57
    public void destroy(Process process, Map<String, String> env) {
58
        ProcessTreeKiller.get().kill(process, env);
58
        ProcessTreeKiller.get().kill(process, env);
(-)a/extexecution.destroy/src/org/netbeans/modules/extexecution/destroy/Bundle.properties (-1 / +1 lines)
Line 1 Link Here
1
OpenIDE-Module-Name=External Execution Process Destroy Support
1
OpenIDE-Module-Name=External Execution Implementations
(-)a/extexecution.impl/src/org/netbeans/modules/extexecution/open/NbFileOpenHandler.java (+128 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.extexecution.open;
43
44
import java.io.File;
45
import java.io.IOException;
46
import java.util.logging.Level;
47
import java.util.logging.Logger;
48
import javax.swing.SwingUtilities;
49
import javax.swing.text.Document;
50
import org.netbeans.api.extexecution.print.LineConvertors;
51
import org.netbeans.spi.extexecution.open.FileOpenHandler;
52
import org.openide.cookies.EditorCookie;
53
import org.openide.cookies.LineCookie;
54
import org.openide.cookies.OpenCookie;
55
import org.openide.filesystems.FileObject;
56
import org.openide.filesystems.FileUtil;
57
import org.openide.loaders.DataObject;
58
import org.openide.text.Line;
59
import org.openide.text.Line.ShowOpenType;
60
import org.openide.text.Line.ShowVisibilityType;
61
import org.openide.util.lookup.ServiceProvider;
62
63
/**
64
 *
65
 * @author Petr Hejl
66
 */
67
@ServiceProvider(service=FileOpenHandler.class)
68
public class NbFileOpenHandler implements FileOpenHandler {
69
70
    private static final Logger LOGGER = Logger.getLogger(NbFileOpenHandler.class.getName());
71
72
    @Override
73
    public void open(final FileObject file, final int lineno) {
74
        if (!SwingUtilities.isEventDispatchThread()) {
75
            SwingUtilities.invokeLater(new Runnable() {
76
                    public void run() {
77
                        open(file, lineno);
78
                    }
79
                });
80
81
            return; // not exactly accurate, but....
82
        }
83
84
        try {
85
            DataObject od = DataObject.find(file);
86
            EditorCookie ec = od.getCookie(EditorCookie.class);
87
            LineCookie lc = od.getCookie(LineCookie.class);
88
89
            if ((ec != null) && (lc != null)) {
90
                Document doc = ec.openDocument();
91
92
                if (doc != null) {
93
                    int line = lineno;
94
95
                    if (line < 1) {
96
                        line = 1;
97
                    }
98
99
                    // XXX .size() call is super-slow for large files, see issue
100
                    // #126531. So we fallback to catching IOOBE
101
//                    int nOfLines = lines.getLines().size();
102
//                    if (line > nOfLines) {
103
//                        line = nOfLines;
104
//                    }
105
                    try {
106
                        Line.Set lines = lc.getLineSet();
107
                        Line l = lines.getCurrent(line - 1);
108
                        if (l != null) {
109
                            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS);
110
                            return;
111
                        }
112
                    } catch (IndexOutOfBoundsException ioobe) {
113
                        // OK, since .size() cannot be used, see above
114
                    }
115
                }
116
            }
117
118
            OpenCookie oc = od.getCookie(OpenCookie.class);
119
120
            if (oc != null) {
121
                oc.open();
122
                return;
123
            }
124
        } catch (IOException e) {
125
            LOGGER.log(Level.INFO, null, e);
126
        }
127
    }
128
}
(-)a/extexecution.impl/src/org/netbeans/modules/extexecution/open/NbHttpOpenHandler.java (+60 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.extexecution.open;
43
44
import java.net.URL;
45
import org.netbeans.spi.extexecution.open.HttpOpenHandler;
46
import org.openide.awt.HtmlBrowser;
47
import org.openide.util.lookup.ServiceProvider;
48
49
/**
50
 *
51
 * @author Petr Hejl
52
 */
53
@ServiceProvider(service=HttpOpenHandler.class)
54
public class NbHttpOpenHandler implements HttpOpenHandler {
55
56
    @Override
57
    public void open(URL url) {
58
        HtmlBrowser.URLDisplayer.getDefault().showURL(url);
59
    }
60
}
(-)a/extexecution.impl/src/org/netbeans/modules/extexecution/open/NbOptionOpenHandler.java (+59 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.extexecution.open;
43
44
import org.netbeans.api.options.OptionsDisplayer;
45
import org.netbeans.spi.extexecution.open.OptionOpenHandler;
46
import org.openide.util.lookup.ServiceProvider;
47
48
/**
49
 *
50
 * @author Petr Hejl
51
 */
52
@ServiceProvider(service=OptionOpenHandler.class)
53
public class NbOptionOpenHandler implements OptionOpenHandler {
54
55
    @Override
56
    public void open(String optionsPath) {
57
        OptionsDisplayer.getDefault().open(optionsPath);
58
    }
59
}
(-)a/extexecution/apichanges.xml (+17 lines)
Lines 107-112 Link Here
107
        <apidef name="extexecution_api_startup">External Execution Startup Arguments API</apidef>
107
        <apidef name="extexecution_api_startup">External Execution Startup Arguments API</apidef>
108
        <apidef name="extexecution_spi">External Execution SPI</apidef>
108
        <apidef name="extexecution_spi">External Execution SPI</apidef>
109
        <apidef name="extexecution_spi_destroy">External Execution Process Destroy SPI</apidef>
109
        <apidef name="extexecution_spi_destroy">External Execution Process Destroy SPI</apidef>
110
        <apidef name="extexecution_spi_open">External Execution Open Handler SPI</apidef>
110
        <apidef name="extexecution_spi_startup">External Execution Startup Arguments SPI</apidef>
111
        <apidef name="extexecution_spi_startup">External Execution Startup Arguments SPI</apidef>
111
        <!-- etc. -->
112
        <!-- etc. -->
112
    </apidefs>
113
    </apidefs>
Lines 116-121 Link Here
116
    <changes>
117
    <changes>
117
118
118
        <change>
119
        <change>
120
            <api name="extexecution_spi_open"/>
121
            <summary>SPI to allow to split the API and implementation</summary>
122
            <version major="1" minor="33"/>
123
            <date day="31" month="8" year="2012"/>
124
            <author login="phejl"/>
125
            <compatibility addition="yes"/>
126
            <description>
127
                This API/SPI allow splitting the extexecution to real API
128
                and implementation classes.
129
            </description>
130
            <class package="org.netbeans.spi.extexecution.open" name="OptionOpenHandler"/>
131
            <class package="org.netbeans.spi.extexecution.open" name="FileOpenHandler"/>
132
            <class package="org.netbeans.spi.extexecution.open" name="HttpOpenHandler"/>
133
            <issue number="216882"/>
134
        </change>
135
        <change>
119
            <api name="extexecution_api_startup"/>
136
            <api name="extexecution_api_startup"/>
120
            <summary>SPI to allow extending process startup</summary>
137
            <summary>SPI to allow extending process startup</summary>
121
            <version major="1" minor="30"/>
138
            <version major="1" minor="30"/>
(-)a/extexecution/arch.xml (+28 lines)
Lines 76-81 Link Here
76
   <api group="java" name="ExternalExecutionDestroySPI" type="export" category="stable" url="@TOP@org/netbeans/spi/extexecution/destroy/package-summary.html"/>.
76
   <api group="java" name="ExternalExecutionDestroySPI" type="export" category="stable" url="@TOP@org/netbeans/spi/extexecution/destroy/package-summary.html"/>.
77
  </p>
77
  </p>
78
  <p>
78
  <p>
79
   The <api group="java" name="ExternalExecutionOpenSPI" type="export" category="stable" url="@TOP@org/netbeans/spi/extexecution/open/package-summary.html"/>
80
   allows implementation module to determine particular way of file or HTTP
81
   URL opening in predefined covertors. It also makes options dialog opening
82
   pluggable.
83
  </p>
84
  <p>
79
   There is also API to provide additional startup arguments to interested
85
   There is also API to provide additional startup arguments to interested
80
   clients such as projects and servers
86
   clients such as projects and servers
81
   <api group="java" name="ExternalExecutionStartupAPI" type="export" category="stable" url="@TOP@org/netbeans/api/extexecution/startup/package-summary.html"/>.
87
   <api group="java" name="ExternalExecutionStartupAPI" type="export" category="stable" url="@TOP@org/netbeans/api/extexecution/startup/package-summary.html"/>.
Lines 262-267 Link Here
262
    and use the additional arguments for the process.
268
    and use the additional arguments for the process.
263
   </p>
269
   </p>
264
  </usecase>
270
  </usecase>
271
  <usecase id="pluggable-open" name="Making certain open actions pluggable">
272
   <p>
273
    Some default
274
    <a href="@TOP@org/netbeans/api/extexecution/print/LineConvertor.html">LineConvertor</a>s
275
    returned by
276
    <a href="@TOP@org/netbeans/api/extexecution/print/LineConvertors.html">LineConvertor</a>
277
    needs to open file or URL. A bit special case is also options dialog opening
278
    required by
279
    <a href="@TOP@org/netbeans/api/extexecution/ExecutionService.html">ExecutionService</a>
280
    to open options dialog specified by
281
    <a href="@TOP@org/netbeans/api/extexecution/ExecutionDescriptor.html">ExecutionDescriptor</a>.
282
    To cover this three usecases in a pluggable way while keeping dependencies
283
    minimal there are three corresponding SPI classes one may implement.
284
    So there is
285
    <a href="@TOP@org/netbeans/spi/extexecution/open/FileOpenHandler.html">FileOpenHandler</a>
286
    to handle file opening,
287
    <a href="@TOP@org/netbeans/spi/extexecution/open/HttpOpenHandler.html">HttpOpenHandler</a>
288
    to deal with HTTP URLs and
289
    <a href="@TOP@org/netbeans/spi/extexecution/open/OptionOpenHandler.html">OptionOpenHandler</a>
290
    to open proper options dialog.
291
   </p>
292
  </usecase>
265
 </answer>
293
 </answer>
266
294
267
295
(-)a/extexecution/manifest.mf (-1 / +2 lines)
Lines 2-6 Link Here
2
AutoUpdate-Show-In-Client: false
2
AutoUpdate-Show-In-Client: false
3
OpenIDE-Module: org.netbeans.modules.extexecution/2
3
OpenIDE-Module: org.netbeans.modules.extexecution/2
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/resources/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/resources/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.32
5
OpenIDE-Module-Specification-Version: 1.33
6
OpenIDE-Module-Recommends: org.netbeans.spi.extexecution.open.OptionOpenHandler
6
7
(-)a/extexecution/nbproject/project.xml (-41 / +1 lines)
Lines 24-46 Link Here
24
                    </run-dependency>
24
                    </run-dependency>
25
                </dependency>
25
                </dependency>
26
                <dependency>
26
                <dependency>
27
                    <code-name-base>org.netbeans.modules.options.api</code-name-base>
28
                    <build-prerequisite/>
29
                    <compile-dependency/>
30
                    <run-dependency>
31
                        <release-version>1</release-version>
32
                        <specification-version>1.8</specification-version>
33
                    </run-dependency>
34
                </dependency>
35
                <dependency>
36
                    <code-name-base>org.openide.awt</code-name-base>
37
                    <build-prerequisite/>
38
                    <compile-dependency/>
39
                    <run-dependency>
40
                        <specification-version>7.2</specification-version>
41
                    </run-dependency>
42
                </dependency>
43
                <dependency>
44
                    <code-name-base>org.openide.filesystems</code-name-base>
27
                    <code-name-base>org.openide.filesystems</code-name-base>
45
                    <build-prerequisite/>
28
                    <build-prerequisite/>
46
                    <compile-dependency/>
29
                    <compile-dependency/>
Lines 57-86 Link Here
57
                    </run-dependency>
40
                    </run-dependency>
58
                </dependency>
41
                </dependency>
59
                <dependency>
42
                <dependency>
60
                    <code-name-base>org.openide.loaders</code-name-base>
61
                    <build-prerequisite/>
62
                    <compile-dependency/>
63
                    <run-dependency>
64
                        <specification-version>6.7.1</specification-version>
65
                    </run-dependency>
66
                </dependency>
67
                <dependency>
68
                    <code-name-base>org.openide.nodes</code-name-base>
69
                    <build-prerequisite/>
70
                    <compile-dependency/>
71
                    <run-dependency>
72
                        <specification-version>7.2.1.1</specification-version>
73
                    </run-dependency>
74
                </dependency>
75
                <dependency>
76
                    <code-name-base>org.openide.text</code-name-base>
77
                    <build-prerequisite/>
78
                    <compile-dependency/>
79
                    <run-dependency>
80
                        <specification-version>6.16.1</specification-version>
81
                    </run-dependency>
82
                </dependency>
83
                <dependency>
84
                    <code-name-base>org.openide.util</code-name-base>
43
                    <code-name-base>org.openide.util</code-name-base>
85
                    <build-prerequisite/>
44
                    <build-prerequisite/>
86
                    <compile-dependency/>
45
                    <compile-dependency/>
Lines 133-138 Link Here
133
                <package>org.netbeans.api.extexecution.startup</package>
92
                <package>org.netbeans.api.extexecution.startup</package>
134
                <package>org.netbeans.spi.extexecution</package>
93
                <package>org.netbeans.spi.extexecution</package>
135
                <package>org.netbeans.spi.extexecution.destroy</package>
94
                <package>org.netbeans.spi.extexecution.destroy</package>
95
                <package>org.netbeans.spi.extexecution.open</package>
136
                <package>org.netbeans.spi.extexecution.startup</package>
96
                <package>org.netbeans.spi.extexecution.startup</package>
137
            </public-packages>
97
            </public-packages>
138
        </data>
98
        </data>
(-)a/extexecution/src/org/netbeans/api/extexecution/ExecutionDescriptor.java (-4 / +5 lines)
Lines 49-54 Link Here
49
import org.netbeans.api.annotations.common.NullAllowed;
49
import org.netbeans.api.annotations.common.NullAllowed;
50
import org.netbeans.api.extexecution.input.InputProcessor;
50
import org.netbeans.api.extexecution.input.InputProcessor;
51
import org.netbeans.api.extexecution.print.LineConvertor;
51
import org.netbeans.api.extexecution.print.LineConvertor;
52
import org.netbeans.spi.extexecution.open.OptionOpenHandler;
52
import org.openide.windows.InputOutput;
53
import org.openide.windows.InputOutput;
53
54
54
/**
55
/**
Lines 586-595 Link Here
586
     * Returns a descriptor with configured options path. If configured
587
     * Returns a descriptor with configured options path. If configured
587
     * value is not <code>null</code> the {@link ExecutionService} will
588
     * value is not <code>null</code> the {@link ExecutionService} will
588
     * display the button in the output tab displaying the proper options
589
     * display the button in the output tab displaying the proper options
589
     * when pressed.
590
     * when pressed. <i>For this to work there has to be
590
     * <p>
591
     * a {@link OptionOpenHandler} in the system. Otherwise the options button
591
     * Format of the parameter is described in
592
     * won't be displayed.</i>
592
     * {@link org.netbeans.api.options.OptionsDisplayer#open(java.lang.String)}.
593
     * <p>
593
     * <p>
594
     * Note that this property has no meaning when custom io is used
594
     * Note that this property has no meaning when custom io is used
595
     * (see {@link #inputOutput(org.openide.windows.InputOutput)}).
595
     * (see {@link #inputOutput(org.openide.windows.InputOutput)}).
Lines 601-606 Link Here
601
     *
601
     *
602
     * @param optionsPath options path, <code>null</code> allowed
602
     * @param optionsPath options path, <code>null</code> allowed
603
     * @return this descriptor with configured options path
603
     * @return this descriptor with configured options path
604
     * @see OptionOpenHandler
604
     */
605
     */
605
    @NonNull
606
    @NonNull
606
    @CheckReturnValue
607
    @CheckReturnValue
(-)a/extexecution/src/org/netbeans/api/extexecution/ExternalProcessSupport.java (-1 / +1 lines)
Lines 42-51 Link Here
42
42
43
package org.netbeans.api.extexecution;
43
package org.netbeans.api.extexecution;
44
44
45
import org.netbeans.spi.extexecution.destroy.*;
46
import java.util.Map;
45
import java.util.Map;
47
import org.netbeans.api.annotations.common.NonNull;
46
import org.netbeans.api.annotations.common.NonNull;
48
import org.netbeans.modules.extexecution.WrapperProcess;
47
import org.netbeans.modules.extexecution.WrapperProcess;
48
import org.netbeans.spi.extexecution.destroy.ProcessDestroyPerformer;
49
import org.openide.util.Lookup;
49
import org.openide.util.Lookup;
50
import org.openide.util.Parameters;
50
import org.openide.util.Parameters;
51
51
(-)a/extexecution/src/org/netbeans/api/extexecution/print/LineConvertors.java (-26 / +30 lines)
Lines 42-47 Link Here
42
42
43
package org.netbeans.api.extexecution.print;
43
package org.netbeans.api.extexecution.print;
44
44
45
import org.netbeans.modules.extexecution.print.UrlListener;
45
import java.net.MalformedURLException;
46
import java.net.MalformedURLException;
46
import java.net.URL;
47
import java.net.URL;
47
import java.util.ArrayList;
48
import java.util.ArrayList;
Lines 54-62 Link Here
54
import org.netbeans.api.annotations.common.CheckForNull;
55
import org.netbeans.api.annotations.common.CheckForNull;
55
import org.netbeans.api.annotations.common.NonNull;
56
import org.netbeans.api.annotations.common.NonNull;
56
import org.netbeans.api.annotations.common.NullAllowed;
57
import org.netbeans.api.annotations.common.NullAllowed;
57
import org.netbeans.modules.extexecution.print.FindFileListener;
58
import org.netbeans.modules.extexecution.open.DefaultFileOpenHandler;
58
import org.openide.awt.HtmlBrowser;
59
import org.netbeans.modules.extexecution.open.DefaultHttpOpenHandler;
60
import org.netbeans.modules.extexecution.print.FileListener;
61
import org.netbeans.spi.extexecution.open.FileOpenHandler;
62
import org.netbeans.spi.extexecution.open.HttpOpenHandler;
59
import org.openide.filesystems.FileObject;
63
import org.openide.filesystems.FileObject;
64
import org.openide.util.Lookup;
60
import org.openide.util.Parameters;
65
import org.openide.util.Parameters;
61
import org.openide.windows.OutputEvent;
66
import org.openide.windows.OutputEvent;
62
import org.openide.windows.OutputListener;
67
import org.openide.windows.OutputListener;
Lines 135-140 Link Here
135
     *             if negative line number is not parsed
140
     *             if negative line number is not parsed
136
     * @return the convertor searching for lines matching the patterns,
141
     * @return the convertor searching for lines matching the patterns,
137
     *             considering matched lines as being files (names or paths)
142
     *             considering matched lines as being files (names or paths)
143
     * @see FileOpenHandler
138
     */
144
     */
139
    @NonNull
145
    @NonNull
140
    public static LineConvertor filePattern(@NullAllowed FileLocator fileLocator, @NonNull Pattern linePattern,
146
    public static LineConvertor filePattern(@NullAllowed FileLocator fileLocator, @NonNull Pattern linePattern,
Lines 162-167 Link Here
162
     *
168
     *
163
     * @return the convertor parsing the line and searching for
169
     * @return the convertor parsing the line and searching for
164
     *             <code>http</code> or <code>https</code> URL
170
     *             <code>http</code> or <code>https</code> URL
171
     * @see HttpOpenHandler
165
     */
172
     */
166
    @NonNull
173
    @NonNull
167
    public static LineConvertor httpUrl() {
174
    public static LineConvertor httpUrl() {
Lines 214-219 Link Here
214
221
215
    private static class FilePatternConvertor implements LineConvertor {
222
    private static class FilePatternConvertor implements LineConvertor {
216
223
224
        private final FileOpenHandler handler;
225
217
        private final FileLocator locator;
226
        private final FileLocator locator;
218
227
219
        private final Pattern linePattern;
228
        private final Pattern linePattern;
Lines 232-237 Link Here
232
        public FilePatternConvertor(FileLocator locator, Pattern linePattern,
241
        public FilePatternConvertor(FileLocator locator, Pattern linePattern,
233
                Pattern filePattern, int fileGroup, int lineGroup) {
242
                Pattern filePattern, int fileGroup, int lineGroup) {
234
243
244
            FileOpenHandler candidate = Lookup.getDefault().lookup(FileOpenHandler.class);
245
            if (candidate != null) {
246
                handler = candidate;
247
            } else {
248
                handler = DefaultFileOpenHandler.INSTANCE;
249
            }
250
235
            this.locator = locator;
251
            this.locator = locator;
236
            this.linePattern = linePattern;
252
            this.linePattern = linePattern;
237
            this.fileGroup = fileGroup;
253
            this.fileGroup = fileGroup;
Lines 279-285 Link Here
279
                }
295
                }
280
296
281
                return Collections.<ConvertedLine>singletonList(
297
                return Collections.<ConvertedLine>singletonList(
282
                        ConvertedLine.forText(line, new FindFileListener(file, lineno, locator)));
298
                        ConvertedLine.forText(line,
299
                        new FileListener(file, lineno, locator, handler)));
283
            }
300
            }
284
301
285
            return null;
302
            return null;
Lines 290-299 Link Here
290
307
291
        private final Pattern pattern = Pattern.compile(".*(((http)|(https))://\\S+)(\\s.*|$)"); // NOI18N
308
        private final Pattern pattern = Pattern.compile(".*(((http)|(https))://\\S+)(\\s.*|$)"); // NOI18N
292
309
310
        private final HttpOpenHandler handler;
311
293
        public HttpUrlConvertor() {
312
        public HttpUrlConvertor() {
294
            super();
313
            HttpOpenHandler candidate = Lookup.getDefault().lookup(HttpOpenHandler.class);
314
            if (candidate != null) {
315
                handler = candidate;
316
            } else {
317
                handler = DefaultHttpOpenHandler.INSTANCE;
318
            }
295
        }
319
        }
296
320
321
        @Override
297
        public List<ConvertedLine> convert(String line) {
322
        public List<ConvertedLine> convert(String line) {
298
            Matcher matcher = pattern.matcher(line);
323
            Matcher matcher = pattern.matcher(line);
299
            if (matcher.matches()) {
324
            if (matcher.matches()) {
Lines 301-307 Link Here
301
                try {
326
                try {
302
                    URL url = new URL(stringUrl);
327
                    URL url = new URL(stringUrl);
303
                    return Collections.<ConvertedLine>singletonList(
328
                    return Collections.<ConvertedLine>singletonList(
304
                            ConvertedLine.forText(line, new UrlOutputListener(url)));
329
                            ConvertedLine.forText(line, new UrlListener(url, handler)));
305
                } catch (MalformedURLException ex) {
330
                } catch (MalformedURLException ex) {
306
                    // return null
331
                    // return null
307
                }
332
                }
Lines 311-335 Link Here
311
        }
336
        }
312
337
313
    }
338
    }
314
315
    private static class UrlOutputListener implements OutputListener {
316
317
        private final URL url;
318
319
        public UrlOutputListener(URL url) {
320
            this.url = url;
321
        }
322
323
        public void outputLineAction(OutputEvent ev) {
324
            HtmlBrowser.URLDisplayer.getDefault().showURL(url);
325
        }
326
327
        public void outputLineCleared(OutputEvent ev) {
328
            // noop
329
        }
330
331
        public void outputLineSelected(OutputEvent ev) {
332
            // noop
333
        }
334
    }
335
}
339
}
(-)a/extexecution/src/org/netbeans/modules/extexecution/InputOutputManager.java (-6 / +21 lines)
Lines 54-59 Link Here
54
import java.util.logging.Level;
54
import java.util.logging.Level;
55
import java.util.logging.Logger;
55
import java.util.logging.Logger;
56
import javax.swing.Action;
56
import javax.swing.Action;
57
import org.netbeans.spi.extexecution.open.OptionOpenHandler;
58
import org.openide.util.Lookup;
57
import org.openide.util.NbBundle;
59
import org.openide.util.NbBundle;
58
import org.openide.windows.IOProvider;
60
import org.openide.windows.IOProvider;
59
import org.openide.windows.InputOutput;
61
import org.openide.windows.InputOutput;
Lines 171-179 Link Here
171
                stopAction = new StopAction();
173
                stopAction = new StopAction();
172
                rerunAction = new RerunAction();
174
                rerunAction = new RerunAction();
173
                if (optionsPath != null) {
175
                if (optionsPath != null) {
174
                    optionsAction = new OptionsAction(optionsPath);
176
                    OptionOpenHandler handler = Lookup.getDefault().lookup(OptionOpenHandler.class);
175
                    io = IOProvider.getDefault().getIO(displayName,
177
                    if (handler != null) {
176
                            new Action[] {rerunAction, stopAction, optionsAction});
178
                        optionsAction = new OptionsAction(handler, optionsPath);
179
                        io = IOProvider.getDefault().getIO(displayName,
180
                                new Action[] {rerunAction, stopAction, optionsAction});
181
                    } else {
182
                        LOGGER.log(Level.WARNING, "No available OptionsOpenHandler so no Options button");
183
                        io = IOProvider.getDefault().getIO(displayName,
184
                            new Action[] {rerunAction, stopAction});
185
                    }
177
                } else {
186
                } else {
178
                    io = IOProvider.getDefault().getIO(displayName,
187
                    io = IOProvider.getDefault().getIO(displayName,
179
                            new Action[] {rerunAction, stopAction});
188
                            new Action[] {rerunAction, stopAction});
Lines 181-189 Link Here
181
                rerunAction.setParent(io);
190
                rerunAction.setParent(io);
182
            } else {
191
            } else {
183
                if (optionsPath != null) {
192
                if (optionsPath != null) {
184
                    optionsAction = new OptionsAction(optionsPath);
193
                    OptionOpenHandler handler = Lookup.getDefault().lookup(OptionOpenHandler.class);
185
                    io = IOProvider.getDefault().getIO(displayName,
194
                    if (handler != null) {
186
                            new Action[] {optionsAction});
195
                        optionsAction = new OptionsAction(handler, optionsPath);
196
                        io = IOProvider.getDefault().getIO(displayName,
197
                                new Action[] {optionsAction});
198
                    } else {
199
                        LOGGER.log(Level.WARNING, "No available OptionsOpenHandler so no Options button");
200
                        io = IOProvider.getDefault().getIO(displayName, true);
201
                    }
187
                } else {
202
                } else {
188
                    io = IOProvider.getDefault().getIO(displayName, true);
203
                    io = IOProvider.getDefault().getIO(displayName, true);
189
                }
204
                }
(-)a/extexecution/src/org/netbeans/modules/extexecution/OptionsAction.java (-4 / +7 lines)
Lines 45-52 Link Here
45
import java.awt.event.ActionEvent;
45
import java.awt.event.ActionEvent;
46
import javax.swing.AbstractAction;
46
import javax.swing.AbstractAction;
47
import javax.swing.Action;
47
import javax.swing.Action;
48
import javax.swing.ImageIcon;
48
import org.netbeans.spi.extexecution.open.OptionOpenHandler;
49
import org.netbeans.api.options.OptionsDisplayer;
50
import org.openide.util.ImageUtilities;
49
import org.openide.util.ImageUtilities;
51
import org.openide.util.NbBundle;
50
import org.openide.util.NbBundle;
52
51
Lines 56-73 Link Here
56
 */
55
 */
57
public class OptionsAction extends AbstractAction {
56
public class OptionsAction extends AbstractAction {
58
57
58
    private final OptionOpenHandler handler;
59
59
    private final String optionsPath;
60
    private final String optionsPath;
60
61
61
    public OptionsAction(String optionsPath) {
62
    public OptionsAction(OptionOpenHandler handler, String optionsPath) {
62
        setEnabled(true); // just to be sure
63
        setEnabled(true); // just to be sure
63
        putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/extexecution/resources/options.png", false)); // NOI18N
64
        putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/extexecution/resources/options.png", false)); // NOI18N
64
        putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(OptionsAction.class, "Options"));
65
        putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(OptionsAction.class, "Options"));
65
66
67
        assert handler != null : "Null handler";
68
        this.handler = handler;
66
        this.optionsPath = optionsPath;
69
        this.optionsPath = optionsPath;
67
    }
70
    }
68
71
69
    public void actionPerformed(ActionEvent e) {
72
    public void actionPerformed(ActionEvent e) {
70
        OptionsDisplayer.getDefault().open(optionsPath);
73
        handler.open(optionsPath);
71
    }
74
    }
72
75
73
    public String getOptionsPath() {
76
    public String getOptionsPath() {
(-)a/extexecution/src/org/netbeans/modules/extexecution/print/FindFileListener.java (-82 / +24 lines)
Lines 43-93 Link Here
43
 */
43
 */
44
package org.netbeans.modules.extexecution.print;
44
package org.netbeans.modules.extexecution.print;
45
45
46
import java.awt.Desktop;
46
import java.io.File;
47
import java.io.File;
47
import java.io.IOException;
48
import java.io.IOException;
49
import java.util.Collection;
48
import java.util.logging.Level;
50
import java.util.logging.Level;
49
import java.util.logging.Logger;
51
import java.util.logging.Logger;
50
import javax.swing.SwingUtilities;
51
import javax.swing.text.Document;
52
53
import org.netbeans.api.extexecution.print.LineConvertors.FileLocator;
52
import org.netbeans.api.extexecution.print.LineConvertors.FileLocator;
54
import org.openide.cookies.EditorCookie;
53
import org.netbeans.spi.extexecution.open.FileOpenHandler;
55
import org.openide.cookies.LineCookie;
56
import org.openide.cookies.OpenCookie;
57
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileUtil;
55
import org.openide.filesystems.FileUtil;
59
import org.openide.loaders.DataObject;
60
import org.openide.text.Line;
61
import org.openide.text.Line.ShowOpenType;
62
import org.openide.text.Line.ShowVisibilityType;
63
import org.openide.windows.OutputEvent;
56
import org.openide.windows.OutputEvent;
64
import org.openide.windows.OutputListener;
57
import org.openide.windows.OutputListener;
65
58
66
/**
59
/**
67
 * An OutputProcessor takes filename and lineno information
60
 * An OutputProcessor takes filename and line information
68
 * and produces hyperlinks. Actually resolving filenames
61
 * and produces hyperlinks. Actually resolving filenames
69
 * into real FileObjects is done lazily via user-supplied
62
 * into real FileObjects is done lazily via user-supplied
70
 * FileLocators when the links are actually clicked.
63
 * FileLocators when the links are actually clicked.
71
 *
64
 *
72
 * @author Tor Norbye, Petr Hejl
65
 * @author Tor Norbye, Petr Hejl
73
 */
66
 */
74
public class FindFileListener implements OutputListener {
67
public class FileListener implements OutputListener {
75
68
76
    private static final Logger LOGGER = Logger.getLogger(FindFileListener.class.getName());
69
    private static final Logger LOGGER = Logger.getLogger(FileListener.class.getName());
77
70
78
    private final String file;
71
    private final String file;
72
79
    private final int lineno;
73
    private final int lineno;
74
80
    private final FileLocator fileLocator;
75
    private final FileLocator fileLocator;
81
76
82
    public FindFileListener(String file, int lineno, FileLocator fileLocator) {
77
    private final FileOpenHandler handler;
83
        if (lineno < 0) {
78
84
            lineno = 0;
79
    public FileListener(String file, int line, FileLocator fileLocator,
80
            FileOpenHandler handler) {
81
82
        if (line < 0) {
83
            line = 0;
85
        }
84
        }
86
85
87
        // TODO : columns?
86
        // TODO : columns?
88
        this.file = file;
87
        this.file = file;
89
        this.lineno = lineno;
88
        this.lineno = line;
90
        this.fileLocator = fileLocator;
89
        this.fileLocator = fileLocator;
90
        this.handler = handler;
91
    }
91
    }
92
92
93
    public void outputLineSelected(OutputEvent ev) {
93
    public void outputLineSelected(OutputEvent ev) {
Lines 99-108 Link Here
99
        FileObject fo = findFile(file);
99
        FileObject fo = findFile(file);
100
100
101
        if (fo != null) {
101
        if (fo != null) {
102
            open(fo, lineno);
102
            handler.open(fo, lineno);
103
        }
103
        }
104
    }
104
    }
105
105
106
    public void outputLineCleared(OutputEvent ev) {
107
    }
108
106
    private FileObject findFile(final String path) {
109
    private FileObject findFile(final String path) {
107
        if (fileLocator != null) {
110
        if (fileLocator != null) {
108
            FileObject fo = fileLocator.find(path);
111
            FileObject fo = fileLocator.find(path);
Lines 113-185 Link Here
113
116
114
        // Perhaps it's an absolute path of some sort... try to resolve those
117
        // Perhaps it's an absolute path of some sort... try to resolve those
115
        // Absolute path? Happens for stack traces in libraries and such
118
        // Absolute path? Happens for stack traces in libraries and such
116
        File file  = new File(path);
119
        File realFile  = new File(path);
117
        if (file.isFile()) {
120
        if (realFile.isFile()) {
118
            return FileUtil.toFileObject(FileUtil.normalizeFile(file));
121
            return FileUtil.toFileObject(FileUtil.normalizeFile(realFile));
119
        } else {
122
        } else {
120
            LOGGER.warning("Cannot resolve file for \"" + path + "\" path.");
123
            LOGGER.warning("Cannot resolve file for \"" + path + "\" path.");
121
            return null;
124
            return null;
122
        }
125
        }
123
    }
126
    }
124
125
    public void outputLineCleared(OutputEvent ev) {
126
    }
127
128
    public static boolean open(final FileObject fo, final int lineno) {
129
        if (!SwingUtilities.isEventDispatchThread()) {
130
            SwingUtilities.invokeLater(new Runnable() {
131
                    public void run() {
132
                        open(fo, lineno);
133
                    }
134
                });
135
136
            return true; // not exactly accurate, but....
137
        }
138
139
        try {
140
            DataObject od = DataObject.find(fo);
141
            EditorCookie ec = od.getCookie(EditorCookie.class);
142
            LineCookie lc = od.getCookie(LineCookie.class);
143
144
            if ((ec != null) && (lc != null)) {
145
                Document doc = ec.openDocument();
146
147
                if (doc != null) {
148
                    int line = lineno;
149
150
                    if (line < 1) {
151
                        line = 1;
152
                    }
153
154
                    // XXX .size() call is super-slow for large files, see issue
155
                    // #126531. So we fallback to catching IOOBE
156
//                    int nOfLines = lines.getLines().size();
157
//                    if (line > nOfLines) {
158
//                        line = nOfLines;
159
//                    }
160
                    try {
161
                        Line.Set lines = lc.getLineSet();
162
                        Line l = lines.getCurrent(line - 1);
163
                        if (l != null) {
164
                            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS);
165
                            return true;
166
                        }
167
                    } catch (IndexOutOfBoundsException ioobe) {
168
                        // OK, since .size() cannot be used, see above
169
                    }
170
                }
171
            }
172
173
            OpenCookie oc = od.getCookie(OpenCookie.class);
174
175
            if (oc != null) {
176
                oc.open();
177
                return true;
178
            }
179
        } catch (IOException e) {
180
            LOGGER.log(Level.INFO, null, e);
181
        }
182
183
        return false;
184
    }
185
}
127
}
(-)a/extexecution/src/org/netbeans/modules/extexecution/resources/Bundle.properties (-1 / +1 lines)
Lines 40-46 Link Here
40
# Version 2 license, then the option applies only if the new code is
40
# Version 2 license, then the option applies only if the new code is
41
# made subject to such option by the copyright holder.
41
# made subject to such option by the copyright holder.
42
42
43
OpenIDE-Module-Name=External Execution Support
43
OpenIDE-Module-Name=External Execution API
44
OpenIDE-Module-Display-Category=Base IDE
44
OpenIDE-Module-Display-Category=Base IDE
45
OpenIDE-Module-Short-Description=Supports execution of external processes
45
OpenIDE-Module-Short-Description=Supports execution of external processes
46
OpenIDE-Module-Long-Description=Supports execution of external processes.
46
OpenIDE-Module-Long-Description=Supports execution of external processes.
(-)a/extexecution/src/org/netbeans/spi/extexecution/open/FileOpenHandler.java (+65 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.extexecution.open;
43
44
import org.netbeans.api.annotations.common.NonNull;
45
import org.netbeans.api.extexecution.print.LineConvertor;
46
import org.netbeans.api.extexecution.print.LineConvertors;
47
import org.openide.filesystems.FileObject;
48
49
/**
50
 * Defines a handler for file opening. May be used by default
51
 * {@link LineConvertor}s provided by {@link LineConvertors}.
52
 *
53
 * @author Petr Hejl
54
 * @since 1.33
55
 */
56
public interface FileOpenHandler {
57
58
    /**
59
     * Opens a file at the given line.
60
     *
61
     * @param file the file to open
62
     * @param line the line of the while which should be make visible
63
     */
64
    void open(@NonNull FileObject file, int line);
65
}
(-)a/extexecution/src/org/netbeans/spi/extexecution/open/HttpOpenHandler.java (+64 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.extexecution.open;
43
44
import java.net.URL;
45
import org.netbeans.api.annotations.common.NonNull;
46
import org.netbeans.api.extexecution.print.LineConvertor;
47
import org.netbeans.api.extexecution.print.LineConvertors;
48
49
/**
50
 * Defines a handler for HTTP URL opening. May be used by default
51
 * {@link LineConvertor}s provided by {@link LineConvertors}.
52
 *
53
 * @author Petr Hejl
54
 * @since 1.33
55
 */
56
public interface HttpOpenHandler {
57
58
    /**
59
     * Opens the URL.
60
     *
61
     * @param url URL to open
62
     */
63
    void open(@NonNull URL url);
64
}
(-)a/extexecution/src/org/netbeans/spi/extexecution/open/OptionOpenHandler.java (+63 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 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 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.extexecution.open;
43
44
import org.netbeans.api.annotations.common.NonNull;
45
import org.netbeans.api.extexecution.ExecutionDescriptor;
46
47
/**
48
 * Defines a handler for options dialog opening. There has to be a handler
49
 * in the system for {@link ExecutionDescriptor#optionsPath(String)} in order
50
 * to work properly.
51
 *
52
 * @author Petr Hejl
53
 * @since 1.33
54
 */
55
public interface OptionOpenHandler {
56
57
    /**
58
     * Opens the option dialog displaying options specified by the path.
59
     *
60
     * @param optionsPath the path describing options to display
61
     */
62
    void open(@NonNull String optionsPath);
63
}
(-)a/extexecution/src/org/netbeans/spi/extexecution/destroy/package-info.java (-3 / +7 lines)
Lines 43-51 Link Here
43
 */
43
 */
44
44
45
/**
45
/**
46
 * The support SPI for terminating external processes.
46
 * The support SPI to allow pluggability of predefined 
47
 * {@link org.netbeans.api.extexecution.print.LineConvertors}.
48
 * Also allows you to define way how option dialog should be opened.
47
 *
49
 *
48
 * @see org.netbeans.spi.extexecution.destroy.ProcessDestroyPerformer
50
 * @see org.netbeans.spi.extexecution.open.FileOpenHandler
51
 * @see org.netbeans.spi.extexecution.open.HttpOpenHandler
52
 * @see org.netbeans.spi.extexecution.open.OptionOpenHandler
49
 */
53
 */
50
package org.netbeans.spi.extexecution.destroy;
54
package org.netbeans.spi.extexecution.open;
51
55
(-)a/extexecution/src/org/netbeans/spi/extexecution/startup/StartupExtenderImplementation.java (-1 / +1 lines)
Lines 68-74 Link Here
68
     * start mode.
68
     * start mode.
69
     *
69
     *
70
     * @param context the lookup providing the contract between client
70
     * @param context the lookup providing the contract between client
71
     *             and provider (see {@link StartupExtender#getStartupExtender}
71
     *             and provider (see {@link StartupExtender#getExtenders(Lookup context, StartupExtender.StartMode mode)}
72
     *             for details)
72
     *             for details)
73
     * @param mode the startup mode the client is going to use
73
     * @param mode the startup mode the client is going to use
74
     * @return the list of arguments to pass to the process
74
     * @return the list of arguments to pass to the process
(-)a/libs.jna/manifest.mf (-1 / +1 lines)
Lines 4-7 Link Here
4
OpenIDE-Module-Install: org/netbeans/libs/jna/Installer.class
4
OpenIDE-Module-Install: org/netbeans/libs/jna/Installer.class
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jna/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jna/Bundle.properties
6
AutoUpdate-Essential-Module: true
6
AutoUpdate-Essential-Module: true
7
OpenIDE-Module-Specification-Version: 1.22
7
OpenIDE-Module-Specification-Version: 1.23
(-)a/libs.jna/nbproject/project.xml (-1 / +1 lines)
Lines 72-78 Link Here
72
                <friend>org.netbeans.core.browser.xulrunner</friend>
72
                <friend>org.netbeans.core.browser.xulrunner</friend>
73
                <friend>org.netbeans.core.nativeaccess</friend>
73
                <friend>org.netbeans.core.nativeaccess</friend>
74
                <friend>org.netbeans.modules.dlight.nativeexecution</friend>
74
                <friend>org.netbeans.modules.dlight.nativeexecution</friend>
75
                <friend>org.netbeans.modules.extexecution.destroy</friend>
75
                <friend>org.netbeans.modules.extexecution.impl</friend>
76
                <friend>org.netbeans.modules.keyring.impl</friend>
76
                <friend>org.netbeans.modules.keyring.impl</friend>
77
                <friend>org.netbeans.modules.masterfs.windows</friend>
77
                <friend>org.netbeans.modules.masterfs.windows</friend>
78
                <friend>org.netbeans.modules.masterfs.linux</friend>
78
                <friend>org.netbeans.modules.masterfs.linux</friend>
(-)a/nbbuild/cluster.properties (-1 / +1 lines)
Lines 285-291 Link Here
285
        editor.util,\
285
        editor.util,\
286
        extbrowser,\
286
        extbrowser,\
287
        extexecution,\
287
        extexecution,\
288
        extexecution.destroy,\
288
        extexecution.impl,\
289
        git,\
289
        git,\
290
        glassfish.common,\
290
        glassfish.common,\
291
        gototest,\
291
        gototest,\

Return to bug 216882