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

(-)ant/manifest.mf (-2 / +2 lines)
Lines 1-12 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.apache.tools.ant.module/2
2
OpenIDE-Module: org.apache.tools.ant.module/2
3
OpenIDE-Module-Localizing-Bundle: org/apache/tools/ant/module/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/apache/tools/ant/module/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.15
4
OpenIDE-Module-Specification-Version: 2.16
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Public-Packages: org.apache.tools.ant.module.api.*, org.apache.tools.ant.*, org.apache.tools.ant.filters.**, org.apache.tools.ant.helper.**, org.apache.tools.ant.input.**, org.apache.tools.ant.listener.**, org.apache.tools.ant.taskdefs.**, org.apache.tools.ant.types.**, org.apache.tools.ant.util.**, org.apache.tools.bzip2.**, org.apache.tools.mail.**, org.apache.tools.tar.**, org.apache.tools.zip.**
6
OpenIDE-Module-Public-Packages: org.apache.tools.ant.module.api.*, org.apache.tools.ant.*, org.apache.tools.ant.filters.**, org.apache.tools.ant.helper.**, org.apache.tools.ant.input.**, org.apache.tools.ant.listener.**, org.apache.tools.ant.taskdefs.**, org.apache.tools.ant.types.**, org.apache.tools.ant.util.**, org.apache.tools.bzip2.**, org.apache.tools.mail.**, org.apache.tools.tar.**, org.apache.tools.zip.**
7
OpenIDE-Module-Install: org/apache/tools/ant/module/AntModule.class
7
OpenIDE-Module-Install: org/apache/tools/ant/module/AntModule.class
8
OpenIDE-Module-Layer: org/apache/tools/ant/module/resources/AntModuleLayer.xml
8
OpenIDE-Module-Layer: org/apache/tools/ant/module/resources/AntModuleLayer.xml
9
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.javahelp/1 > 1.0, org.openide.deprecated > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
9
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.javahelp/1 > 1.0, org.openide.deprecated > 1.2, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
10
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
10
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
11
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
11
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
12
OpenIDE-Module-Package-Dependencies: [org.apache.tools.ant.Location], [org.apache.xerces.parsers.DOMParser], [org.apache.xml.serialize.EncodingInfo]
12
OpenIDE-Module-Package-Dependencies: [org.apache.tools.ant.Location], [org.apache.xerces.parsers.DOMParser], [org.apache.xml.serialize.EncodingInfo]
(-)ant/src/org/apache/tools/ant/module/loader/AntExecSupport.java (-2 / +2 lines)
Lines 16-27 Link Here
16
package org.apache.tools.ant.module.loader;
16
package org.apache.tools.ant.module.loader;
17
17
18
import org.openide.execution.Executor;
18
import org.openide.execution.Executor;
19
import org.openide.loaders.ExecSupport;
19
import org.openide.loaders.ExecutionSupport;
20
import org.openide.loaders.MultiDataObject;
20
import org.openide.loaders.MultiDataObject;
21
21
22
import org.apache.tools.ant.module.AntSettings;
22
import org.apache.tools.ant.module.AntSettings;
23
23
24
public class AntExecSupport extends ExecSupport {
24
public class AntExecSupport extends ExecutionSupport {
25
    
25
    
26
    public AntExecSupport (MultiDataObject.Entry entry) {
26
    public AntExecSupport (MultiDataObject.Entry entry) {
27
        super (entry);
27
        super (entry);
(-)ant/src/org/apache/tools/ant/module/loader/AntProjectDataObject.java (-9 lines)
Lines 18-24 Link Here
18
import java.beans.PropertyChangeEvent;
18
import java.beans.PropertyChangeEvent;
19
import java.beans.PropertyChangeListener;
19
import java.beans.PropertyChangeListener;
20
20
21
import org.openide.cookies.DebuggerCookie;
22
import org.openide.cookies.SaveCookie;
21
import org.openide.cookies.SaveCookie;
23
import org.openide.filesystems.FileObject;
22
import org.openide.filesystems.FileObject;
24
import org.openide.loaders.*;
23
import org.openide.loaders.*;
Lines 52-65 Link Here
52
            cookies.add (new AntActionInstance (proj));
51
            cookies.add (new AntActionInstance (proj));
53
        }
52
        }
54
        addPropertyChangeListener (this);
53
        addPropertyChangeListener (this);
55
    }
56
    
57
    // #12864: AntExecSupport only incidentally implements DebuggerCookie
58
    public Node.Cookie getCookie (Class clazz) {
59
        if (clazz == DebuggerCookie.class) {
60
            return null;
61
        }
62
        return super.getCookie (clazz);
63
    }
54
    }
64
    
55
    
65
    public HelpCtx getHelpCtx () {
56
    public HelpCtx getHelpCtx () {
(-)ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java (-3 / +2 lines)
Lines 154-163 Link Here
154
        exec.setShortDescription (NbBundle.getMessage (AntProjectNode.class, "HINT_execution"));
154
        exec.setShortDescription (NbBundle.getMessage (AntProjectNode.class, "HINT_execution"));
155
        CompilerSupport csupp = (CompilerSupport) getCookie (CompilerSupport.class);
155
        CompilerSupport csupp = (CompilerSupport) getCookie (CompilerSupport.class);
156
        if (csupp != null) csupp.addProperties (exec);
156
        if (csupp != null) csupp.addProperties (exec);
157
        ExecSupport xsupp = (ExecSupport) getCookie (ExecSupport.class);
157
        ExecutionSupport xsupp = (ExecutionSupport) getCookie (ExecutionSupport.class);
158
        if (xsupp != null) xsupp.addProperties (exec);
158
        if (xsupp != null) xsupp.addProperties (exec);
159
        exec.remove (ExecSupport.PROP_FILE_PARAMS);
159
        exec.remove (ExecutionSupport.PROP_FILE_PARAMS);
160
        exec.remove (ExecSupport.PROP_DEBUGGER_TYPE);
161
        if (csupp != null || xsupp != null) {
160
        if (csupp != null || xsupp != null) {
162
            sheet.put (exec);
161
            sheet.put (exec);
163
        }
162
        }
(-)apisupport/apidocs/build.xml (-1 / +4 lines)
Lines 8-14 Link Here
8
http://www.sun.com/
8
http://www.sun.com/
9
9
10
The Original Code is NetBeans. The Initial Developer of the Original
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
12
Microsystems, Inc. All Rights Reserved.
13
-->
13
-->
14
<project name="apisupport/apidocs" default="netbeans" basedir=".">
14
<project name="apisupport/apidocs" default="netbeans" basedir=".">
Lines 40-45 Link Here
40
        <makeparserdb db="netbeans/system/ParserDB/OpenAPIs" sources="../../openide/src" nbroot="../.."/>
40
        <makeparserdb db="netbeans/system/ParserDB/OpenAPIs" sources="../../openide/src" nbroot="../.."/>
41
        <makeparserdb db="netbeans/system/ParserDB/CompilerAPI" sources="../../openide/compiler/src" nbroot="../.."/>
41
        <makeparserdb db="netbeans/system/ParserDB/CompilerAPI" sources="../../openide/compiler/src" nbroot="../.."/>
42
        <makeparserdb db="netbeans/system/ParserDB/ExecutionAPI" sources="../../openide/execution/src" nbroot="../.."/>
42
        <makeparserdb db="netbeans/system/ParserDB/ExecutionAPI" sources="../../openide/execution/src" nbroot="../.."/>
43
        <makeparserdb db="netbeans/system/ParserDB/DebuggerAPI" sources="../../debuggercore/oldapi/src" nbroot="../.."/>
43
        <makeparserdb db="netbeans/system/ParserDB/InputOutputAPI" sources="../../openide/io/src" nbroot="../.."/>
44
        <makeparserdb db="netbeans/system/ParserDB/InputOutputAPI" sources="../../openide/io/src" nbroot="../.."/>
44
        <makeparserdb db="netbeans/system/ParserDB/JavaHelpAPI" sources="../../core/javahelp/src" nbroot="../.."/>
45
        <makeparserdb db="netbeans/system/ParserDB/JavaHelpAPI" sources="../../core/javahelp/src" nbroot="../.."/>
45
        <makeparserdb db="netbeans/system/ParserDB/SettingsAPI" sources="../../core/settings/src" nbroot="../.."/>
46
        <makeparserdb db="netbeans/system/ParserDB/SettingsAPI" sources="../../core/settings/src" nbroot="../.."/>
Lines 55-60 Link Here
55
        <copy file="../../openide/io/javadoc/InputOutputAPI.zip" tofile="netbeans/docs/InputOutputAPI.zip"/>
56
        <copy file="../../openide/io/javadoc/InputOutputAPI.zip" tofile="netbeans/docs/InputOutputAPI.zip"/>
56
        <ant dir="../../openide/execution" target="javadoc"/>
57
        <ant dir="../../openide/execution" target="javadoc"/>
57
        <copy file="../../openide/execution/javadoc/ExecutionAPI.zip" tofile="netbeans/docs/ExecutionAPI.zip"/>
58
        <copy file="../../openide/execution/javadoc/ExecutionAPI.zip" tofile="netbeans/docs/ExecutionAPI.zip"/>
59
        <ant dir="../../debuggercore/oldapi" target="javadoc"/>
60
        <copy file="../../debuggercore/oldapi/javadoc/DebuggerAPI.zip" tofile="netbeans/docs/DebuggerAPI.zip"/>
58
        <ant dir="../../openide/compiler" target="javadoc"/>
61
        <ant dir="../../openide/compiler" target="javadoc"/>
59
        <copy file="../../openide/compiler/javadoc/CompilerAPI.zip" tofile="netbeans/docs/CompilerAPI.zip"/>
62
        <copy file="../../openide/compiler/javadoc/CompilerAPI.zip" tofile="netbeans/docs/CompilerAPI.zip"/>
60
        <ant dir="../../core/javahelp" target="javadoc"/>
63
        <ant dir="../../core/javahelp" target="javadoc"/>
(-)apisupport/apidocs/manifest.mf (-1 / +1 lines)
Lines 2-8 Link Here
2
OpenIDE-Module: org.netbeans.modules.apisupport.apidocs
2
OpenIDE-Module: org.netbeans.modules.apisupport.apidocs
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/apidocs/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/apidocs/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/modules/apisupport/apidocs/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/apisupport/apidocs/layer.xml
5
OpenIDE-Module-Specification-Version: 2.15
5
OpenIDE-Module-Specification-Version: 2.16
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.13, org.netbeans.modules.javadoc/1 > 1.10
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.13, org.netbeans.modules.javadoc/1 > 1.10
(-)apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/Bundle.properties (+2 lines)
Lines 23-28 Link Here
23
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc.xml=OpenAPIs.zip (Open APIs Javadoc)
23
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc.xml=OpenAPIs.zip (Open APIs Javadoc)
24
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-compiler.xml=CompilerAPI.zip (Compiler API Javadoc)
24
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-compiler.xml=CompilerAPI.zip (Compiler API Javadoc)
25
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-execution.xml=ExecutionAPI.zip (Execution API Javadoc)
25
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-execution.xml=ExecutionAPI.zip (Execution API Javadoc)
26
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-debugger.xml=DebuggerAPI.zip (Debugger API Javadoc)
26
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-io.xml=InputOutputAPI.zip (Input/Output API Javadoc)
27
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-io.xml=InputOutputAPI.zip (Input/Output API Javadoc)
27
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-javahelp.xml=JavaHelpAPI.zip (JavaHelp Integration API Javadoc)
28
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-javahelp.xml=JavaHelpAPI.zip (JavaHelp Integration API Javadoc)
28
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-settings.xml=SettingsAPI.zip (Settings API Javadoc)
29
Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-settings.xml=SettingsAPI.zip (Settings API Javadoc)
Lines 31-36 Link Here
31
Mount/java/org-netbeans-modules-apisupport-openide-main.xml=openide.jar (Open APIs Library)
32
Mount/java/org-netbeans-modules-apisupport-openide-main.xml=openide.jar (Open APIs Library)
32
Mount/java/org-netbeans-modules-apisupport-openide-compiler.xml=openide-compiler.jar (Compiler API Library)
33
Mount/java/org-netbeans-modules-apisupport-openide-compiler.xml=openide-compiler.jar (Compiler API Library)
33
Mount/java/org-netbeans-modules-apisupport-openide-execution.xml=openide-execution.jar (Execution API Library)
34
Mount/java/org-netbeans-modules-apisupport-openide-execution.xml=openide-execution.jar (Execution API Library)
35
Mount/java/org-netbeans-modules-apisupport-openide-debugger.xml=openide-debugger.jar (Debugger API Library)
34
Mount/java/org-netbeans-modules-apisupport-openide-io.xml=openide-io.jar (Input/Output API Library)
36
Mount/java/org-netbeans-modules-apisupport-openide-io.xml=openide-io.jar (Input/Output API Library)
35
Mount/java/org-netbeans-modules-apisupport-javahelp-api.xml=javahelp-api.jar (JavaHelp Integration API Library)
37
Mount/java/org-netbeans-modules-apisupport-javahelp-api.xml=javahelp-api.jar (JavaHelp Integration API Library)
36
Mount/java/org-netbeans-modules-apisupport-core-settings.xml=core-settings.jar (Settings API Library)
38
Mount/java/org-netbeans-modules-apisupport-core-settings.xml=core-settings.jar (Settings API Library)
(-)apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/javadoc-debugger.xml (+19 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
<!DOCTYPE Javadoc PUBLIC
15
          "-//NetBeans IDE//DTD JavadocLibrary//EN"
16
          "http://www.netbeans.org/dtds/JavadocLibrary-1_0.dtd">
17
<Javadoc>
18
    <Archive name="docs/DebuggerAPI.zip"/>
19
</Javadoc>
(-)apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/layer.xml (+10 lines)
Lines 23-28 Link Here
23
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
23
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
24
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
24
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
25
            </file>
25
            </file>
26
            <!-- XXX delete me when deprecating this module -->
27
            <file name="org-netbeans-modules-apisupport-javadoc-debugger.xml" url="javadoc-debugger.xml">
28
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
29
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
30
            </file>
26
            <file name="org-netbeans-modules-apisupport-javadoc-io.xml" url="javadoc-io.xml">
31
            <file name="org-netbeans-modules-apisupport-javadoc-io.xml" url="javadoc-io.xml">
27
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
32
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
28
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
33
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
Lines 55-60 Link Here
55
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
60
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
56
            </file>
61
            </file>
57
            <file name="org-netbeans-modules-apisupport-openide-execution.xml" url="openide-execution-jar.xml">
62
            <file name="org-netbeans-modules-apisupport-openide-execution.xml" url="openide-execution-jar.xml">
63
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
64
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
65
            </file>
66
            <!-- XXX delete me when deprecating this module -->
67
            <file name="org-netbeans-modules-apisupport-openide-debugger.xml" url="openide-debugger-jar.xml">
58
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
68
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.apidocs.Bundle"/>
59
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
69
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/apidocs/ShowAPIJavadocIcon.gif"/>
60
            </file>
70
            </file>
(-)apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/openide-debugger-jar.xml (+17 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
<!DOCTYPE library PUBLIC "-//NetBeans//DTD Java Library 1.1//EN" "http://www.netbeans.org/dtds/java-library-1_1.dtd">
15
<library>
16
    <archive name="modules/autoload/openide-debugger.jar"/>
17
</library>
(-)applet/build.xml (+1 lines)
Lines 33-38 Link Here
33
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
33
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
34
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
34
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
35
	<pathelement location="../debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
35
	<pathelement location="../debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
36
	<pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
36
	<!--<pathelement location="../html/netbeans/modules/html.jar"/> -->
37
	<!--<pathelement location="../html/netbeans/modules/html.jar"/> -->
37
      </classpath>
38
      </classpath>
38
    </javac>
39
    </javac>
(-)applet/manifest.mf (-2 / +2 lines)
Lines 3-9 Link Here
3
OpenIDE-Module-Layer: org/netbeans/modules/applet/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/applet/layer.xml
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
7
OpenIDE-Module-Specification-Version: 1.10
7
OpenIDE-Module-Specification-Version: 1.11
8
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
8
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
9
9
(-)clazz/build.xml (-1 / +2 lines)
Lines 8-14 Link Here
8
http://www.sun.com/
8
http://www.sun.com/
9
9
10
The Original Code is NetBeans. The Initial Developer of the Original
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
12
Microsystems, Inc. All Rights Reserved.
13
-->
13
-->
14
14
Lines 31-36 Link Here
31
        <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
31
        <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
32
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
32
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
33
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
33
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
34
        <pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
34
      </classpath>
35
      </classpath>
35
    </javac>
36
    </javac>
36
  </target>
37
  </target>
(-)clazz/manifest.mf (-2 / +2 lines)
Lines 4-11 Link Here
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/clazz/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/clazz/Bundle.properties
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Specification-Version: 1.11
7
OpenIDE-Module-Specification-Version: 1.12
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.classfile/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.execution > 1.0
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.classfile/1, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
9
OpenIDE-Module: org.netbeans.modules.clazz/1
9
OpenIDE-Module: org.netbeans.modules.clazz/1
10
OpenIDE-Module-Requires: org.openide.execution.ExecutionEngine
10
OpenIDE-Module-Requires: org.openide.execution.ExecutionEngine
11
11
(-)core/manifest.mf (-2 / +2 lines)
Lines 1-7 Link Here
1
OpenIDE-Module: org.netbeans.core/1
1
OpenIDE-Module: org.netbeans.core/1
2
OpenIDE-Module-Specification-Version: 1.11
2
OpenIDE-Module-Specification-Version: 1.12
3
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
3
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.32
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.33
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/Bundle.properties
6
OpenIDE-Module-Layer: org/netbeans/core/resources/mf-layer.xml
6
OpenIDE-Module-Layer: org/netbeans/core/resources/mf-layer.xml
7
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
7
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
(-)core/deprecated/manifest.mf (-3 / +1 lines)
Lines 1-11 Link Here
1
OpenIDE-Module: org.netbeans.core.deprecated
1
OpenIDE-Module: org.netbeans.core.deprecated
2
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
2
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
3
OpenIDE-Module-Specification-Version: 1.1
3
OpenIDE-Module-Specification-Version: 1.2
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.7, org.openide.deprecated > 1.0, org.openide.execution > 1.0
5
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.7, org.openide.deprecated > 1.0, org.openide.execution > 1.0
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/deprecated/Bundle.properties
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/deprecated/Bundle.properties
7
OpenIDE-Module-Install: org/netbeans/core/deprecated/Install.class
8
OpenIDE-Module-Provides: org.openide.TopManager
7
OpenIDE-Module-Provides: org.openide.TopManager
9
OpenIDE-Module-Layer: org/netbeans/core/deprecated/layer.xml
10
OpenIDE-Module-Deprecated: true
8
OpenIDE-Module-Deprecated: true
11
9
(-)core/deprecated/src/org/netbeans/core/deprecated/Bundle.properties (-11 / +1 lines)
Lines 6-12 Link Here
6
# http://www.sun.com/
6
# http://www.sun.com/
7
# 
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
OpenIDE-Module-Name=Deprecated Core
12
OpenIDE-Module-Name=Deprecated Core
Lines 23-38 Link Here
23
CTL_ControlPanel=Control Panel
23
CTL_ControlPanel=Control Panel
24
CTL_Project_Settings=Project Settings
24
CTL_Project_Settings=Project Settings
25
CTL_Project_Settings_Hint=Contains project-specific settings.
25
CTL_Project_Settings_Hint=Contains project-specific settings.
26
27
LAB_DebuggerTypeDefault=Default Debugging
28
HINT_DebuggerTypeDefault=Simple debugging according to the debugger's own preferences.
29
30
LAB_DebuggerType=Debugger Types
31
HINT_DebuggerType=All types of debuggers registered in the system.
32
33
LAB_NoDebugger=(do not debug)
34
# {0} - class name
35
EXC_NoDebugger=The class {0} is not configured to be debugged.\nYou may change this if you wish.
36
26
37
EXC_WorkspaceLoadFail=Cannot load workspaces. Using default configuration.
27
EXC_WorkspaceLoadFail=Cannot load workspaces. Using default configuration.
38
EXC_CorruptedProject=Your saved project files are corrupted.
28
EXC_CorruptedProject=Your saved project files are corrupted.
(-)core/deprecated/src/org/netbeans/core/deprecated/DebuggerType.java (-51 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.deprecated;
15
16
import java.beans.*;
17
import java.util.ResourceBundle;
18
import org.openide.util.NbBundle;
19
20
/**
21
*
22
* @author jtulach
23
*/
24
public abstract class DebuggerType {
25
    private DebuggerType () {}
26
27
    /** Object that provides beaninfo for {@link DebuggerType.Default}.
28
    *
29
    * @author Jaroslav Tulach
30
    */
31
    public static class DefaultBeanInfo extends SimpleBeanInfo {
32
33
        public BeanDescriptor getBeanDescriptor () {
34
            BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.Default.class);
35
            ResourceBundle bundle = NbBundle.getBundle(DebuggerType.DefaultBeanInfo.class);
36
            descr.setDisplayName (bundle.getString("LAB_DebuggerTypeDefault")); // NOI18N
37
            descr.setShortDescription (bundle.getString("HINT_DebuggerTypeDefault")); // NOI18N
38
            return descr;
39
        }
40
41
        public BeanInfo[] getAdditionalBeanInfo () {
42
            try {
43
                return new BeanInfo[] { Introspector.getBeanInfo (org.openide.debugger.DebuggerType.class) };
44
            } catch (IntrospectionException ie) {
45
                org.openide.ErrorManager.getDefault().notify(ie);
46
                return null;
47
            }
48
        }
49
50
    }
51
}
(-)core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeBeanInfo.java (-58 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.deprecated;
15
16
import java.awt.Image;
17
import java.beans.*;
18
import java.util.ResourceBundle;
19
20
import org.openide.util.NbBundle;
21
import org.openide.util.Utilities;
22
23
/** Object that provides beaninfo for {@link DebuggerType}.
24
*
25
* @author Jaroslav Tulach
26
*/
27
public class DebuggerTypeBeanInfo extends SimpleBeanInfo {
28
29
    public BeanDescriptor getBeanDescriptor () {
30
        BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.class);
31
        ResourceBundle bundle = NbBundle.getBundle(DebuggerTypeBeanInfo.class);
32
        descr.setDisplayName (bundle.getString ("LAB_DebuggerType")); // NOI18N
33
        descr.setShortDescription (bundle.getString ("HINT_DebuggerType")); // NOI18N
34
        descr.setValue ("helpID", org.openide.debugger.DebuggerType.class.getName ()); // NOI18N
35
        return descr;
36
    }
37
38
    public BeanInfo[] getAdditionalBeanInfo () {
39
        try {
40
            return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) };
41
        } catch (IntrospectionException ie) {
42
            org.openide.ErrorManager.getDefault().notify(ie);
43
            return null;
44
        }
45
    }
46
47
48
    /**
49
    * Return the icon
50
    */
51
    public Image getIcon(int type) {
52
        if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16))
53
            return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes.gif"); // NOI18N
54
        else
55
            return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes32.gif"); // NOI18N
56
    }
57
    
58
}
(-)core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeEditor.java (-79 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.deprecated;
15
16
import java.io.*;
17
import java.text.MessageFormat;
18
import org.netbeans.beaninfo.editors.NoServiceTypeBeanInfo;
19
import org.netbeans.beaninfo.editors.ServiceTypeEditor;
20
import org.openide.ErrorManager;
21
22
import org.openide.debugger.*;
23
import org.openide.util.HelpCtx;
24
import org.openide.util.NbBundle;
25
import org.openide.execution.ExecInfo;
26
27
/** Support for property editor for DebuggerType.
28
*
29
* @author   Petr Jiricka
30
*/
31
32
public class DebuggerTypeEditor extends ServiceTypeEditor {
33
34
    public static final org.openide.debugger.DebuggerType NO_DEBUGGER = new NoDebugger ();
35
36
    public DebuggerTypeEditor () {
37
        super (org.openide.debugger.DebuggerType.class, "LAB_ChooseServiceType"); // NOI18N
38
    }
39
40
    /** Accessor for creating instance */
41
    public static org.openide.debugger.DebuggerType getNoDebugger() {
42
        return NO_DEBUGGER;
43
    }
44
    
45
    public static final class NoDebugger extends org.openide.debugger.DebuggerType {
46
47
        static final long serialVersionUID =-6872256326426790372L;
48
        private NoDebugger () {
49
        }
50
51
        protected String displayName () {
52
            return NbBundle.getBundle (DebuggerTypeEditor.class).getString ("LAB_NoDebugger");
53
        }
54
55
        public HelpCtx getHelpCtx () {
56
            return new HelpCtx (NoDebugger.class);
57
        }
58
59
        public void startDebugger (final ExecInfo info, boolean ign) throws DebuggerException {
60
            DebuggerException e = new DebuggerException("do not debug"); // NOI18N
61
            ErrorManager.getDefault().annotate(e, NbBundle.getMessage(DebuggerTypeEditor.class, "EXC_NoDebugger", info.getClassName()));
62
            throw e;
63
        }
64
65
        private Object readResolve () throws ObjectStreamException {
66
            return NO_DEBUGGER;
67
        }
68
69
    }
70
71
    public static final class NoDebuggerBeanInfo extends NoServiceTypeBeanInfo {
72
73
        protected String iconResource () {
74
            return "/org/netbeans/beaninfo/editors/resources/noDebugger.gif"; // NOI18N
75
        }
76
77
    }
78
79
}
(-)core/deprecated/src/org/netbeans/core/deprecated/Install.java (-44 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.deprecated;
15
16
import java.beans.Introspector;
17
import java.beans.PropertyEditorManager;
18
19
import org.openide.modules.ModuleInstall;
20
21
public class Install extends ModuleInstall {
22
    
23
    /** Make sure BeanInfo and PropertyEditor for DebuggerType can be found.
24
     */
25
    public void restored() {
26
        String[] sysbisp = Introspector.getBeanInfoSearchPath();
27
        String[] nbbisp = new String[] {
28
            "org.netbeans.core.deprecated", // NOI18N
29
        };
30
        String[] allbisp = new String[sysbisp.length + nbbisp.length];
31
        System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length);
32
        System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length);
33
        Introspector.setBeanInfoSearchPath(allbisp);
34
        String[] syspesp = PropertyEditorManager.getEditorSearchPath();
35
        String[] nbpesp = new String[] {
36
            "org.netbeans.core.deprecated", // NOI18N
37
        };
38
        String[] allpesp = new String[syspesp.length + nbpesp.length];
39
        System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length);
40
        System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length);
41
        PropertyEditorManager.setEditorSearchPath(allpesp);
42
    }
43
    
44
}
(-)core/deprecated/src/org/netbeans/core/deprecated/layer.xml (-30 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.0//EN" "http://www.netbeans.org/dtds/filesystem-1_0.dtd">
15
16
<filesystem>
17
18
    <folder name="Services">
19
        <folder name="NoOps">
20
            <file name="NoDebugger.instance">
21
              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.beaninfo.editors.Bundle"/>
22
              <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/beaninfo/editors/resources/noDebugger.gif"/>
23
              <attr name="instanceOf" stringvalue="org.openide.ServiceType,org.openide.debugger.DebuggerType,org.netbeans.core.deprecated.DebuggerTypeEditor$NoDebugger" />
24
              <attr name="instanceClass" stringvalue="org.netbeans.core.deprecated.DebuggerTypeEditor$NoDebugger" />
25
              <attr name="instanceCreate" methodvalue="org.netbeans.core.deprecated.DebuggerTypeEditor.getNoDebugger" />
26
            </file>
27
        </folder>
28
    </folder>
29
        
30
</filesystem>
(-)core/release/system/ModuleAutoDeps/org-netbeans-core.xml (+34 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<!DOCTYPE transformations PUBLIC "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN" "http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd">
16
17
<transformations version="1.0">
18
19
    <transformationgroup>
20
        <description>API separation phase II (#19443) - terminalemulator</description>
21
        <exclusion codenamebase="org.netbeans.lib.terminalemulator" prefix="false"/>
22
        <transformation>
23
            <trigger-dependency type="cancel">
24
                <package-dependency name="org.netbeans.lib.terminalemulator"/>
25
            </trigger-dependency>
26
            <implies>
27
                <result>
28
                    <module-dependency codenamebase="org.netbeans.lib.terminalemulator" spec="1.0"/>
29
                </result>
30
            </implies>
31
        </transformation>
32
    </transformationgroup>
33
34
</transformations>
(-)core/src/org/netbeans/core/modules/AutomaticDependencies.java (+689 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.modules;
15
16
import java.io.*;
17
import java.net.URL;
18
import java.util.*;
19
import org.xml.sax.*;
20
21
import org.openide.ErrorManager;
22
import org.openide.modules.*;
23
import org.openide.xml.XMLUtil;
24
25
/**
26
 * Parser and interpreter for automatic module dependencies.
27
 * Public for possible access from AU (see #29577).
28
 * Usage: see implementation of {@link NbInstaller#refineDependencies}.
29
 * <p>You may run this class standalone, with just openide.jar and core.jarin the classpath.
30
 * @author Jesse Glick, with help from NB XML module
31
 * @see "#30161"
32
 * @see <a href="auto-deps-1_0.dtd"><samp>-//NetBeans//DTD Module Automatic Dependencies 1.0//EN</samp></a>
33
 * @since org.netbeans.core/1 1.12
34
 */
35
public final class AutomaticDependencies {
36
37
    private AutomaticDependencies() {}
38
    
39
    /**
40
     * Create an empty list of transformations.
41
     * @return an empty list
42
     */
43
    public static AutomaticDependencies empty() {
44
        return new AutomaticDependencies();
45
    }
46
    
47
    /**
48
     * Create a list of transformations based on some XML files.
49
     * They must be valid (this method may not validate them).
50
     * Doctype must be <samp>&lt;transformations&gt;</samp> from
51
     * <samp>-//NetBeans//DTD Module Automatic Dependencies 1.0//EN</samp>.
52
     * @param urls the XML files
53
     * @throws SAXException if malformed
54
     * @throws IOException if unloadable
55
     * @return a list of parsed transformations
56
     */
57
    public static AutomaticDependencies parse(URL[] urls) throws SAXException, IOException {
58
        AutomaticDependencies h = new AutomaticDependencies();
59
        Parser p = new Parser(h.new Handler());
60
        for (int i = 0; i < urls.length; i++) {
61
            String id = urls[i].toExternalForm();
62
            try {
63
                p.parse(new InputSource(id));
64
            } catch (SAXException e) {
65
                Util.err.annotate(e, ErrorManager.UNKNOWN, "While parsing: " + id, null, null, null);
66
                throw e;
67
            } catch (IOException e) {
68
                Util.err.annotate(e, ErrorManager.UNKNOWN, "While parsing: " + id, null, null, null);
69
                throw e;
70
            }
71
        }
72
        return h;
73
    }
74
    
75
    /**
76
     * For testing purposes only. Should dump file structure.
77
     * @param x list of URLs to parse
78
     */
79
    public static void main(String[] x) throws Exception {
80
        URL[] urls = new URL[x.length];
81
        for (int i = 0; i < x.length; i++) {
82
            urls[i] = new URL(x[i]);
83
        }
84
        parse(urls); // warm up classes
85
        long time = System.currentTimeMillis();
86
        System.out.println(parse(urls));
87
        long taken = System.currentTimeMillis() - time;
88
        System.out.println("Time taken: " + taken + " msec");
89
    }
90
    
91
    // ------------- INTERPRETATION --------------
92
    
93
    /**
94
     * Interpret the transformations on a module.
95
     * The module's dependencies may be added to, changed, or removed, according
96
     * to the configuration of this transformations list.
97
     * @param cnb the code name base of the module being considered
98
     * @param dependencies a mutable set of type {@link Dependency}; call-by-reference
99
     */
100
    public void refineDependencies(String cnb, Set dependencies) {
101
        // First, collect all deps of each type by name, for quick access.
102
        // Also note that transformations apply *in parallel* so we cannot
103
        // check triggers of a transformation based on the in-progress set.
104
        Map modDeps = new HashMap(); // Map<String,Dependency>
105
        Map tokDeps = new HashMap(); // Map<String,Dependency>
106
        Map pkgDeps = new HashMap(); // Map<String,Dependency>
107
        Iterator it = dependencies.iterator();
108
        while (it.hasNext()) {
109
            Dependency d = (Dependency)it.next();
110
            switch (d.getType()) {
111
            case Dependency.TYPE_MODULE:
112
                String dcnb = (String)Util.parseCodeName(d.getName())[0];
113
                modDeps.put(dcnb, d);
114
                break;
115
            case Dependency.TYPE_PACKAGE:
116
                String name = packageBaseName(d.getName());
117
                if (name != null) {
118
                    pkgDeps.put(name, d);
119
                }
120
                break;
121
            case Dependency.TYPE_REQUIRES:
122
                tokDeps.put(d.getName(), d);
123
                break;
124
            case Dependency.TYPE_IDE:
125
                throw new IllegalArgumentException("No TYPE_IDE dependencies permitted for " + cnb);
126
            case Dependency.TYPE_JAVA:
127
                // ignored
128
                break;
129
            default:
130
                throw new IllegalStateException(d.toString());
131
            }
132
        }
133
        // Now go through transformations and see if they apply.
134
        it = groups.iterator();
135
        while (it.hasNext()) {
136
            TransformationGroup g = (TransformationGroup)it.next();
137
            if (g.isExcluded(cnb)) {
138
                continue;
139
            }
140
            Iterator it2 = g.transformations.iterator();
141
            while (it2.hasNext()) {
142
                Transformation t = (Transformation)it2.next();
143
                t.apply(modDeps, tokDeps, pkgDeps, dependencies);
144
            }
145
        }
146
    }
147
    
148
    // ---------------- STRUCTS --------------------
149
    
150
    private final List groups = new ArrayList(); // List<TransformationGroup>
151
    
152
    public String toString() {
153
        return "AutomaticDependencies[" + groups + "]";
154
    }
155
    
156
    private static final class Exclusion {
157
        public String codenamebase;
158
        public boolean prefix;
159
        public String toString() {
160
            return "Exclusion[" + codenamebase + ",prefix=" + prefix + "]";
161
        }
162
        
163
        /**
164
         * Does this exclusion apply to the given code name base?
165
         */
166
        public boolean matches(String cnb) {
167
            return cnb.equals(codenamebase) ||
168
                (prefix && cnb.startsWith(codenamebase + ".")); // NOI18N
169
        }
170
        
171
    }
172
    
173
    private static final class TransformationGroup {
174
        // public String description;
175
        public final List exclusions = new ArrayList(); // List<Exclusion>
176
        public final List transformations = new ArrayList(); // List<Transformation>
177
        public String toString() {
178
            return "TransformationGroup[" + exclusions + "," + transformations + "]";
179
        }
180
        
181
        /**
182
         * Is the given code name base excluded from this group of transformations?
183
         */
184
        public boolean isExcluded(String cnb) {
185
            Iterator it = exclusions.iterator();
186
            while (it.hasNext()) {
187
                if (((Exclusion)it.next()).matches(cnb)) {
188
                    return true;
189
                }
190
            }
191
            return false;
192
        }
193
        
194
    }
195
    
196
    private static final class Transformation {
197
        public Dep trigger;
198
        public String triggerType;
199
        public final List results = new ArrayList(); // List<Dep>
200
        public String toString() {
201
            return "Transformation[trigger=" + trigger + ",triggerType=" + triggerType + ",results=" + results + "]";
202
        }
203
        
204
        /**
205
         * Transform some dependencies.
206
         */
207
        public void apply(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) {
208
            Dependency d = trigger.applies(modDeps, tokDeps, pkgDeps, dependencies, triggerType);
209
            if (d != null) {
210
                // It matched.
211
                if (triggerType.equals("cancel")) {
212
                    // Remove it now.
213
                    dependencies.remove(d);
214
                } else if (triggerType.equals("older")) {
215
                    // Fine, don't.
216
                } else {
217
                    throw new IllegalStateException(triggerType);
218
                }
219
                // Add in results.
220
                Iterator it = results.iterator();
221
                while (it.hasNext()) {
222
                    Dep nue = (Dep)it.next();
223
                    nue.update(modDeps, tokDeps, pkgDeps, dependencies);
224
                }
225
            }
226
        }
227
        
228
    }
229
    
230
    private static abstract class Dep {
231
        public final String toString() {
232
            return manifestKey() + ": " + toManifestForm();
233
        }
234
        
235
        /**
236
         * The form of the dependency in a manifest (value only).
237
         */
238
        public abstract String toManifestForm();
239
        
240
        /**
241
         * The form of the dependency in a manifest (key part).
242
         */
243
        public abstract String manifestKey();
244
        
245
        /**
246
         * The type of dependency according to {@link Dependency}.
247
         */
248
        public abstract int type();
249
        
250
        /**
251
         * Make a real dependency from this pattern.
252
         */
253
        public final Dependency createDependency() {
254
            return (Dependency)Dependency.create(type(), toManifestForm()).iterator().next();
255
        }
256
        
257
        /**
258
         * Check whether this dependency pattern applies as a trigger.
259
         * @return the triggered actual dependency if so, else null
260
         */
261
        public abstract Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type);
262
        
263
        /**
264
         * Update actual dependencies assuming a trigger matched.
265
         * This dependency pattern is to be added to the dependencies set
266
         * (possibly upgrading an existing dependency).
267
         */
268
        public abstract void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies);
269
        
270
    }
271
    
272
    private static final class ModuleDep extends Dep {
273
        public String codenamebase;
274
        public int major = -1;
275
        public SpecificationVersion spec = null;
276
        
277
        public String toManifestForm() {
278
            return codenamebase + (major == -1 ? "" : "/" + major) + (spec == null ? "" : " > " + spec);
279
        }
280
        
281
        public String manifestKey() {
282
            return "OpenIDE-Module-Module-Dependencies";
283
        }
284
        
285
        public int type() {
286
            return Dependency.TYPE_MODULE;
287
        }
288
        
289
        public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) {
290
            Dependency d = (Dependency)modDeps.get(codenamebase);
291
            if (d == null) return null;
292
            if (type.equals("cancel")) {
293
                // That's enough.
294
                return d;
295
            } else if (type.equals("older")) {
296
                if (spec == null) throw new IllegalStateException();
297
                // Compare. Check that d < this
298
                return older(d) ? d : null;
299
            } else {
300
                throw new IllegalStateException(type);
301
            }
302
        }
303
        
304
        /**
305
         * Is the given dependency older than this pattern?
306
         */
307
        private boolean older(Dependency d) {
308
            if (d.getType() != Dependency.TYPE_MODULE) throw new IllegalArgumentException();
309
            Integer dRelI = (Integer)Util.parseCodeName(d.getName())[1];
310
            int dRel = (dRelI == null) ? -1 : dRelI.intValue();
311
            if (dRel < major) return true;
312
            if (dRel > major) return false;
313
            if (spec == null) return false;
314
            String dSpec = d.getVersion();
315
            if (dSpec == null) return true;
316
            return new SpecificationVersion(dSpec).compareTo(spec) < 0;
317
        }
318
        
319
        public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) {
320
            Dependency d = (Dependency)modDeps.get(codenamebase);
321
            if (d != null && older(d)) {
322
                dependencies.remove(d);
323
                dependencies.add(createDependency());
324
            } else if (d == null) {
325
                dependencies.add(createDependency());
326
            }
327
        }
328
        
329
    }
330
    
331
    /**
332
     * Find actual package name (or null) from a package dep name.
333
     * "javax.tv" -> "javax.tv"
334
     * "javax.tv[Tuner]" -> "javax.tv"
335
     * "[javax.tv.Tuner]" -> null
336
     */
337
    private static String packageBaseName(String name) {
338
        int i = name.indexOf('[');
339
        if (i == -1) {
340
            return name;
341
        } else if (i > 0) {
342
            return name.substring(0, i);
343
        } else {
344
            return null;
345
        }
346
    }
347
        
348
    private static final class PackageDep extends Dep {
349
        public String name;
350
        public String bname;
351
        public SpecificationVersion spec = null;
352
        
353
        public String toManifestForm() {
354
            return name + (spec == null ? "" : " > " + spec);
355
        }
356
        
357
        public String manifestKey() {
358
            return "OpenIDE-Module-Package-Dependencies";
359
        }
360
        
361
        public int type() {
362
            return Dependency.TYPE_PACKAGE;
363
        }
364
        
365
        /**
366
         * Is the given dependency older than this pattern?
367
         */
368
        private boolean older(Dependency d) {
369
            if (d.getType() != Dependency.TYPE_PACKAGE) throw new IllegalArgumentException();
370
            if (spec == null) return false;
371
            String dSpec = d.getVersion();
372
            if (dSpec == null) return true;
373
            return new SpecificationVersion(dSpec).compareTo(spec) < 0;
374
        }
375
        
376
        public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) {
377
            Dependency d = (Dependency)pkgDeps.get(bname);
378
            if (d == null) {
379
                return null;
380
            }
381
            if (type.equals("cancel")) {
382
                // That's enough.
383
                return d;
384
            } else if (type.equals("older")) {
385
                if (spec == null) throw new IllegalStateException();
386
                // Compare. Check that d < this
387
                return older(d) ? d : null;
388
            } else {
389
                throw new IllegalStateException(type);
390
            }
391
        }
392
        
393
        public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) {
394
            Dependency d = (Dependency)pkgDeps.get(bname);
395
            if (d != null && older(d)) {
396
                dependencies.remove(d);
397
                dependencies.add(createDependency());
398
            } else if (d == null) {
399
                dependencies.add(createDependency());
400
            }
401
        }
402
        
403
    }
404
    
405
    private static final class TokenDep extends Dep {
406
        public String name;
407
        
408
        public String toManifestForm() {
409
            return name;
410
        }
411
        
412
        public String manifestKey() {
413
            return "OpenIDE-Module-Requires";
414
        }
415
        
416
        public int type() {
417
            return Dependency.TYPE_REQUIRES;
418
        }
419
        
420
        public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) {
421
            Dependency d = (Dependency)tokDeps.get(name);
422
            if (d == null) {
423
                return null;
424
            }
425
            if (type.equals("cancel")) {
426
                // That's enough.
427
                return d;
428
            } else {
429
                // older is not supported
430
                throw new IllegalStateException(type);
431
            }
432
        }
433
        
434
        public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) {
435
            if (tokDeps.get(name) == null) {
436
                dependencies.add(createDependency());
437
            }
438
        }
439
        
440
    }
441
    
442
    // ---------------------- PARSING -----------------------
443
    
444
    private final class Handler {
445
    
446
        private TransformationGroup currentGroup = null;
447
        private Transformation currentTransformation = null;
448
        private boolean inTrigger = false;
449
450
        public void start_trigger(final Attributes meta) throws SAXException {
451
            inTrigger = true;
452
            currentTransformation.triggerType = meta.getValue("type");
453
        }
454
455
        public void end_trigger() throws SAXException {
456
            inTrigger = false;
457
        }
458
459
        public void start_transformation(final Attributes meta) throws SAXException {
460
            currentTransformation = new Transformation();
461
        }
462
463
        public void end_transformation() throws SAXException {
464
            currentGroup.transformations.add(currentTransformation);
465
            currentTransformation = null;
466
        }
467
468
        private void handleDep(Dep d) throws SAXException {
469
            if (inTrigger) {
470
                currentTransformation.trigger = d;
471
            } else {
472
                currentTransformation.results.add(d);
473
            }
474
        }
475
476
        public void handle_module_dependency(final Attributes meta) throws SAXException {
477
            ModuleDep d = new ModuleDep();
478
            String major = meta.getValue("major");
479
            if (major != null) {
480
                d.major = Integer.parseInt(major);
481
            }
482
            d.codenamebase = meta.getValue("codenamebase");
483
            String s = meta.getValue("spec");
484
            d.spec = (s == null) ? null : new SpecificationVersion(s);
485
            handleDep(d);
486
        }
487
488
        public void handle_token_dependency(final Attributes meta) throws SAXException {
489
            TokenDep d = new TokenDep();
490
            d.name = meta.getValue("name");
491
            handleDep(d);
492
        }
493
494
        public void handle_package_dependency(final Attributes meta) throws SAXException {
495
            PackageDep d = new PackageDep();
496
            d.name = meta.getValue("name");
497
            d.bname = packageBaseName(d.name);
498
            if (inTrigger) {
499
                if (d.bname == null) throw new SAXException("No actual package name in trigger");
500
                if (!d.name.equals(d.bname)) throw new SAXException("Cannot use test class in trigger");
501
            }
502
            String s = meta.getValue("spec");
503
            d.spec = (s == null) ? null : new SpecificationVersion(s);
504
            handleDep(d);
505
        }
506
507
        public void start_transformationgroup(final Attributes meta) throws SAXException {
508
            currentGroup = new TransformationGroup();
509
        }
510
511
        public void end_transformationgroup() throws SAXException {
512
            groups.add(currentGroup);
513
            currentGroup = null;
514
        }
515
516
        public void start_result(final Attributes meta) throws SAXException {
517
            // do nothing
518
        }
519
520
        public void end_result() throws SAXException {
521
            // do nothing
522
        }
523
524
        public void handle_exclusion(final Attributes meta) throws SAXException {
525
            Exclusion excl = new Exclusion();
526
            excl.codenamebase = meta.getValue("codenamebase");
527
            excl.prefix = Boolean.valueOf(meta.getValue("prefix")).booleanValue();
528
            currentGroup.exclusions.add(excl);
529
        }
530
531
        public void handle_description(final String data, final Attributes meta) throws SAXException {
532
            //currentGroup.description = data;
533
        }
534
535
        public void start_transformations(final Attributes meta) throws SAXException {
536
            if (!"1.0".equals(meta.getValue("version"))) throw new SAXException("Unsupported DTD");
537
            // do nothing
538
        }
539
540
        public void end_transformations() throws SAXException {
541
            // do nothing
542
        }
543
544
        public void start_results(final Attributes meta) throws SAXException {
545
            // do nothing
546
        }
547
548
        public void end_results() throws SAXException {
549
            // do nothing
550
        }
551
    
552
    }
553
    
554
    private static final class Parser implements ContentHandler, ErrorHandler, EntityResolver {
555
556
        private java.lang.StringBuffer buffer;
557
558
        private Handler handler;
559
560
        private java.util.Stack context;
561
562
        public Parser(final Handler handler) {
563
            this.handler = handler;
564
            buffer = new StringBuffer(111);
565
            context = new java.util.Stack();
566
        }
567
568
        public final void setDocumentLocator(Locator locator) {
569
        }
570
571
        public final void startDocument() throws SAXException {
572
        }
573
574
        public final void endDocument() throws SAXException {
575
        }
576
577
        public final void startElement(java.lang.String ns, java.lang.String name, java.lang.String qname, Attributes attrs) throws SAXException {
578
            dispatch(true);
579
            context.push(new Object[] {qname, new org.xml.sax.helpers.AttributesImpl(attrs)});
580
            if ("trigger-dependency".equals(qname)) {
581
                handler.start_trigger(attrs);
582
            } else if ("transformation".equals(qname)) {
583
                handler.start_transformation(attrs);
584
            } else if ("module-dependency".equals(qname)) {
585
                handler.handle_module_dependency(attrs);
586
            } else if ("transformationgroup".equals(qname)) {
587
                handler.start_transformationgroup(attrs);
588
            } else if ("result".equals(qname)) {
589
                handler.start_result(attrs);
590
            } else if ("exclusion".equals(qname)) {
591
                handler.handle_exclusion(attrs);
592
            } else if ("token-dependency".equals(qname)) {
593
                handler.handle_token_dependency(attrs);
594
            } else if ("package-dependency".equals(qname)) {
595
                handler.handle_package_dependency(attrs);
596
            } else if ("transformations".equals(qname)) {
597
                handler.start_transformations(attrs);
598
            } else if ("implies".equals(qname)) {
599
                handler.start_results(attrs);
600
            }
601
        }
602
603
        public final void endElement(java.lang.String ns, java.lang.String name, java.lang.String qname) throws SAXException {
604
            dispatch(false);
605
            context.pop();
606
            if ("trigger-dependency".equals(qname)) {
607
                handler.end_trigger();
608
            } else if ("transformation".equals(qname)) {
609
                handler.end_transformation();
610
            } else if ("transformationgroup".equals(qname)) {
611
                handler.end_transformationgroup();
612
            } else if ("result".equals(qname)) {
613
                handler.end_result();
614
            } else if ("transformations".equals(qname)) {
615
                handler.end_transformations();
616
            } else if ("implies".equals(qname)) {
617
                handler.end_results();
618
            }
619
        }
620
621
        public final void characters(char[] chars, int start, int len) throws SAXException {
622
            buffer.append(chars, start, len);
623
        }
624
625
        public final void ignorableWhitespace(char[] chars, int start, int len) throws SAXException {
626
        }
627
628
        public final void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException {
629
        }
630
631
        public final void startPrefixMapping(final java.lang.String prefix, final java.lang.String uri) throws SAXException {
632
        }
633
634
        public final void endPrefixMapping(final java.lang.String prefix) throws SAXException {
635
        }
636
637
        public final void skippedEntity(java.lang.String name) throws SAXException {
638
        }
639
640
        private void dispatch(final boolean fireOnlyIfMixed) throws SAXException {
641
            if (fireOnlyIfMixed && buffer.length() == 0) return; //skip it
642
643
            Object[] ctx = (Object[]) context.peek();
644
            String here = (String) ctx[0];
645
            Attributes attrs = (Attributes) ctx[1];
646
            if ("description".equals(here)) {
647
                if (fireOnlyIfMixed) throw new IllegalStateException("Unexpected characters() event! (Missing DTD?)");
648
                handler.handle_description(buffer.length() == 0 ? null : buffer.toString(), attrs);
649
            } else {
650
                //do not care
651
            }
652
            buffer.delete(0, buffer.length());
653
        }
654
655
        /**
656
         * The recognizer entry method taking an InputSource.
657
         * @param input InputSource to be parsed.
658
         * @throws IOException on I/O error.
659
         * @throws SAXException propagated exception thrown by a DocumentHandler.
660
         */
661
        public void parse(final InputSource input) throws SAXException, IOException {
662
            XMLReader parser = XMLUtil.createXMLReader(false, false); // fastest mode
663
            parser.setContentHandler(this);
664
            parser.setErrorHandler(this);
665
            parser.setEntityResolver(this);
666
            parser.parse(input);
667
        }
668
669
        public void error(SAXParseException ex) throws SAXException  {
670
            //if (context.isEmpty()) System.err.println("Missing DOCTYPE.");
671
            throw ex;
672
        }
673
674
        public void fatalError(SAXParseException ex) throws SAXException {
675
            throw ex;
676
        }
677
678
        public void warning(SAXParseException ex) throws SAXException {
679
            // ignore
680
        }
681
682
        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
683
            // Not validating, so skip DTD.
684
            return new InputSource(new ByteArrayInputStream(new byte[0]));
685
        }
686
687
    }
688
689
}
(-)core/src/org/netbeans/core/modules/Module.java (-1 / +11 lines)
Lines 453-459 Link Here
453
            }
453
            }
454
            // Dependencies
454
            // Dependencies
455
            Set dependencies = new HashSet(20); // Set<Dependency>
455
            Set dependencies = new HashSet(20); // Set<Dependency>
456
            dependencies.addAll(Dependency.create(Dependency.TYPE_IDE, attr.getValue("OpenIDE-Module-IDE-Dependencies"))); // NOI18N
456
            // First convert IDE/1 -> org.openide/1, so we never have to deal with
457
            // "IDE deps" internally:
458
            Set openideDeps = Dependency.create(Dependency.TYPE_IDE, attr.getValue("OpenIDE-Module-IDE-Dependencies")); // NOI18N
459
            if (!openideDeps.isEmpty()) {
460
                // If empty, leave it that way; NbInstaller will add it anyway.
461
                Dependency d = (Dependency)openideDeps.iterator().next();
462
                String name = d.getName();
463
                if (!name.startsWith("IDE/")) throw new IllegalStateException("Weird IDE dep: " + name); // NOI18N
464
                dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, "org.openide/" + name.substring(4) + " > " + d.getVersion())); // NOI18N
465
                if (dependencies.size() != 1) throw new IllegalStateException("Should be singleton: " + dependencies); // NOI18N
466
            }
457
            dependencies.addAll(Dependency.create(Dependency.TYPE_JAVA, attr.getValue("OpenIDE-Module-Java-Dependencies"))); // NOI18N
467
            dependencies.addAll(Dependency.create(Dependency.TYPE_JAVA, attr.getValue("OpenIDE-Module-Java-Dependencies"))); // NOI18N
458
            dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, attr.getValue("OpenIDE-Module-Module-Dependencies"))); // NOI18N
468
            dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, attr.getValue("OpenIDE-Module-Module-Dependencies"))); // NOI18N
459
            dependencies.addAll(Dependency.create(Dependency.TYPE_PACKAGE, attr.getValue("OpenIDE-Module-Package-Dependencies"))); // NOI18N
469
            dependencies.addAll(Dependency.create(Dependency.TYPE_PACKAGE, attr.getValue("OpenIDE-Module-Package-Dependencies"))); // NOI18N
(-)core/src/org/netbeans/core/modules/ModuleManager.java (-2 / +2 lines)
Lines 1399-1406 Link Here
1399
                            }
1399
                            }
1400
                        }
1400
                        }
1401
                    } else {
1401
                    } else {
1402
                        // Java/IDE dependency. Fixed for lifetime of the IDE, safe to check once and keep.
1402
                        // Java dependency. Fixed for whole VM session, safe to check once and keep.
1403
                        if (! Util.checkJavaOrIDEDependency(dep)) {
1403
                        if (! Util.checkJavaDependency(dep)) {
1404
                            // Bad.
1404
                            // Bad.
1405
                            probs.add(dep);
1405
                            probs.add(dep);
1406
                        }
1406
                        }
(-)core/src/org/netbeans/core/modules/NbEvents.java (-2 lines)
Lines 342-349 Link Here
342
                        return NbBundle.getMessage(NbEvents.class, "MSG_problem_package_not_loaded_or_old", name);
342
                        return NbBundle.getMessage(NbEvents.class, "MSG_problem_package_not_loaded_or_old", name);
343
                    }
343
                    }
344
                }
344
                }
345
            case Dependency.TYPE_IDE:
346
                return dep.toString();//XXX
347
            case Dependency.TYPE_JAVA:
345
            case Dependency.TYPE_JAVA:
348
                return dep.toString();//XXX
346
                return dep.toString();//XXX
349
            default:
347
            default:
(-)core/src/org/netbeans/core/modules/NbInstaller.java (-215 / +55 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 31-37 Link Here
31
import org.openide.util.lookup.InstanceContent;
31
import org.openide.util.lookup.InstanceContent;
32
import java.util.jar.Manifest;
32
import java.util.jar.Manifest;
33
import org.openide.ErrorManager;
33
import org.openide.ErrorManager;
34
import org.openide.filesystems.FileUtil;
34
import org.openide.filesystems.*;
35
import org.xml.sax.SAXException;
35
36
36
/** Concrete implementation of the module installation functionality.
37
/** Concrete implementation of the module installation functionality.
37
 * This class can pay attention to the details of manifest format,
38
 * This class can pay attention to the details of manifest format,
Lines 716-937 Link Here
716
        }
717
        }
717
    }
718
    }
718
    
719
    
719
    /** Get IDE dependency, if any, for a module.
720
    private AutomaticDependencies autoDepsHandler = null;
720
     * @param dependencies module dependencies
721
    private final Map autoDepsByModule = new HashMap(); // Map<Module,URL>
721
     * @return a fake spec version: major release version of IDE followed by actual spec; or null if no dep
722
     */
723
    private static SpecificationVersion getIDEDep(Set dependencies) {
724
        SpecificationVersion openide = null;
725
        Iterator it = dependencies.iterator();
726
        while (it.hasNext()) {
727
            Dependency d = (Dependency)it.next();
728
            if (d.getType() == Dependency.TYPE_IDE &&
729
                    d.getComparison() == Dependency.COMPARE_SPEC) {
730
                try {
731
                    int rel;
732
                    int idx = d.getName().lastIndexOf('/'); // NOI18N
733
                    if (idx != -1) {
734
                        rel = Integer.parseInt(d.getName().substring(idx + 1));
735
                    } else {
736
                        rel = 0;
737
                    }
738
                    openide = new SpecificationVersion("" + rel + "." + d.getVersion()); // NOI18N
739
                } catch (NumberFormatException nfe) {
740
                    Util.err.notify(nfe);
741
                }
742
                break;
743
            }
744
        }
745
        return openide;
746
    }
747
    
748
    /** If true, no automatic deps are made on modules for old client modules.
749
     * Useful for unit tests.
750
     */
751
    private static final boolean NO_COMPAT_AUTO_DEPS_JH = Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH");
752
    private static final boolean NO_COMPAT_AUTO_DEPS_DEPRECATED = Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED");
753
    private static final boolean NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO = Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO");
754
    
722
    
755
    /** Overridden to perform automatic API upgrades.
723
    /** Overridden to perform automatic API upgrades.
756
     * That is, should do nothing on new modules, but for older ones will
724
     * That is, should do nothing on new modules, but for older ones will
757
     * automatically make them depend on things they need.
725
     * automatically make them depend on things they need.
726
     * This is now all handled from declarative configuration files:
727
     * in the system filesystem, ModuleAutoDeps/*.xml may be added
728
     * according to the DTD "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN".
758
     */
729
     */
759
    public void refineDependencies(Module m, Set dependencies) {
730
    public void refineDependencies(Module m, Set dependencies) {
760
        // Special cases.
731
        // All modules implicitly depend on the APIs somehow.
761
        if (m.getCodeNameBase().equals("org.netbeans.core")) return; // NOI18N
732
        if (!m.getCodeNameBase().equals("org.openide") &&
762
        if (m.getCodeNameBase().startsWith("org.netbeans.core.")) return; // NOI18N
733
                Util.getModuleDep(dependencies, "org.openide") == null) {
763
        if (m.getCodeNameBase().equals("org.openide")) return; // NOI18N
734
            dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, "org.openide/1 > 0")); // NOI18N
764
        if (m.getCodeNameBase().startsWith("org.openide.")) return; // NOI18N
765
        // First find out what API this module is expecting.
766
        // Format: release.major.minor, e.g. IDE/1 > 2.3 => "1.2.3"
767
        SpecificationVersion openide = getIDEDep(dependencies);
768
        // Handle JavaHelp. For modules before API 2.2, they should have an
769
        // automatic dependency on token org.netbeans.api.javahelp.Help.
770
        if (!NO_COMPAT_AUTO_DEPS_JH && !m.getCodeNameBase().equals("org.netbeans.modules.javahelp") && // NOI18N
771
                (openide == null || openide.compareTo(new SpecificationVersion("1.2.2")) < 0)) { // NOI18N
772
            // Older than IDE/1 2.2, or at least does not claim to be newer.
773
            // First make sure it does not *already* depend on this module.
774
            boolean alreadyHaveJH = false;
775
            Iterator it = dependencies.iterator();
776
            while (it.hasNext()) {
777
                Dependency d = (Dependency)it.next();
778
                if (d.getType() == Dependency.TYPE_REQUIRES &&
779
                        d.getName().equals("org.netbeans.api.javahelp.Help")) { // NOI18N
780
                    alreadyHaveJH = true;
781
                    break;
782
                }
783
            }
784
            if (!alreadyHaveJH) {
785
                Util.err.log("Adding automatic dependency on org.netbeans.api.javahelp.Help for module " + m.getCodeNameBase());
786
                dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES,
787
                                                      "org.netbeans.api.javahelp.Help")); // NOI18N
788
            }
789
            // #27776: need to also handle package deps on javax.help,
790
            // which should now be module deps on
791
            // org.netbeans.modules.javahelp.
792
            alreadyHaveJH = false;
793
            it = dependencies.iterator();
794
            while (it.hasNext()) {
795
                Dependency d = (Dependency)it.next();
796
                if (d.getType() == Dependency.TYPE_MODULE &&
797
                        d.getName().startsWith("org.netbeans.modules.javahelp/")) { // NOI18N
798
                    alreadyHaveJH = true;
799
                    break;
800
                }
801
            }
802
            if (!alreadyHaveJH) {
803
                boolean needPackageJH = false;
804
                it = dependencies.iterator();
805
                String pkg = "javax.help"; // NOI18N
806
                while (it.hasNext()) {
807
                    Dependency d = (Dependency)it.next();
808
                    String name = d.getName();
809
                    if (d.getType() == Dependency.TYPE_PACKAGE &&
810
                            (name.equals(pkg) || name.startsWith("[" + pkg + ".") || name.startsWith(pkg + "["))) { // NOI18N
811
                        needPackageJH = true;
812
                        it.remove(); // it will not work any more
813
                        break;
814
                    }
815
                }
816
                if (needPackageJH) {
817
                    Util.err.log("Adding automatic dependency on org.netbeans.modules.javahelp for module " + m.getCodeNameBase());
818
                    dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE,
819
                                                          "org.netbeans.modules.javahelp/1 > 1.0")); // NOI18N
820
                }
821
            }
822
        }
735
        }
823
        // For pre-3.14, add automatic deps on org.openide.src and org.openide.deprecated.
736
        if (Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.noAutoDeps")) {
824
        if (!NO_COMPAT_AUTO_DEPS_DEPRECATED && (openide == null || openide.compareTo(new SpecificationVersion("1.3.14")) < 0)) { // NOI18N
737
            // Skip them all - useful for unit tests.
825
            String[] nue = {
738
            return;
826
                "org.openide.deprecated", // NOI18N
739
        }
827
                "org.openide.src", // NOI18N
740
        if (autoDepsHandler == null) {
828
            };
741
            FileObject depsFolder = Repository.getDefault().getDefaultFileSystem().findResource("ModuleAutoDeps");
829
            for (int i = 0; i < nue.length; i++) {
742
            if (depsFolder != null) {
830
                boolean alreadyHave = false;
743
                FileObject[] kids = depsFolder.getChildren();
831
                Iterator it = dependencies.iterator();
744
                List urls = new ArrayList(Math.max(kids.length, 1)); // List<URL>
832
                while (it.hasNext()) {
745
                for (int i = 0; i < kids.length; i++) {
833
                    Dependency d = (Dependency)it.next();
746
                    if (kids[i].hasExt("xml")) { // NOI18N
834
                    if (d.getType() == Dependency.TYPE_MODULE &&
747
                        try {
835
                            d.getName().equals(nue[i])) {
748
                            urls.add(kids[i].getURL());
836
                        alreadyHave = true;
749
                        } catch (FileStateInvalidException e) {
837
                        break;
750
                            Util.err.notify(e);
838
                    }
751
                        }
839
                }
840
                if (!alreadyHave) {
841
                    Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase());
842
                    dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, nue[i] + " > 1.0")); // NOI18N
843
                }
844
            }
845
            boolean alreadyHave = false;
846
            Iterator it = dependencies.iterator();
847
            while (it.hasNext()) {
848
                Dependency d = (Dependency)it.next();
849
                if (d.getType() == Dependency.TYPE_REQUIRES &&
850
                        d.getName().equals("org.openide.TopManager")) { // NOI18N
851
                    alreadyHave = true;
852
                    break;
853
                }
854
            }
855
            if (!alreadyHave) {
856
                Util.err.log("Adding automatic dependency on org.openide.TopManager for module " + m.getCodeNameBase());
857
                dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES, "org.openide.TopManager")); // NOI18N
858
            }
859
        }
860
        // For pre-3.17, add an automatic dep on org.openide.compiler, org.openide.execution, org.openide.io.
861
        // Translate package deps on term to module deps.
862
        if (!NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO && (openide == null || openide.compareTo(new SpecificationVersion("1.3.17")) < 0)) { // NOI18N
863
            String[] nue = {
864
                "org.openide.compiler", // NOI18N
865
                "org.openide.execution", // NOI18N
866
                "org.openide.io", // NOI18N
867
            };
868
            for (int i = 0; i < nue.length; i++) {
869
                boolean alreadyHave = false;
870
                Iterator it = dependencies.iterator();
871
                while (it.hasNext()) {
872
                    Dependency d = (Dependency)it.next();
873
                    if (d.getType() == Dependency.TYPE_MODULE &&
874
                            d.getName().equals(nue[i])) {
875
                        alreadyHave = true;
876
                        break;
877
                    }
878
                }
879
                if (!alreadyHave) {
880
                    Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase());
881
                    dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, nue[i] + " > 1.0")); // NOI18N
882
                }
883
            }
884
            nue = new String[] {
885
                "org.openide.compiler.CompilationEngine", // NOI18N
886
                "org.openide.execution.ExecutionEngine", // NOI18N
887
                "org.openide.windows.IOProvider", // NOI18N
888
            };
889
            for (int i = 0; i < nue.length; i++) {
890
                boolean alreadyHave = false;
891
                Iterator it = dependencies.iterator();
892
                while (it.hasNext()) {
893
                    Dependency d = (Dependency)it.next();
894
                    if (d.getType() == Dependency.TYPE_REQUIRES &&
895
                            d.getName().equals(nue[i])) {
896
                        alreadyHave = true;
897
                        break;
898
                    }
899
                }
900
                if (!alreadyHave) {
901
                    Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase());
902
                    dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES, nue[i]));
903
                }
904
            }
905
            boolean alreadyHaveTerm = false;
906
            Iterator it = dependencies.iterator();
907
            while (it.hasNext()) {
908
                Dependency d = (Dependency)it.next();
909
                if (d.getType() == Dependency.TYPE_MODULE &&
910
                        d.getName().equals("org.netbeans.lib.terminalemulator")) { // NOI18N
911
                    alreadyHaveTerm = true;
912
                    break;
913
                }
914
            }
915
            if (!alreadyHaveTerm) {
916
                boolean needPackageTerm = false;
917
                it = dependencies.iterator();
918
                String pkg = "org.netbeans.lib.terminalemulator"; // NOI18N
919
                while (it.hasNext()) {
920
                    Dependency d = (Dependency)it.next();
921
                    String name = d.getName();
922
                    if (d.getType() == Dependency.TYPE_PACKAGE &&
923
                            (name.equals(pkg) || name.startsWith("[" + pkg + ".") || name.startsWith(pkg + "["))) { // NOI18N
924
                        needPackageTerm = true;
925
                        it.remove(); // it will not work any more
926
                        break;
927
                    }
752
                    }
928
                }
753
                }
929
                if (needPackageTerm) {
754
                try {
930
                    Util.err.log("Adding automatic dependency on org.netbeans.lib.terminalemulator for module " + m.getCodeNameBase());
755
                    autoDepsHandler = AutomaticDependencies.parse((URL[])urls.toArray(new URL[urls.size()]));
931
                    dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE,
756
                } catch (IOException e) {
932
                                                          "org.netbeans.lib.terminalemulator > 1.0")); // NOI18N
757
                    Util.err.notify(e);
933
                }
758
                } catch (SAXException e) {
934
            }
759
                    Util.err.notify(e);
760
                }
761
            }
762
            if (autoDepsHandler == null) {
763
                // Parsing failed, or no files.
764
                autoDepsHandler = AutomaticDependencies.empty();
765
            }
766
            if (Util.err.isLoggable(ErrorManager.INFORMATIONAL)) {
767
                Util.err.log(ErrorManager.INFORMATIONAL, "Auto deps: " + autoDepsHandler);
768
            }
769
        }
770
        Set oldDependencies = new HashSet(dependencies);
771
        autoDepsHandler.refineDependencies(m.getCodeNameBase(), dependencies);
772
        if (!oldDependencies.equals(dependencies)) {
773
            Set added = new HashSet(dependencies);
774
            added.removeAll(oldDependencies);
775
            oldDependencies.removeAll(dependencies);
776
            Util.err.log(ErrorManager.WARNING, "Dependencies for module " + m.getCodeNameBase() + " were upgraded: added = " + added + " removed = " + oldDependencies);
935
        }
777
        }
936
    }
778
    }
937
    
779
    
Lines 941-948 Link Here
941
    // interpret them recursively to force its classloader to "see" accessible
783
    // interpret them recursively to force its classloader to "see" accessible
942
    // classes from even indirect dependencies.
784
    // classes from even indirect dependencies.
943
    public void refineClassLoader(Module m, List parents) {
785
    public void refineClassLoader(Module m, List parents) {
944
        SpecificationVersion openide = getIDEDep(m.getDependencies());
786
        SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N
945
        if (!NO_COMPAT_AUTO_TRANSITIVE_DEPS && (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0)) { // NOI18N
787
        if (!NO_COMPAT_AUTO_TRANSITIVE_DEPS && (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0)) { // NOI18N
788
            Util.err.log(ErrorManager.WARNING, "Adding automatic recursive dependencies for module " + m.getCodeNameBase());
946
            Dependency[] deps = m.getDependenciesArray();
789
            Dependency[] deps = m.getDependenciesArray();
947
            Set parentModules = new HashSet(deps.length * 3 + 5); // Set<Module>
790
            Set parentModules = new HashSet(deps.length * 3 + 5); // Set<Module>
948
            addLoadersRecursively(parents, deps, parentModules, m);
791
            addLoadersRecursively(parents, deps, parentModules, m);
Lines 1003-1010 Link Here
1003
        // package prefixes can simply be deleted)
846
        // package prefixes can simply be deleted)
1004
        "org/netbeans/core/", // NOI18N
847
        "org/netbeans/core/", // NOI18N
1005
        "org/netbeans/beaninfo/", // NOI18N
848
        "org/netbeans/beaninfo/", // NOI18N
1006
        // terminalemulator.jar
1007
        "org/netbeans/lib/terminalemulator/", // NOI18N
1008
        // regexp.jar
849
        // regexp.jar
1009
        "org/apache/regexp/", // NOI18N
850
        "org/apache/regexp/", // NOI18N
1010
        // crimson.jar
851
        // crimson.jar
Lines 1022-1028 Link Here
1022
        if (s == null) {
863
        if (s == null) {
1023
            s = new HashSet(); // Set<String>
864
            s = new HashSet(); // Set<String>
1024
            Dependency[] deps = m.getDependenciesArray();
865
            Dependency[] deps = m.getDependenciesArray();
1025
            SpecificationVersion openide = getIDEDep(m.getDependencies());
866
            SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N
1026
            boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N
867
            boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N
1027
            for (int i = 0; i < deps.length; i++) {
868
            for (int i = 0; i < deps.length; i++) {
1028
                // Extend this for other classpath modules:
869
                // Extend this for other classpath modules:
Lines 1093-1099 Link Here
1093
     */
934
     */
1094
    private static final String[][] CLASSPATH_JARS = {
935
    private static final String[][] CLASSPATH_JARS = {
1095
        {"core", "org/netbeans/core/", "org/netbeans/beaninfo/"}, // NOI18N
936
        {"core", "org/netbeans/core/", "org/netbeans/beaninfo/"}, // NOI18N
1096
        {"terminalemulator", "org/netbeans/lib/terminalemulator/"}, // NOI18N
1097
        {"regexp", "org/apache/regexp/"}, // NOI18N
937
        {"regexp", "org/apache/regexp/"}, // NOI18N
1098
        {"crimson", "org/apache/crimson/"}, // NOI18N
938
        {"crimson", "org/apache/crimson/"}, // NOI18N
1099
        {"xerces", "org/apache/xerces/", "org/apache/xml/serialize/"}, // NOI18N
939
        {"xerces", "org/apache/xerces/", "org/apache/xml/serialize/"}, // NOI18N
Lines 1153-1159 Link Here
1153
                implDeps.add(deps[i].getName());
993
                implDeps.add(deps[i].getName());
1154
            }
994
            }
1155
        }
995
        }
1156
        SpecificationVersion openide = getIDEDep(m.getDependencies());
996
        SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N
1157
        boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N
997
        boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N
1158
        // #27853: only make recursive for old modules.
998
        // #27853: only make recursive for old modules.
1159
        addModuleClasspathEntries(m, m, modulesConsidered, implDeps, l, pre27853 ? Integer.MAX_VALUE : 1);
999
        addModuleClasspathEntries(m, m, modulesConsidered, implDeps, l, pre27853 ? Integer.MAX_VALUE : 1);
(-)core/src/org/netbeans/core/modules/Util.java (-13 / +32 lines)
Lines 139-158 Link Here
139
    // XXX ought to be some way to get localized messages for these...
139
    // XXX ought to be some way to get localized messages for these...
140
140
141
    /** Check whether a simple dependency is met.
141
    /** Check whether a simple dependency is met.
142
     * Only applicable to Java and IDE dependencies.
142
     * Only applicable to Java dependencies.
143
     */
143
     */
144
    static boolean checkJavaOrIDEDependency(Dependency dep) throws IllegalArgumentException {
144
    static boolean checkJavaDependency(Dependency dep) throws IllegalArgumentException {
145
        // Note that "any" comparison is not possible for these types.
145
        // Note that "any" comparison is not possible for this type.
146
        if (dep.getType() == Dependency.TYPE_IDE) {
146
        if (dep.getType() == Dependency.TYPE_JAVA) {
147
            if (! dep.getName().equals(Dependency.IDE_NAME)) {
148
                return false;
149
            }
150
            if (dep.getComparison() == Dependency.COMPARE_SPEC) {
151
                return new SpecificationVersion(dep.getVersion()).compareTo(Dependency.IDE_SPEC) <= 0;
152
            } else {
153
                return dep.getVersion().equals(Dependency.IDE_IMPL);
154
            }
155
        } else if (dep.getType() == Dependency.TYPE_JAVA) {
156
            if (dep.getName().equals(Dependency.JAVA_NAME)) {
147
            if (dep.getName().equals(Dependency.JAVA_NAME)) {
157
                if (dep.getComparison() == Dependency.COMPARE_SPEC) {
148
                if (dep.getComparison() == Dependency.COMPARE_SPEC) {
158
                    return new SpecificationVersion(dep.getVersion()).compareTo(Dependency.JAVA_SPEC) <= 0;
149
                    return new SpecificationVersion(dep.getVersion()).compareTo(Dependency.JAVA_SPEC) <= 0;
Lines 606-609 Link Here
606
        }
597
        }
607
    }
598
    }
608
599
600
    /** Get API module dependency, if any, for a module.
601
     * @param dependencies module dependencies
602
     * @param cnb code name base of API module
603
     * @return a fake spec version (0.x.y if x.y w/ no major release, else r.x.y); or null if no dep
604
     */
605
    static SpecificationVersion getModuleDep(Set dependencies, String cnb) {
606
        Iterator it = dependencies.iterator();
607
        while (it.hasNext()) {
608
            Dependency d = (Dependency)it.next();
609
            if (d.getType() == Dependency.TYPE_MODULE &&
610
                    d.getComparison() == Dependency.COMPARE_SPEC) {
611
                try {
612
                    Object[] p = parseCodeName(d.getName());
613
                    if (!p[0].equals(cnb)) {
614
                        continue;
615
                    }
616
                    int rel = ((Integer)p[1]).intValue(); // ignore any end range, consider only start
617
                    if (rel == -1) rel = 0;
618
                    return new SpecificationVersion("" + rel + "." + d.getVersion()); // NOI18N
619
                } catch (NumberFormatException nfe) {
620
                    Util.err.notify(nfe);
621
                    return null;
622
                }
623
            }
624
        }
625
        return null;
626
    }
627
    
609
}
628
}
(-)core/src/org/netbeans/core/modules/auto-deps-1_0.dtd (+142 lines)
Added Link Here
1
<!--
2
                Sun Public License Notice
3
4
The contents of this file are subject to the Sun Public License
5
Version 1.0 (the "License"). You may not use this file except in
6
compliance with the License. A copy of the License is available at
7
http://www.sun.com/
8
9
The Original Code is NetBeans. The Initial Developer of the Original
10
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
Microsystems, Inc. All Rights Reserved.
12
-->
13
14
<!--
15
Structure of XML files present in a NetBeans installation
16
with names system/ModuleAutoDeps/*.xml (conventionally named
17
according to code name base, e.g. org-netbeans-modules-foo.xml).
18
19
Each file contribute some module dependency transformations
20
to the system, helping backward compatibility.
21
22
This file can be processed with the Generate Documentation
23
context menu item in NetBeans to create an HTML summary.
24
25
Public ID: "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN"
26
Public URL: http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd
27
28
@see "#30161"
29
-->
30
31
<!ENTITY % dependency 'module-dependency | package-dependency | token-dependency'>
32
33
<!---
34
A set of transformations to apply to all module dependencies,
35
to retain backward compatibility during refactorings.
36
This should be the root element of auto-deps.xml.
37
Note that transformations are applied <em>in parallel</em>, so
38
later transformations cannot be triggered by results from earlier
39
transformations.
40
-->
41
<!ELEMENT transformations (transformationgroup*)>
42
<!ATTLIST transformations
43
          version (1.0) #REQUIRED
44
>
45
46
<!---
47
A module to exclude from dependency transformation.
48
You may give a specific module, or all modules whose code name base
49
begins with some prefix.
50
(For prefix: name <samp>a.b</samp> matches the module named
51
<samp>a.b</samp> and all modules whose names start with <samp>a.b.</samp>.)
52
-->
53
<!ELEMENT exclusion EMPTY>
54
<!ATTLIST exclusion
55
          codenamebase CDATA #REQUIRED
56
          prefix (true | false) #REQUIRED
57
>
58
59
<!---
60
A group of transformations to apply, related to one another.
61
-->
62
<!ELEMENT transformationgroup (description, exclusion*, transformation+)>
63
64
<!---
65
Textual description of a transformation group.
66
Informational only.
67
-->
68
<!ELEMENT description (#PCDATA)>
69
70
<!---
71
One dependency transformation.
72
Each non-excluded module matching the trigger will
73
get the specified resulting dependencies.
74
-->
75
<!ELEMENT transformation (trigger-dependency, implies)>
76
77
<!---
78
The trigger for a transformation.
79
Contains an old dependency declaration.
80
Cancel triggers match when the module had that dependency
81
(if versioned, must be at least that new, in both major and spec)
82
and when matching, delete the old dependency.
83
Older triggers (can only be used when spec given) match when
84
the dependency was there but on an older version than the one specified.
85
-->
86
<!ELEMENT trigger-dependency (%dependency;)>
87
<!-- add as needed: (newer | negative)
88
Newer triggers match when the module had that dependency
89
(if it was versioned, must be at least that new, in both major and spec).
90
Negative triggers match if the module did not have it.
91
-->
92
<!ATTLIST trigger-dependency
93
          type (cancel | older) #REQUIRED
94
>
95
96
<!---
97
Dependencies to create as a result of this transformation.
98
-->
99
<!ELEMENT implies (result+)>
100
101
<!---
102
One dependency to create as a result of this transformation.
103
If the module already had a dependency on the specified object (module, ...),
104
and that dependency was older than the specified one,
105
then it will be <em>replaced</em> by the specified dependency.
106
Otherwise a fresh dependency will be added.
107
-->
108
<!ELEMENT result (%dependency;)>
109
110
<!---
111
A dependency on a module, similar to
112
<code>OpenIDE-Module-Module-Dependencies</code>.
113
For <code>OpenIDE-Module-IDE-Dependencies</code>,
114
use codenamebase=org.openide (and major=1).
115
-->
116
<!ELEMENT module-dependency EMPTY>
117
<!ATTLIST module-dependency
118
          codenamebase CDATA #REQUIRED
119
          major CDATA #IMPLIED
120
          spec CDATA #IMPLIED
121
>
122
123
<!---
124
A dependency on a package, similar to
125
<code>OpenIDE-Module-Package-Dependencies</code>.
126
<code>name</code> here may include sample class information
127
only when used in a result, not in a trigger!
128
-->
129
<!ELEMENT package-dependency EMPTY>
130
<!ATTLIST package-dependency
131
          name CDATA #REQUIRED
132
          spec CDATA #IMPLIED
133
>
134
135
<!---
136
A dependency on a token, similar to
137
<code>OpenIDE-Module-Requires</code>.
138
-->
139
<!ELEMENT token-dependency EMPTY>
140
<!ATTLIST token-dependency
141
          name CDATA #REQUIRED
142
>
(-)core/src/org/netbeans/core/modules/package.html (+3 lines)
Lines 76-81 Link Here
76
  <p>{@link org.netbeans.core.modules.TestModuleDeployer} is a service available via lookup
76
  <p>{@link org.netbeans.core.modules.TestModuleDeployer} is a service available via lookup
77
  which deploys test modules; accessible separately with a thin API for use by modules
77
  which deploys test modules; accessible separately with a thin API for use by modules
78
  such as the API Support.
78
  such as the API Support.
79
  <p>{@link AutomaticDependencies} is used to parse the <a href="auto-deps.xml"><samp>auto-deps.xml</samp></a>
80
  file and automatically update dependencies used by old modules as a result. This is very
81
  useful for maintaining backward compatibility across major refactorings.
79
  <p>Also of interest: {@link org.netbeans.core.ui.ModuleBean} provides a Swing-safe UI
82
  <p>Also of interest: {@link org.netbeans.core.ui.ModuleBean} provides a Swing-safe UI
80
  wrapper for <code>Module</code> and <code>ModuleManager</code>, used by the <b>Modules</b> node.
83
  wrapper for <code>Module</code> and <code>ModuleManager</code>, used by the <b>Modules</b> node.
81
  <p>Those interested in using the independent parts of the module system as a standalone JAR
84
  <p>Those interested in using the independent parts of the module system as a standalone JAR
(-)core/src/org/netbeans/core/resources/mf-layer.xml (+3 lines)
Lines 139-144 Link Here
139
            	<file name="DTD_Module_Status_1_0" url="nbres:/org/netbeans/core/modules/module-status-1_0.dtd">
139
            	<file name="DTD_Module_Status_1_0" url="nbres:/org/netbeans/core/modules/module-status-1_0.dtd">
140
                	<attr name="hint.originalPublicID" stringvalue="-//NetBeans//DTD Module Status 1.0//EN"/>
140
                	<attr name="hint.originalPublicID" stringvalue="-//NetBeans//DTD Module Status 1.0//EN"/>
141
            	</file>
141
            	</file>
142
                <file name="DTD_Module_Automatic_Dependencies_1_0" url="nbres:/org/netbeans/core/modules/module-deps-1_0.dtd">
143
                    <attr name="hint.originalPublicID" stringvalue="-//NetBeans//DTD Module Automatic Dependencies 1.0//EN"/>
144
                </file>
142
145
143
            	<!-- Declarative MIME resolver -->
146
            	<!-- Declarative MIME resolver -->
144
            	<file name="DTD_MIME_Resolver_1_0" url="nbres:/org/netbeans/core/filesystems/resolver.dtd">
147
            	<file name="DTD_MIME_Resolver_1_0" url="nbres:/org/netbeans/core/filesystems/resolver.dtd">
(-)core/test/cfg-unit.xml (-3 / +2 lines)
Lines 50-58 Link Here
50
    <testbag testattribs="stable" executor="code" name="testbag_3" resultsprocessor="unit">
50
    <testbag testattribs="stable" executor="code" name="testbag_3" resultsprocessor="unit">
51
        <testset dir="unit/src">
51
        <testset dir="unit/src">
52
            <patternset>
52
            <patternset>
53
                <include name="org/netbeans/core/modules/ModuleManagerTest.class"/>
53
                <include name="org/netbeans/core/modules/*Test.class"/>
54
                <include name="org/netbeans/core/modules/ModuleListTest.class"/>
54
                <include name="org/netbeans/core/modules/*Test?.class"/>
55
                <include name="org/netbeans/core/modules/NbInstallerTest?.class"/>
56
                <include name="org/netbeans/core/NbPlacesTest.class"/>
55
                <include name="org/netbeans/core/NbPlacesTest.class"/>
57
                <include name="org/netbeans/core/projects/SystemFileSystemTest.class"/>
56
                <include name="org/netbeans/core/projects/SystemFileSystemTest.class"/>
58
                <include name="org/netbeans/core/projects/cache/*Test.class"/>
57
                <include name="org/netbeans/core/projects/cache/*Test.class"/>
(-)core/test/unit/src/org/netbeans/core/modules/AutomaticDependenciesTest.java (+147 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.modules;
15
16
import java.net.URL;
17
import java.util.*;
18
import org.netbeans.junit.*;
19
import junit.textui.TestRunner;
20
import org.openide.modules.Dependency;
21
22
/** Test AutomaticDependencies (end-to-end).
23
 * @author Jesse Glick
24
 */
25
public class AutomaticDependenciesTest extends NbTestCase {
26
    
27
    public AutomaticDependenciesTest(String name) {
28
        super(name);
29
    }
30
    
31
    public static void main(String[] args) {
32
        TestRunner.run(new NbTestSuite(AutomaticDependenciesTest.class));
33
    }
34
    
35
    private AutomaticDependencies ad;
36
    protected void setUp() throws Exception {
37
        ad = AutomaticDependencies.parse(new URL[] {
38
            AutomaticDependenciesTest.class.getResource("data/auto-deps-1.xml"),
39
            AutomaticDependenciesTest.class.getResource("data/auto-deps-2.xml"),
40
        });
41
    }
42
    
43
    public void testBasicOperation() throws Exception {
44
        Set deps = new HashSet(); // Set<Dependency>
45
        deps.addAll(Dependency.create(Dependency.TYPE_JAVA, "Java > 1.3"));
46
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "unrelated"));
47
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.0"));
48
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig2/1 > 1.5.1"));
49
        Set _deps = new HashSet(deps);
50
        ad.refineDependencies("random", _deps);
51
        assertEquals("Java > 1.3, Nue, nue > 1.0, nue2 > 1.0, orig > 1.0, orig2/1 > 1.5.1, unrelated", normal(_deps));
52
    }
53
    
54
    public void testExcludes() throws Exception {
55
        Set deps = new HashSet(); // Set<Dependency>
56
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.0"));
57
        Set _deps = new HashSet(deps);
58
        ad.refineDependencies("a", _deps);
59
        assertEquals("orig > 1.0", normal(_deps));
60
        _deps = new HashSet(deps);
61
        ad.refineDependencies("a.x", _deps);
62
        assertEquals("Nue, nue > 1.0, orig > 1.0", normal(_deps));
63
        _deps = new HashSet(deps);
64
        ad.refineDependencies("b", _deps);
65
        assertEquals("orig > 1.0", normal(_deps));
66
        _deps = new HashSet(deps);
67
        ad.refineDependencies("b.x", _deps);
68
        assertEquals("orig > 1.0", normal(_deps));
69
    }
70
    
71
    public void testVersionSensitivity() throws Exception {
72
        Set deps = new HashSet(); // Set<Dependency>
73
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.1"));
74
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig2/2 > 0.1"));
75
        Set _deps = new HashSet(deps);
76
        ad.refineDependencies("random", _deps);
77
        assertEquals("orig > 1.1, orig2/2 > 0.1", normal(_deps));
78
    }
79
    
80
    public void testCancellations() throws Exception {
81
        Set deps = new HashSet(); // Set<Dependency>
82
        deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0"));
83
        Set _deps = new HashSet(deps);
84
        ad.refineDependencies("random", _deps);
85
        assertEquals("javax.death/1 > 1.0", normal(_deps));
86
    }
87
    
88
    public void testMerges() throws Exception {
89
        Set deps = new HashSet(); // Set<Dependency>
90
        deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0"));
91
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 1.0"));
92
        Set _deps = new HashSet(deps);
93
        ad.refineDependencies("random", _deps);
94
        assertEquals("javax.death/1 > 1.0", normal(_deps));
95
        deps = new HashSet(); // Set<Dependency>
96
        deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0"));
97
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 0.3"));
98
        _deps = new HashSet(deps);
99
        ad.refineDependencies("random", _deps);
100
        assertEquals("javax.death/1 > 1.0", normal(_deps));
101
        deps = new HashSet(); // Set<Dependency>
102
        deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0"));
103
        deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 1.3"));
104
        _deps = new HashSet(deps);
105
        ad.refineDependencies("random", _deps);
106
        assertEquals("javax.death/1 > 1.3", normal(_deps));
107
    }
108
    
109
    private static String normal(Set deps) {
110
        SortedSet s = new TreeSet(); // Set<String>
111
        Iterator it = deps.iterator();
112
        while (it.hasNext()) {
113
            Dependency d = (Dependency)it.next();
114
            s.add(dep2String(d));
115
        }
116
        StringBuffer b = new StringBuffer();
117
        it = s.iterator();
118
        while (it.hasNext()) {
119
            b.append(it.next());
120
            if (it.hasNext()) {
121
                b.append(", ");
122
            }
123
        }
124
        return b.toString();
125
    }
126
    
127
    private static String dep2String(Dependency d) {
128
        StringBuffer b = new StringBuffer();
129
        b.append(d.getName());
130
        switch (d.getComparison()) {
131
        case Dependency.COMPARE_ANY:
132
            break;
133
        case Dependency.COMPARE_IMPL:
134
            b.append(" = ");
135
            b.append(d.getVersion());
136
            break;
137
        case Dependency.COMPARE_SPEC:
138
            b.append(" > ");
139
            b.append(d.getVersion());
140
            break;
141
        default:
142
            throw new IllegalStateException();
143
        }
144
        return b.toString();
145
    }
146
    
147
}
(-)core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java (+6 lines)
Lines 173-178 Link Here
173
            } catch (IllegalArgumentException iae) {
173
            } catch (IllegalArgumentException iae) {
174
                // Good. m1 should not have been passed to it.
174
                // Good. m1 should not have been passed to it.
175
            }
175
            }
176
            assertEquals(Collections.EMPTY_SET, m1.getProblems());
177
            assertEquals(Collections.EMPTY_SET, m2.getProblems());
176
            List toEnable = mgr.simulateEnable(Collections.singleton(m2));
178
            List toEnable = mgr.simulateEnable(Collections.singleton(m2));
177
            assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable);
179
            assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable);
178
            mgr.enable(Collections.singleton(m2));
180
            mgr.enable(Collections.singleton(m2));
Lines 224-229 Link Here
224
            } catch (IllegalArgumentException iae) {
226
            } catch (IllegalArgumentException iae) {
225
                // Good. m2 should not have been passed to it.
227
                // Good. m2 should not have been passed to it.
226
            }
228
            }
229
            assertEquals(Collections.EMPTY_SET, m1.getProblems());
230
            assertEquals(Collections.EMPTY_SET, m2.getProblems());
227
            List toEnable = mgr.simulateEnable(Collections.singleton(m1));
231
            List toEnable = mgr.simulateEnable(Collections.singleton(m1));
228
            assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable);
232
            assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable);
229
            mgr.enable(Collections.singleton(m1));
233
            mgr.enable(Collections.singleton(m1));
Lines 1436-1441 Link Here
1436
        ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents());
1440
        ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents());
1437
        mgr.mutexPrivileged().enterWriteAccess();
1441
        mgr.mutexPrivileged().enterWriteAccess();
1438
        try {
1442
        try {
1443
            addOpenide(mgr);
1439
            Module m1 = mgr.create(new File(jars, "api-mod-export-all.jar"), null, false, false, false);
1444
            Module m1 = mgr.create(new File(jars, "api-mod-export-all.jar"), null, false, false, false);
1440
            Module m2 = mgr.create(new File(jars, "uses-api-simple-dep.jar"), null, false, false, false);
1445
            Module m2 = mgr.create(new File(jars, "uses-api-simple-dep.jar"), null, false, false, false);
1441
            mgr.enable(m1);
1446
            mgr.enable(m1);
Lines 1548-1553 Link Here
1548
        ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents());
1553
        ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents());
1549
        mgr.mutexPrivileged().enterWriteAccess();
1554
        mgr.mutexPrivileged().enterWriteAccess();
1550
        try {
1555
        try {
1556
            addOpenide(mgr);
1551
            Module m1 = mgr.create(new File(jars, "api-mod-export-api.jar"), null, false, false, false);
1557
            Module m1 = mgr.create(new File(jars, "api-mod-export-api.jar"), null, false, false, false);
1552
            Module m2 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false);
1558
            Module m2 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false);
1553
            Module m3 = mgr.create(new File(jars, "uses-api-transitively.jar"), null, false, false, false);
1559
            Module m3 = mgr.create(new File(jars, "uses-api-transitively.jar"), null, false, false, false);
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest2.java (-3 / +4 lines)
Lines 37-54 Link Here
37
    
37
    
38
    protected void setUp() throws Exception {
38
    protected void setUp() throws Exception {
39
        super.setUp();
39
        super.setUp();
40
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true");
40
        System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true");
41
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true");
42
    }
41
    }
43
    
42
    
44
    /** Test #21173/#23595: overriding layers by localization. */
43
    /** Test #21173/#23595: overriding layers by localization. */
45
    public void testLocLayerOverrides() throws Exception {
44
    public void testLocLayerOverrides() throws Exception {
46
        NbTopManager.get(); // init module system
45
        NbTopManager.get(); // init module system
47
        final FakeEvents ev = new FakeEvents();
46
        final FakeEvents ev = new FakeEvents();
48
        ModuleInstaller installer = new NbInstaller(ev);
47
        NbInstaller installer = new NbInstaller(ev);
49
        ModuleManager mgr = new ModuleManager(installer, ev);
48
        ModuleManager mgr = new ModuleManager(installer, ev);
49
        installer.registerManager(mgr);
50
        mgr.mutexPrivileged().enterWriteAccess();
50
        mgr.mutexPrivileged().enterWriteAccess();
51
        try {
51
        try {
52
            addOpenide(mgr);
52
            Locale orig = Locale.getDefault();
53
            Locale orig = Locale.getDefault();
53
            Locale.setDefault(new Locale("cs", "CZ"));
54
            Locale.setDefault(new Locale("cs", "CZ"));
54
            try {
55
            try {
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest3.java (-1 / +3 lines)
Lines 38-47 Link Here
38
    public void testBrandingLayerOverrides() throws Exception {
38
    public void testBrandingLayerOverrides() throws Exception {
39
        NbTopManager.get(); // init module system
39
        NbTopManager.get(); // init module system
40
        final FakeEvents ev = new FakeEvents();
40
        final FakeEvents ev = new FakeEvents();
41
        ModuleInstaller installer = new NbInstaller(ev);
41
        NbInstaller installer = new NbInstaller(ev);
42
        ModuleManager mgr = new ModuleManager(installer, ev);
42
        ModuleManager mgr = new ModuleManager(installer, ev);
43
        installer.registerManager(mgr);
43
        mgr.mutexPrivileged().enterWriteAccess();
44
        mgr.mutexPrivileged().enterWriteAccess();
44
        try {
45
        try {
46
            addOpenide(mgr);
45
            String orig = NbBundle.getBranding();
47
            String orig = NbBundle.getBranding();
46
            NbBundle.setBranding("foo");
48
            NbBundle.setBranding("foo");
47
            try {
49
            try {
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest4.java (+1 lines)
Lines 59-64 Link Here
59
        installer.registerManager(mgr);
59
        installer.registerManager(mgr);
60
        mgr.mutexPrivileged().enterWriteAccess();
60
        mgr.mutexPrivileged().enterWriteAccess();
61
        try {
61
        try {
62
            addOpenide(mgr);
62
            Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false);
63
            Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false);
63
            Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false);
64
            Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false);
64
            assertEquals(Collections.EMPTY_SET, m2.getProblems());
65
            assertEquals(Collections.EMPTY_SET, m2.getProblems());
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest5.java (+1 lines)
Lines 49-54 Link Here
49
        installer.registerManager(mgr);
49
        installer.registerManager(mgr);
50
        mgr.mutexPrivileged().enterWriteAccess();
50
        mgr.mutexPrivileged().enterWriteAccess();
51
        try {
51
        try {
52
            addOpenide(mgr);
52
            Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false);
53
            Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false);
53
            Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false);
54
            Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false);
54
            
55
            
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest7.java (-3 / +1 lines)
Lines 47-55 Link Here
47
    protected void setUp() throws Exception {
47
    protected void setUp() throws Exception {
48
        super.setUp();
48
        super.setUp();
49
        System.setProperty("netbeans.suppress.sysprop.warning", "true");
49
        System.setProperty("netbeans.suppress.sysprop.warning", "true");
50
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true");
50
        System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true");
51
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true");
52
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO", "true");
53
        // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false
51
        // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false
54
        clearWorkDir();
52
        clearWorkDir();
55
        File workdir = getWorkDir();
53
        File workdir = getWorkDir();
(-)core/test/unit/src/org/netbeans/core/modules/NbInstallerTest8.java (-3 / +1 lines)
Lines 49-57 Link Here
49
    protected void setUp() throws Exception {
49
    protected void setUp() throws Exception {
50
        super.setUp();
50
        super.setUp();
51
        System.setProperty("netbeans.suppress.sysprop.warning", "true");
51
        System.setProperty("netbeans.suppress.sysprop.warning", "true");
52
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true");
52
        System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true");
53
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true");
54
        System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO", "true");
55
        // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false
53
        // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false
56
        clearWorkDir();
54
        clearWorkDir();
57
        File workdir = getWorkDir();
55
        File workdir = getWorkDir();
(-)core/test/unit/src/org/netbeans/core/modules/SetupHid.java (+18 lines)
Lines 18-23 Link Here
18
import java.io.*;
18
import java.io.*;
19
import java.util.*;
19
import java.util.*;
20
import java.beans.*;
20
import java.beans.*;
21
import java.net.URL;
22
import java.util.jar.Manifest;
21
import org.openide.filesystems.*;
23
import org.openide.filesystems.*;
22
import org.openide.filesystems.FileSystem; // override java.io.FileSystem
24
import org.openide.filesystems.FileSystem; // override java.io.FileSystem
23
import org.netbeans.core.NbTopManager;
25
import org.netbeans.core.NbTopManager;
Lines 96-101 Link Here
96
            text.append(new String(buf, 0, read, "US-ASCII"));
98
            text.append(new String(buf, 0, read, "US-ASCII"));
97
        }
99
        }
98
        return text.toString();
100
        return text.toString();
101
    }
102
    
103
    protected void addOpenide(ModuleManager mgr) throws Exception {
104
        ClassLoader l = SetupHid.class.getClassLoader();
105
        Enumeration e = l.getResources("META-INF/MANIFEST.MF");
106
        Manifest mani = null;
107
        while (e.hasMoreElements()) {
108
            URL u = (URL)e.nextElement();
109
            Manifest m = new Manifest(u.openStream());
110
            if ("org.openide/1".equals(m.getMainAttributes().getValue("OpenIDE-Module"))) {
111
                mani = m;
112
                break;
113
            }
114
        }
115
        if (mani == null) throw new IllegalStateException("openide.jar not in classpath?");
116
        mgr.enable(mgr.createFixed(mani, null, l));
99
    }
117
    }
100
    
118
    
101
    protected static class FakeModuleInstaller extends ModuleInstaller {
119
    protected static class FakeModuleInstaller extends ModuleInstaller {
(-)core/test/unit/src/org/netbeans/core/modules/data/auto-deps-1.xml (+47 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<!DOCTYPE transformations PUBLIC "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN" "http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd">
16
<transformations version="1.0">
17
18
    <transformationgroup>
19
        <description>La la</description>
20
        <exclusion codenamebase="a" prefix="false"/>
21
        <exclusion codenamebase="b" prefix="true"/>
22
        <transformation>
23
            <trigger-dependency type="older">
24
                <module-dependency codenamebase="orig" spec="1.1"/>
25
            </trigger-dependency>
26
            <implies>
27
                <result>
28
                    <module-dependency codenamebase="nue" spec="1.0"/>
29
                </result>
30
                <result>
31
                    <token-dependency name="Nue"/>
32
                </result>
33
            </implies>
34
        </transformation>
35
        <transformation>
36
            <trigger-dependency type="cancel">
37
                <package-dependency name="javax.death"/>
38
            </trigger-dependency>
39
            <implies>
40
                <result>
41
                    <module-dependency codenamebase="javax.death" major="1" spec="1.0"/>
42
                </result>
43
            </implies>
44
        </transformation>
45
    </transformationgroup>
46
47
</transformations>
(-)core/test/unit/src/org/netbeans/core/modules/data/auto-deps-2.xml (+32 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<!DOCTYPE transformations PUBLIC "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN" "http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd">
16
<transformations version="1.0">
17
18
    <transformationgroup>
19
        <description>La la</description>
20
        <transformation>
21
            <trigger-dependency type="older">
22
                <module-dependency codenamebase="orig2" major="1" spec="2.0"/>
23
            </trigger-dependency>
24
            <implies>
25
                <result>
26
                    <module-dependency codenamebase="nue2" spec="1.0"/>
27
                </result>
28
            </implies>
29
        </transformation>
30
    </transformationgroup>
31
32
</transformations>
(-)debuggercore/build.xml (-3 / +5 lines)
Lines 50-55 Link Here
50
        <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
50
        <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
51
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
51
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
52
        <pathelement location="../openide/io/netbeans/modules/autoload/openide-io.jar"/>
52
        <pathelement location="../openide/io/netbeans/modules/autoload/openide-io.jar"/>
53
        <pathelement location="oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
53
      </classpath>
54
      </classpath>
54
    </javac>
55
    </javac>
55
  </target>
56
  </target>
Lines 68-78 Link Here
68
  </target>
69
  </target>
69
70
70
   
71
   
71
  <target name="netbeans" depends="jars">
72
  <target name="netbeans" depends="jars" description="Build everything.">
72
    <genlist targetname="nbm" outputfiledir="netbeans"/>
73
    <genlist targetname="nbm" outputfiledir="netbeans"/>
73
  </target>
74
  </target>
74
75
75
  <target name="nbm" depends="netbeans">
76
  <target name="nbm" depends="netbeans" description="Build NBM.">
76
    <makenbm file="debuggercore.nbm"
77
    <makenbm file="debuggercore.nbm"
77
             topdir="."
78
             topdir="."
78
             module="netbeans/modules/autoload/debuggerCore.jar"
79
             module="netbeans/modules/autoload/debuggerCore.jar"
Lines 82-88 Link Here
82
      <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
83
      <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
83
    </makenbm>
84
    </makenbm>
84
  </target>
85
  </target>
85
  <target name="clean">
86
  
87
  <target name="clean" description="Clean everything.">
86
    <delete>
88
    <delete>
87
      <fileset dir="src">
89
      <fileset dir="src">
88
        <include name="**/*.class"/>
90
        <include name="**/*.class"/>
(-)debuggercore/manifest.mf (-2 / +2 lines)
Lines 3-10 Link Here
3
OpenIDE-Module-Install: org/netbeans/modules/debugger/multisession/EnterpriseModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/debugger/multisession/EnterpriseModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
6
OpenIDE-Module-Module-Dependencies: org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
6
OpenIDE-Module-Module-Dependencies: org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.openide.debugger > 1.0
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
8
OpenIDE-Module-Specification-Version: 2.5
8
OpenIDE-Module-Specification-Version: 2.7
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
10
10
(-)debuggercore/oldapi/.cvsignore (+5 lines)
Added Link Here
1
manifest-subst.mf
2
netbeans
3
Info
4
openide-debugger.nbm
5
javadoc
(-)debuggercore/oldapi/build.xml (+97 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<project name="debuggercore/oldapi" default="netbeans" basedir=".">
16
17
    <property name="nb_all" value="../.."/>
18
19
    <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
20
    <taskdef name="genlist" classname="org.netbeans.nbbuild.MakeListOfNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
21
    <taskdef name="locjar" classname="org.netbeans.nbbuild.LocalizedJar" classpath="${nb_all}/nbbuild/nbantext.jar"/>
22
23
    <property name="nbm_alias" value="nb_ide"/>
24
    <property name="homepage.base" value="netbeans.org"/>
25
    <property name="dist.base" value="www.netbeans.org/download/nbms/40"/>
26
    <property name="license.file" value="${nb_all}/nbbuild/standard-nbm-license.txt"/>
27
28
    <path id="cp">
29
        <pathelement location="${nb_all}/openide/openide-13javac-workaround.jar"/>
30
        <pathelement location="${nb_all}/openide/netbeans/lib/openide.jar"/>
31
        <pathelement location="${nb_all}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
32
        <pathelement location="${nb_all}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
33
        <pathelement location="${nb_all}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
34
        <!-- ServiceTypeEditor: -->
35
        <pathelement location="${nb_all}/core/netbeans/lib/core.jar"/>
36
    </path>
37
  
38
    <target name="compile">
39
        <javac srcdir="src" destdir="src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}">
40
            <classpath refid="cp"/>
41
        </javac>
42
    </target>
43
44
    <target name="jars" depends="compile">
45
        <mkdir dir="netbeans/modules/autoload"/>
46
        <filter token="BUILD_NUMBER_SUBST" value="${buildnumber}"/>
47
        <copy file="manifest.mf" tofile="manifest-subst.mf" filtering="on"/>
48
        <locjar jarfile="netbeans/modules/autoload/openide-debugger.jar"
49
                manifest="manifest-subst.mf"
50
                basedir="src"
51
	        excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"
52
	        compress="false">
53
            <locale name="ja"/>
54
        </locjar>
55
    </target>
56
57
    <target name="netbeans" depends="jars">
58
        <genlist targetname="nbm" outputfiledir="netbeans"/>
59
    </target>
60
61
    <target name="nbm" depends="netbeans">
62
        <makenbm file="openide-debugger.nbm"
63
                 topdir="."
64
                 module="netbeans/modules/autoload/openide-debugger.jar"
65
                 homepage="http://debuggercore.${homepage.base}/"
66
                 distribution="http://${dist.base}/openide-debugger.nbm">
67
            <license file="${license.file}"/>
68
            <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
69
        </makenbm>
70
    </target>
71
  
72
    <target name="javadoc" description="Build Javadoc.">
73
        <!-- Ant 1.4 bug workaround: <property refid="..."/> does not work inside <ant> -->
74
        <property name="_cp" refid="cp"/>
75
        <ant dir="${nb_all}/nbbuild" antfile="template.xml" target="javadoc">
76
            <property name="javadoc.base" location="."/>
77
            <property name="javadoc.name" value="DebuggerAPI"/>
78
            <property name="javadoc.title" value="Debugger API"/>
79
            <property name="javadoc.packages" value="org.openide.debugger,org.openide.cookies,org.openide.loaders"/>
80
            <property name="javadoc.classpath" value="${_cp}"/>
81
        </ant>
82
    </target>
83
  
84
    <target name="clean">
85
        <delete>
86
            <fileset dir="src">
87
                <include name="**/*.class"/>
88
            </fileset>
89
        </delete>
90
        <delete file="manifest-subst.mf"/>
91
        <delete file="openide-debugger.nbm"/>
92
        <delete dir="netbeans"/>
93
        <delete dir="Info"/>
94
        <delete dir="javadoc"/>
95
    </target>
96
  
97
</project>
(-)debuggercore/oldapi/manifest.mf (+11 lines)
Added Link Here
1
OpenIDE-Module: org.openide.debugger
2
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.31
3
OpenIDE-Module-Specification-Version: 1.0
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Module-Dependencies: org.openide.execution > 1.0, org.openide.compiler > 1.0, org.openide.src > 1.0, org.netbeans.core/1 > 1.11
6
OpenIDE-Module-Requires: org.openide.compiler.CompilationEngine
7
OpenIDE-Module-Localizing-Bundle: org/openide/debugger/module/Bundle.properties
8
OpenIDE-Module-Install: org/openide/debugger/module/Install.class
9
OpenIDE-Module-Layer: org/openide/debugger/module/layer.xml
10
OpenIDE-Module-Public-Packages: org.openide.debugger.*, org.openide.cookies.*, org.openide.loaders.*
11
(-)debuggercore/oldapi/api/doc/changes/apichanges.xml (+116 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
  -->
14
<?xml-stylesheet type="text/xml" href="../../../../../openide/api/doc/changes/apichanges.xsl"?>
15
<!DOCTYPE apichanges PUBLIC "-//NetBeans//DTD API changes list 1.0//EN" "../../../../../openide/api/doc/changes/apichanges.dtd">
16
<apichanges>
17
    <apidefs>
18
        <apidef name="debugger">Debugger API</apidef>
19
    </apidefs>
20
21
    <changes>
22
23
        <change>
24
            <api name="debugger"/>
25
            <summary>Un-deprecation of Debugger API</summary>
26
            <version major="1" minor="0"/>
27
            <date day="27" month="1" year="2003"/>
28
            <author login="jglick"/>
29
            <compatibility binary="compatible" source="incompatible">
30
                <p>
31
                    Old modules should run unchanged, though they are encouraged
32
                    to depend explicitly on the new API.
33
                </p>
34
                <p>
35
                    Code which set a performer for
36
                    <code>ToggleBreakpointAction</code> (or, perhaps,
37
                    <code>AddWatchAction</code>) should be changed to use the new
38
                    action context system: add bindings for
39
                    <samp>"org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"</samp>
40
                    (resp.
41
                    <samp>"org.netbeans.modules.debugger.support.actions.AddWatchAction"</samp>)
42
                    to the <code>TopComponent</code>'s action map, rather than
43
                    overriding <code>componentActivated</code> and
44
                    <code>componentDeactivated</code>.
45
                </p>
46
                <p>
47
                    Modules depending on <code>org.openide.deprecated</code>
48
                    versions prior to <code>1.2</code> will automatically receive
49
                    a dependency on the new module.
50
                </p>
51
            </compatibility>
52
            <description>
53
                <p>
54
                    Most of the Debugger API has been restored in non-deprecated
55
                    form in a separate autoload module. Only the actions in
56
                    <code>org.openide.actions.*</code> were not moved from
57
                    <samp>openide-deprecated.jar</samp> as they should not be
58
                    needed.
59
                </p>
60
            </description>
61
            <class package="org.openide.cookies" name="DebuggerCookie"/>
62
            <class package="org.openide.loaders" name="ExecSupport"/>
63
            <package name="org.openide.debugger"/>
64
            <issue number="29914"/>
65
        </change>
66
67
    </changes>
68
69
    <htmlcontents>
70
<!--
71
72
                            NO NO NO NO NO!
73
74
         ==============>    DO NOT EDIT ME!  <======================
75
76
          AUTOMATICALLY GENERATED FROM APICHANGES.XML, DO NOT EDIT
77
78
                SEE debuggercore/oldapi/api/doc/changes/apichanges.xml
79
80
-->
81
        <head>
82
            <title>Change History for the Debugger API</title>
83
            <link rel="stylesheet" href="http://www.netbeans.org/netbeans.css" type="text/css"/>
84
            <meta name="CATEGORY" content="OtherDevelopmentDoc"/>
85
            <meta name="DESCRIPTION" content="A cross-indexed list of all changes made to the NetBeans Debugger API."/>
86
        </head>
87
        <body>
88
            <p>
89
                See also: <a href="http://openide.netbeans.org/apichanges.html#issue-19443-1">Separation of the Debugger API</a>
90
            </p>
91
            <p>
92
                There were no recorded pre-separation changes for the Debugger
93
                API.
94
            </p>
95
96
            <hr/><h1><a name="list-all-apis">Index of APIs</a></h1>
97
            <changelist style="list-all-apis"/>
98
            
99
            <h1><a name="incompat-by-date">Incompatible changes by date</a></h1>
100
            <changelist style="incompat-by-date"/>
101
102
            <h1><a name="all-by-date">All changes by date</a></h1>
103
            <changelist style="all-by-date"/>
104
105
            <h1><a name="all-by-version">Changes by version</a></h1>
106
            <changelist style="all-by-version"/>
107
108
            <h1><a name="all-by-class">Changes by affected class</a></h1>
109
            <changelist style="all-by-class"/>
110
111
            <hr/><h1><a name="details-by-api">Details of all changes by API and date</a></h1>
112
            <changelist style="details-by-api"/>
113
        </body>
114
    </htmlcontents>
115
116
</apichanges>
(-)debuggercore/oldapi/api/doc/org/openide/debugger/package.html (+32 lines)
Added Link Here
1
<!--
2
   -                 Sun Public License Notice
3
   - 
4
   - The contents of this file are subject to the Sun Public License
5
   - Version 1.0 (the "License"). You may not use this file except in
6
   - compliance with the License. A copy of the License is available at
7
   - http://www.sun.com/
8
   - 
9
   - The Original Code is NetBeans. The Initial Developer of the Original
10
   - Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
   - Microsystems, Inc. All Rights Reserved.
12
  -->
13
14
<html>
15
<body>
16
17
The IDE can support plugged-in implementations of an abstract
18
19
<a href="@TOP@org/openide/debugger/doc-files/api.html"><em>debugger</em></a>
20
21
interface.
22
23
<p>The <a href="doc-files/api.html"><b>Debugger API</b></a> permits a
24
new debugger to be inserted into the system, largely reusing the
25
existing user interface, and permitting extra functionality to be
26
exposed via nodes if needed. The API may also be used to control the
27
system debugger, especially to add private variable watches to the
28
debugged process that may be used to create a richer debugging
29
environment.
30
31
</body>
32
</html>
(-)debuggercore/oldapi/api/doc/org/openide/debugger/doc-files/api.html (+821 lines)
Added Link Here
1
<!--
2
   -                 Sun Public License Notice
3
   - 
4
   - The contents of this file are subject to the Sun Public License
5
   - Version 1.0 (the "License"). You may not use this file except in
6
   - compliance with the License. A copy of the License is available at
7
   - http://www.sun.com/
8
   - 
9
   - The Original Code is NetBeans. The Initial Developer of the Original
10
   - Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
   - Microsystems, Inc. All Rights Reserved.
12
  -->
13
14
<html>
15
<head>
16
<title>Debugger API</title>
17
<link rel="Stylesheet" href="../../open-apis.css" type="text/css" title="NetBeans Open APIs Style">
18
</head>
19
<body>
20
21
<p align="right"><a href="../../../../overview-summary.html"><b>Overview</b></a></p>
22
23
<h1>Javadoc</h1>
24
25
The Javadoc resides in
26
27
<a href="../package-summary.html"><code>org.openide.debugger</code></a>.
28
29
<h1>Contents</h1>
30
31
<ul>
32
33
<li><a href="#create">Creating a Debugger</a>
34
<ul>
35
<li><a href="#break-watch">Special breakpoint &amp; watch implementation</a>
36
<li><a href="#module">Installation tips</a>
37
</ul>
38
39
<li><a href="#create-xtra">Creating Extra Debugger-Related Implementation</a>
40
<ul>
41
<li><a href="#curr-line">Handling the current line</a>
42
<li><a href="#xtra-actions">Adding extra actions</a>
43
<li><a href="#env-nodes">Adding nodes to "Runtime"</a>
44
<li><a href="#windows">Adding a debugging workspace, windows, etc.</a>
45
<li><a href="#sysop">Adding a system option</a>
46
<li><a href="#persistence">Persisting debugger state</a>
47
</ul>
48
49
<li><a href="#createtype">Creating Debugger Types</a>
50
51
<li><a href="#invoke">Invoking the Debugger</a>
52
<ul>
53
<li><a href="#hidden-watch">Using hidden watches</a>
54
</ul>
55
56
</ul>
57
58
<h1>Debugger API</h1>
59
60
The Debugger API provides a thin interface between the IDE and various
61
possible debugger implementations, including the IDE's standard
62
debugger. The API is designed to work with Java programs, although it
63
could also be used for
64
65
<a href="http://grunge.cs.tu-berlin.de/~tolk/vmlanguages.html">any language</a>
66
67
compiled to the JVM.
68
69
<p>Note that the API itself defines only the basic methods of
70
communication, and does not specify a rich level of
71
functionality. However, what it provides is sufficient to implement
72
all of the connections between the standard debugger module and the
73
debugging-related actions and UI components, including with the
74
Editor. Real debuggers will very likely have more features than are
75
specified here, but it is not difficult to make the
76
77
<a href="#create-xtra">added functionality</a>
78
79
visible to the user.
80
81
<p>There are two different aspects to adding debugging capabilities to the IDE.
82
One is to create the <a href="#create">debugger itself</a>, i.e. a set of implementations
83
which specify how the debugger will be run, its current dynamic status, manipulation
84
of breakpoints and watches, etc. The other half is to create <a href="#createtype">debugger types</a>
85
which specify how the debugger should be <em>invoked</em> for particular types of objects - for
86
example, applets need to be debugged by means of launching the AppletViewer pointing to the correct
87
applet class or HTML page; but once the AppletViewer's main class has been launched with the correct
88
arguments, the remaining implementation is entirely up to the debugger. These two halves can (and typically
89
are) treated quite separately, so that the standard IDE debugger module installs a debugger as well as a
90
couple of simple, generic debugger types, while modules providing support for more exotic data types such
91
as applets or servlets provide their own specialized debugger types.
92
93
<div class="nonnormative">
94
95
<p>In practice, the specification of debugger functionality in the
96
Open APIs is insufficient for most projects to supply an integrated
97
alternate debugger for NetBeans. Generally it is necessary to rely on
98
additional SPIs contained in the Debugger Core module. These however
99
may not have the same standards of API design, documentation, and
100
compatibility as the Open APIs.</p>
101
102
<p>The
103
104
<a href="http://debuggercore.netbeans.org/">debugger module's home page</a>
105
106
has a certain amount of documentation for how to use these extended
107
SPIs, and a trivial example. As of this writing, the documentation is
108
not sufficient to cover all aspects of the module's SPI, so additional
109
help from the mailing lists and examination of NetBeans source code
110
will likely be necessary.</p>
111
112
</div>
113
114
<h2><a name="create">Creating a Debugger</a></h2>
115
116
To create a debugger, you must implement the
117
118
<a href="../Debugger.html"><code>Debugger</code></a>
119
120
abstract class. It must provide the following sets of features:
121
122
<ol>
123
124
<li>Access to, and control of, the debugger's basic state. The state should be queriable by means of
125
126
<a href="../Debugger.html#getState()"><code>Debugger.getState()</code></a>.
127
128
Initially, the debugger will be
129
130
<a href="../Debugger.html#DEBUGGER_NOT_RUNNING"><code>Debugger.DEBUGGER_NOT_RUNNING</code></a>
131
132
When some other part of the system starts it up with
133
134
<a href="../Debugger.html#startDebugger(org.openide.debugger.DebuggerInfo)"><code>Debugger.startDebugger(...)</code></a>,
135
136
it may indicate its state during the initialization phase as
137
138
<a href="../Debugger.html#DEBUGGER_STARTING"><code>Debugger.DEBUGGER_STARTING</code></a>.
139
140
When it is ready, it will be either
141
142
<a href="../Debugger.html#DEBUGGER_RUNNING"><code>Debugger.DEBUGGER_RUNNING</code></a>
143
144
(if actually executing user code at the time),
145
146
or
147
148
<a href="../Debugger.html#DEBUGGER_STOPPED"><code>Debugger.DEBUGGER_STOPPED</code></a>
149
150
(if stopped at a breakpoint).
151
152
<p>Once it is running, the debugger should respond to the basic commands
153
154
<a href="../Debugger.html#traceInto()"><code>Debugger.traceInto()</code></a>,
155
156
<a href="../Debugger.html#traceOver()"><code>Debugger.traceOver()</code></a>,
157
158
and
159
160
<a href="../Debugger.html#stepOut()"><code>Debugger.stepOut()</code></a>,
161
162
all of which return it to the stopped state; and
163
164
<a href="../Debugger.html#go()"><code>Debugger.go()</code></a>,
165
166
putting it into the running state (unless a breakpoint is encountered).
167
168
<a href="../Debugger.html#finishDebugger()"><code>Debugger.finishDebugger()</code></a>
169
170
should stop the debugger as soon as possible (some cleanup may be
171
required) and leave it in the not-running state.
172
173
<p>The
174
175
<a href="../DebuggerInfo.html"><code>DebuggerInfo</code></a>
176
177
provides the basic information needed for the debugger to start - the
178
name of the main class; a list of "command-line" parameters to pass to
179
its <code>main(String[])</code> method, which may be empty; and
180
(optionally) the name of a class to first stop execution on (as if
181
there were breakpoints on all of its methods).
182
183
<p>The debugger can look in the
184
185
<a href="@OPENIDE@/org/openide/filesystems/Repository.html">repository</a>
186
187
to find source code; and for a normal external
188
debugger, determine how to prepare the classpath correctly, which
189
generally involves scanning through
190
191
<a href="@OPENIDE@/org/openide/filesystems/Repository.html#getFileSystems()">all filesystems</a>,
192
193
asking each to
194
195
<a href="@OPENIDE@/org/openide/filesystems/FileSystem.html#prepareEnvironment(org.openide.filesystems.FileSystem.Environment)">add information</a>
196
197
to an object supplied by the debugger implementing
198
199
<a href="@OPENIDE@/org/openide/filesystems/FileSystem.Environment.html"><code>FileSystem.Environment</code></a>.
200
201
If classes should be compiled before being used in the debugger, the
202
debugger should take care of that using the
203
204
<a href="@OPENIDE/COMPILER@/org/openide/compiler/doc-files/api.html">Compiler API</a>.
205
206
<li>The debugger should be able to create breakpoints and watches when
207
requested by
208
209
<a href="../Debugger.html#createBreakpoint(org.openide.text.Line)"><code>Debugger.createBreakpoint(...)</code></a>
210
211
(and related methods) or
212
213
<a href="../Debugger.html#createWatch(java.lang.String, boolean)"><code>Debugger.createWatch(...)</code></a>.
214
215
The debugger must <a href="#break-watch">create</a> an implementation
216
of these objects.
217
218
<li>The debugger should
219
220
<a href="../Debugger.html#addPropertyChangeListener(java.beans.PropertyChangeListener)">fire events</a>
221
222
for a few properties, so that other parts of the system (such as the
223
224
Trace Over
225
226
action) can be sensitive to changes in the debugger's state.
227
228
<li><a name="sysopt-note"></a>Most debuggers (including the standard module) will
229
need to provide certain options not specified in the API, such as
230
whether to compile automatically before debugging; extra class path
231
elements to use; parameters to connect to an external debugger;
232
etc. These should be handled by providing a
233
234
<a href="@OPENIDE@/org/openide/options/doc-files/api.html#make-opt">system option</a>
235
236
in the debugger's module.
237
238
</ol>
239
240
<h3><a name="break-watch">Special breakpoint &amp; watch implementation</a></h3>
241
242
<p>The debugger is not required to do anything for implementation of
243
breakpoints and watches beyond the small interfaces specified in
244
245
<a href="../Breakpoint.html"><code>Breakpoint</code></a>
246
247
and
248
249
<a href="../Watch.html"><code>Watch</code></a>,
250
251
which essentially only specify abstract points in debugged code and
252
request that listeners be notified of changes in these basic
253
properties. These objects need only be created by the main debugger
254
class, as mentioned above.</p>
255
256
<div class="nonnormative">
257
258
<p>However, it is likely that the debugger implementation will want to
259
provide additional functionality, possibly pertaining to these
260
objects. For example:
261
262
<ul>
263
264
<li>Breakpoints could be made conditional, not absolute, based on some
265
(possibly Java) expression to evaluate.
266
267
<li>Threads and thread groups could be explicitly represented.
268
269
<li>Inspection of objects in the debugged process could be provided.
270
271
<li>Watches could be real expressions (say, a function call), not just
272
the name of a variable.
273
274
</ul>
275
276
<p>None of this interferes with the use of the API - the only likely
277
caveat is that the Editor might expect a watch to operate correctly
278
when its expression is an unqualified (local or member) variable name,
279
so this should be considered. (This most common usage of watches is
280
the one that a user will expect anyway.)</p>
281
282
</div>
283
284
<p>Any additional functionality built onto the debugger itself, or
285
onto its breakpoints or watches, ought to be exposed as JavaBeans
286
properties, and events fired upon their change - this convention
287
ensures that if such objects are used by any other part of the system
288
(say, inspected in a property sheet, customized in some action...),
289
that the extended functionality will be properly presented.
290
See the section on
291
292
<a href="#create-xtra">extra implementation</a>
293
294
for ideas on how to present additional functionality.
295
296
<h3><a name="module">Installation tips</a></h3>
297
298
<p>Installation of the debugger itself is quite simple thanks to the
299
300
<a href="@OPENIDE@/org/openide/doc-files/services-api.html#service-lookup">Services API</a> -
301
302
you need only register an instance of it to lookup</p>
303
304
<p class="nonnormative">A typical debugger implementation will, however, want to install
305
some other components to support it, such as a system option
306
(mentioned <a href="#sysopt-note">above</a>), or an environment node
307
to represent the state of the running debugger, its breakpoints and
308
watches, possibly threads, etc. - see the
309
310
<a href="@OPENIDE@/org/openide/nodes/doc-files/api.html#create-mod">Nodes API</a>
311
312
for instructions on doing this.</p>
313
314
<h2><a name="create-xtra">Creating Extra Debugger-Related Implementation</a></h2>
315
316
While the previous section described what is <em>required</em> of
317
the debugger by the APIs, in practice a good debugger module will
318
present more of a user interface than the APIs specify. By default,
319
the implementation of the IDE does not do much with the debugger
320
directly:
321
322
<ol>
323
324
<li><a href="../DebuggerType.Default.html"><code>DebuggerType.Default</code></a>
325
326
is available as a bare-bones
327
328
<a href="#createtype">debugger type</a>
329
330
which just invokes the debugger via the public interface; you may
331
want to write your own debugger types to complement it.
332
333
</ol>
334
335
<div class="nonnormative">
336
337
The following subsections describe things which the IDE
338
implementation does <em>not</em> do automatically, and ideas on how
339
to implement them suitably for your debugger. They are all optional
340
for a compliant debugger implementation, since they affect the UI
341
rather than the interactions of other parts of the IDE with the
342
debugger; most are desirable nevertheless.
343
344
<a href="#createtype">Writing debugger types</a>
345
346
is also a good idea, but is described separately since it may also
347
be done in modules outside of the debugger proper, as debugger
348
types are specific to certain kinds of development support
349
(e.g. RMI, servlet, etc.).
350
351
<h3><a name="curr-line">Handling the current line</a></h3>
352
353
It is desirable (though not strictly required) that a debugger update
354
the Editor to track the current line as it moves through source code
355
(if such movement can be tracked properly, and the current source is
356
available). This is the debugger's responsibility, not the Editor's
357
nor the system's.
358
359
<p>Though different debuggers may of course vary in exactly how they
360
wish to do this, the basic implementation is not difficult once you
361
know where to look:
362
363
<ol>
364
365
<li>Keep track of the current line in a variable of type
366
367
<a href="@OPENIDE@/org/openide/text/Line.html"><code>Line</code></a>,
368
369
which is designed for exactly this sort of purpose. You may use
370
371
<a href="@OPENIDE@/org/openide/text/Line.html#markCurrentLine()"><code>Line.markCurrentLine()</code></a>
372
373
and
374
375
<a href="@OPENIDE@/org/openide/text/Line.html#unmarkCurrentLine()"><code>Line.unmarkCurrentLine()</code></a>
376
377
whenever control enters or exits this line.
378
379
<li>To find the current source file based on the classname,
380
381
<a href="@OPENIDE@/org/openide/filesystems/Repository.html#find(java.lang.String, java.lang.String, java.lang.String)"><code>Repository.find(...)</code></a>
382
383
is easiest. You may instead wish to get all filesystems marked as
384
supporting debugging via
385
386
<a href="@OPENIDE@/org/openide/filesystems/FileSystemCapability.html#DEBUG"><code>FileSystemCapability.DEBUG</code></a>
387
388
and then call
389
390
<a href="@OPENIDE@/org/openide/filesystems/FileSystemCapability.html#find(java.lang.String, java.lang.String, java.lang.String)"><code>FileSystemCapability.find(...)</code></a>
391
392
to find the source file within these filesystems only.
393
394
<li>Knowing the file containing source, the lines in it are available
395
by first getting the data object (with
396
397
<a href="@OPENIDE@/org/openide/loaders/DataObject.html#find(org.openide.filesystems.FileObject)"><code>DataObject.find(...)</code></a>),
398
399
then using
400
401
<a href="@OPENIDE@/org/openide/loaders/DataObject.html#getCookie(java.lang.Class)"><code>DataObject.getCookie(...)</code></a>
402
403
to look for a
404
405
<a href="@OPENIDE@/org/openide/cookies/LineCookie.html"><code>LineCookie</code></a>
406
407
(which ought to have been provided by, e.g., the
408
409
<a href="@OPENIDE@/org/openide/text/EditorSupport.html"><code>EditorSupport</code></a>
410
411
attached by the standard Java loader),
412
413
and finally getting the desired line with
414
415
<a href="@OPENIDE@/org/openide/cookies/LineCookie.html#getLineSet()"><code>LineCookie.getLineSet()</code></a>
416
417
and
418
419
<a href="@OPENIDE@/org/openide/text/Line.Set.html#getOriginal(int)"><code>Line.Set.getOriginal(int)</code></a>
420
421
(which finds the line based on the original line numbering, even if
422
the user has since edited the document).
423
424
</ol>
425
426
<h3><a name="xtra-actions">Adding extra actions</a></h3>
427
428
Many debuggers will provide additional functionality as regards
429
their running state over that specified in the APIs. For example,
430
the standard IDE debugger supports suspending and resuming the
431
debugger, which is not required by the APIs and not accessible via
432
them. For this reason, you may want to create your own user-visible
433
actions to support extended debugger manipulation using the
434
435
<a href="@OPENIDE@/org/openide/actions/doc-files/api.html#create">Actions API</a>.
436
437
<p>The IDE's default menu and toolbar configurations should include
438
the basic (API-supplied) actions in sensible positions. If you do
439
not agree with these positions, or wish to add your own special
440
actions to the menus or toolbars, the Actions API again describes
441
442
<a href="@OPENIDE@/org/openide/actions/doc-files/api.html#adv-install">how to do this</a>.
443
444
<p>Finally, you may want to provide context-menu actions on
445
446
<a href="#env-nodes">any nodes</a>
447
448
which you create for your debugger; if so, please use the
449
450
<a href="@OPENIDE@/org/openide/nodes/doc-files/api.html#create-cookie-act">Nodes API</a>
451
452
for guidance.
453
454
<h3><a name="env-nodes">Adding nodes to "Runtime"</a></h3>
455
456
The standard debugger installs a new master node into the
457
<b>Runtime</b> tab in the Explorer, containing lists of current
458
breakpoints and watches, as well as extra functionality it has such
459
as current threads (and thread groups), and debugging sessions in
460
the case of a multiple-session debugger. Debugger implementors who
461
wish to provide similar functionality should do so themselves;
462
although there is no direct API support for this, in practice
463
creating basic lists of objects is not difficult.
464
465
<p>The basic idea is to use the
466
467
<a href="@OPENIDE@/org/openide/nodes/doc-files/api.html#create">Nodes API</a>
468
469
to create simple lists of all objects in your debugger's current
470
state. For starters, you could create a master node (the one
471
directly under <b>Runtime</b>) as an
472
473
<a href="@OPENIDE@/org/openide/nodes/AbstractNode.html"><code>AbstractNode</code></a>
474
475
using
476
477
<a href="@OPENIDE@/org/openide/nodes/Children.Array.html"><code>Children.Array</code></a>:
478
479
the children can just be listed as is, since you will want one
480
child for each category (breakpoints, watches, etc.).
481
482
<p>Now, each category node (e.g. list of all watches) can again be
483
an <code>AbstractNode</code>, but this time using
484
485
<a href="@OPENIDE@/org/openide/nodes/Children.Keys.html"><code>Children.Keys</code></a>
486
487
so that its children are dynamically determined; in the
488
489
<a href="@OPENIDE@/org/openide/nodes/Children.html#addNotify()"><code>Children.addNotify()</code></a>
490
491
method, call
492
493
<a href="@OPENIDE@/org/openide/nodes/Children.Keys.html#setKeys(java.util.Collection)"><code>Children.Keys.setKeys(Collection)</code></a>
494
495
to update the list of keys. Probably you will want each key to just
496
be one actual watch object from the debugger. Also, attach a
497
listener to your debugger so that when the set of watches changes,
498
<code>setKeys</code> will be called again with the new list of
499
children to update the display. Note that if your implementation
500
supports hidden breakpoints, as determined by
501
502
<a href="../Breakpoint.html#isHidden()"><code>Breakpoint.isHidden()</code></a>,
503
504
then these should of course be excluded from the visible list.
505
506
<p>In the
507
508
<a href="@OPENIDE@/org/openide/nodes/Children.Keys.html#createNodes(java.lang.Object)"><code>Children.Keys.createNodes(Object)</code></a>
509
510
method, you know your key is a watch object, so just use
511
512
<a href="@OPENIDE@/org/openide/nodes/BeanNode.html#BeanNode(java.lang.Object)"><code>new BeanNode(Object)</code></a>
513
514
to represent it. Remember, watches and breakpoints should have
515
bound properties and bean info just like any JavaBean, so using a
516
<code>BeanNode</code> for them should provide all the right
517
behavior automatically. You can also subclass <code>BeanNode</code>
518
and implement
519
520
<a href="@OPENIDE@/org/openide/nodes/BeanNode.html#canDestroy()"><code>BeanNode.canDestroy()</code></a>
521
522
and
523
524
<a href="@OPENIDE@/org/openide/nodes/BeanNode.html#destroy()"><code>BeanNode.destroy()</code></a>
525
526
(etc.) to permit the user to delete watches from this view - the
527
method should simply remove the watch from the debugger, and then
528
the parent node will get routinely notified via its listener of the
529
change and refresh the display.
530
531
<p>Other types of objects such as threads and so on can also be
532
represented in similar ways, but of course the details of how to
533
set up the nodes will vary depending on how you represent such
534
objects; refer to the Nodes API for this.
535
536
<p>Finally, the master node can be installed by your module using the
537
538
<a href="@OPENIDE@/org/openide/modules/doc-files/api.html#sec-environment">Modules API</a>.
539
540
<h3><a name="windows">Adding a debugging workspace, windows, etc.</a></h3>
541
542
You can check how the IDE looks without your debugger module (or
543
the standard debugger module) installed and then decide if you need
544
to customize workspaces, windows, and so on. If you wish, you can
545
create your own customized workspaces and so on for the purpose of
546
giving a characteristic feel and UI to a user's debugging sessions;
547
refer to the
548
549
<a href="@OPENIDE@/org/openide/windows/doc-files/api.html#xml-scenarios">Window System API</a>
550
551
for all details.
552
553
<p>If you wish to provide a window (possibly multitabbed) showing
554
your debugging nodes, the way the standard module does, you can
555
create
556
557
<a href="@OPENIDE@/org/openide/explorer/ExplorerPanel.html"><code>ExplorerPanel</code></a>s
558
559
to hold e.g. a
560
561
<a href="@OPENIDE@/org/openide/explorer/view/BeanTreeView.html"><code>BeanTreeView</code></a>
562
563
and a
564
565
<a href="@OPENIDE@/org/openide/explorer/propertysheet/PropertySheetView.html"><code>PropertySheetView</code></a>,
566
567
then assign the root node to such a window using
568
569
<a href="@OPENIDE@/org/openide/explorer/ExplorerPanel.html#getExplorerManager()"><code>ExplorerPanel.getExplorerManager()</code></a>
570
571
and
572
573
<a href="@OPENIDE@/org/openide/explorer/ExplorerManager.html#setRootContext(org.openide.nodes.Node)"><code>ExplorerManager.setRootContext(Node)</code></a>.
574
575
The multitabbed look can be achieved simply using
576
577
<a href="@OPENIDE@/org/openide/windows/doc-files/api.html#xml-visual">window manager modes</a>.
578
579
<h3><a name="sysop">Adding a system option</a></h3>
580
581
You will probably want to add a
582
583
<a href="@OPENIDE@/org/openide/options/doc-files/api.html#make-opt">system option</a>
584
585
to the IDE representing general configuration of your debugger
586
(specifics of how to debug particular files, such as the path to
587
any required debugger executable, ought to be left to
588
589
<a href="#createtype">debugger types</a>).
590
591
<h3><a name="persistence">Persisting debugger state</a></h3>
592
593
Finally, it is important for the user experience of the IDE that as
594
much as possible of their environment persist across IDE
595
restarts. This is generally done by storing various types of
596
configurations in the project state. In the case of debuggers,
597
conventionally at least the list of breakpoints and watches should
598
be stored, so that a user does not need to set up their debugging
599
environment afresh each time the IDE is restarted. Fortunately,
600
implementing this is rather easy; it is suggested that you:
601
602
<ol>
603
604
<li>Make sure your watches and breakpoints are really safely
605
serializable (as required by the API interfaces).
606
607
<li>Create a bean holding the set of watches and breakpoints
608
as properties. It should be serializable and fire property
609
changes.
610
611
<li><a href="@OPENIDE@/org/openide/doc-files/services-api.html#settings">Register</a>
612
an instance of this bean to lookup. It need not have any visible
613
representation.
614
615
<li>You can now ask lookup for the instance of the bean, and changes
616
should be saved to disk automatically.
617
618
</ol>
619
620
</div>
621
622
<h2><a name="createtype">Creating a Debugger Type</a></h2>
623
624
You may create <em>debugger types</em> in order to provide special
625
support for debugging objects other than simple Java classes with
626
<code>main</code> methods. For example, debugging applets may
627
entail launching the debugger on the AppletViewer application,
628
passing in the HTML URL for the applet to be debugged. (For classes
629
with <code>main</code> methods, the standard default implementation
630
631
<a href="../DebuggerType.Default.html"><code>DebuggerType.Default</code></a>
632
633
suffices.) Thus, debugger types are the bridge between the specifics of how
634
a file should be started (in this way resembling
635
636
<a href="@OPENIDE/EXECUTION@/org/openide/execution/Executor.html"><code>Executor</code></a>s)
637
638
and the debugger implementation (which assumes that it is being started
639
on a class with a <code>main</code> method).
640
641
<p>Creating and installing the debugger type with its associated
642
configuration is a fairly uniform process, according to the
643
644
<a href="@OPENIDE@/org/openide/doc-files/services-api.html">Services API</a>, since
645
646
the required superclass
647
648
<a href="../DebuggerType.html"><code>DebuggerType</code></a>
649
650
is a variety of
651
652
<a href="@OPENIDE@/org/openide/ServiceType.html"><code>ServiceType</code></a>.
653
654
Only issues pertaining specifically to subclassing
655
<code>DebuggerType</code> will be discussed here.
656
657
<p>There is just one abstract method to implement:
658
659
<a href="../DebuggerType.html#startDebugger(org.openide.execution.ExecInfo, boolean)"><code>DebuggerType.startDebugger(ExecInfo,boolean)</code></a>.
660
661
When a user of debugger types (such as <code>ExecSupport</code>,
662
see <a href="#invoke">below</a>) wishes to start debugging some
663
object (say, an applet), it will call this method on the debugger
664
type, passing it an
665
666
<a href="@OPENIDE@/org/openide/loaders/DataObject.html"><code>DataObject</code></a>
667
668
containing the class to be debugged; and a flag indicating whether the
669
debugger should initially break on the "main class" of the object
670
(however that should be interpreted).</p>
671
672
<div class="nonnormative">
673
674
<p>Typically, the debugger type will do a few simple steps:</p>
675
676
<ol>
677
678
<li> Construct a
679
680
<a href="../DebuggerInfo.html#DebuggerInfo(java.lang.String, java.lang.String[])"><code>new DebuggerInfo(...)</code></a>
681
682
according to the information passed in the <code>ExecInfo</code>,
683
as well as the specifics of the debugger type. For example, in the
684
case of applets, the <code>DebuggerInfo</code> should specify the
685
main class as being that of the AppletViewer application, and the
686
class name of the applet should be used to look up an HTML page
687
which can then be passed in the argument list along with other
688
options.
689
690
<li> Handle the stop-on-main flag appropriately. If the flag is
691
clear, typically
692
693
<pre>
694
new DebuggerInfo (mainClass, arguments, null)
695
</pre>
696
697
should be used, to prevent the debugger from breaking except at
698
user-specified points. If the flag is set, you may use the
699
two-argument constructor, but this will break at the beginning of
700
the real main class (e.g. AppletViewer); you may instead prefer to
701
explicitly specify the class to break on, such as the applet class.
702
703
<li> Actually launch the debugger with:
704
705
<pre>
706
TopManager.getDefault ().getDebugger ().startDebugger (myDebugInfo);
707
</pre>
708
709
</ol>
710
711
</div>
712
713
<p>Note that general problems occurring during this problem can be reported with a
714
715
<a href="../DebuggerException.html"><code>DebuggerException</code></a>.
716
717
<p>You have the option of what exactly to include in the
718
<code>DebuggerInfo</code> option passed to the
719
<code>startDebugger</code> method. If the debugger type is to be
720
generic (work with any installed debugger), then you should only
721
assume the API minimum and use an actual instance of
722
<code>DebuggerInfo</code>. But, it is permissible to provide
723
additional debugger-specific information, if that information can
724
be used to good effect by the debugger implementation.</p>
725
726
<p class="nonnormative">For example, the standard IDE debugger actually defines several
727
additional subclasses of <code>DebuggerInfo</code> and provides a
728
special API to these (outside of the Open APIs), such as an
729
extended info which contains descriptions of the exact process name
730
to be used to start the Java launcher in debug mode, special VM
731
options, and so on. It also defines standard debugger-type
732
superclasses which already have all of this configuration present
733
as Bean properties. So, debugger types (such as those for applets)
734
can specify an applet style of debugging, along with special VM
735
characteristics for the user to configure. If the debugger is
736
handed a plain <code>DebuggerInfo</code>, it simply uses default
737
settings for all the specifics; conversely, an extended
738
<code>DebuggerInfo</code> could be passed to an alternate debugger
739
implementation without harm, as the alternate debugger would just
740
not recognize the extra information in the subclass.</p>
741
742
<div class="nonnormative">
743
744
<h2><a name="invoke">Invoking the Debugger</a></h2>
745
746
There is little to say about how to invoke an existing debugger
747
programmatically - the essential methods are all provided in the
748
<code>Debugger</code> interface, and the debugger can be started with
749
only a
750
751
<a href="../DebuggerInfo.html#DebuggerInfo(java.lang.String, java.lang.String[], java.lang.String)">small amount</a>
752
753
of information. The debugger instance itself should be obtained via
754
755
<a href="@OPENIDE@/org/openide/util/Lookup.html"><code>lookup</code></a>
756
757
(currently the system expects only one debugger to be installed at
758
a time; the APIs permit the implementation to keep multiple
759
debuggers loaded with only one active at a time, though currently
760
the implementation does not do this).
761
762
<p>You may also wish to start debugging a particular file by means
763
of its
764
765
<a href="../../cookies/DebuggerCookie.html"><code>DebuggerCookie</code></a>;
766
767
most frequently this implementation is an
768
769
<a href="../../loaders/ExecSupport.html"><code>ExecSupport</code></a>
770
771
which will delegate the request to an associated debugger type,
772
which then launches the system debugger with the correct
773
arguments. This more natural method is that used by the standard
774
debugger-launching actions.
775
776
<p>The
777
778
<a href="@OPENIDE@/org/openide/doc-files/services-api.html#use-find">Services API</a>
779
780
also permits you to look for specific debugger types which could
781
then be applied manually to a specific file.
782
783
</div>
784
785
<h3><a name="hidden-watch">Using hidden watches</a></h3>
786
787
A sophisticated editor implementation, and potentially other
788
components as well, may want to monitor the current value of a
789
variable mentioned in source code (e.g.) while the debugger is in
790
operation. This is possible using a <em>hidden watch</em>, which
791
functions exactly like a regular watch but is not created by the user
792
and not intended for direct display to the user. To create one, just
793
get the debugger and call
794
795
<a href="../Debugger.html#createWatch(java.lang.String, boolean)"><code>Debugger.createWatch(...)</code></a>
796
797
(with the second argument <code>true</code>). Typically the watched
798
expression will be an unqualified variable name, but of course this
799
depends on the watch's use, and what the debugger implementation is
800
capable of handling (only assume bare variable names are supported).
801
802
<p>Now, the current display value of the watch is available with
803
804
<a href="../Watch.html#getAsText()"><code>Watch.getAsText()</code></a>,
805
806
and the
807
808
<a href="../Watch.html#PROP_AS_TEXT">corresponding property</a>
809
810
may be listened to in order to update some user-oriented display (such
811
as a tool tip).
812
813
<p>Remember to call
814
815
<a href="../Watch.html#remove()"><code>Watch.remove()</code></a>
816
817
as soon as the watch is no longer required, so as not to waste memory.
818
819
<hr>@FOOTER@
820
</body>
821
</html>
(-)debuggercore/oldapi/src/org/openide/cookies/DebuggerCookie.java (+30 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.cookies;
15
16
import org.openide.debugger.DebuggerException;
17
import org.openide.nodes.Node;
18
19
/** Cookie for debugger. Any data object or node that supports
20
* debugging can implement this cookie.
21
*
22
* @author Jan Jancura
23
*/
24
public interface DebuggerCookie extends Node.Cookie {
25
    /** Start debugging of associated object.
26
    * @param stopOnMain if <code>true</code>, debugger stops on the first line of debugged code
27
    * @exception DebuggerException if the session cannot be started
28
    */
29
    public void debug (boolean stopOnMain) throws DebuggerException;
30
}
(-)debuggercore/oldapi/src/org/openide/debugger/Breakpoint.java (+109 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
import org.openide.text.Line;
19
import org.openide.src.ConstructorElement;
20
21
/**
22
* Represents one breakpoint.
23
* Breakpoints are created and returned
24
* by the {@link Debugger} implementation. A breakpoint may be assigned either to a source line
25
* of a class, or to a method (or constructor) of a class.
26
* The current set of breakpoints is stored
27
* in the implementation of {@link Debugger}.
28
* <P>
29
* The abstract class contains only the necessary manipulation methods
30
* used by the IDE, like enabling/disabling the breakpoint and obtaining its
31
* position. A good implementation can offer the user much better ways to
32
* deal with the breakpoint (conditional breakpoints, etc.). Such information should
33
* be presented as properties--so it is assumed that the
34
* breakpoint itself is a serializable JavaBean.
35
*
36
*
37
* @author   Jan Jancura, Jaroslav Tulach
38
*/
39
public abstract class Breakpoint implements java.io.Serializable {
40
    /** Property name for validity of the breakpoint. */
41
    public static final String PROP_VALID = "valid"; // NOI18N
42
    /** Property name for enabled status of the breakpoint. */
43
    public static final String PROP_ENABLED = "enabled"; // NOI18N
44
45
    static final long serialVersionUID =4899621215676971003L;
46
    /** Destroy this breakpoint.
47
    * Removes it from the list of all breakpoints in the system.
48
    */
49
    public abstract void remove ();
50
51
    /** Get the line assigned to the breakpoint.
52
    *
53
    * @return the source line or <code>null</code> if no line is specified (it is assigned to a method)
54
    */
55
    public abstract Line getLine ();
56
57
    /** Get the name of the class the breakpoint is in.
58
    *
59
    * @return the class name
60
    */
61
    public abstract String getClassName ();
62
63
    /** Get the method the breakpoint is in.
64
    *
65
    * @return the method (or constructor) element or <code>null</code> if it assigned to a line
66
    */
67
    public abstract ConstructorElement getMethod ();
68
69
    /**
70
    * Test whether the breakpoint is enabled.
71
    *
72
    * @return <code>true</code> if so
73
    */
74
    public abstract boolean isEnabled ();
75
76
    /**
77
    * Set whether the breakpoint is enabled.
78
    *
79
    * @param state <code>true</code> to enable, <code>false</code> to disable
80
    */
81
    public abstract void setEnabled (boolean enabled);
82
83
    /**
84
    * Test whether the breakpoint is valid.
85
    * Invalidity might be caused by an inability to find the class it is supposed to be in, for example.
86
    * @return <code>true</code> if it is valid
87
    */
88
    public abstract boolean isValid ();
89
90
    /** Test whether the breakpoint is hidden.
91
    * If so, it
92
    * is not presented in the list of all breakpoints. Such a breakpoint can be used
93
    * for the IDE's (or some module's) private use, not displaying anything to the user.
94
    * @return <code>true</code> if the breakpoint is hidden
95
    */
96
    public abstract boolean isHidden ();
97
98
    /**
99
    * Add a property change listener.
100
    * @param listener the listener to add
101
    */
102
    public abstract void addPropertyChangeListener (PropertyChangeListener listener);
103
104
    /**
105
    * Remove a property change listener.
106
    * @param listener the listener to remove
107
    */
108
    public abstract void removePropertyChangeListener (PropertyChangeListener listener);
109
}
(-)debuggercore/oldapi/src/org/openide/debugger/Bundle.properties (+17 lines)
Added Link Here
1
#                 Sun Public License Notice
2
# 
3
# The contents of this file are subject to the Sun Public License
4
# Version 1.0 (the "License"). You may not use this file except in
5
# compliance with the License. A copy of the License is available at
6
# http://www.sun.com/
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
10
# Microsystems, Inc. All Rights Reserved.
11
12
# DebuggerType.Default.class - debugger type
13
LAB_DefaultDebuggerType=Default Debugging
14
15
# ExecSupport
16
PROP_debuggerType=Debugger
17
HINT_debuggerType=Style of debugger to use for this file.
(-)debuggercore/oldapi/src/org/openide/debugger/Bundle_ja.properties (+23 lines)
Added Link Here
1
#                 Sun Public License Notice
2
# 
3
# The contents of this file are subject to the Sun Public License
4
# Version 1.0 (the "License"). You may not use this file except in
5
# compliance with the License. A copy of the License is available at
6
# http://www.sun.com/
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
# Microsystems, Inc. All Rights Reserved.
11
12
13
14
15
16
#
17
18
# DebuggerType.Default.class - debugger type
19
20
#
21
# LAB_DefaultDebuggerType=Default Debugging
22
LAB_DefaultDebuggerType=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30d0\u30c3\u30ac
23
(-)debuggercore/oldapi/src/org/openide/debugger/Debugger.java (+227 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
import org.openide.text.Line;
19
import org.openide.src.ConstructorElement;
20
21
/**
22
* Provides a minimal interface between the IDE and a debugger.
23
* It permits
24
* control of the state of the debugger and creation of breakpoints and
25
* watches.
26
* <p>You may find an instance in {@link org.openide.util.Lookup}.
27
* @author   Jan Jancura, Jaroslav Tulach
28
*/
29
public abstract class Debugger {
30
    /** Debugger state when the debugger is not running at all. */
31
    public static final int DEBUGGER_NOT_RUNNING = 1;
32
    /** Debugger state when the debugger is starting to run. */
33
    public static final int DEBUGGER_STARTING = 2;
34
    /** Debugger state when the debugger is running user code. */
35
    public static final int DEBUGGER_RUNNING = 3;
36
    /** Debugger state when the debugger is stopped, for example at a breakpoint. */
37
    public static final int DEBUGGER_STOPPED = 4;
38
39
    /** Name of property for the debugger's state. */
40
    public static final String PROP_STATE = "state"; // NOI18N
41
    /** Name of property for the set of breakpoints in the system. */
42
    public static final String PROP_BREAKPOINTS = "breakpoints"; // NOI18N
43
    /** Name of property for the set of watches in the system. */
44
    public static final String PROP_WATCHES = "watches"; // NOI18N
45
    /** Name of property for the debugger's current line. */
46
    public static final String PROP_CURRENT_LINE = "currentLine"; // NOI18N
47
48
    /** */
49
    public static final int ACTION_BREAKPOINT_HIT = 1;
50
    /** */
51
    public static final int ACTION_TRACE_OVER = 2;
52
    /** */
53
    public static final int ACTION_TRACE_INTO = 3;
54
    /** */
55
    public static final int ACTION_STEP_OUT = 4;
56
57
    /** Start a new debugging session.
58
    * The current debugging session, if any, should be stopped first.
59
    * The provided information specifies the class to start and
60
    * arguments to pass it, and the name of class to stop debugging in, if applicable.
61
    *
62
    * @param info debugger startup info
63
    * @exception DebuggerException if an error occurs while starting the debugger
64
    */
65
    public abstract void startDebugger (DebuggerInfo info) throws DebuggerException;
66
67
    /**
68
    * Finish the debugger session.
69
    * @throws DebuggerException if there was problem during cleanup
70
    */
71
    public abstract void finishDebugger () throws DebuggerException;
72
73
    /**
74
    * Trace into (a statement).
75
    * @throws DebuggerException if there is a problem during execution
76
    */
77
    public abstract void traceInto () throws DebuggerException;
78
79
    /**
80
    * Trace over (a statement).
81
    * @throws DebuggerException if there is a problem during execution
82
    */
83
    public abstract void traceOver () throws DebuggerException;
84
85
    /**
86
    * Go.
87
    * This should continue executing user code until a breakpoint is hit or the debugger finishes.
88
    * @throws DebuggerException if there is a problem during execution
89
    */
90
    public abstract void go () throws DebuggerException;
91
92
    /**
93
    * Step out (of a statement).
94
    * @throws DebuggerException if there is a problem during execution
95
    */
96
    public abstract void stepOut () throws DebuggerException;
97
98
    // BREAKPOINTS
99
100
    /** Create a new breakpoint assigned to a specific line.
101
    * The line is represented by a line object that can change its
102
    * position as the text is modified.
103
    *
104
    * @param l line to create breakpoint at
105
    * @return the new breakpoint
106
    */
107
    public abstract Breakpoint createBreakpoint (Line l);
108
109
    /** Create a new breakpoint assigned to a specific line.
110
    * Allows creation of a hidden breakpoint.
111
    *
112
    * @param l line to create breakpoint at
113
    * @param hidden <code>true</code> if the breakpoint should be hidden from the user
114
    * @return the new breakpoint
115
    */
116
    public abstract Breakpoint createBreakpoint (Line l, boolean hidden);
117
118
    /** Find the breakpoint assigned to a given line.
119
    *
120
    * @param l line to find the breakpoint at
121
    * @return the breakpoint or <code>null</code> if there is no such breakpoint
122
    */
123
    public abstract Breakpoint findBreakpoint (Line l);
124
125
    /** Create a new breakpoint assigned to a method (or constructor).
126
    * The method is represented by a method (or constructor) source element that
127
    * must have a declaring class.
128
    *
129
    * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class
130
    * @return the new breakpoint
131
    * @exception IllegalArgumentException if the method does not have a declaring class
132
    */
133
    public abstract Breakpoint createBreakpoint (ConstructorElement method);
134
135
    /** Create a new breakpoint assigned to a method (or constructor).
136
    * The method is represented by a method (or constructor) source element that
137
    * must have a declaring class.
138
    * Allows creation of a hidden breakpoint.
139
    *
140
    * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class
141
    * @param hidden <code>true</code> if the breakpoint should be hidden from the user
142
    * @return the new breakpoint
143
    * @exception IllegalArgumentException if the method does not have a declaring class
144
    */
145
    public abstract Breakpoint createBreakpoint (ConstructorElement method, boolean hidden);
146
147
    /** Find the breakpoint assigned to a method (or constructor).
148
    *
149
    * @param method method or constructor to find the breakpoint of
150
    * @return the breakpoint or <code>null</code> if there is no such breakpoint
151
    * @exception IllegalArgumentException if the method does not have a declaring class
152
    */
153
    public abstract Breakpoint findBreakpoint (ConstructorElement method);
154
155
    /** Get all breakpoints in the system.
156
    *
157
    * @return all breakpoints
158
    */
159
    public abstract Breakpoint[] getBreakpoints ();
160
161
    /**
162
    * Remove all breakpoints from the system.
163
    */
164
    public abstract void removeAllBreakpoints ();
165
166
167
168
    // WATCHES
169
170
    /** Create new uninitialized watch. The watch is visible (not hidden).
171
    *
172
    * @return the new watch
173
    */
174
    public abstract Watch createWatch ();
175
176
    /** Create a watch with its expression set to an initial value.
177
    * Also
178
    * allows creation of a hidden watch (not presented to the user), for example
179
    * for internal use in the editor to obtain values of variables
180
    * under the mouse pointer.
181
    *
182
    * @param expr expression to watch for (the format is the responsibility of the debugger implementation, but it is typically a variable name)
183
    * @param hidden <code>true</code> if the watch should be hidden from the user
184
    * @return the new watch
185
    */
186
    public abstract Watch createWatch (String expr, boolean hidden);
187
188
    /**
189
    * Get all watches in the system.
190
    *
191
    * @return all watches
192
    */
193
    public abstract Watch[] getWatches ();
194
195
    /**
196
    * Remove all watches from the system.
197
    */
198
    public abstract void removeAllWatches ();
199
200
    // PROPERTIES
201
202
    /** Get the state of the debugger.
203
    *
204
    * @return {@link #DEBUGGER_NOT_RUNNING}, {@link #DEBUGGER_RUNNING}, {@link #DEBUGGER_STOPPED}, or {@link #DEBUGGER_STARTING}
205
    */
206
    public abstract int getState ();
207
208
    /** Get the current line of debugger.
209
    *
210
    * @return current line
211
    */
212
    public abstract Line getCurrentLine ();
213
214
    /**
215
    * Add a property change listener.
216
    *
217
    * @param l the listener to add
218
    */
219
    public abstract void addPropertyChangeListener (PropertyChangeListener l);
220
221
    /**
222
    * Remove a property change listener.
223
    *
224
    * @param l the listener to remove
225
    */
226
    public abstract void removePropertyChangeListener (PropertyChangeListener l);
227
}
(-)debuggercore/oldapi/src/org/openide/debugger/DebuggerException.java (+56 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
/**
17
* An exception occurring in the debugger.
18
* This exception
19
* is thrown in the debugger from all methods which may involve running user code.
20
*
21
* @author   Jan Jancura
22
* @version  0.11, Jan 30, 1998
23
*/
24
public class DebuggerException extends java.lang.reflect.InvocationTargetException {
25
26
    /** generated Serialized Version UID */
27
    static final long serialVersionUID = -3112649137515905742L;
28
29
    /**
30
    * Construct a <code>DebuggerException</code> for a specified inner exception.
31
    * @param throwable the basic exception
32
    */
33
    public DebuggerException (Throwable throwable) {
34
        super (throwable);
35
    }
36
37
    /**
38
    * Construct a <code>DebuggerException</code> with a description.
39
    *
40
    * @param message message text
41
    */
42
    public DebuggerException (String description) {
43
        super (new Exception (), description);
44
    }
45
46
    /**
47
    * Construct a <code>DebuggerException</code> with a description and base error.
48
    *
49
    * @param message description of the exception
50
    * @param throwable original exception
51
    */
52
    public DebuggerException (String description, Throwable throwable) {
53
        super (throwable, description);
54
    }
55
56
}
(-)debuggercore/oldapi/src/org/openide/debugger/DebuggerInfo.java (+97 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
17
/**
18
* Contains information about a class to debug.
19
* Consists of these pieces of information:
20
* <UL>
21
* <LI>the class to run
22
* <LI>parameters for its main method
23
* <LI>a class name to stop execution in, if desired
24
* </UL>
25
*
26
* @author Jan Jancura, Jaroslav Tulach
27
*/
28
public class DebuggerInfo extends org.openide.execution.ExecInfo {
29
    /** class to stop at */
30
    private String stopClassName;
31
32
    /**
33
    * Construct a new <code>DebuggerInfo</code> with the class to run and its parameters specified.
34
    * Sets class to stop in to be the class to run.
35
    *
36
    * @param className name of debugged class
37
    * @param argv command-line arguments used for debugging this class; may be empty but not <code>null</code>
38
    */
39
    public DebuggerInfo (
40
        String className,
41
        String[] argv
42
    ) {
43
        this (
44
            className,
45
            argv,
46
            className
47
        );
48
    }
49
50
    /**
51
    * Construct a new <code>DebuggerInfo</code> with the class to run, parameters, and a class to stop at.
52
    *
53
    * @param className name of debugged class
54
    * @param argv command-line arguments used for debugging this class; may be empty but not <code>null</code>
55
    * @param stopClassName name of class to stop in (may be <code>null</code>)
56
    */
57
    public DebuggerInfo (
58
        String className,
59
        String[] argv,
60
        String stopClassName
61
    ) {
62
        super (className, argv);
63
        this.stopClassName = stopClassName;
64
    }
65
66
    /** Checks whether the method has declaring class.
67
    * @param m method
68
    * @return the same method
69
    * @exception IllegalArgumentException if the stopMethod does not have
70
    *   declaring class
71
    *
72
    private static MethodElement method (MethodElement m) {
73
      if (m.getDeclaringClass () == null) {
74
        throw new IllegalArgumentException ("No declaring class for method: " + m.getName ());
75
      }
76
      return m;
77
}
78
    */
79
80
81
    /** Get the class to stop execution in.
82
    *
83
    * @return the class name or <code>null</code>
84
    */
85
    public String getStopClassName () {
86
        return stopClassName;
87
    }
88
89
    /** Getter for a method to stop at. If the method is not null
90
    * it has a declaring class. So
91
    * @return method or null
92
    *
93
    public MethodElement getStopMethod () {
94
      return stopMethod;
95
}
96
    */
97
}
(-)debuggercore/oldapi/src/org/openide/debugger/DebuggerNotFoundException.java (+34 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
/**
17
* Exception indicating that the debugger itself could not be loaded properly.
18
*
19
* @author   Jan Jancura
20
* @deprecated Not used by anything except deprecated TopManager.
21
*             You may instead find a {@link Debugger} via lookup.
22
*/
23
public class DebuggerNotFoundException extends DebuggerException {
24
25
    /** generated Serialized Version UID */
26
    static final long serialVersionUID = -3112649144515905742L;
27
28
    /**
29
    * Construct a new exception.
30
    */
31
    public DebuggerNotFoundException () {
32
        super (new Exception ());
33
    }
34
}
(-)debuggercore/oldapi/src/org/openide/debugger/DebuggerType.java (+167 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.util.Collections;
17
import java.util.Enumeration;
18
19
import org.openide.execution.ExecInfo;
20
import org.openide.ServiceType;
21
import org.openide.util.HelpCtx;
22
import org.openide.loaders.DataObject;
23
import org.openide.cookies.ArgumentsCookie;
24
import org.openide.util.Lookup;
25
26
/** Defines one debugger type. It has method start that accepts ExecInfo and should
27
* probably create new DebuggerInfo and call Debugger.startDebug (debuggerInfo).
28
* The type should be serializable, so it can be attached to file attributes
29
* of any object that wishes to be especially debugged.
30
*
31
* <p>This class <em>currently</em> has a property editor in the IDE's
32
* default editor search path.
33
* 
34
* @author Jaroslav Tulach
35
*/
36
public abstract class DebuggerType extends ServiceType {
37
    static final long serialVersionUID =-3659300496270314301L;
38
    /** Should start the debugging of this type.
39
    * @param info class and parameters to run
40
    * @param stopOnMain should the debugging stop on main method or go to first breakpoint
41
    * @exception DebuggerException if debugger is not installed or cannot be started
42
    * @deprecated This method is a relic of Java-specific execution. New <code>DebuggerType</code>
43
    *             implementations are encouraged to implement this method to throw an
44
    *             exception, and override {@link #startDebugger(DataObject,boolean)} to be the actual implementation.
45
    */
46
    public abstract void startDebugger (ExecInfo info, boolean stopOnMain) throws DebuggerException;
47
48
    /** Starts debugging for a data object.
49
     * The default implementation assumes this object behaves akin to a Java class
50
     * by having a package-qualified object name and arguments as given by
51
     * {@link ArgumentsCookie} and delegates to {@link #startDebugger(ExecInfo,boolean)}.
52
    * @param obj object to run
53
    * @param stopOnMain should the debugging stop on main method or go to first breakpoint
54
    * @exception DebuggerException if debugger is not installed or cannot be started
55
    */
56
    public void startDebugger(DataObject obj, boolean stopOnMain) throws DebuggerException {
57
        String[] params;
58
        ArgumentsCookie ac = (ArgumentsCookie) obj.getCookie(getKlass("org.openide.cookies.ArgumentsCookie"));
59
        if (ac != null) {
60
            params = ac.getArguments();
61
        } else {
62
            params = new String[0];
63
        }
64
        startDebugger(new ExecInfo(obj.getPrimaryFile().getPackageName ('.'), params), stopOnMain);
65
    }
66
67
    public HelpCtx getHelpCtx () {
68
        return new HelpCtx (DebuggerType.class);
69
    }
70
71
    /** Get all registered executors in the system's execution engine.
72
    * @return enumeration of <code>DebuggerType</code>s
73
    * @deprecated Please use {@link org.openide.util.Lookup} instead.
74
    */
75
    public static Enumeration debuggerTypes () {
76
        return Collections.enumeration(Lookup.getDefault().lookup(new Lookup.Template(DebuggerType.class)).allInstances());
77
    }
78
79
    /** Find the
80
    * debugger implemented as a given class, among the executors registered to the
81
    * execution engine.
82
    * <P>
83
    * This should be used during (de-)serialization
84
    * of the specific debugger for a data object: only store its class name
85
    * and then try to find the debugger implemented by that class later.
86
    *
87
    * @param clazz the class of the debugger looked for
88
    * @return the desired debugger or <code>null</code> if it does not exist
89
    * @deprecated Please use {@link org.openide.util.Lookup} instead.
90
    */
91
    public static DebuggerType find (Class clazz) {
92
        return (DebuggerType)Lookup.getDefault().lookup(clazz);
93
    }
94
95
    /** Find the
96
    * debugger with requested name, among the executors registered to the
97
    * execution engine.
98
    * <P>
99
    * This should be used during (de-)serialization
100
    * of the specific debugger for a data object: only store its name
101
    * and then try to find the debugger later.
102
    *
103
    * @param name (display) name of debugger to find
104
    * @return the desired debugger or <code>null</code> if it does not exist
105
    */
106
    public static DebuggerType find (String name) {
107
        ServiceType.Registry r = (ServiceType.Registry)Lookup.getDefault().lookup(ServiceType.Registry.class);
108
        ServiceType t = r.find (name);
109
        if (t instanceof DebuggerType) {
110
            return (DebuggerType)t;
111
        } else {
112
            return null;
113
        }
114
    }
115
116
    /** Get the default debugger for the system's execution engine.
117
    * <p>You may actually want {@link org.openide.loaders.ExecSupport#getExecutor}.
118
    * @return the default debugger
119
    * @deprecated There is probably not a single debugger type meaningfully applicable to all file types.
120
    *             If you explicitly want to invoke the plain Debugger interfaces, use {@link DebuggerType.Default} instead.
121
    */
122
    public static DebuggerType getDefault () {
123
        Enumeration en = debuggerTypes ();
124
        if (en.hasMoreElements ()) {
125
            return (DebuggerType)en.nextElement ();
126
        } else {
127
            return new Default ();
128
        }
129
    }
130
131
    // lazily loads a class
132
    private final Class getKlass(String name) {
133
        try {
134
            return Class.forName(name, false, getClass().getClassLoader());
135
        } catch (ClassNotFoundException e) {
136
            throw new NoClassDefFoundError(e.getLocalizedMessage());
137
        }
138
    }
139
    
140
    /** Default debugger type. */
141
    public static class Default extends DebuggerType {
142
        static final long serialVersionUID =6286540187114472027L;
143
144
        /* Gets the display name for this debugger type. */
145
        public String displayName() {
146
            return org.openide.util.NbBundle.getBundle(
147
                       Default.class
148
                   ).getString("LAB_DefaultDebuggerType");
149
        }
150
151
        public HelpCtx getHelpCtx () {
152
            return new HelpCtx (Default.class);
153
        }
154
155
        /* Starts the debugger. */
156
        public void startDebugger(ExecInfo info, boolean stopOnMain) throws DebuggerException {
157
            Debugger d = (Debugger)Lookup.getDefault().lookup(Debugger.class);
158
            if (stopOnMain)
159
                d.startDebugger(new DebuggerInfo(
160
                            info.getClassName(), info.getArguments()));
161
            else
162
                d.startDebugger(new DebuggerInfo(
163
                            info.getClassName(), info.getArguments(), null));
164
        }
165
    } // end of inner class DefaultDebuggerType
166
167
}
(-)debuggercore/oldapi/src/org/openide/debugger/Watch.java (+103 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
/** Represents one debugger watch.
19
* It contains only basic information
20
* that can be used by the core of the IDE.
21
* For example, the editor can use this object
22
* to display tooltips above variable names in the edited text.
23
* <P>
24
* It is likely that the real implementation of the watch can offer more
25
* functionality to the user--in which case it should expose properties
26
* as a JavaBean.
27
*
28
* @author   Jan Jancura, Jaroslav Tulach
29
*/
30
public abstract class Watch implements java.io.Serializable {
31
    /** Name of the property for the watched variable name. */
32
    public static final String PROP_VARIABLE_NAME = "variableName"; // NOI18N
33
    /** Name of the property for the value of the watched expression as a string. */
34
    public static final String PROP_AS_TEXT = "asText"; // NOI18N
35
    /** Name of the property for the type of the watch value. */
36
    public static final String PROP_TYPE = "type"; // NOI18N
37
38
39
    static final long serialVersionUID =2309154226451869624L;
40
    /** Remove the watch from the list of all watches in the system.
41
    */
42
    public abstract void remove ();
43
44
    /** Get the name of the variable to watch.
45
    *
46
    * @return the variable name
47
    */
48
    public abstract String getVariableName ();
49
50
    /** Set the variable name to watch.
51
    *
52
    * @param name string name of the variable to watch
53
    */
54
    public abstract void setVariableName (String name);
55
56
    /** Get a textual representation of the value.
57
    * The watch should convert
58
    * the real value to a string representation. So if the watch represents
59
    * a <code>null</code> reference, the returned string will be for example <code>"null"</code>.
60
    *
61
    * @return the value of this watch, or <code>null</code> if the watch is not in scope
62
    */
63
    public abstract String getAsText ();
64
65
    /** Set the value of the watched variable (as text).
66
    *
67
    * @param value text representation of the new value
68
    * @exception DebuggerException if the value cannot be changed, or the
69
    *    string does not represent valid value, or the value type cannot reasonably be set as text
70
    */
71
    public abstract void setAsText (String value) throws DebuggerException;
72
73
    /** Get the string representation of the type of the variable.
74
    *
75
    * @return type string (i.e. the class name, or for a primitive e.g. <code>"int"</code>)
76
    */
77
    public abstract String getType ();
78
79
    /** Test whether the watch is hidden.
80
    * If so, it
81
    * is not presented in the list of all watches. Such a watch can be used
82
    * for the IDE's (or some module's) private use, not displaying anything to the user.
83
    * @return <code>true</code> if the watch is hidden
84
    * @see Debugger#createWatch(String, boolean)
85
    */
86
    public abstract boolean isHidden ();
87
88
    /**
89
    * Add a property change listener.
90
    * Change events should be fired for the properties {@link #PROP_VARIABLE_NAME}, {@link #PROP_AS_TEXT}, and {@link #PROP_TYPE}.
91
    *
92
    * @param l the listener to add
93
    */
94
    public abstract void addPropertyChangeListener (PropertyChangeListener l);
95
96
    /**
97
    * Remove a property change listener.
98
    *
99
    * @param l the listener to remove
100
    */
101
    public abstract void removePropertyChangeListener (PropertyChangeListener l);
102
103
}
(-)debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties (+28 lines)
Added Link Here
1
#                 Sun Public License Notice
2
# 
3
# The contents of this file are subject to the Sun Public License
4
# Version 1.0 (the "License"). You may not use this file except in
5
# compliance with the License. A copy of the License is available at
6
# http://www.sun.com/
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
10
# Microsystems, Inc. All Rights Reserved.
11
12
OpenIDE-Module-Name=Debugger API
13
OpenIDE-Module-Display-Category=Infrastructure
14
OpenIDE-Module-Short-Description=The original Debugger API from the Open APIs.
15
OpenIDE-Module-Long-Description=\
16
    A simple API for controlling basic aspects of debugging. \
17
    Likely to be replaced in the future with a more comprehensive API, \
18
    but available for compatibility purposes in the meantime.
19
20
LAB_DebuggerTypeDefault=Default Debugging
21
HINT_DebuggerTypeDefault=Simple debugging according to the debugger's own preferences.
22
23
LAB_DebuggerType=Debugger Types
24
HINT_DebuggerType=All types of debuggers registered in the system.
25
26
LAB_NoDebugger=(do not debug)
27
# {0} - class name
28
EXC_NoDebugger=The class {0} is not configured to be debugged.\nYou may change this if you wish.
(-)debuggercore/oldapi/src/org/openide/debugger/module/DebuggerType.java (+51 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger.module;
15
16
import java.beans.*;
17
import java.util.ResourceBundle;
18
import org.openide.util.NbBundle;
19
20
/**
21
*
22
* @author jtulach
23
*/
24
public abstract class DebuggerType {
25
    private DebuggerType () {}
26
27
    /** Object that provides beaninfo for {@link DebuggerType.Default}.
28
    *
29
    * @author Jaroslav Tulach
30
    */
31
    public static class DefaultBeanInfo extends SimpleBeanInfo {
32
33
        public BeanDescriptor getBeanDescriptor () {
34
            BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.Default.class);
35
            ResourceBundle bundle = NbBundle.getBundle(DebuggerType.DefaultBeanInfo.class);
36
            descr.setDisplayName (bundle.getString("LAB_DebuggerTypeDefault")); // NOI18N
37
            descr.setShortDescription (bundle.getString("HINT_DebuggerTypeDefault")); // NOI18N
38
            return descr;
39
        }
40
41
        public BeanInfo[] getAdditionalBeanInfo () {
42
            try {
43
                return new BeanInfo[] { Introspector.getBeanInfo (org.openide.debugger.DebuggerType.class) };
44
            } catch (IntrospectionException ie) {
45
                org.openide.ErrorManager.getDefault().notify(ie);
46
                return null;
47
            }
48
        }
49
50
    }
51
}
(-)debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeBeanInfo.java (+58 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger.module;
15
16
import java.awt.Image;
17
import java.beans.*;
18
import java.util.ResourceBundle;
19
20
import org.openide.util.NbBundle;
21
import org.openide.util.Utilities;
22
23
/** Object that provides beaninfo for {@link DebuggerType}.
24
*
25
* @author Jaroslav Tulach
26
*/
27
public class DebuggerTypeBeanInfo extends SimpleBeanInfo {
28
29
    public BeanDescriptor getBeanDescriptor () {
30
        BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.class);
31
        ResourceBundle bundle = NbBundle.getBundle(DebuggerTypeBeanInfo.class);
32
        descr.setDisplayName (bundle.getString ("LAB_DebuggerType")); // NOI18N
33
        descr.setShortDescription (bundle.getString ("HINT_DebuggerType")); // NOI18N
34
        descr.setValue ("helpID", org.openide.debugger.DebuggerType.class.getName ()); // NOI18N
35
        return descr;
36
    }
37
38
    public BeanInfo[] getAdditionalBeanInfo () {
39
        try {
40
            return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) };
41
        } catch (IntrospectionException ie) {
42
            org.openide.ErrorManager.getDefault().notify(ie);
43
            return null;
44
        }
45
    }
46
47
48
    /**
49
    * Return the icon
50
    */
51
    public Image getIcon(int type) {
52
        if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16))
53
            return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes.gif"); // NOI18N
54
        else
55
            return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes32.gif"); // NOI18N
56
    }
57
    
58
}
(-)debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeEditor.java (+79 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger.module;
15
16
import java.io.*;
17
import java.text.MessageFormat;
18
import org.netbeans.beaninfo.editors.NoServiceTypeBeanInfo;
19
import org.netbeans.beaninfo.editors.ServiceTypeEditor;
20
import org.openide.ErrorManager;
21
22
import org.openide.debugger.*;
23
import org.openide.util.HelpCtx;
24
import org.openide.util.NbBundle;
25
import org.openide.execution.ExecInfo;
26
27
/** Support for property editor for DebuggerType.
28
*
29
* @author   Petr Jiricka
30
*/
31
32
public class DebuggerTypeEditor extends ServiceTypeEditor {
33
34
    public static final org.openide.debugger.DebuggerType NO_DEBUGGER = new NoDebugger ();
35
36
    public DebuggerTypeEditor () {
37
        super (org.openide.debugger.DebuggerType.class, "LAB_ChooseServiceType"); // NOI18N
38
    }
39
40
    /** Accessor for creating instance */
41
    public static org.openide.debugger.DebuggerType getNoDebugger() {
42
        return NO_DEBUGGER;
43
    }
44
    
45
    public static final class NoDebugger extends org.openide.debugger.DebuggerType {
46
47
        static final long serialVersionUID =-6872256326426790372L;
48
        private NoDebugger () {
49
        }
50
51
        protected String displayName () {
52
            return NbBundle.getBundle (DebuggerTypeEditor.class).getString ("LAB_NoDebugger");
53
        }
54
55
        public HelpCtx getHelpCtx () {
56
            return new HelpCtx (NoDebugger.class);
57
        }
58
59
        public void startDebugger (final ExecInfo info, boolean ign) throws DebuggerException {
60
            DebuggerException e = new DebuggerException("do not debug"); // NOI18N
61
            ErrorManager.getDefault().annotate(e, NbBundle.getMessage(DebuggerTypeEditor.class, "EXC_NoDebugger", info.getClassName()));
62
            throw e;
63
        }
64
65
        private Object readResolve () throws ObjectStreamException {
66
            return NO_DEBUGGER;
67
        }
68
69
    }
70
71
    public static final class NoDebuggerBeanInfo extends NoServiceTypeBeanInfo {
72
73
        protected String iconResource () {
74
            return "/org/netbeans/beaninfo/editors/resources/noDebugger.gif"; // NOI18N
75
        }
76
77
    }
78
79
}
(-)debuggercore/oldapi/src/org/openide/debugger/module/Install.java (+44 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger.module;
15
16
import java.beans.Introspector;
17
import java.beans.PropertyEditorManager;
18
19
import org.openide.modules.ModuleInstall;
20
21
public class Install extends ModuleInstall {
22
    
23
    /** Make sure BeanInfo and PropertyEditor for DebuggerType can be found.
24
     */
25
    public void restored() {
26
        String[] sysbisp = Introspector.getBeanInfoSearchPath();
27
        String[] nbbisp = new String[] {
28
            "org.openide.debugger.module", // NOI18N
29
        };
30
        String[] allbisp = new String[sysbisp.length + nbbisp.length];
31
        System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length);
32
        System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length);
33
        Introspector.setBeanInfoSearchPath(allbisp);
34
        String[] syspesp = PropertyEditorManager.getEditorSearchPath();
35
        String[] nbpesp = new String[] {
36
            "org.openide.debugger.module", // NOI18N
37
        };
38
        String[] allpesp = new String[syspesp.length + nbpesp.length];
39
        System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length);
40
        System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length);
41
        PropertyEditorManager.setEditorSearchPath(allpesp);
42
    }
43
    
44
}
(-)debuggercore/oldapi/src/org/openide/debugger/module/layer.xml (+27 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
15
<filesystem>
16
    <folder name="Services">
17
        <folder name="NoOps">
18
            <file name="NoDebugger.instance">
19
              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.beaninfo.editors.Bundle"/>
20
              <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/beaninfo/editors/resources/noDebugger.gif"/>
21
              <attr name="instanceOf" stringvalue="org.openide.ServiceType,org.openide.debugger.DebuggerType,org.openide.debugger.module.DebuggerTypeEditor$NoDebugger"/>
22
              <attr name="instanceClass" stringvalue="org.openide.debugger.module.DebuggerTypeEditor$NoDebugger"/>
23
              <attr name="instanceCreate" methodvalue="org.openide.debugger.module.DebuggerTypeEditor.getNoDebugger"/>
24
            </file>
25
        </folder>
26
    </folder>
27
</filesystem>
(-)debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java (+243 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.loaders;
15
16
import java.beans.*;
17
import java.awt.event.*;
18
import java.io.IOException;
19
import java.lang.reflect.InvocationTargetException;
20
21
import org.openide.*;
22
import org.openide.compiler.*;
23
import org.openide.compiler.Compiler;
24
import org.openide.debugger.*;
25
import org.openide.execution.*;
26
import org.openide.explorer.propertysheet.*;
27
import org.openide.filesystems.*;
28
import org.openide.cookies.CompilerCookie;
29
import org.openide.cookies.DebuggerCookie;
30
import org.openide.nodes.Sheet;
31
import org.openide.nodes.PropertySupport;
32
import org.openide.util.NbBundle;
33
import org.openide.util.Mutex;
34
import org.openide.util.Lookup;
35
36
/** Support for execution and debugging.
37
* Use {@link org.openide.loaders.ExecutionSupport} unless you need support for debugging too.
38
* @author Jaroslav Tulach, Jesse Glick
39
*/
40
public class ExecSupport extends ExecutionSupport
41
    implements DebuggerCookie {
42
    /** extended attribute for debugger type */
43
    private static final String EA_DEBUGGER_TYPE = "NetBeansAttrDebuggerType"; // NOI18N
44
45
    /** Name of property providing a custom {@link DebuggerType} for a file. */
46
    public static final String PROP_DEBUGGER_TYPE     = "debuggerType"; // NOI18N
47
48
    /** @deprecated use {@link #getEntry} */
49
    protected MultiDataObject.Entry entry;
50
    /** @deprecated useless */
51
    protected boolean isReadOnly;
52
53
    /** Create new support for given entry. The file is taken from the
54
    * entry and is updated if the entry moves or renames itself.
55
    * @param entry entry to create instance from
56
    */
57
    public ExecSupport (MultiDataObject.Entry entry) {
58
        super(entry);
59
        this.entry = entry;
60
        Boolean ro = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES);
61
        isReadOnly = (ro == null)?false:(!ro.booleanValue());
62
    }
63
64
    /* Start debugging of associated object.
65
    * @param stopOnMain if <code>true</code>, debugger stops on the first line of debugged code
66
    * @exception DebuggerException if the session cannot be started
67
    */
68
    public void debug (final boolean stopOnMain) throws DebuggerException {
69
        DebuggerType t = getDebuggerType (entry);
70
        if (t == null) {
71
            t = defaultDebuggerType ();
72
        }
73
74
        try {
75
            t.startDebugger (entry.getDataObject(), stopOnMain);
76
            // ok, debugger started
77
            return;
78
        } catch (final DebuggerException ex) {
79
            try {
80
                Mutex.EVENT.readAccess (new Mutex.ExceptionAction () {
81
                                            public Object run () throws DebuggerException {
82
                                                if (debugFailed (ex)) {
83
                                                    // restart
84
                                                    debug (stopOnMain);
85
                                                }
86
                                                return null;
87
                                            }
88
                                        });
89
            } catch (org.openide.util.MutexException mx) {
90
                if (mx.getException() instanceof DebuggerException) {
91
                    throw (DebuggerException)mx.getException();
92
                } else {
93
                    throw new DebuggerException(mx.getException());
94
                }
95
            }
96
        }
97
    }
98
99
    /** Check if this object is up to date or in need of compilation.
100
    * Should compile it if necessary.
101
    * <p>The default implementation checks whether {@link CompilerCookie} is provided and
102
    * if so, creates a job and compiles the object. This behavior may be 
103
    * overridden by subclasses.
104
    *
105
    * @return <code>true</code> if the object was successfully brought up to date, <code>false</code> if the attempt failed (and it may be still be out of date)
106
    * @deprecated The check should be done in an action - ExecAction, ...
107
    */
108
    protected boolean checkCompiled () {
109
        DataObject obj = entry.getDataObject ();
110
111
        CompilerCookie c = (CompilerCookie)obj.getCookie (CompilerCookie.class);
112
113
        if (c != null) {
114
            CompilerJob job = new CompilerJob (Compiler.DEPTH_ZERO);
115
            job.setDisplayName (obj.getName ());
116
            c.addToJob (job, Compiler.DEPTH_ZERO);
117
            if (!job.isUpToDate ()) {
118
                // add name
119
                // compile it
120
                CompilerTask t = job.start ();
121
                return t.isSuccessful ();
122
            }
123
        }
124
        return true;
125
    }
126
127
    /** Called when invocation of the debugger fails. Allows to do some
128
    * modifications to the type of debugging and try it again.
129
    *
130
    * @param ex exeception that occured during execution
131
    * @return true if the debugging should be started again
132
    */
133
    protected boolean debugFailed (DebuggerException ex) {
134
        DebuggerType e = (DebuggerType)choose (getDebuggerType (entry), DebuggerType.class, ex);
135
        if (e == null) {
136
            return false;
137
        } else {
138
            try {
139
                setDebuggerType (entry, e);
140
                return true;
141
            } catch (IOException exc) {
142
                return false;
143
            }
144
        }
145
    }
146
147
    /** This method allows subclasses to override the default
148
    * debugger type they want to use for debugging.
149
    *
150
    * @return current implementation returns DebuggerType.getDefault ()
151
    */
152
    protected DebuggerType defaultDebuggerType () {
153
        return DebuggerType.getDefault ();
154
    }
155
156
    //
157
    // debugger support
158
    //
159
160
    /** Assignes a debugger type to an entry.
161
    * @param entry the object's entry
162
    * @param type the debugger type for this entry
163
    * @exception IOException if arguments cannot be set
164
    */
165
    public static void setDebuggerType (MultiDataObject.Entry entry, DebuggerType type) throws IOException {
166
        entry.getFile ().setAttribute (EA_DEBUGGER_TYPE,
167
                                       type == null ? null : new ServiceType.Handle (type)
168
                                      );
169
    }
170
171
    /** Retrieves the debugger type for this entry.
172
    * @param entry the entry
173
    * @return the debugger type or null if no type assigned
174
    */
175
    public static DebuggerType getDebuggerType (MultiDataObject.Entry entry) {
176
        Object handle = entry.getFile ().getAttribute (EA_DEBUGGER_TYPE);
177
        if (handle != null && (handle instanceof ServiceType.Handle)) {
178
            ServiceType dbg = ((ServiceType.Handle) handle).getServiceType ();
179
            if (dbg instanceof DebuggerType) {
180
                return (DebuggerType) dbg;
181
            }
182
        }
183
        
184
        Lookup l = Environment.find (entry.getDataObject ());
185
        DebuggerType dt = (DebuggerType)l.lookup (DebuggerType.class);
186
        if (dt != null) {
187
            return dt;
188
        }
189
        
190
        return null;
191
    }
192
193
    /** Helper method that creates default properties for execution of
194
    * a given support.
195
    * Includes properties to set the executor; debugger; and arguments.
196
    *
197
    * @param set sheet set to add properties to
198
    */
199
    public void addProperties (Sheet.Set set) {
200
        super.addProperties(set);
201
        set.put(createDebuggerProperty ());
202
    }
203
204
    /** Creates the debugger property for entry.
205
    * @return the property
206
    */
207
    private PropertySupport createDebuggerProperty () {
208
        return new PropertySupport.ReadWrite (
209
                   PROP_DEBUGGER_TYPE,
210
                   DebuggerType.class,
211
                   NbBundle.getMessage(DebuggerType.class, "PROP_debuggerType"),
212
                   NbBundle.getMessage(DebuggerType.class, "HINT_debuggerType")
213
               ) {
214
                   public Object getValue() {
215
                       DebuggerType dt = getDebuggerType (entry);
216
                       if (dt == null)
217
                           return defaultDebuggerType ();
218
                       else
219
                           return dt;
220
                   }
221
                   public void setValue (Object val) throws InvocationTargetException {
222
                       try {
223
                           setDebuggerType (entry, (DebuggerType) val);
224
                       } catch (IOException ex) {
225
                           throw new InvocationTargetException (ex);
226
                       }
227
                   }
228
                   public boolean supportsDefaultValue () {
229
                       return true;
230
                   }
231
232
                   public void restoreDefaultValue () throws InvocationTargetException {
233
                       setValue (null);
234
                   }
235
                   
236
                   public boolean canWrite () {
237
                       Boolean isReadOnly = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES);
238
                       return (isReadOnly == null)?false:(!isReadOnly.booleanValue());
239
                   }
240
               };
241
    }
242
243
}
(-)debuggercore/src/org/netbeans/modules/debugger/delegator/DelegatingDebugger.java (-2 lines)
Lines 30-36 Link Here
30
import org.openide.DialogDescriptor;
30
import org.openide.DialogDescriptor;
31
import org.openide.ErrorManager;
31
import org.openide.ErrorManager;
32
import org.openide.NotifyDescriptor;
32
import org.openide.NotifyDescriptor;
33
import org.openide.actions.StartDebuggerAction;
34
import org.openide.debugger.*;
33
import org.openide.debugger.*;
35
import org.openide.text.Line;
34
import org.openide.text.Line;
36
import org.openide.util.NbBundle;
35
import org.openide.util.NbBundle;
Lines 39-45 Link Here
39
import org.openide.windows.InputOutput;
38
import org.openide.windows.InputOutput;
40
import org.openide.windows.WindowManager;
39
import org.openide.windows.WindowManager;
41
import org.openide.windows.Workspace;
40
import org.openide.windows.Workspace;
42
import org.openide.actions.StartDebuggerAction;
43
import org.openide.src.ClassElement;
41
import org.openide.src.ClassElement;
44
import org.openide.src.ConstructorElement;
42
import org.openide.src.ConstructorElement;
45
43
(-)debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseDebugger.java (-1 lines)
Lines 24-30 Link Here
24
import org.openide.TopManager;
24
import org.openide.TopManager;
25
import org.openide.DialogDescriptor;
25
import org.openide.DialogDescriptor;
26
import org.openide.NotifyDescriptor;
26
import org.openide.NotifyDescriptor;
27
import org.openide.actions.StartDebuggerAction;
28
import org.openide.debugger.*;
27
import org.openide.debugger.*;
29
import org.openide.text.Line;
28
import org.openide.text.Line;
30
import org.openide.util.actions.SystemAction;
29
import org.openide.util.actions.SystemAction;
(-)debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseModule.java (-1 lines)
Lines 21-27 Link Here
21
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.nodes.*;
21
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.nodes.*;
22
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaProjectSettings;
22
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaProjectSettings;
23
23
24
import org.openide.actions.StartDebuggerAction;
25
import org.openide.util.actions.SystemAction;
24
import org.openide.util.actions.SystemAction;
26
import org.openide.debugger.DebuggerException;
25
import org.openide.debugger.DebuggerException;
27
import org.openide.loaders.*;
26
import org.openide.loaders.*;
(-)debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml (-8 / +15 lines)
Lines 18-25 Link Here
18
    <folder name="Actions">
18
    <folder name="Actions">
19
        <folder name="Debug">
19
        <folder name="Debug">
20
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.core.Bundle" />
20
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.core.Bundle" />
21
            <file name="org-openide-actions-AddWatchAction.instance"/>
21
            <file name="org-netbeans-modules-debugger-support-actions-AddWatchAction.instance"/>
22
            <file name="org-openide-actions-ToggleBreakpointAction.instance"/>
22
            <file name="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction.instance"/>
23
            <file name="org-netbeans-modules-debugger-support-actions-FinishAction.instance"/>
23
            <file name="org-netbeans-modules-debugger-support-actions-FinishAction.instance"/>
24
            
24
            
25
            <file name="org-netbeans-modules-debugger-support-actions-RunToCursorAction.instance"/>
25
            <file name="org-netbeans-modules-debugger-support-actions-RunToCursorAction.instance"/>
Lines 122-129 Link Here
122
            
122
            
123
            <attr name="Separator6.instance/org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance" boolvalue="true" />
123
            <attr name="Separator6.instance/org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance" boolvalue="true" />
124
            <file name="org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance" />
124
            <file name="org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance" />
125
            <attr name="org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance/org-openide-actions-AddWatchAction.instance" boolvalue="true" />
125
            <attr name="org-netbeans-modules-debugger-support-actions-AddBreakpointAction.instance/org-netbeans-modules-debugger-support-actions-AddWatchAction.instance" boolvalue="true" />
126
            <file name="org-openide-actions-AddWatchAction.instance"/>
126
            <file name="org-netbeans-modules-debugger-support-actions-AddWatchAction.instance"/>
127
127
128
        </folder>
128
        </folder>
129
        <attr name="Debug/Tools" boolvalue="true" />
129
        <attr name="Debug/Tools" boolvalue="true" />
Lines 173-180 Link Here
173
            <attr name="org-netbeans-modules-debugger-support-actions-RunToCursorAction.instance/org-netbeans-modules-debugger-support-actions-FixAction.instance" boolvalue="true" />
173
            <attr name="org-netbeans-modules-debugger-support-actions-RunToCursorAction.instance/org-netbeans-modules-debugger-support-actions-FixAction.instance" boolvalue="true" />
174
            <file name="org-netbeans-modules-debugger-support-actions-FixAction.instance" />
174
            <file name="org-netbeans-modules-debugger-support-actions-FixAction.instance" />
175
175
176
            <attr name="org-netbeans-modules-debugger-support-actions-FixAction.instance/org-openide-actions-AddWatchAction.instance" boolvalue="true" />
176
            <attr name="org-netbeans-modules-debugger-support-actions-FixAction.instance/org-netbeans-modules-debugger-support-actions-AddWatchAction.instance" boolvalue="true" />
177
            <file name="org-openide-actions-AddWatchAction.instance"/>
177
            <file name="org-netbeans-modules-debugger-support-actions-AddWatchAction.instance"/>
178
        </folder>
178
        </folder>
179
179
180
        <folder name="View">
180
        <folder name="View">
Lines 188-197 Link Here
188
    <folder name="Shortcuts">
188
    <folder name="Shortcuts">
189
189
190
        <file name="S-F8.instance">
190
        <file name="S-F8.instance">
191
	    <attr name="instanceClass" stringvalue="org.openide.actions.ToggleBreakpointAction"/>
191
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"/>
192
	</file>
192
	</file>
193
        <file name="CS-F7.instance">
193
        <file name="CS-F7.instance">
194
	    <attr name="instanceClass" stringvalue="org.openide.actions.AddWatchAction"/>
194
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.debugger.support.actions.AddWatchAction"/>
195
	</file>
195
	</file>
196
        <file name="CS-F8.instance">
196
        <file name="CS-F8.instance">
197
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.debugger.support.actions.AddBreakpointAction"/>
197
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.debugger.support.actions.AddBreakpointAction"/>
Lines 352-357 Link Here
352
            <folder name="x-java">
352
            <folder name="x-java">
353
                <folder name="ToolTips">
353
                <folder name="ToolTips">
354
                    <file name="org-netbeans-modules-debugger-support-java-ToolTipAnnotation.instance"/>
354
                    <file name="org-netbeans-modules-debugger-support-java-ToolTipAnnotation.instance"/>
355
                </folder>
356
                <folder name="Popup">
357
                    <attr name="Separator7.instance/org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction.instance" boolvalue="true"/>
358
                    <file name="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction.instance"/>
359
                    <attr name="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction.instance/org-netbeans-modules-debugger-support-actions-AddWatchAction.instance" boolvalue="true"/>
360
                    <file name="org-netbeans-modules-debugger-support-actions-AddWatchAction.instance"/>
361
                    <attr name="org-netbeans-modules-debugger-support-actions-AddWatchAction.instance/Separator8.instance" boolvalue="true"/>
355
                </folder>
362
                </folder>
356
            </folder>
363
            </folder>
357
        </folder>
364
        </folder>
(-)debuggercore/src/org/netbeans/modules/debugger/support/DebuggerContextSettings.java (-1 / +5 lines)
Lines 15-27 Link Here
15
15
16
import org.netbeans.modules.debugger.Register;
16
import org.netbeans.modules.debugger.Register;
17
import org.openide.options.ContextSystemOption;
17
import org.openide.options.ContextSystemOption;
18
import org.openide.actions.StartDebuggerAction;
19
import org.openide.debugger.DebuggerNotFoundException;
18
import org.openide.debugger.DebuggerNotFoundException;
20
import org.openide.execution.NbClassPath;
19
import org.openide.execution.NbClassPath;
21
import org.openide.TopManager;
20
import org.openide.TopManager;
22
import org.openide.util.NbBundle;
21
import org.openide.util.NbBundle;
23
import org.openide.util.HelpCtx;
22
import org.openide.util.HelpCtx;
24
import org.netbeans.modules.debugger.support.nodes.DebuggerWindow;
23
import org.netbeans.modules.debugger.support.nodes.DebuggerWindow;
24
import org.openide.util.SharedClassObject;
25
25
26
/**
26
/**
27
* Settings for java debugger.
27
* Settings for java debugger.
Lines 55-60 Link Here
55
     */
55
     */
56
    public static final String PROP_DW_ORIENTATION = "dwOrientation";
56
    public static final String PROP_DW_ORIENTATION = "dwOrientation";
57
57
58
    public static DebuggerContextSettings getDefault() {
59
        return (DebuggerContextSettings)SharedClassObject.findObject(DebuggerContextSettings.class, true);
60
    }
61
    
58
    /* SERIALIZATION
62
    /* SERIALIZATION
59
    public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException {
63
    public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException {
60
        S ystem.out.println("DebuggerContextSettings.writeExternal");
64
        S ystem.out.println("DebuggerContextSettings.writeExternal");
(-)debuggercore/src/org/netbeans/modules/debugger/support/DebuggerModule.java (-9 / +1 lines)
Lines 31-37 Link Here
31
import org.netbeans.modules.debugger.delegator.DelegatingDebuggerImpl;
31
import org.netbeans.modules.debugger.delegator.DelegatingDebuggerImpl;
32
32
33
import org.openide.awt.*;
33
import org.openide.awt.*;
34
import org.openide.actions.*;
35
import org.openide.debugger.*;
34
import org.openide.debugger.*;
36
import org.openide.explorer.*;
35
import org.openide.explorer.*;
37
import org.openide.explorer.propertysheet.*;
36
import org.openide.explorer.propertysheet.*;
Lines 211-218 Link Here
211
            setActionPerformer (new AddWatchPerformer ());
210
            setActionPerformer (new AddWatchPerformer ());
212
        ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)).
211
        ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)).
213
            setActionPerformer (new DebuggerWindowPerformer ());
212
            setActionPerformer (new DebuggerWindowPerformer ());
214
        ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)).
215
            setMultisession (true);
216
        register ();
213
        register ();
217
    }
214
    }
218
215
Lines 234-241 Link Here
234
            Register.setDebuggerCoreImpl (new DelegatingDebuggerImpl ());
231
            Register.setDebuggerCoreImpl (new DelegatingDebuggerImpl ());
235
        ((AddWatchAction) SystemAction.get (AddWatchAction.class)).
232
        ((AddWatchAction) SystemAction.get (AddWatchAction.class)).
236
            setActionPerformer (new AddWatchPerformer ());
233
            setActionPerformer (new AddWatchPerformer ());
237
        ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)).
238
            setMultisession (true);
239
        ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)).
234
        ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)).
240
            setActionPerformer (new DebuggerWindowPerformer ());
235
            setActionPerformer (new DebuggerWindowPerformer ());
241
        register ();
236
        register ();
Lines 246-254 Link Here
246
241
247
    /** Module was uninstalled. */
242
    /** Module was uninstalled. */
248
    public void uninstalled () {
243
    public void uninstalled () {
249
        ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)).
250
            setMultisession (false);
251
     
252
        // Remove all breakpoints.
244
        // Remove all breakpoints.
253
        BreakpointGroup group = Register.getCoreDebugger ().getRootBreakpointGroup ();
245
        BreakpointGroup group = Register.getCoreDebugger ().getRootBreakpointGroup ();
254
        int x;
246
        int x;
Lines 350-356 Link Here
350
    
342
    
351
    public static void changeWorkspace () {
343
    public static void changeWorkspace () {
352
        WindowManager dp = TopManager.getDefault ().getWindowManager ();
344
        WindowManager dp = TopManager.getDefault ().getWindowManager ();
353
        Workspace d = dp.findWorkspace (org.openide.actions.StartDebuggerAction.getWorkspace());
345
        Workspace d = dp.findWorkspace (DebuggerContextSettings.getDefault().getDesktop());
354
        if (d != null) d.activate ();
346
        if (d != null) d.activate ();
355
    }
347
    }
356
}
348
}
(-)debuggercore/src/org/netbeans/modules/debugger/support/DebuggerSettings.java (-5 / +17 lines)
Lines 14-20 Link Here
14
package org.netbeans.modules.debugger.support;
14
package org.netbeans.modules.debugger.support;
15
15
16
import org.openide.options.SystemOption;
16
import org.openide.options.SystemOption;
17
import org.openide.actions.StartDebuggerAction;
18
import org.openide.debugger.DebuggerNotFoundException;
17
import org.openide.debugger.DebuggerNotFoundException;
19
import org.openide.execution.NbClassPath;
18
import org.openide.execution.NbClassPath;
20
import org.openide.util.NbBundle;
19
import org.openide.util.NbBundle;
Lines 22-27 Link Here
22
21
23
22
24
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaDebuggerSettings;
23
/*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaDebuggerSettings;
24
import org.openide.util.SharedClassObject;
25
25
26
/**
26
/**
27
 * Settings for java debugger. Used for backward compatibility only.
27
 * Settings for java debugger. Used for backward compatibility only.
Lines 53-60 Link Here
53
    
53
    
54
    public static final String PROP_RUN_COMPILATION = "runCompilation"; // NOI18N
54
    public static final String PROP_RUN_COMPILATION = "runCompilation"; // NOI18N
55
55
56
    public static DebuggerSettings getDefault() {
57
        return (DebuggerSettings)SharedClassObject.findObject(DebuggerSettings.class, true);
58
    }
59
    
60
    protected void initialize() {
61
        super.initialize();
62
        putProperty(PROP_RUN_MULTISESSION, Boolean.TRUE, false);
63
    }
64
56
    // backward compability
65
    // backward compability
66
    /*
57
    private boolean runCompilation = true;
67
    private boolean runCompilation = true;
68
     */
58
    
69
    
59
    /* SERIALIZATION
70
    /* SERIALIZATION
60
    public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException {
71
    public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException {
Lines 98-103 Link Here
98
109
99
    /**
110
    /**
100
    * Getter for desktop property. 
111
    * Getter for desktop property. 
112
     * @deprecated See {@link DebuggerContextSettings#getDesktop}
101
    */
113
    */
102
    public String getDesktop () {
114
    public String getDesktop () {
103
        return (String) getProperty (PROP_DESKTOP);
115
        return (String) getProperty (PROP_DESKTOP);
Lines 105-110 Link Here
105
117
106
    /**
118
    /**
107
    * Setter for desktop property. 
119
    * Setter for desktop property. 
120
     * @deprecated See {@link DebuggerContextSettings#setDesktop}
108
    */
121
    */
109
    public void setDesktop (String desktop) {
122
    public void setDesktop (String desktop) {
110
        putProperty (PROP_DESKTOP, desktop, true);
123
        putProperty (PROP_DESKTOP, desktop, true);
Lines 136-149 Link Here
136
    
149
    
137
    public boolean getRunCompilation () {
150
    public boolean getRunCompilation () {
138
        Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION);
151
        Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION);
139
        return (b != null) ? b.booleanValue () : StartDebuggerAction.getRunCompilation ();
152
        if (b != null) return b.booleanValue();
153
/*//REFACTOR*/        return JavaDebuggerSettings.getDefault().getRunCompilation ();
140
    }
154
    }
141
    
155
    
142
    public void setRunCompilation (boolean value) {
156
    public void setRunCompilation (boolean value) {
143
        putProperty (PROP_RUN_COMPILATION, value ? Boolean.TRUE : Boolean.FALSE, true);
157
        putProperty (PROP_RUN_COMPILATION, value ? Boolean.TRUE : Boolean.FALSE, true);
144
  /*//REFACTOR*/      JavaDebuggerSettings settings = ((JavaDebuggerSettings) JavaDebuggerSettings.findObject 
158
/*//REFACTOR*/        JavaDebuggerSettings.getDefault().setRunCompilation (value);
145
  /*//REFACTOR*/       (JavaDebuggerSettings.class, true));
146
/*//REFACTOR*/        settings.setRunCompilation (value);
147
    }
159
    }
148
160
149
    
161
    
(-)debuggercore/src/org/netbeans/modules/debugger/support/DelegatingDebugger.java (-2 lines)
Lines 30-36 Link Here
30
import org.openide.DialogDescriptor;
30
import org.openide.DialogDescriptor;
31
import org.openide.ErrorManager;
31
import org.openide.ErrorManager;
32
import org.openide.NotifyDescriptor;
32
import org.openide.NotifyDescriptor;
33
import org.openide.actions.StartDebuggerAction;
34
import org.openide.debugger.*;
33
import org.openide.debugger.*;
35
import org.openide.text.Line;
34
import org.openide.text.Line;
36
import org.openide.util.NbBundle;
35
import org.openide.util.NbBundle;
Lines 38-44 Link Here
38
import org.openide.util.actions.*;
37
import org.openide.util.actions.*;
39
import org.openide.windows.InputOutput;
38
import org.openide.windows.InputOutput;
40
import org.openide.windows.WindowManager;
39
import org.openide.windows.WindowManager;
41
import org.openide.actions.StartDebuggerAction;
42
import org.openide.src.ClassElement;
40
import org.openide.src.ClassElement;
43
import org.openide.src.ConstructorElement;
41
import org.openide.src.ConstructorElement;
44
42
(-)debuggercore/src/org/netbeans/modules/debugger/support/actions/AddWatchAction.java (+55 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.modules.debugger.support.actions;
15
16
import java.util.Locale;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.NbBundle;
19
import org.openide.util.actions.CallbackSystemAction;
20
21
// XXX should this still be a CallbackSystemAction? Does anyone set a performer
22
// other than DebuggerModule.restored?
23
24
/** Add a debugger watch.
25
*
26
* @author   Jan Jancura
27
*/
28
public class AddWatchAction extends CallbackSystemAction {
29
    /** generated Serialized Version UID */
30
    static final long serialVersionUID = 4192338605369205946L;
31
32
    protected void initialize() {
33
        super.initialize();
34
        // XXX revisit:
35
        setSurviveFocusChange(true);
36
    }
37
38
    /* @return the action's icon */
39
    public String getName() {
40
        return NbBundle.getMessage(AddWatchAction.class, "AddWatch");
41
    }
42
43
    /* @return the action's help context */
44
    public HelpCtx getHelpCtx() {
45
        return new HelpCtx (AddWatchAction.class);
46
    }
47
48
    /* Icon resource.
49
    * @return name of resource for icon
50
    */
51
    protected String iconResource () {
52
        return "org/openide/resources/actions/addWatch.gif"; // NOI18N
53
    }
54
55
}
(-)debuggercore/src/org/netbeans/modules/debugger/support/actions/Bundle.properties (+6 lines)
Lines 154-156 Link Here
154
CTL_Pop_topmost_frame_action_name=&Pop Topmost Call
154
CTL_Pop_topmost_frame_action_name=&Pop Topmost Call
155
155
156
CTL_Debugger_Window=Debugger Window
156
CTL_Debugger_Window=Debugger Window
157
158
# AddWatchAction
159
AddWatch=New &Watch...
160
161
# ToggleBreakpointAction
162
ToggleBreakpoint=&Toggle Breakpoint
(-)debuggercore/src/org/netbeans/modules/debugger/support/actions/ToggleBreakpointAction.java (+52 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.modules.debugger.support.actions;
15
16
import java.util.Locale;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.NbBundle;
19
import org.openide.util.actions.CallbackSystemAction;
20
21
/** Toggle a breakpoint (e.g.<!-- --> in the Editor).
22
*
23
* @author   Jan Jancura
24
*/
25
public class ToggleBreakpointAction extends CallbackSystemAction {
26
    /** generated Serialized Version UID */
27
    static final long serialVersionUID = 2293420959009110628L;
28
29
    protected void initialize() {
30
        super.initialize();
31
        // XXX revisit:
32
        setSurviveFocusChange(true);
33
    }
34
35
    /* @return the action's icon */
36
    public String getName() {
37
        return NbBundle.getMessage(ToggleBreakpointAction.class, "ToggleBreakpoint");
38
    }
39
40
    /* @return the action's help context */
41
    public HelpCtx getHelpCtx() {
42
        return new HelpCtx (ToggleBreakpointAction.class);
43
    }
44
45
    /* Icon resource.
46
    * @return name of resource for icon
47
    */
48
    protected String iconResource () {
49
        return "org/openide/resources/actions/toggleBreakpoint.gif"; // NOI18N
50
    }
51
52
}
(-)debuggercore/src/org/netbeans/modules/debugger/support/java/JavaDebuggerSettings.java (-6 / +7 lines)
Lines 15-21 Link Here
15
15
16
import org.openide.options.SystemOption;
16
import org.openide.options.SystemOption;
17
import org.openide.options.ContextSystemOption;
17
import org.openide.options.ContextSystemOption;
18
import org.openide.actions.StartDebuggerAction;
19
import org.openide.debugger.DebuggerNotFoundException;
18
import org.openide.debugger.DebuggerNotFoundException;
20
import org.openide.execution.NbClassPath;
19
import org.openide.execution.NbClassPath;
21
import org.openide.util.NbBundle;
20
import org.openide.util.NbBundle;
Lines 23-28 Link Here
23
22
24
import org.netbeans.modules.debugger.support.DebuggerSettings;
23
import org.netbeans.modules.debugger.support.DebuggerSettings;
25
import org.netbeans.modules.debugger.support.DebuggerContextSettings;
24
import org.netbeans.modules.debugger.support.DebuggerContextSettings;
25
import org.openide.util.SharedClassObject;
26
26
27
27
28
/**
28
/**
Lines 75-80 Link Here
75
            DebuggerContextSettings.findObject (DebuggerContextSettings.class, true);
75
            DebuggerContextSettings.findObject (DebuggerContextSettings.class, true);
76
        ds.addOption (this);
76
        ds.addOption (this);
77
    }
77
    }
78
    
79
    public static JavaDebuggerSettings getDefault() {
80
        return (JavaDebuggerSettings)SharedClassObject.findObject(JavaDebuggerSettings.class, true);
81
    }
78
82
79
    /**
83
    /**
80
    * Returns name of this setings.
84
    * Returns name of this setings.
Lines 155-163 Link Here
155
    public boolean getRunCompilation () {
159
    public boolean getRunCompilation () {
156
        Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION);
160
        Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION);
157
        if (b == null) {
161
        if (b == null) {
158
            DebuggerSettings settings = ((DebuggerSettings) DebuggerSettings.findObject 
162
            // ??? avoid recursion
159
                (DebuggerSettings.class, true));
163
            return true;
160
            return settings.getRunCompilation ();
161
        }
164
        }
162
        return b.booleanValue ();
165
        return b.booleanValue ();
163
    }
166
    }
Lines 168-175 Link Here
168
    public void setRunCompilation (boolean value) {
171
    public void setRunCompilation (boolean value) {
169
        boolean oldValue = getRunCompilation ();
172
        boolean oldValue = getRunCompilation ();
170
        if (value == oldValue) return;
173
        if (value == oldValue) return;
171
        if (!value && StartDebuggerAction.getRunCompilation ())
172
            StartDebuggerAction.setRunCompilation (value);
173
        putProperty (
174
        putProperty (
174
            PROP_RUN_COMPILATION,
175
            PROP_RUN_COMPILATION,
175
            value ? Boolean.TRUE : Boolean.FALSE,
176
            value ? Boolean.TRUE : Boolean.FALSE,
(-)debuggercore/src/org/netbeans/modules/debugger/support/nodes/WatchesRootNode.java (-1 / +1 lines)
Lines 23-29 Link Here
23
import java.lang.ref.WeakReference;
23
import java.lang.ref.WeakReference;
24
24
25
import org.openide.debugger.*;
25
import org.openide.debugger.*;
26
import org.openide.actions.AddWatchAction;
27
import org.openide.actions.PropertiesAction;
26
import org.openide.actions.PropertiesAction;
28
import org.openide.actions.ToolsAction;
27
import org.openide.actions.ToolsAction;
29
import org.openide.util.actions.SystemAction;
28
import org.openide.util.actions.SystemAction;
Lines 34-39 Link Here
34
33
35
import org.netbeans.modules.debugger.*;
34
import org.netbeans.modules.debugger.*;
36
import org.netbeans.modules.debugger.support.DebuggerModule;
35
import org.netbeans.modules.debugger.support.DebuggerModule;
36
import org.netbeans.modules.debugger.support.actions.AddWatchAction;
37
import org.netbeans.modules.debugger.support.actions.DeleteAllCookie;
37
import org.netbeans.modules.debugger.support.actions.DeleteAllCookie;
38
import org.netbeans.modules.debugger.support.actions.DeleteAllAction;
38
import org.netbeans.modules.debugger.support.actions.DeleteAllAction;
39
import org.netbeans.modules.debugger.support.util.*;
39
import org.netbeans.modules.debugger.support.util.*;
(-)debuggerjpda/build.xml (+1 lines)
Lines 69-74 Link Here
69
        <pathelement location="../openide/io/netbeans/modules/autoload/openide-io.jar"/>
69
        <pathelement location="../openide/io/netbeans/modules/autoload/openide-io.jar"/>
70
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
70
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
71
	<pathelement location="../debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
71
	<pathelement location="../debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
72
	<pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
72
      </classpath>
73
      </classpath>
73
    </javac>
74
    </javac>
74
  </target>
75
  </target>
(-)debuggerjpda/manifest.mf (-2 / +3 lines)
Lines 2-11 Link Here
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/debugger/jpda/JPDADebuggerModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/debugger/jpda/JPDADebuggerModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml
5
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3 > 2.3, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
5
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3 > 2.3, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.openide.debugger > 1.0
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
8
OpenIDE-Module-Specification-Version: 1.13
8
OpenIDE-Module-Provides: org.openide.debugger.Debugger
9
OpenIDE-Module-Specification-Version: 1.14
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
10
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
10
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
11
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
11
12
(-)debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ActionsPresenceTestCase.java (-2 / +2 lines)
Lines 30-42 Link Here
30
    private static final String ACTION_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction";
30
    private static final String ACTION_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction";
31
    private static final String ACTION_DEBUGGER_WINDOW="org-netbeans-modules-debugger-support-actions-DebuggerWindowAction";
31
    private static final String ACTION_DEBUGGER_WINDOW="org-netbeans-modules-debugger-support-actions-DebuggerWindowAction";
32
    private static final String ACTION_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction";
32
    private static final String ACTION_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction";
33
    private static final String ACTION_ADD_WATCH="org-openide-actions-AddWatchAction";
33
    private static final String ACTION_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction";
34
    private static final String ACTION_FINISH="org-netbeans-modules-debugger-support-actions-FinishAction";
34
    private static final String ACTION_FINISH="org-netbeans-modules-debugger-support-actions-FinishAction";
35
    private static final String ACTION_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction";
35
    private static final String ACTION_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction";
36
    private static final String ACTION_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction";
36
    private static final String ACTION_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction";
37
    private static final String ACTION_START="org-netbeans-modules-debugger-support-actions-StartAction";
37
    private static final String ACTION_START="org-netbeans-modules-debugger-support-actions-StartAction";
38
    private static final String ACTION_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
38
    private static final String ACTION_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
39
    private static final String ACTION_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction";
39
    private static final String ACTION_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction";
40
    private static final String ACTION_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
40
    private static final String ACTION_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
41
    private static final String ACTION_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
41
    private static final String ACTION_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
42
    private static final String ACTION_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction";
42
    private static final String ACTION_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction";
(-)debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/MenusPresenceTestCase.java (-2 / +2 lines)
Lines 37-45 Link Here
37
    private static final String MENUITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
37
    private static final String MENUITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
38
    private static final String MENUITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
38
    private static final String MENUITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
39
    private static final String MENUITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
39
    private static final String MENUITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
40
    private static final String MENUITEM_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction";
40
    private static final String MENUITEM_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction";
41
    private static final String MENUITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction";
41
    private static final String MENUITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction";
42
    private static final String MENUITEM_ADD_WATCH="org-openide-actions-AddWatchAction";
42
    private static final String MENUITEM_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction";
43
    private static final String MENUITEM_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction";
43
    private static final String MENUITEM_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction";
44
    private static final String MENUITEM_GO_TO_CALLING="org-netbeans-modules-debugger-support-actions-GoToCallingMethodAction";    
44
    private static final String MENUITEM_GO_TO_CALLING="org-netbeans-modules-debugger-support-actions-GoToCallingMethodAction";    
45
45
(-)debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ToolBarsPresenceTestCase.java (-2 / +2 lines)
Lines 31-37 Link Here
31
    private static final String TOOLBARITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
31
    private static final String TOOLBARITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction";
32
    private static final String TOOLBARITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
32
    private static final String TOOLBARITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction";
33
    private static final String TOOLBARITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction";
33
    private static final String TOOLBARITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction";
34
    private static final String TOOLBARITEM_ADD_WATCH="org-openide-actions-AddWatchAction";
34
    private static final String TOOLBARITEM_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction";
35
    private static final String TOOLBAR_DEBUG_FULL="DebugFull";
35
    private static final String TOOLBAR_DEBUG_FULL="DebugFull";
36
    private static final String TOOLBARITEM_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction";
36
    private static final String TOOLBARITEM_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction";
37
    private static final String TOOLBARITEM_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction";
37
    private static final String TOOLBARITEM_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction";
Lines 39-45 Link Here
39
    private static final String TOOLBARITEM_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction";
39
    private static final String TOOLBARITEM_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction";
40
    private static final String TOOLBARITEM_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction";
40
    private static final String TOOLBARITEM_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction";
41
    private static final String TOOLBARITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
41
    private static final String TOOLBARITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction";
42
    private static final String TOOLBARITEM_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction";
42
    private static final String TOOLBARITEM_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction";
43
    private static final String TOOLBARITEM_FIX="org-netbeans-modules-debugger-support-actions-FixAction";
43
    private static final String TOOLBARITEM_FIX="org-netbeans-modules-debugger-support-actions-FixAction";
44
    
44
    
45
    public ToolBarsPresenceTestCase(String name) {
45
    public ToolBarsPresenceTestCase(String name) {
(-)editor/build.xml (+1 lines)
Lines 38-43 Link Here
38
        <pathelement location="../openide/netbeans/lib/openide.jar"/>
38
        <pathelement location="../openide/netbeans/lib/openide.jar"/>
39
        <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
39
        <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
40
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
40
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
41
        <pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
41
        <fileset dir="../core/external">
42
        <fileset dir="../core/external">
42
          <include name="regexp*.jar"/>
43
          <include name="regexp*.jar"/>
43
          <include name="xml-apis*.jar"/>
44
          <include name="xml-apis*.jar"/>
(-)editor/manifest.mf (-2 / +2 lines)
Lines 1-11 Link Here
1
OpenIDE-Module: org.netbeans.modules.editor/1
1
OpenIDE-Module: org.netbeans.modules.editor/1
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/editor/EditorModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/editor/EditorModule.class
4
OpenIDE-Module-Specification-Version: 1.12
4
OpenIDE-Module-Specification-Version: 1.13
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Layer: org/netbeans/modules/editor/resources/layer.xml
6
OpenIDE-Module-Layer: org/netbeans/modules/editor/resources/layer.xml
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.0, org.openide.deprecated > 1.0, org.openide.src > 1.0
8
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.0, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.debugger > 1.0
9
OpenIDE-Module-Requires: org.openide.TopManager
9
OpenIDE-Module-Requires: org.openide.TopManager
10
Class-Path: ext/nb-editor.jar
10
Class-Path: ext/nb-editor.jar
11
11
(-)editor/libsrc/org/netbeans/editor/GlyphGutter.java (-1 / +4 lines)
Lines 531-542 Link Here
531
                    annos.activateNextAnnotation(line);
531
                    annos.activateNextAnnotation(line);
532
                } else {
532
                } else {
533
                    Action a = ImplementationProvider.getDefault().getToggleBreakpointAction();
533
                    Action a = ImplementationProvider.getDefault().getToggleBreakpointAction();
534
                    if (a != null) {
534
                    if (a != null && a.isEnabled()) {
535
                        int line = (int)( (float)e.getY() / (float)lineHeight );
535
                        int line = (int)( (float)e.getY() / (float)lineHeight );
536
                        int currentLine = -1;
536
                        int currentLine = -1;
537
                        try {
537
                        try {
538
                            currentLine = Utilities.getLineOffset(doc, editorUI.getComponent().getCaret().getDot());
538
                            currentLine = Utilities.getLineOffset(doc, editorUI.getComponent().getCaret().getDot());
539
                        } catch (BadLocationException ex) {
539
                        } catch (BadLocationException ex) {
540
                            // XXX what should this do?
540
                        }
541
                        }
541
                        if (line != currentLine) {
542
                        if (line != currentLine) {
542
                            int offset = Utilities.getRowStartFromLineOffset(doc, line);
543
                            int offset = Utilities.getRowStartFromLineOffset(doc, line);
Lines 544-549 Link Here
544
                            editorUI.getComponent().getCaret().setDot(offset);
545
                            editorUI.getComponent().getCaret().setDot(offset);
545
                        }
546
                        }
546
                        a.actionPerformed(new ActionEvent(editorUI.getComponent(), 0, ""));
547
                        a.actionPerformed(new ActionEvent(editorUI.getComponent(), 0, ""));
548
                    } else {
549
                        Toolkit.getDefaultToolkit().beep();
547
                    }
550
                    }
548
                }
551
                }
549
            }
552
            }
(-)editor/src/org/netbeans/modules/editor/NbImplementationProvider.java (-3 / +13 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 *
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 18-24 Link Here
18
import org.netbeans.editor.ImplementationProvider;
18
import org.netbeans.editor.ImplementationProvider;
19
import javax.swing.Action;
19
import javax.swing.Action;
20
import org.openide.util.actions.SystemAction;
20
import org.openide.util.actions.SystemAction;
21
import org.openide.actions.ToggleBreakpointAction;
21
import org.openide.util.Lookup;
22
22
23
/** This is NetBeans specific provider of functionality.
23
/** This is NetBeans specific provider of functionality.
24
 * See base class for detailed comments.
24
 * See base class for detailed comments.
Lines 35-41 Link Here
35
    }
35
    }
36
36
37
    public Action getToggleBreakpointAction() {
37
    public Action getToggleBreakpointAction() {
38
        return SystemAction.get(org.openide.actions.ToggleBreakpointAction.class);
38
        try {
39
            ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class);
40
            Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N
41
            if (SystemAction.class.isAssignableFrom(c)) {
42
                return SystemAction.get(c);
43
            } else {
44
                return (Action)c.newInstance();
45
            }
46
        } catch (Exception e) {
47
            return null;
48
        }
39
    }
49
    }
40
    
50
    
41
}
51
}
(-)editor/src/org/netbeans/modules/editor/resources/layer.xml (-6 / +1 lines)
Lines 258-270 Link Here
258
                    <file name="Separator7.instance">
258
                    <file name="Separator7.instance">
259
			<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
259
			<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
260
                    </file>
260
                    </file>
261
                    <attr name="Separator7.instance/org-openide-actions-ToggleBreakpointAction.instance" boolvalue="true"/>
262
261
263
                    <file name="org-openide-actions-ToggleBreakpointAction.instance"/>
262
                    <attr name="Separator7.instance/Separator8.instance" boolvalue="true"/>
264
                    <attr name="org-openide-actions-ToggleBreakpointAction.instance/org-openide-actions-AddWatchAction.instance" boolvalue="true"/>
265
266
                    <file name="org-openide-actions-AddWatchAction.instance"/>
267
                    <attr name="org-openide-actions-AddWatchAction.instance/Separator8.instance" boolvalue="true"/>
268
263
269
                    <file name="Separator8.instance">
264
                    <file name="Separator8.instance">
270
			<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
265
			<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
(-)form/manifest.mf (-2 / +2 lines)
Lines 1-9 Link Here
1
OpenIDE-Module: org.netbeans.modules.form/2
1
OpenIDE-Module: org.netbeans.modules.form/2
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/form/Bundle2.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/form/Bundle2.properties
3
OpenIDE-Module-Specification-Version: 1.11
3
OpenIDE-Module-Specification-Version: 1.12
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Install: org/netbeans/modules/form/FormEditorModule.class
5
OpenIDE-Module-Install: org/netbeans/modules/form/FormEditorModule.class
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21
8
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.modules.InstalledFileLocator
8
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.modules.InstalledFileLocator
9
OpenIDE-Module-Layer: org/netbeans/modules/form/resources/layer.xml
9
OpenIDE-Module-Layer: org/netbeans/modules/form/resources/layer.xml
(-)form/src/org/netbeans/modules/form/FormNode.java (-2 / +2 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 56-62 Link Here
56
            && (CompilerCookie.class.isAssignableFrom(type)
56
            && (CompilerCookie.class.isAssignableFrom(type)
57
                || SaveCookie.class.isAssignableFrom(type)
57
                || SaveCookie.class.isAssignableFrom(type)
58
                || ExecCookie.class.isAssignableFrom(type)
58
                || ExecCookie.class.isAssignableFrom(type)
59
                || DebuggerCookie.class.isAssignableFrom(type)
59
                || type.getName().equals("org.openide.cookies.DebuggerCookie") // NOI18N
60
                || CloseCookie.class.isAssignableFrom(type)
60
                || CloseCookie.class.isAssignableFrom(type)
61
                || ArgumentsCookie.class.isAssignableFrom(type)
61
                || ArgumentsCookie.class.isAssignableFrom(type)
62
                || PrintCookie.class.isAssignableFrom(type)))
62
                || PrintCookie.class.isAssignableFrom(type)))
(-)j2eeserver/build.xml (+1 lines)
Lines 176-181 Link Here
176
        <pathelement location="${nbroot}/jarpackager/netbeans/modules/jarpackager.jar"/>
176
        <pathelement location="${nbroot}/jarpackager/netbeans/modules/jarpackager.jar"/>
177
        <pathelement location="${nbroot}/debuggerjpda/netbeans/modules/jpdaDebugger.jar"/>
177
        <pathelement location="${nbroot}/debuggerjpda/netbeans/modules/jpdaDebugger.jar"/>
178
        <pathelement location="${nbroot}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
178
        <pathelement location="${nbroot}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
179
        <pathelement location="${nbroot}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
179
      </classpath>
180
      </classpath>
180
    </javac>
181
    </javac>
181
  </target>
182
  </target>
(-)j2eeserver/manifest.mf (-2 / +2 lines)
Lines 1-9 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.j2eeserver/2
2
OpenIDE-Module: org.netbeans.modules.j2eeserver/2
3
OpenIDE-Module-Specification-Version: 1.6
3
OpenIDE-Module-Specification-Version: 1.7
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
6
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
6
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.openide.debugger > 1.0
8
OpenIDE-Module-Layer: org/netbeans/modules/j2ee/impl/layer.xml
8
OpenIDE-Module-Layer: org/netbeans/modules/j2ee/impl/layer.xml
9
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/impl/Bundle.properties
9
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/impl/Bundle.properties
(-)jarpackager/manifest.mf (-2 / +2 lines)
Lines 1-10 Link Here
1
OpenIDE-Module: org.netbeans.modules.jarpackager/2
1
OpenIDE-Module: org.netbeans.modules.jarpackager/2
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jarpackager/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jarpackager/Bundle.properties
3
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
3
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
4
OpenIDE-Module-Module-Dependencies: org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
4
OpenIDE-Module-Module-Dependencies: org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
6
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
6
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
7
OpenIDE-Module-Specification-Version: 1.12
7
OpenIDE-Module-Specification-Version: 1.13
8
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
8
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
9
OpenIDE-Module-Layer: org/netbeans/modules/jarpackager/resources/mf-layer.xml
9
OpenIDE-Module-Layer: org/netbeans/modules/jarpackager/resources/mf-layer.xml
10
10
(-)jarpackager/src/org/netbeans/modules/jarpackager/JarChildren.java (-3 / +2 lines)
Lines 8-14 Link Here
8
 * http://www.sun.com/
8
 * http://www.sun.com/
9
 *
9
 *
10
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * The Original Code is NetBeans. The Initial Developer of the Original
11
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
11
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
 * Microsystems, Inc. All Rights Reserved.
12
 * Microsystems, Inc. All Rights Reserved.
13
 */
13
 */
14
14
Lines 175-184 Link Here
175
            // fill execution properties
175
            // fill execution properties
176
            // #10827: subclasses might not have JarExecSupport cookie
176
            // #10827: subclasses might not have JarExecSupport cookie
177
            //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps);
177
            //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps);
178
            ExecSupport exec = (ExecSupport)getCookie(ExecSupport.class);
178
            ExecutionSupport exec = (ExecutionSupport)getCookie(ExecutionSupport.class);
179
            if (exec != null) {
179
            if (exec != null) {
180
                exec.addProperties(ps);
180
                exec.addProperties(ps);
181
                ps.remove(ExecSupport.PROP_DEBUGGER_TYPE);
182
            }
181
            }
183
            sheet.put(ps);
182
            sheet.put(ps);
184
            
183
            
(-)jarpackager/src/org/netbeans/modules/jarpackager/JarExecutor.java (-2 / +2 lines)
Lines 7-13 Link Here
7
* http://www.sun.com/
7
* http://www.sun.com/
8
* 
8
* 
9
* The Original Code is NetBeans. The Initial Developer of the Original
9
* The Original Code is NetBeans. The Initial Developer of the Original
10
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
* Microsystems, Inc. All Rights Reserved.
11
* Microsystems, Inc. All Rights Reserved.
12
*/
12
*/
13
13
Lines 78-84 Link Here
78
    * overridden to create the correct sort of ExecInfo
78
    * overridden to create the correct sort of ExecInfo
79
    */
79
    */
80
    protected Process createProcess (DataObject obj) throws IOException {
80
    protected Process createProcess (DataObject obj) throws IOException {
81
	String[] params = ExecSupport.getArguments (new org.openide.loaders.FileEntry(
81
	String[] params = ExecutionSupport.getArguments (new org.openide.loaders.FileEntry(
82
	    null, obj.getPrimaryFile()
82
	    null, obj.getPrimaryFile()
83
	));
83
	));
84
	if (checkSimpleClass(obj)) {
84
	if (checkSimpleClass(obj)) {
(-)jarpackager/src/org/netbeans/modules/jarpackager/SimpleJarDataObject.java (-4 / +3 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 *
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 336-345 Link Here
336
	    // fill execution properties
336
	    // fill execution properties
337
            // #10827: subclasses might not have JarExecSupport cookie
337
            // #10827: subclasses might not have JarExecSupport cookie
338
            //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps);
338
            //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps);
339
            ExecSupport exec = (ExecSupport)getCookie(ExecSupport.class);
339
            ExecutionSupport exec = (ExecutionSupport)getCookie(ExecutionSupport.class);
340
            if (exec != null) {
340
            if (exec != null) {
341
                exec.addProperties(ps);
341
                exec.addProperties(ps);
342
                ps.remove(ExecSupport.PROP_DEBUGGER_TYPE);
343
            }
342
            }
344
	    sheet.put(ps);
343
	    sheet.put(ps);
345
	    return sheet;
344
	    return sheet;
Lines 386-392 Link Here
386
    } // end of JarNode inner class
385
    } // end of JarNode inner class
387
386
388
    /** A class which provides the information needed to execute a jar file */
387
    /** A class which provides the information needed to execute a jar file */
389
    static class JarExecSupport extends ExecSupport {
388
    static class JarExecSupport extends ExecutionSupport {
390
        
389
        
391
        /** Create new support for given entry. The file is taken from the
390
        /** Create new support for given entry. The file is taken from the
392
         * entry and is updated if the entry moves or renames itself.
391
         * entry and is updated if the entry moves or renames itself.
(-)java/build.xml (+1 lines)
Lines 46-51 Link Here
46
      <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
46
      <pathelement location="../openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
47
      <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
47
      <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
48
      <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
48
      <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
49
      <pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
49
    </path>
50
    </path>
50
  </target>
51
  </target>
51
52
(-)java/manifest.mf (-2 / +2 lines)
Lines 3-11 Link Here
3
OpenIDE-Module-Install: org/netbeans/modules/java/JavaModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/java/JavaModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/java/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/java/resources/mf-layer.xml
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21
6
OpenIDE-Module-Module-Dependencies: org.netbeans.api.java/1,org.netbeans.modules.classfile/1, org.openide.src > 1.0, org.openide.deprecated > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0
6
OpenIDE-Module-Module-Dependencies: org.netbeans.api.java/1,org.netbeans.modules.classfile/1, org.openide.src > 1.0, org.openide.deprecated > 1.2, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.compiler.CompilationEngine, org.openide.modules.InstalledFileLocator
7
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.compiler.CompilationEngine, org.openide.modules.InstalledFileLocator
8
OpenIDE-Module-Specification-Version: 1.13
8
OpenIDE-Module-Specification-Version: 1.14
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
10
OpenIDE-Module-Package-Dependencies: [org.netbeans.modules.java.gj.JavaCompilerType], [org.netbeans.lib.javac.Main], org.apache.regexp[RE], [com.sun.tools.javamake.Main]
10
OpenIDE-Module-Package-Dependencies: [org.netbeans.modules.java.gj.JavaCompilerType], [org.netbeans.lib.javac.Main], org.apache.regexp[RE], [com.sun.tools.javamake.Main]
11
Class-Path: ext/javac.jar ext/java-gj.jar ext/javamake-1.2.12.jar
11
Class-Path: ext/javac.jar ext/java-gj.jar ext/javamake-1.2.12.jar
(-)java/src/org/netbeans/modules/java/JavaEditor.java (-32 / +41 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 19-24 Link Here
19
import java.io.*;
19
import java.io.*;
20
import java.text.MessageFormat;
20
import java.text.MessageFormat;
21
import java.util.*;
21
import java.util.*;
22
import javax.swing.AbstractAction;
22
import javax.swing.SwingUtilities;
23
import javax.swing.SwingUtilities;
23
import javax.swing.JEditorPane;
24
import javax.swing.JEditorPane;
24
import javax.swing.Timer;
25
import javax.swing.Timer;
Lines 31-37 Link Here
31
import org.openide.TopManager;
32
import org.openide.TopManager;
32
import org.openide.ErrorManager;
33
import org.openide.ErrorManager;
33
import org.openide.NotifyDescriptor;
34
import org.openide.NotifyDescriptor;
34
import org.openide.actions.ToggleBreakpointAction;
35
import org.openide.cookies.SaveCookie;
35
import org.openide.cookies.SaveCookie;
36
import org.openide.cookies.SourceCookie;
36
import org.openide.cookies.SourceCookie;
37
import org.openide.cookies.LineCookie;
37
import org.openide.cookies.LineCookie;
Lines 44-53 Link Here
44
import org.openide.loaders.DataObject;
44
import org.openide.loaders.DataObject;
45
import org.openide.loaders.MultiDataObject;
45
import org.openide.loaders.MultiDataObject;
46
import org.openide.src.SourceElement;
46
import org.openide.src.SourceElement;
47
import org.openide.util.TaskListener;
47
import org.openide.util.*;
48
import org.openide.util.actions.ActionPerformer;
48
import org.openide.util.actions.ActionPerformer;
49
import org.openide.util.actions.SystemAction;
49
import org.openide.util.actions.SystemAction;
50
import org.openide.util.NbBundle;
51
import org.openide.filesystems.*;
50
import org.openide.filesystems.*;
52
import org.openide.filesystems.FileSystem; // override java.io.FileSystem
51
import org.openide.filesystems.FileSystem; // override java.io.FileSystem
53
import org.openide.windows.CloneableTopComponent;
52
import org.openide.windows.CloneableTopComponent;
Lines 1089-1095 Link Here
1089
                                      }
1088
                                      }
1090
                                  }
1089
                                  }
1091
                              };
1090
                              };
1092
            
1091
         
1092
            getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N
1093
        }
1094
1095
        /**
1096
         * Locally bound action to toggle breakpoint on the current line.
1097
         * @see "#29914"
1098
         */
1099
        private final class ToggleBreakpointAction extends AbstractAction implements LookupListener {
1100
            private final Lookup.Result debuggerR;
1101
            public ToggleBreakpointAction() {
1102
                debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class));
1103
                debuggerR.addLookupListener(this);
1104
                resultChanged(null);
1105
            }
1106
            public void actionPerformed(ActionEvent e) {
1107
                int lineNumber = NbDocument.findLineNumber (
1108
                    support.getDocument (),
1109
                    getEditorPane ().getCaret ().getDot ()
1110
                    );
1111
                Line line = support.getLineSet ().getCurrent (lineNumber);
1112
                synchronized (this) {
1113
                    Iterator it = debuggerR.allInstances().iterator();
1114
                    if (it.hasNext()) {
1115
                        Debugger debugger = (Debugger)it.next();
1116
                        Breakpoint breakpoint = debugger.findBreakpoint (line);
1117
                        if (breakpoint == null)
1118
                            debugger.createBreakpoint (line);
1119
                        else
1120
                            breakpoint.remove ();
1121
                    }
1122
                }
1123
            }
1124
            public void resultChanged(LookupEvent e) {
1125
                setEnabled(!debuggerR.allInstances().isEmpty());
1126
            }
1093
        }
1127
        }
1094
1128
1095
        /** Restart the timer which updates the selected nodes after the specified delay from
1129
        /** Restart the timer which updates the selected nodes after the specified delay from
Lines 1117-1147 Link Here
1117
        }
1151
        }
1118
1152
1119
        /* This method is called when parent window of this component has focus,
1153
        /* This method is called when parent window of this component has focus,
1120
        * and this component is preferred one in it. This implementation adds 
1154
        * and this component is preferred one in it.
1121
        * performer to the ToggleBreakpointAction.
1122
        */
1155
        */
1123
        protected void componentActivated () {
1156
        protected void componentActivated () {
1124
            try {
1125
                final Debugger debugger = TopManager.getDefault ().getDebugger ();
1126
                ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)).
1127
                setActionPerformer (new ActionPerformer () {
1128
                                        public void performAction (SystemAction a) {
1129
                                            int lineNumber = NbDocument.findLineNumber (
1130
                                                        support.getDocument (),
1131
                                                        getEditorPane ().getCaret ().getDot ()
1132
                                                    );
1133
                                            Line line = support.getLineSet ().getCurrent (lineNumber);
1134
                                            synchronized (this) {
1135
                                                Breakpoint breakpoint = debugger.findBreakpoint (line);
1136
                                                if (breakpoint == null)
1137
                                                    debugger.createBreakpoint (line);
1138
                                                else
1139
                                                    breakpoint.remove ();
1140
                                            }
1141
                                        }
1142
                                    });
1143
            } catch (DebuggerNotFoundException e) {
1144
            }
1145
            JEditorPane p = getEditorPane();
1157
            JEditorPane p = getEditorPane();
1146
            if (p != null)
1158
            if (p != null)
1147
                p.addCaretListener(caretListener);
1159
                p.addCaretListener(caretListener);
Lines 1162-1173 Link Here
1162
1174
1163
        /*
1175
        /*
1164
        * This method is called when parent window of this component losts focus,
1176
        * This method is called when parent window of this component losts focus,
1165
        * or when this component losts preferrence in the parent window. This
1177
        * or when this component losts preferrence in the parent window.
1166
        * implementation removes performer from the ToggleBreakpointAction.
1167
        */
1178
        */
1168
        protected void componentDeactivated () {
1179
        protected void componentDeactivated () {
1169
            ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)).
1170
            setActionPerformer (null);
1171
            getEditorPane().removeCaretListener(caretListener);
1180
            getEditorPane().removeCaretListener(caretListener);
1172
            Parsing.removeParsingListener(parsingListener);
1181
            Parsing.removeParsingListener(parsingListener);
1173
            synchronized (this) {
1182
            synchronized (this) {
(-)nbbuild/build.properties (+2 lines)
Lines 65-70 Link Here
65
        core/output, \
65
        core/output, \
66
        core/deprecated, \
66
        core/deprecated, \
67
        java/srcmodel, \
67
        java/srcmodel, \
68
        debuggercore/oldapi, \
68
        core/javahelp, \
69
        core/javahelp, \
69
        core/compiler, \
70
        core/compiler, \
70
        core/execution, \
71
        core/execution, \
Lines 270-275 Link Here
270
        diff, \
271
        diff, \
271
        java/api, \
272
        java/api, \
272
        java/srcmodel, \
273
        java/srcmodel, \
274
        debuggercore/oldapi, \
273
        lexer, \
275
        lexer, \
274
        openidex/looks, \
276
        openidex/looks, \
275
        mdr, \
277
        mdr, \
(-)nbbuild/build.xml (-13 / +17 lines)
Lines 131-137 Link Here
131
    <echo message="Building Open APIs..."/>
131
    <echo message="Building Open APIs..."/>
132
    <ant dir="../openide" target="netbeans"/>
132
    <ant dir="../openide" target="netbeans"/>
133
  </target>
133
  </target>
134
  <target name="all-openide/deprecated" depends="all-openide,all-java/srcmodel,all-openide/compiler,all-openide/io,all-openide/execution">
134
  <target name="all-openide/deprecated" depends="all-openide,all-java/srcmodel,all-debuggercore/oldapi,all-openide/compiler,all-openide/io,all-openide/execution">
135
    <echo message="Building openide/deprecated..."/>
135
    <echo message="Building openide/deprecated..."/>
136
    <ant dir="../openide/deprecated" target="netbeans"/>
136
    <ant dir="../openide/deprecated" target="netbeans"/>
137
  </target>
137
  </target>
Lines 230-236 Link Here
230
    <echo message="Building module apisupport lite..."/>
230
    <echo message="Building module apisupport lite..."/>
231
    <ant dir="../apisupport/lite" target="netbeans"/>
231
    <ant dir="../apisupport/lite" target="netbeans"/>
232
  </target>
232
  </target>
233
  <target name="all-applet" depends="all-openide,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution">
233
  <target name="all-applet" depends="all-openide,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-debuggercore/oldapi">
234
    <echo message="Building module applet..."/>
234
    <echo message="Building module applet..."/>
235
    <ant dir="../applet" target="netbeans"/>
235
    <ant dir="../applet" target="netbeans"/>
236
  </target>
236
  </target>
Lines 250-256 Link Here
250
    <echo message="Building module classclosure..."/>
250
    <echo message="Building module classclosure..."/>
251
    <ant dir="../classclosure" target="netbeans"/>
251
    <ant dir="../classclosure" target="netbeans"/>
252
  </target>
252
  </target>
253
  <target name="all-clazz" depends="all-openide,all-classfile,all-openide/deprecated,all-java/srcmodel,all-openide/execution">
253
  <target name="all-clazz" depends="all-openide,all-classfile,all-openide/deprecated,all-java/srcmodel,all-openide/execution,all-debuggercore/oldapi">
254
    <echo message="Building module clazz..."/>
254
    <echo message="Building module clazz..."/>
255
    <ant dir="../clazz" target="netbeans"/>
255
    <ant dir="../clazz" target="netbeans"/>
256
  </target>
256
  </target>
Lines 258-268 Link Here
258
    <echo message="Building module db..."/>
258
    <echo message="Building module db..."/>
259
    <ant dir="../db" target="netbeans"/>
259
    <ant dir="../db" target="netbeans"/>
260
  </target>
260
  </target>
261
  <target name="all-debuggercore" depends="all-openide,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io">
261
  <target name="all-debuggercore/oldapi" depends="all-openide,all-java/srcmodel,all-openide/execution,all-openide/compiler,all-core">
262
    <echo message="Building module debuggercore/oldapi..."/>
263
    <ant dir="../debuggercore/oldapi" target="netbeans"/>
264
  </target>
265
  <target name="all-debuggercore" depends="all-openide,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io,all-debuggercore/oldapi">
262
    <echo message="Building module debuggercore..."/>
266
    <echo message="Building module debuggercore..."/>
263
    <ant dir="../debuggercore" target="netbeans"/>
267
    <ant dir="../debuggercore" target="netbeans"/>
264
  </target>
268
  </target>
265
  <target name="all-debuggerjpda" depends="all-openide,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io">
269
  <target name="all-debuggerjpda" depends="all-openide,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io,all-debuggercore/oldapi">
266
    <echo message="Building module debuggerjpda..."/>
270
    <echo message="Building module debuggerjpda..."/>
267
    <ant dir="../debuggerjpda" target="netbeans"/>
271
    <ant dir="../debuggerjpda" target="netbeans"/>
268
  </target>
272
  </target>
Lines 271-277 Link Here
271
    <ant dir="../debuggertools" target="netbeans"/>
275
    <ant dir="../debuggertools" target="netbeans"/>
272
  </target>
276
  </target>
273
  <!-- XXX illegal dependence on core! -->
277
  <!-- XXX illegal dependence on core! -->
274
  <target name="all-editor" depends="all-openide,all-core,all-openide/deprecated,all-java/srcmodel">
278
  <target name="all-editor" depends="all-openide,all-core,all-openide/deprecated,all-java/srcmodel,all-debuggercore/oldapi">
275
    <echo message="Building module editor..."/>
279
    <echo message="Building module editor..."/>
276
    <ant dir="../editor" target="netbeans"/>
280
    <ant dir="../editor" target="netbeans"/>
277
  </target>
281
  </target>
Lines 327-333 Link Here
327
    <echo message="Building module innertesters..."/>
331
    <echo message="Building module innertesters..."/>
328
    <ant dir="../innertesters" target="netbeans"/>
332
    <ant dir="../innertesters" target="netbeans"/>
329
  </target>
333
  </target>
330
  <target name="all-j2eeserver" depends="all-openide,all-jarpackager,all-debuggercore,all-debuggerjpda,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io">
334
  <target name="all-j2eeserver" depends="all-openide,all-jarpackager,all-debuggercore,all-debuggerjpda,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io,all-debuggercore/oldapi">
331
    <echo message="Building module j2eeserver..."/>
335
    <echo message="Building module j2eeserver..."/>
332
    <ant dir="../j2eeserver" target="netbeans"/>
336
    <ant dir="../j2eeserver" target="netbeans"/>
333
  </target>
337
  </target>
Lines 339-345 Link Here
339
    <echo message="Building module jarpackager..."/>
343
    <echo message="Building module jarpackager..."/>
340
    <ant dir="../jarpackager" target="netbeans"/>
344
    <ant dir="../jarpackager" target="netbeans"/>
341
  </target>
345
  </target>
342
  <target name="all-java" depends="all-openide,all-java/api,all-classfile,all-java/srcmodel,all-openide/deprecated,all-openide/compiler,all-openide/execution">
346
  <target name="all-java" depends="all-openide,all-java/api,all-classfile,all-java/srcmodel,all-openide/deprecated,all-openide/compiler,all-openide/execution,all-debuggercore/oldapi">
343
    <echo message="Building module java..."/>
347
    <echo message="Building module java..."/>
344
    <ant dir="../java" target="netbeans"/>
348
    <ant dir="../java" target="netbeans"/>
345
  </target>
349
  </target>
Lines 421-427 Link Here
421
    <echo message="Building module openidex..."/>
425
    <echo message="Building module openidex..."/>
422
    <ant dir="../openidex" target="netbeans"/>
426
    <ant dir="../openidex" target="netbeans"/>
423
  </target>
427
  </target>
424
  <target name="all-projects" depends="all-openide,all-core,all-openide/deprecated,all-openide/compiler,all-openide/execution">
428
  <target name="all-projects" depends="all-openide,all-core,all-openide/deprecated,all-openide/compiler,all-openide/execution,all-debuggercore/oldapi">
425
    <echo message="Building module projects..."/>
429
    <echo message="Building module projects..."/>
426
    <ant dir="../projects" target="netbeans"/>
430
    <ant dir="../projects" target="netbeans"/>
427
  </target>
431
  </target>
Lines 433-439 Link Here
433
    <echo message="Building module remotefs..."/>
437
    <echo message="Building module remotefs..."/>
434
    <ant dir="../remotefs" target="netbeans"/>
438
    <ant dir="../remotefs" target="netbeans"/>
435
  </target>
439
  </target>
436
  <target name="all-rmi" depends="all-openide,all-java,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution">
440
  <target name="all-rmi" depends="all-openide,all-java,all-debuggercore,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-debuggercore/oldapi">
437
    <echo message="Building module rmi..."/>
441
    <echo message="Building module rmi..."/>
438
    <ant dir="../rmi" target="netbeans"/>
442
    <ant dir="../rmi" target="netbeans"/>
439
  </target>
443
  </target>
Lines 509-515 Link Here
509
    <echo message="Building module tomcatint/tomcat32..."/>
513
    <echo message="Building module tomcatint/tomcat32..."/>
510
    <ant dir="../tomcatint/tomcat32" target="netbeans"/>
514
    <ant dir="../tomcatint/tomcat32" target="netbeans"/>
511
  </target>
515
  </target>
512
  <target name="all-tomcatint/tomcat40" depends="all-openide,all-web/core,all-schema2beans,all-openide/deprecated,all-java/srcmodel,all-openide/execution,all-openide/compiler,all-openide/io">
516
  <target name="all-tomcatint/tomcat40" depends="all-openide,all-web/core,all-schema2beans,all-openide/deprecated,all-java/srcmodel,all-openide/execution,all-openide/compiler,all-openide/io,all-debuggercore/oldapi">
513
    <echo message="Building module tomcatint/tomcat40..."/>
517
    <echo message="Building module tomcatint/tomcat40..."/>
514
    <ant dir="../tomcatint/tomcat40" target="netbeans"/>
518
    <ant dir="../tomcatint/tomcat40" target="netbeans"/>
515
  </target>
519
  </target>
Lines 578-584 Link Here
578
    <ant dir="../web/servletapi23" target="netbeans"/>
582
    <ant dir="../web/servletapi23" target="netbeans"/>
579
  </target>
583
  </target>
580
  <!-- XXX illegal dependence on core! -->
584
  <!-- XXX illegal dependence on core! -->
581
  <target name="all-web/core" depends="all-openide,all-java,all-core,all-editor,all-j2eeserver,all-html,all-httpserver,all-jarpackager,all-debuggercore,all-openidex,all-schema2beans,all-xml/api,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io">
585
  <target name="all-web/core" depends="all-openide,all-java,all-core,all-editor,all-j2eeserver,all-html,all-httpserver,all-jarpackager,all-debuggercore,all-openidex,all-schema2beans,all-xml/api,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-openide/io,all-debuggercore/oldapi">
582
    <echo message="Building module web/core..."/>
586
    <echo message="Building module web/core..."/>
583
    <ant dir="../web/core" target="netbeans"/>
587
    <ant dir="../web/core" target="netbeans"/>
584
  </target>
588
  </target>
Lines 590-596 Link Here
590
    <echo message="Building module web/jspsyntax..."/>
594
    <echo message="Building module web/jspsyntax..."/>
591
    <ant dir="../web/jspsyntax" target="netbeans"/>
595
    <ant dir="../web/jspsyntax" target="netbeans"/>
592
  </target>
596
  </target>
593
  <target name="all-web/jspdebug" depends="all-web/core,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution">
597
  <target name="all-web/jspdebug" depends="all-web/core,all-openide/deprecated,all-java/srcmodel,all-openide/compiler,all-openide/execution,all-debuggercore/oldapi">
594
    <echo message="Building module web/jspdebug..."/>
598
    <echo message="Building module web/jspdebug..."/>
595
    <ant dir="../web/jspdebug" target="netbeans"/>
599
    <ant dir="../web/jspdebug" target="netbeans"/>
596
  </target>
600
  </target>
(-)nbbuild/antsrc/org/netbeans/nbbuild/MakeParserDB.java (+1 lines)
Lines 117-122 Link Here
117
                "java/srcmodel/netbeans/modules/autoload/java-src-model.jar",
117
                "java/srcmodel/netbeans/modules/autoload/java-src-model.jar",
118
                "java/netbeans/modules/java.jar",
118
                "java/netbeans/modules/java.jar",
119
                "editor/netbeans/modules/editor.jar",
119
                "editor/netbeans/modules/editor.jar",
120
                "debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar",
120
                // XXX delete these when java + editor no longer use TopManager!
121
                // XXX delete these when java + editor no longer use TopManager!
121
                "openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar",
122
                "openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar",
122
                "core/deprecated/netbeans/modules/autoload/core-deprecated.jar",
123
                "core/deprecated/netbeans/modules/autoload/core-deprecated.jar",
(-)openide/build.xml (-1 / +7 lines)
Lines 345-351 Link Here
345
    
345
    
346
  </target>
346
  </target>
347
347
348
  <target name="netbeans" depends="jars" description="Build everything needed for inclusion in the IDE.">
348
  <target name="release">
349
    <copy todir="netbeans" includeEmptyDirs="false">
350
      <fileset dir="release" excludesfile="../nbbuild/standard-jar-excludes.txt"/>
351
    </copy>
352
  </target>
353
354
  <target name="netbeans" depends="jars,release" description="Build everything needed for inclusion in the IDE.">
349
    <genlist targetname="nbm" outputfiledir="netbeans"/>
355
    <genlist targetname="nbm" outputfiledir="netbeans"/>
350
  </target>
356
  </target>
351
357
(-)openide/openide-spec-vers.properties (-2 / +1 lines)
Lines 5-9 Link Here
5
# Must always be numeric (numbers separated by '.', e.g. 1.11.3).
5
# Must always be numeric (numbers separated by '.', e.g. 1.11.3).
6
# See http://openide.netbeans.org/versioning-policy.html for more.
6
# See http://openide.netbeans.org/versioning-policy.html for more.
7
7
8
8
org.openide.specification.version=3.33
9
org.openide.specification.version=3.32
(-)openide/api/doc/changes/apichanges.xml (+19 lines)
Lines 3657-3662 Link Here
3657
3657
3658
    <change>
3658
    <change>
3659
      <api name="modules"/>
3659
      <api name="modules"/>
3660
      <summary>Modules can declare their own dependency transformations</summary>
3661
      <version major="3" minor="33"/>
3662
      <date day="27" month="1" year="2003"/>
3663
      <author login="jglick"/>
3664
      <compatibility addition="yes"/>
3665
      <description>
3666
        <p>
3667
          Modules may now declare their own transformations of module
3668
          dependencies using a declarative XML syntax in the folder
3669
          <samp>ModuleAutoDeps/</samp> in the system filesystem. This is useful
3670
          for being able to manage major refactorings of functionality in a
3671
          manner that will retain binary compatibility.
3672
        </p>
3673
      </description>
3674
      <issue number="30161"/>
3675
    </change>
3676
3677
    <change>
3678
      <api name="modules"/>
3660
      <summary>Short description for modules</summary>
3679
      <summary>Short description for modules</summary>
3661
      <date day="21" month="12" year="2000"/>
3680
      <date day="21" month="12" year="2000"/>
3662
      <author login="jglick"/>
3681
      <author login="jglick"/>
(-)openide/api/doc/org/openide/doc-files/upgrade.html (+45 lines)
Lines 475-480 Link Here
475
475
476
<a href="http://www.netbeans.org/issues/show_bug.cgi?id=19443">issue #19443</a>.</p>
476
<a href="http://www.netbeans.org/issues/show_bug.cgi?id=19443">issue #19443</a>.</p>
477
477
478
<h4>Phase III</h4>
479
480
<p>The Debugger API is no longer deprecated in this phase, and is
481
available in the new autoload module
482
<samp>debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar</samp>.
483
This new module contains all of <code>org.openide.debugger.*</code>,
484
plus <code>org.openide.cookies.DebuggerCookie</code> and
485
<code>org.openide.loaders.ExecSupport</code>.</p>
486
487
<p>The module does <em>not</em> contain any actions. In the event that
488
you were setting action performers for e.g.
489
<code>ToggleBreakpointAction</code>, please note that the action
490
implementations now reside in the
491
<code>org.netbeans.modules.debugger.support.actions.*</code> package
492
(in <samp>debuggerCore.jar</samp>); and that you need not refer
493
directly to the action in order to set a performer - rather, modify
494
the action map for your <code>TopComponent</code> (or other component)
495
to bind e.g.
496
<samp>"org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"</samp>
497
to a <code>javax.swing.Action</code> of your choice. This is easier
498
and safer than setting and unsetting action performers.</p>
499
500
<p>Modules should declare a dependency:</p>
501
502
<pre>
503
OpenIDE-Module-Module-Dependencies: org.openide.debugger &gt; 1.0
504
</pre>
505
506
<p>Any modules depending on <code>org.openide.deprecated</code> prior
507
to version <code>1.2</code> will receive this dependency
508
automatically.</p>
509
510
<p>You may if you wish also:</p>
511
512
<pre>
513
OpenIDE-Module-Requires: org.openide.debugger.Debugger
514
</pre>
515
516
<p>in case your module cannot work without a debugger implementation
517
being installed.</p>
518
519
<p>For more details, see
520
521
<a href="http://www.netbeans.org/issues/show_bug.cgi?id=29914">issue #29914</a>.</p>
522
478
<h3><a name="4.0i-indirect-dep-cp">Indirect dependencies do not count for a module's "effective classpath"</a></h3>
523
<h3><a name="4.0i-indirect-dep-cp">Indirect dependencies do not count for a module's "effective classpath"</a></h3>
479
524
480
<p>In NetBeans 3.4, if module A exposes some API packages (either
525
<p>In NetBeans 3.4, if module A exposes some API packages (either
(-)openide/api/doc/org/openide/modules/doc-files/api.html (+26 lines)
Lines 71-76 Link Here
71
<ul>
71
<ul>
72
<li> <a href="#related-files">Related Files</a>
72
<li> <a href="#related-files">Related Files</a>
73
<li> <a href="#deprecation">Deprecation</a>
73
<li> <a href="#deprecation">Deprecation</a>
74
<li> <a href="#refactoring">Refactoring</a>
74
<li> <a href="#downloading">Downloading</a>
75
<li> <a href="#downloading">Downloading</a>
75
<li> <a href="#order">Module install order</a>
76
<li> <a href="#order">Module install order</a>
76
<li> <a href="#listing">List of all modules</a>
77
<li> <a href="#listing">List of all modules</a>
Lines 1351-1356 Link Here
1351
This
1352
This
1352
message may be displayed somehow if a non-deprecated module depending on your
1353
message may be displayed somehow if a non-deprecated module depending on your
1353
deprecated module is enabled.</p>
1354
deprecated module is enabled.</p>
1355
1356
<h3><a name="refactoring">Refactoring</a></h3>
1357
1358
<p>Sometimes as the developer of an API module, you may wish to make
1359
major changes in how your APIs are laid out physically in modules.
1360
Most commonly, you determine that it would be desirable to split one
1361
big API module into several smaller pieces. However you wish to retain
1362
compatibility for existing client modules, so that if they used your
1363
old monolithic module, they will now automatically get access to the
1364
newer, smaller pieces.</p>
1365
1366
<p>This is straightforward: create an XML file according to the DTD
1367
1368
<a href="http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd"><code>-//NetBeans//DTD&nbsp;Module&nbsp;Automatic&nbsp;Dependencies&nbsp;1.0//EN</code></a>
1369
1370
and
1371
1372
<a href="#related-files">install it</a>
1373
1374
in the system filesystem under <samp>ModuleAutoDeps/</samp>
1375
(<samp>system/ModuleAutoDeps/*.xml</samp>). Note that it will probably
1376
<em>not</em> work to do this using an XML layer since the information
1377
must be available before any module is even loaded.</p>
1378
1379
<p><em>As of 3.33</em></p>
1354
1380
1355
<div class="nonnormative">
1381
<div class="nonnormative">
1356
1382
(-)openide/deprecated/build.xml (-1 / +8 lines)
Lines 33-38 Link Here
33
                <pathelement location="${nb_all}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
33
                <pathelement location="${nb_all}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
34
                <pathelement location="${nb_all}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
34
                <pathelement location="${nb_all}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
35
                <pathelement location="${nb_all}/openide/io/netbeans/modules/autoload/openide-io.jar"/>
35
                <pathelement location="${nb_all}/openide/io/netbeans/modules/autoload/openide-io.jar"/>
36
                <pathelement location="${nb_all}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
36
37
37
                <fileset dir="../../core/external">
38
                <fileset dir="../../core/external">
38
                    <include name="xml-apis*.jar"/>
39
                    <include name="xml-apis*.jar"/>
Lines 56-62 Link Here
56
        </locjar>
57
        </locjar>
57
    </target>
58
    </target>
58
59
59
    <target name="netbeans" depends="jars">
60
    <target name="release">
61
        <copy todir="netbeans" includeEmptyDirs="false">
62
            <fileset dir="release" excludesfile="../../nbbuild/standard-jar-excludes.txt"/>
63
        </copy>
64
    </target>
65
66
    <target name="netbeans" depends="jars,release">
60
        <genlist targetname="nbm" outputfiledir="netbeans"/>
67
        <genlist targetname="nbm" outputfiledir="netbeans"/>
61
    </target>
68
    </target>
62
69
(-)openide/deprecated/manifest.mf (-3 / +3 lines)
Lines 1-9 Link Here
1
OpenIDE-Module: org.openide.deprecated
1
OpenIDE-Module: org.openide.deprecated
2
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.18
2
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.33
3
OpenIDE-Module-Specification-Version: 1.1
3
OpenIDE-Module-Specification-Version: 1.2
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Localizing-Bundle: org/openide/deprecated/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/openide/deprecated/Bundle.properties
6
OpenIDE-Module-Module-Dependencies: org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.io > 1.0, org.openide.execution > 1.0
6
OpenIDE-Module-Module-Dependencies: org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.io > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
7
OpenIDE-Module-Requires: org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
7
OpenIDE-Module-Requires: org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
8
OpenIDE-Module-Deprecated: true
8
OpenIDE-Module-Deprecated: true
9
9
(-)openide/deprecated/release/system/ModuleAutoDeps/org-openide-deprecated.xml (+47 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<!DOCTYPE transformations PUBLIC "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN" "http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd">
16
17
<transformations version="1.0">
18
19
    <transformationgroup>
20
        <description>Debugger API separation (#29914)</description>
21
        <exclusion codenamebase="org.netbeans.core" prefix="true"/>
22
        <exclusion codenamebase="org.openide" prefix="true"/>
23
        <transformation>
24
            <trigger-dependency type="older">
25
                <module-dependency codenamebase="org.openide" major="1" spec="3.14"/>
26
            </trigger-dependency>
27
            <implies>
28
                <result>
29
                    <module-dependency codenamebase="org.openide.debugger" spec="1.0"/>
30
                </result>
31
                <!-- No dep on org.openide.debugger.Debugger; -->
32
                <!-- this was never implied by earlier APIs. -->
33
            </implies>
34
        </transformation>
35
        <transformation>
36
            <trigger-dependency type="older">
37
                <module-dependency codenamebase="org.openide.deprecated" spec="1.2"/>
38
            </trigger-dependency>
39
            <implies>
40
                <result>
41
                    <module-dependency codenamebase="org.openide.debugger" spec="1.0"/>
42
                </result>
43
            </implies>
44
        </transformation>
45
    </transformationgroup>
46
47
</transformations>
(-)openide/deprecated/src/org/openide/actions/AddWatchAction.java (+22 lines)
Lines 14-22 Link Here
14
package org.openide.actions;
14
package org.openide.actions;
15
15
16
import java.util.Locale;
16
import java.util.Locale;
17
import org.openide.ErrorManager;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.HelpCtx;
19
import org.openide.util.Lookup;
18
import org.openide.util.NbBundle;
20
import org.openide.util.NbBundle;
21
import org.openide.util.actions.ActionPerformer;
19
import org.openide.util.actions.CallbackSystemAction;
22
import org.openide.util.actions.CallbackSystemAction;
23
import org.openide.util.actions.SystemAction;
20
24
21
/** Add a debugger watch.
25
/** Add a debugger watch.
22
*
26
*
Lines 31-36 Link Here
31
        super.initialize();
35
        super.initialize();
32
        // XXX revisit:
36
        // XXX revisit:
33
        setSurviveFocusChange(true);
37
        setSurviveFocusChange(true);
38
    }
39
40
    /*
41
     * Tries to also delegate to the new impl, for compatibility.
42
     */
43
    public void setActionPerformer(ActionPerformer p) {
44
        super.setActionPerformer(p);
45
        try {
46
            ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class);
47
            Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N
48
            CallbackSystemAction a = (CallbackSystemAction)SystemAction.get(c);
49
            a.setActionPerformer(p);
50
        } catch (ClassNotFoundException cnfe) {
51
            // Not installed, ignore it.
52
        } catch (Exception e) {
53
            // Oh well, ignore it.
54
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
55
        }
34
    }
56
    }
35
57
36
    /* @return the action's icon */
58
    /* @return the action's icon */
(-)openide/deprecated/src/org/openide/actions/ToggleBreakpointAction.java (+22 lines)
Lines 14-22 Link Here
14
package org.openide.actions;
14
package org.openide.actions;
15
15
16
import java.util.Locale;
16
import java.util.Locale;
17
import org.openide.ErrorManager;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.HelpCtx;
19
import org.openide.util.Lookup;
18
import org.openide.util.NbBundle;
20
import org.openide.util.NbBundle;
21
import org.openide.util.actions.ActionPerformer;
19
import org.openide.util.actions.CallbackSystemAction;
22
import org.openide.util.actions.CallbackSystemAction;
23
import org.openide.util.actions.SystemAction;
20
24
21
/** Toggle a breakpoint (e.g.<!-- --> in the Editor).
25
/** Toggle a breakpoint (e.g.<!-- --> in the Editor).
22
*
26
*
Lines 31-36 Link Here
31
        super.initialize();
35
        super.initialize();
32
        // XXX revisit:
36
        // XXX revisit:
33
        setSurviveFocusChange(true);
37
        setSurviveFocusChange(true);
38
    }
39
    
40
    /*
41
     * Tries to also delegate to the new impl, for compatibility.
42
     */
43
    public void setActionPerformer(ActionPerformer p) {
44
        super.setActionPerformer(p);
45
        try {
46
            ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class);
47
            Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N
48
            CallbackSystemAction a = (CallbackSystemAction)SystemAction.get(c);
49
            a.setActionPerformer(p);
50
        } catch (ClassNotFoundException cnfe) {
51
            // Not installed, ignore it.
52
        } catch (Exception e) {
53
            // Oh well, ignore it.
54
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
55
        }
34
    }
56
    }
35
57
36
    /* @return the action's icon */
58
    /* @return the action's icon */
(-)openide/deprecated/src/org/openide/cookies/DebuggerCookie.java (-30 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.cookies;
15
16
import org.openide.debugger.DebuggerException;
17
import org.openide.nodes.Node;
18
19
/** Cookie for debugger. Any data object or node that supports
20
* debugging can implement this cookie.
21
*
22
* @author Jan Jancura
23
*/
24
public interface DebuggerCookie extends Node.Cookie {
25
    /** Start debugging of associated object.
26
    * @param stopOnMain if <code>true</code>, debugger stops on the first line of debugged code
27
    * @exception DebuggerException if the session cannot be started
28
    */
29
    public void debug (boolean stopOnMain) throws DebuggerException;
30
}
(-)openide/deprecated/src/org/openide/debugger/Breakpoint.java (-109 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
import org.openide.text.Line;
19
import org.openide.src.ConstructorElement;
20
21
/**
22
* Represents one breakpoint.
23
* Breakpoints are created and returned
24
* by the {@link Debugger} implementation. A breakpoint may be assigned either to a source line
25
* of a class, or to a method (or constructor) of a class.
26
* The current set of breakpoints is stored
27
* in the implementation of {@link Debugger}.
28
* <P>
29
* The abstract class contains only the necessary manipulation methods
30
* used by the IDE, like enabling/disabling the breakpoint and obtaining its
31
* position. A good implementation can offer the user much better ways to
32
* deal with the breakpoint (conditional breakpoints, etc.). Such information should
33
* be presented as properties--so it is assumed that the
34
* breakpoint itself is a serializable JavaBean.
35
*
36
*
37
* @author   Jan Jancura, Jaroslav Tulach
38
*/
39
public abstract class Breakpoint implements java.io.Serializable {
40
    /** Property name for validity of the breakpoint. */
41
    public static final String PROP_VALID = "valid"; // NOI18N
42
    /** Property name for enabled status of the breakpoint. */
43
    public static final String PROP_ENABLED = "enabled"; // NOI18N
44
45
    static final long serialVersionUID =4899621215676971003L;
46
    /** Destroy this breakpoint.
47
    * Removes it from the list of all breakpoints in the system.
48
    */
49
    public abstract void remove ();
50
51
    /** Get the line assigned to the breakpoint.
52
    *
53
    * @return the source line or <code>null</code> if no line is specified (it is assigned to a method)
54
    */
55
    public abstract Line getLine ();
56
57
    /** Get the name of the class the breakpoint is in.
58
    *
59
    * @return the class name
60
    */
61
    public abstract String getClassName ();
62
63
    /** Get the method the breakpoint is in.
64
    *
65
    * @return the method (or constructor) element or <code>null</code> if it assigned to a line
66
    */
67
    public abstract ConstructorElement getMethod ();
68
69
    /**
70
    * Test whether the breakpoint is enabled.
71
    *
72
    * @return <code>true</code> if so
73
    */
74
    public abstract boolean isEnabled ();
75
76
    /**
77
    * Set whether the breakpoint is enabled.
78
    *
79
    * @param state <code>true</code> to enable, <code>false</code> to disable
80
    */
81
    public abstract void setEnabled (boolean enabled);
82
83
    /**
84
    * Test whether the breakpoint is valid.
85
    * Invalidity might be caused by an inability to find the class it is supposed to be in, for example.
86
    * @return <code>true</code> if it is valid
87
    */
88
    public abstract boolean isValid ();
89
90
    /** Test whether the breakpoint is hidden.
91
    * If so, it
92
    * is not presented in the list of all breakpoints. Such a breakpoint can be used
93
    * for the IDE's (or some module's) private use, not displaying anything to the user.
94
    * @return <code>true</code> if the breakpoint is hidden
95
    */
96
    public abstract boolean isHidden ();
97
98
    /**
99
    * Add a property change listener.
100
    * @param listener the listener to add
101
    */
102
    public abstract void addPropertyChangeListener (PropertyChangeListener listener);
103
104
    /**
105
    * Remove a property change listener.
106
    * @param listener the listener to remove
107
    */
108
    public abstract void removePropertyChangeListener (PropertyChangeListener listener);
109
}
(-)openide/deprecated/src/org/openide/debugger/Bundle.properties (-17 lines)
Removed Link Here
1
#                 Sun Public License Notice
2
# 
3
# The contents of this file are subject to the Sun Public License
4
# Version 1.0 (the "License"). You may not use this file except in
5
# compliance with the License. A copy of the License is available at
6
# http://www.sun.com/
7
# 
8
# The Original Code is NetBeans. The Initial Developer of the Original
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
10
# Microsystems, Inc. All Rights Reserved.
11
12
# DebuggerType.Default.class - debugger type
13
LAB_DefaultDebuggerType=Default Debugging
14
15
# ExecSupport
16
PROP_debuggerType=Debugger
17
HINT_debuggerType=Style of debugger to use for this file.
(-)openide/deprecated/src/org/openide/debugger/Debugger.java (-227 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
import org.openide.text.Line;
19
import org.openide.src.ConstructorElement;
20
21
/**
22
* Provides a minimal interface between the IDE and a debugger.
23
* It permits
24
* control of the state of the debugger and creation of breakpoints and
25
* watches.
26
*
27
* @author   Jan Jancura, Jaroslav Tulach
28
*/
29
public abstract class Debugger {
30
    /** Debugger state when the debugger is not running at all. */
31
    public static final int DEBUGGER_NOT_RUNNING = 1;
32
    /** Debugger state when the debugger is starting to run. */
33
    public static final int DEBUGGER_STARTING = 2;
34
    /** Debugger state when the debugger is running user code. */
35
    public static final int DEBUGGER_RUNNING = 3;
36
    /** Debugger state when the debugger is stopped, e.g.<!-- --> at a breakpoint. */
37
    public static final int DEBUGGER_STOPPED = 4;
38
39
    /** Name of property for the debugger's state. */
40
    public static final String PROP_STATE = "state"; // NOI18N
41
    /** Name of property for the set of breakpoints in the system. */
42
    public static final String PROP_BREAKPOINTS = "breakpoints"; // NOI18N
43
    /** Name of property for the set of watches in the system. */
44
    public static final String PROP_WATCHES = "watches"; // NOI18N
45
    /** Name of property for the debugger's current line. */
46
    public static final String PROP_CURRENT_LINE = "currentLine"; // NOI18N
47
48
    /** */
49
    public static final int ACTION_BREAKPOINT_HIT = 1;
50
    /** */
51
    public static final int ACTION_TRACE_OVER = 2;
52
    /** */
53
    public static final int ACTION_TRACE_INTO = 3;
54
    /** */
55
    public static final int ACTION_STEP_OUT = 4;
56
57
    /** Start a new debugging session.
58
    * The current debugging session, if any, should be stopped first.
59
    * The provided information specifies the class to start and
60
    * arguments to pass it, and the name of class to stop debugging in, if applicable.
61
    *
62
    * @param info debugger startup info
63
    * @exception DebuggerException if an error occurs while starting the debugger
64
    */
65
    public abstract void startDebugger (DebuggerInfo info) throws DebuggerException;
66
67
    /**
68
    * Finish the debugger session.
69
    * @throws DebuggerException if there was problem during cleanup
70
    */
71
    public abstract void finishDebugger () throws DebuggerException;
72
73
    /**
74
    * Trace into (a statement).
75
    * @throws DebuggerException if there is a problem during execution
76
    */
77
    public abstract void traceInto () throws DebuggerException;
78
79
    /**
80
    * Trace over (a statement).
81
    * @throws DebuggerException if there is a problem during execution
82
    */
83
    public abstract void traceOver () throws DebuggerException;
84
85
    /**
86
    * Go.
87
    * This should continue executing user code until a breakpoint is hit or the debugger finishes.
88
    * @throws DebuggerException if there is a problem during execution
89
    */
90
    public abstract void go () throws DebuggerException;
91
92
    /**
93
    * Step out (of a statement).
94
    * @throws DebuggerException if there is a problem during execution
95
    */
96
    public abstract void stepOut () throws DebuggerException;
97
98
    // BREAKPOINTS
99
100
    /** Create a new breakpoint assigned to a specific line.
101
    * The line is represented by a line object that can change its
102
    * position as the text is modified.
103
    *
104
    * @param l line to create breakpoint at
105
    * @return the new breakpoint
106
    */
107
    public abstract Breakpoint createBreakpoint (Line l);
108
109
    /** Create a new breakpoint assigned to a specific line.
110
    * Allows creation of a hidden breakpoint.
111
    *
112
    * @param l line to create breakpoint at
113
    * @param hidden <code>true</code> if the breakpoint should be hidden from the user
114
    * @return the new breakpoint
115
    */
116
    public abstract Breakpoint createBreakpoint (Line l, boolean hidden);
117
118
    /** Find the breakpoint assigned to a given line.
119
    *
120
    * @param l line to find the breakpoint at
121
    * @return the breakpoint or <code>null</code> if there is no such breakpoint
122
    */
123
    public abstract Breakpoint findBreakpoint (Line l);
124
125
    /** Create a new breakpoint assigned to a method (or constructor).
126
    * The method is represented by a method (or constructor) source element that
127
    * must have a declaring class.
128
    *
129
    * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class
130
    * @return the new breakpoint
131
    * @exception IllegalArgumentException if the method does not have a declaring class
132
    */
133
    public abstract Breakpoint createBreakpoint (ConstructorElement method);
134
135
    /** Create a new breakpoint assigned to a method (or constructor).
136
    * The method is represented by a method (or constructor) source element that
137
    * must have a declaring class.
138
    * Allows creation of a hidden breakpoint.
139
    *
140
    * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class
141
    * @param hidden <code>true</code> if the breakpoint should be hidden from the user
142
    * @return the new breakpoint
143
    * @exception IllegalArgumentException if the method does not have a declaring class
144
    */
145
    public abstract Breakpoint createBreakpoint (ConstructorElement method, boolean hidden);
146
147
    /** Find the breakpoint assigned to a method (or constructor).
148
    *
149
    * @param method method or constructor to find the breakpoint of
150
    * @return the breakpoint or <code>null</code> if there is no such breakpoint
151
    * @exception IllegalArgumentException if the method does not have a declaring class
152
    */
153
    public abstract Breakpoint findBreakpoint (ConstructorElement method);
154
155
    /** Get all breakpoints in the system.
156
    *
157
    * @return all breakpoints
158
    */
159
    public abstract Breakpoint[] getBreakpoints ();
160
161
    /**
162
    * Remove all breakpoints from the system.
163
    */
164
    public abstract void removeAllBreakpoints ();
165
166
167
168
    // WATCHES
169
170
    /** Create new uninitialized watch. The watch is visible (not hidden).
171
    *
172
    * @return the new watch
173
    */
174
    public abstract Watch createWatch ();
175
176
    /** Create a watch with its expression set to an initial value.
177
    * Also
178
    * allows creation of a hidden watch (not presented to the user), for example
179
    * for internal use in the editor to obtain values of variables
180
    * under the mouse pointer.
181
    *
182
    * @param expr expression to watch for (the format is the responsibility of the debugger implementation, but it is typically a variable name)
183
    * @param hidden <code>true</code> if the watch should be hidden from the user
184
    * @return the new watch
185
    */
186
    public abstract Watch createWatch (String expr, boolean hidden);
187
188
    /**
189
    * Get all watches in the system.
190
    *
191
    * @return all watches
192
    */
193
    public abstract Watch[] getWatches ();
194
195
    /**
196
    * Remove all watches from the system.
197
    */
198
    public abstract void removeAllWatches ();
199
200
    // PROPERTIES
201
202
    /** Get the state of the debugger.
203
    *
204
    * @return {@link #DEBUGGER_NOT_RUNNING}, {@link #DEBUGGER_RUNNING}, {@link #DEBUGGER_STOPPED}, or {@link #DEBUGGER_STARTING}
205
    */
206
    public abstract int getState ();
207
208
    /** Get the current line of debugger.
209
    *
210
    * @return current line
211
    */
212
    public abstract Line getCurrentLine ();
213
214
    /**
215
    * Add a property change listener.
216
    *
217
    * @param l the listener to add
218
    */
219
    public abstract void addPropertyChangeListener (PropertyChangeListener l);
220
221
    /**
222
    * Remove a property change listener.
223
    *
224
    * @param l the listener to remove
225
    */
226
    public abstract void removePropertyChangeListener (PropertyChangeListener l);
227
}
(-)openide/deprecated/src/org/openide/debugger/DebuggerException.java (-56 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
/**
17
* An exception occurring in the debugger.
18
* This exception
19
* is thrown in the debugger from all methods which may involve running user code.
20
*
21
* @author   Jan Jancura
22
* @version  0.11, Jan 30, 1998
23
*/
24
public class DebuggerException extends java.lang.reflect.InvocationTargetException {
25
26
    /** generated Serialized Version UID */
27
    static final long serialVersionUID = -3112649137515905742L;
28
29
    /**
30
    * Construct a <code>DebuggerException</code> for a specified inner exception.
31
    * @param throwable the basic exception
32
    */
33
    public DebuggerException (Throwable throwable) {
34
        super (throwable);
35
    }
36
37
    /**
38
    * Construct a <code>DebuggerException</code> with a description.
39
    *
40
    * @param message message text
41
    */
42
    public DebuggerException (String description) {
43
        super (new Exception (), description);
44
    }
45
46
    /**
47
    * Construct a <code>DebuggerException</code> with a description and base error.
48
    *
49
    * @param message description of the exception
50
    * @param throwable original exception
51
    */
52
    public DebuggerException (String description, Throwable throwable) {
53
        super (throwable, description);
54
    }
55
56
}
(-)openide/deprecated/src/org/openide/debugger/DebuggerInfo.java (-97 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
17
/**
18
* Contains information about a class to debug.
19
* Consists of these pieces of information:
20
* <UL>
21
* <LI>the class to run
22
* <LI>parameters for its main method
23
* <LI>a class name to stop execution in, if desired
24
* </UL>
25
*
26
* @author Jan Jancura, Jaroslav Tulach
27
*/
28
public class DebuggerInfo extends org.openide.execution.ExecInfo {
29
    /** class to stop at */
30
    private String stopClassName;
31
32
    /**
33
    * Construct a new <code>DebuggerInfo</code> with the class to run and its parameters specified.
34
    * Sets class to stop in to be the class to run.
35
    *
36
    * @param className name of debugged class
37
    * @param argv command-line arguments used for debugging this class; may be empty but not <code>null</code>
38
    */
39
    public DebuggerInfo (
40
        String className,
41
        String[] argv
42
    ) {
43
        this (
44
            className,
45
            argv,
46
            className
47
        );
48
    }
49
50
    /**
51
    * Construct a new <code>DebuggerInfo</code> with the class to run, parameters, and a class to stop at.
52
    *
53
    * @param className name of debugged class
54
    * @param argv command-line arguments used for debugging this class; may be empty but not <code>null</code>
55
    * @param stopClassName name of class to stop in (may be <code>null</code>)
56
    */
57
    public DebuggerInfo (
58
        String className,
59
        String[] argv,
60
        String stopClassName
61
    ) {
62
        super (className, argv);
63
        this.stopClassName = stopClassName;
64
    }
65
66
    /** Checks whether the method has declaring class.
67
    * @param m method
68
    * @return the same method
69
    * @exception IllegalArgumentException if the stopMethod does not have
70
    *   declaring class
71
    *
72
    private static MethodElement method (MethodElement m) {
73
      if (m.getDeclaringClass () == null) {
74
        throw new IllegalArgumentException ("No declaring class for method: " + m.getName ());
75
      }
76
      return m;
77
}
78
    */
79
80
81
    /** Get the class to stop execution in.
82
    *
83
    * @return the class name or <code>null</code>
84
    */
85
    public String getStopClassName () {
86
        return stopClassName;
87
    }
88
89
    /** Getter for a method to stop at. If the method is not null
90
    * it has a declaring class. So
91
    * @return method or null
92
    *
93
    public MethodElement getStopMethod () {
94
      return stopMethod;
95
}
96
    */
97
}
(-)openide/deprecated/src/org/openide/debugger/DebuggerNotFoundException.java (-32 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
/**
17
* Exception indicating that the debugger itself could not be loaded properly.
18
*
19
* @author   Jan Jancura
20
*/
21
public class DebuggerNotFoundException extends DebuggerException {
22
23
    /** generated Serialized Version UID */
24
    static final long serialVersionUID = -3112649144515905742L;
25
26
    /**
27
    * Construct a new exception.
28
    */
29
    public DebuggerNotFoundException () {
30
        super (new Exception ());
31
    }
32
}
(-)openide/deprecated/src/org/openide/debugger/DebuggerType.java (-169 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.util.Enumeration;
17
18
import org.openide.TopManager;
19
import org.openide.execution.ExecInfo;
20
import org.openide.ServiceType;
21
import org.openide.util.HelpCtx;
22
import org.openide.loaders.DataObject;
23
import org.openide.cookies.ArgumentsCookie;
24
25
/** Defines one debugger type. It has method start that accepts ExecInfo and should
26
* probably create new DebuggerInfo and call Debugger.startDebug (debuggerInfo).
27
* The type should be serializable, so it can be attached to file attributes
28
* of any object that wishes to be especially debugged.
29
*
30
* <p>This class <em>currently</em> has a property editor in the IDE's
31
* default editor search path.
32
* 
33
* @author Jaroslav Tulach
34
*/
35
public abstract class DebuggerType extends ServiceType {
36
    static final long serialVersionUID =-3659300496270314301L;
37
    /** Should start the debugging of this type.
38
    * @param info class and parameters to run
39
    * @param stopOnMain should the debugging stop on main method or go to first breakpoint
40
    * @exception DebuggerException if debugger is not installed or cannot be started
41
    * @deprecated This method is a relic of Java-specific execution. New <code>DebuggerType</code>
42
    *             implementations are encouraged to implement this method to throw an
43
    *             exception, and override {@link #startDebugger(DataObject,boolean)} to be the actual implementation.
44
    */
45
    public abstract void startDebugger (ExecInfo info, boolean stopOnMain) throws DebuggerException;
46
47
    /** Starts debugging for a data object.
48
     * The default implementation assumes this object behaves akin to a Java class
49
     * by having a package-qualified object name and arguments as given by
50
     * {@link ArgumentsCookie} and delegates to {@link #startDebugger(ExecInfo,boolean)}.
51
    * @param obj object to run
52
    * @param stopOnMain should the debugging stop on main method or go to first breakpoint
53
    * @exception DebuggerException if debugger is not installed or cannot be started
54
    */
55
    public void startDebugger(DataObject obj, boolean stopOnMain) throws DebuggerException {
56
        String[] params;
57
        ArgumentsCookie ac = (ArgumentsCookie) obj.getCookie(getKlass("org.openide.cookies.ArgumentsCookie"));
58
        if (ac != null) {
59
            params = ac.getArguments();
60
        } else {
61
            params = new String[0];
62
        }
63
        startDebugger(new ExecInfo(obj.getPrimaryFile().getPackageName ('.'), params), stopOnMain);
64
    }
65
66
    public HelpCtx getHelpCtx () {
67
        return new HelpCtx (DebuggerType.class);
68
    }
69
70
    /** Get all registered executors in the system's execution engine.
71
    * @return enumeration of <code>DebuggerType</code>s
72
    * @deprecated Please use {@link org.openide.util.Lookup} instead.
73
    */
74
    public static Enumeration debuggerTypes () {
75
        return TopManager.getDefault ().getServices ().services (DebuggerType.class);
76
    }
77
78
    /** Find the
79
    * debugger implemented as a given class, among the executors registered to the
80
    * execution engine.
81
    * <P>
82
    * This should be used during (de-)serialization
83
    * of the specific debugger for a data object: only store its class name
84
    * and then try to find the debugger implemented by that class later.
85
    *
86
    * @param clazz the class of the debugger looked for
87
    * @return the desired debugger or <code>null</code> if it does not exist
88
    * @deprecated Please use {@link org.openide.util.Lookup} instead.
89
    */
90
    public static DebuggerType find (Class clazz) {
91
        ServiceType t = TopManager.getDefault ().getServices ().find (clazz);
92
        if (t instanceof DebuggerType) {
93
            return (DebuggerType)t;
94
        } else {
95
            return null;
96
        }
97
    }
98
99
    /** Find the
100
    * debugger with requested name, among the executors registered to the
101
    * execution engine.
102
    * <P>
103
    * This should be used during (de-)serialization
104
    * of the specific debugger for a data object: only store its name
105
    * and then try to find the debugger later.
106
    *
107
    * @param name (display) name of debugger to find
108
    * @return the desired debugger or <code>null</code> if it does not exist
109
    */
110
    public static DebuggerType find (String name) {
111
        ServiceType t = TopManager.getDefault ().getServices ().find (name);
112
        if (t instanceof DebuggerType) {
113
            return (DebuggerType)t;
114
        } else {
115
            return null;
116
        }
117
    }
118
119
    /** Get the default debugger for the system's execution engine.
120
    * <p>You may actually want {@link org.openide.loaders.ExecSupport#getExecutor}.
121
    * @return the default debugger
122
    * @deprecated There is probably not a single debugger type meaningfully applicable to all file types.
123
    *             If you explicitly want to invoke the plain Debugger interfaces, use {@link DebuggerType.Default} instead.
124
    */
125
    public static DebuggerType getDefault () {
126
        Enumeration en = debuggerTypes ();
127
        if (en.hasMoreElements ()) {
128
            return (DebuggerType)en.nextElement ();
129
        } else {
130
            return new Default ();
131
        }
132
    }
133
134
    // lazily loads a class
135
    private final Class getKlass(String name) {
136
        try {
137
            return Class.forName(name, false, getClass().getClassLoader());
138
        } catch (ClassNotFoundException e) {
139
            throw new NoClassDefFoundError(e.getLocalizedMessage());
140
        }
141
    }
142
    
143
    /** Default debugger type. */
144
    public static class Default extends DebuggerType {
145
        static final long serialVersionUID =6286540187114472027L;
146
147
        /* Gets the display name for this debugger type. */
148
        public String displayName() {
149
            return org.openide.util.NbBundle.getBundle(
150
                       Default.class
151
                   ).getString("LAB_DefaultDebuggerType");
152
        }
153
154
        public HelpCtx getHelpCtx () {
155
            return new HelpCtx (Default.class);
156
        }
157
158
        /* Starts the debugger. */
159
        public void startDebugger(ExecInfo info, boolean stopOnMain) throws DebuggerException {
160
            if (stopOnMain)
161
                TopManager.getDefault().getDebugger().startDebugger(new DebuggerInfo(
162
                            info.getClassName(), info.getArguments()));
163
            else
164
                TopManager.getDefault().getDebugger().startDebugger(new DebuggerInfo(
165
                            info.getClassName(), info.getArguments(), null));
166
        }
167
    } // end of inner class DefaultDebuggerType
168
169
}
(-)openide/deprecated/src/org/openide/debugger/Watch.java (-103 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.debugger;
15
16
import java.beans.PropertyChangeListener;
17
18
/** Represents one debugger watch.
19
* It contains only basic information
20
* that can be used by the core of the IDE.
21
* For example, the editor can use this object
22
* to display tooltips above variable names in the edited text.
23
* <P>
24
* It is likely that the real implementation of the watch can offer more
25
* functionality to the user--in which case it should expose properties
26
* as a JavaBean.
27
*
28
* @author   Jan Jancura, Jaroslav Tulach
29
*/
30
public abstract class Watch implements java.io.Serializable {
31
    /** Name of the property for the watched variable name. */
32
    public static final String PROP_VARIABLE_NAME = "variableName"; // NOI18N
33
    /** Name of the property for the value of the watched expression as a string. */
34
    public static final String PROP_AS_TEXT = "asText"; // NOI18N
35
    /** Name of the property for the type of the watch value. */
36
    public static final String PROP_TYPE = "type"; // NOI18N
37
38
39
    static final long serialVersionUID =2309154226451869624L;
40
    /** Remove the watch from the list of all watches in the system.
41
    */
42
    public abstract void remove ();
43
44
    /** Get the name of the variable to watch.
45
    *
46
    * @return the variable name
47
    */
48
    public abstract String getVariableName ();
49
50
    /** Set the variable name to watch.
51
    *
52
    * @param name string name of the variable to watch
53
    */
54
    public abstract void setVariableName (String name);
55
56
    /** Get a textual representation of the value.
57
    * The watch should convert
58
    * the real value to a string representation. So if the watch represents
59
    * a <code>null</code> reference, the returned string will be for example <code>"null"</code>.
60
    *
61
    * @return the value of this watch, or <code>null</code> if the watch is not in scope
62
    */
63
    public abstract String getAsText ();
64
65
    /** Set the value of the watched variable (as text).
66
    *
67
    * @param value text representation of the new value
68
    * @exception DebuggerException if the value cannot be changed, or the
69
    *    string does not represent valid value, or the value type cannot reasonably be set as text
70
    */
71
    public abstract void setAsText (String value) throws DebuggerException;
72
73
    /** Get the string representation of the type of the variable.
74
    *
75
    * @return type string (i.e. the class name, or for a primitive e.g. <code>"int"</code>)
76
    */
77
    public abstract String getType ();
78
79
    /** Test whether the watch is hidden.
80
    * If so, it
81
    * is not presented in the list of all watches. Such a watch can be used
82
    * for the IDE's (or some module's) private use, not displaying anything to the user.
83
    * @return <code>true</code> if the watch is hidden
84
    * @see Debugger#createWatch(String, boolean)
85
    */
86
    public abstract boolean isHidden ();
87
88
    /**
89
    * Add a property change listener.
90
    * Change events should be fired for the properties {@link #PROP_VARIABLE_NAME}, {@link #PROP_AS_TEXT}, and {@link #PROP_TYPE}.
91
    *
92
    * @param l the listener to add
93
    */
94
    public abstract void addPropertyChangeListener (PropertyChangeListener l);
95
96
    /**
97
    * Remove a property change listener.
98
    *
99
    * @param l the listener to remove
100
    */
101
    public abstract void removePropertyChangeListener (PropertyChangeListener l);
102
103
}
(-)openide/deprecated/src/org/openide/loaders/ExecSupport.java (-243 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.openide.loaders;
15
16
import java.beans.*;
17
import java.awt.event.*;
18
import java.io.IOException;
19
import java.lang.reflect.InvocationTargetException;
20
21
import org.openide.*;
22
import org.openide.compiler.*;
23
import org.openide.compiler.Compiler;
24
import org.openide.debugger.*;
25
import org.openide.execution.*;
26
import org.openide.explorer.propertysheet.*;
27
import org.openide.filesystems.*;
28
import org.openide.cookies.CompilerCookie;
29
import org.openide.cookies.DebuggerCookie;
30
import org.openide.nodes.Sheet;
31
import org.openide.nodes.PropertySupport;
32
import org.openide.util.NbBundle;
33
import org.openide.util.Mutex;
34
import org.openide.util.Lookup;
35
36
/** Support for execution and debugging.
37
* @author Jaroslav Tulach, Jesse Glick
38
* @deprecated Use {@link ExecutionSupport} unless you need support for debugging too.
39
*/
40
public class ExecSupport extends ExecutionSupport
41
    implements DebuggerCookie {
42
    /** extended attribute for debugger type */
43
    private static final String EA_DEBUGGER_TYPE = "NetBeansAttrDebuggerType"; // NOI18N
44
45
    /** Name of property providing a custom {@link DebuggerType} for a file. */
46
    public static final String PROP_DEBUGGER_TYPE     = "debuggerType"; // NOI18N
47
48
    /** @deprecated use {@link #getEntry} */
49
    protected MultiDataObject.Entry entry;
50
    /** @deprecated useless */
51
    protected boolean isReadOnly;
52
53
    /** Create new support for given entry. The file is taken from the
54
    * entry and is updated if the entry moves or renames itself.
55
    * @param entry entry to create instance from
56
    */
57
    public ExecSupport (MultiDataObject.Entry entry) {
58
        super(entry);
59
        this.entry = entry;
60
        Boolean ro = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES);
61
        isReadOnly = (ro == null)?false:(!ro.booleanValue());
62
    }
63
64
    /* Start debugging of associated object.
65
    * @param stopOnMain if <code>true</code>, debugger stops on the first line of debugged code
66
    * @exception DebuggerException if the session cannot be started
67
    */
68
    public void debug (final boolean stopOnMain) throws DebuggerException {
69
        DebuggerType t = getDebuggerType (entry);
70
        if (t == null) {
71
            t = defaultDebuggerType ();
72
        }
73
74
        try {
75
            t.startDebugger (entry.getDataObject(), stopOnMain);
76
            // ok, debugger started
77
            return;
78
        } catch (final DebuggerException ex) {
79
            try {
80
                Mutex.EVENT.readAccess (new Mutex.ExceptionAction () {
81
                                            public Object run () throws DebuggerException {
82
                                                if (debugFailed (ex)) {
83
                                                    // restart
84
                                                    debug (stopOnMain);
85
                                                }
86
                                                return null;
87
                                            }
88
                                        });
89
            } catch (org.openide.util.MutexException mx) {
90
                if (mx.getException() instanceof DebuggerException) {
91
                    throw (DebuggerException)mx.getException();
92
                } else {
93
                    throw new DebuggerException(mx.getException());
94
                }
95
            }
96
        }
97
    }
98
99
    /** Check if this object is up to date or in need of compilation.
100
    * Should compile it if necessary.
101
    * <p>The default implementation checks whether {@link CompilerCookie} is provided and
102
    * if so, creates a job and compiles the object. This behavior may be 
103
    * overridden by subclasses.
104
    *
105
    * @return <code>true</code> if the object was successfully brought up to date, <code>false</code> if the attempt failed (and it may be still be out of date)
106
    * @deprecated The check should be done in an action - ExecAction, ...
107
    */
108
    protected boolean checkCompiled () {
109
        DataObject obj = entry.getDataObject ();
110
111
        CompilerCookie c = (CompilerCookie)obj.getCookie (CompilerCookie.class);
112
113
        if (c != null) {
114
            CompilerJob job = new CompilerJob (Compiler.DEPTH_ZERO);
115
            job.setDisplayName (obj.getName ());
116
            c.addToJob (job, Compiler.DEPTH_ZERO);
117
            if (!job.isUpToDate ()) {
118
                // add name
119
                // compile it
120
                CompilerTask t = job.start ();
121
                return t.isSuccessful ();
122
            }
123
        }
124
        return true;
125
    }
126
127
    /** Called when invocation of the debugger fails. Allows to do some
128
    * modifications to the type of debugging and try it again.
129
    *
130
    * @param ex exeception that occured during execution
131
    * @return true if the debugging should be started again
132
    */
133
    protected boolean debugFailed (DebuggerException ex) {
134
        DebuggerType e = (DebuggerType)choose (getDebuggerType (entry), DebuggerType.class, ex);
135
        if (e == null) {
136
            return false;
137
        } else {
138
            try {
139
                setDebuggerType (entry, e);
140
                return true;
141
            } catch (IOException exc) {
142
                return false;
143
            }
144
        }
145
    }
146
147
    /** This method allows subclasses to override the default
148
    * debugger type they want to use for debugging.
149
    *
150
    * @return current implementation returns DebuggerType.getDefault ()
151
    */
152
    protected DebuggerType defaultDebuggerType () {
153
        return DebuggerType.getDefault ();
154
    }
155
156
    //
157
    // debugger support
158
    //
159
160
    /** Assignes a debugger type to an entry.
161
    * @param entry the object's entry
162
    * @param type the debugger type for this entry
163
    * @exception IOException if arguments cannot be set
164
    */
165
    public static void setDebuggerType (MultiDataObject.Entry entry, DebuggerType type) throws IOException {
166
        entry.getFile ().setAttribute (EA_DEBUGGER_TYPE,
167
                                       type == null ? null : new ServiceType.Handle (type)
168
                                      );
169
    }
170
171
    /** Retrieves the debugger type for this entry.
172
    * @param entry the entry
173
    * @return the debugger type or null if no type assigned
174
    */
175
    public static DebuggerType getDebuggerType (MultiDataObject.Entry entry) {
176
        Object handle = entry.getFile ().getAttribute (EA_DEBUGGER_TYPE);
177
        if (handle != null && (handle instanceof ServiceType.Handle)) {
178
            ServiceType dbg = ((ServiceType.Handle) handle).getServiceType ();
179
            if (dbg instanceof DebuggerType) {
180
                return (DebuggerType) dbg;
181
            }
182
        }
183
        
184
        Lookup l = Environment.find (entry.getDataObject ());
185
        DebuggerType dt = (DebuggerType)l.lookup (DebuggerType.class);
186
        if (dt != null) {
187
            return dt;
188
        }
189
        
190
        return null;
191
    }
192
193
    /** Helper method that creates default properties for execution of
194
    * a given support.
195
    * Includes properties to set the executor; debugger; and arguments.
196
    *
197
    * @param set sheet set to add properties to
198
    */
199
    public void addProperties (Sheet.Set set) {
200
        super.addProperties(set);
201
        set.put(createDebuggerProperty ());
202
    }
203
204
    /** Creates the debugger property for entry.
205
    * @return the property
206
    */
207
    private PropertySupport createDebuggerProperty () {
208
        return new PropertySupport.ReadWrite (
209
                   PROP_DEBUGGER_TYPE,
210
                   DebuggerType.class,
211
                   NbBundle.getMessage(DebuggerType.class, "PROP_debuggerType"),
212
                   NbBundle.getMessage(DebuggerType.class, "HINT_debuggerType")
213
               ) {
214
                   public Object getValue() {
215
                       DebuggerType dt = getDebuggerType (entry);
216
                       if (dt == null)
217
                           return defaultDebuggerType ();
218
                       else
219
                           return dt;
220
                   }
221
                   public void setValue (Object val) throws InvocationTargetException {
222
                       try {
223
                           setDebuggerType (entry, (DebuggerType) val);
224
                       } catch (IOException ex) {
225
                           throw new InvocationTargetException (ex);
226
                       }
227
                   }
228
                   public boolean supportsDefaultValue () {
229
                       return true;
230
                   }
231
232
                   public void restoreDefaultValue () throws InvocationTargetException {
233
                       setValue (null);
234
                   }
235
                   
236
                   public boolean canWrite () {
237
                       Boolean isReadOnly = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES);
238
                       return (isReadOnly == null)?false:(!isReadOnly.booleanValue());
239
                   }
240
               };
241
    }
242
243
}
(-)openide/release/system/ModuleAutoDeps/org-openide.xml (+100 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
                Sun Public License Notice
4
5
The contents of this file are subject to the Sun Public License
6
Version 1.0 (the "License"). You may not use this file except in
7
compliance with the License. A copy of the License is available at
8
http://www.sun.com/
9
10
The Original Code is NetBeans. The Initial Developer of the Original
11
Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12
Microsystems, Inc. All Rights Reserved.
13
-->
14
15
<!DOCTYPE transformations PUBLIC "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN" "http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd">
16
17
<transformations version="1.0">
18
19
    <transformationgroup>
20
        <description>JavaHelp was moved into a module</description>
21
        <exclusion codenamebase="org.netbeans.core" prefix="true"/>
22
        <exclusion codenamebase="org.openide" prefix="true"/>
23
        <exclusion codenamebase="org.netbeans.modules.javahelp" prefix="false"/>
24
        <transformation>
25
            <trigger-dependency type="older">
26
                <module-dependency codenamebase="org.openide" major="1" spec="2.2"/>
27
            </trigger-dependency>
28
            <implies>
29
                <result>
30
                    <token-dependency name="org.netbeans.api.javahelp.Help"/>
31
                </result>
32
            </implies>
33
        </transformation>
34
        <!-- #27776: package deps too -->
35
        <transformation>
36
            <trigger-dependency type="cancel">
37
                <package-dependency name="javax.help"/>
38
            </trigger-dependency>
39
            <implies>
40
                <result>
41
                    <module-dependency codenamebase="org.netbeans.modules.javahelp" major="1" spec="1.0"/>
42
                </result>
43
            </implies>
44
        </transformation>
45
    </transformationgroup>
46
47
    <transformationgroup>
48
        <description>API separation phase I (#19443)</description>
49
        <exclusion codenamebase="org.netbeans.core" prefix="true"/>
50
        <exclusion codenamebase="org.openide" prefix="true"/>
51
        <transformation>
52
            <trigger-dependency type="older">
53
                <module-dependency codenamebase="org.openide" major="1" spec="3.14"/>
54
            </trigger-dependency>
55
            <implies>
56
                <result>
57
                    <module-dependency codenamebase="org.openide.deprecated" spec="1.0"/>
58
                </result>
59
                <result>
60
                    <token-dependency name="org.openide.TopManager"/>
61
                </result>
62
                <result>
63
                    <module-dependency codenamebase="org.openide.src" spec="1.0"/>
64
                </result>
65
            </implies>
66
        </transformation>
67
    </transformationgroup>
68
69
    <transformationgroup>
70
        <description>API separation phase II (#19443)</description>
71
        <exclusion codenamebase="org.netbeans.core" prefix="true"/>
72
        <exclusion codenamebase="org.openide" prefix="true"/>
73
        <transformation>
74
            <trigger-dependency type="older">
75
                <module-dependency codenamebase="org.openide" major="1" spec="3.17"/>
76
            </trigger-dependency>
77
            <implies>
78
                <result>
79
                    <module-dependency codenamebase="org.openide.compiler" spec="1.0"/>
80
                </result>
81
                <result>
82
                    <token-dependency name="org.openide.compiler.CompilationEngine"/>
83
                </result>
84
                <result>
85
                    <module-dependency codenamebase="org.openide.execution" spec="1.0"/>
86
                </result>
87
                <result>
88
                    <token-dependency name="org.openide.execution.ExecutionEngine"/>
89
                </result>
90
                <result>
91
                    <module-dependency codenamebase="org.openide.io" spec="1.0"/>
92
                </result>
93
                <result>
94
                    <token-dependency name="org.openide.windows.IOProvider"/>
95
                </result>
96
            </implies>
97
        </transformation>
98
    </transformationgroup>
99
100
</transformations>
(-)projects/build.xml (+1 lines)
Lines 33-38 Link Here
33
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar" />
33
        <pathelement location="../java/srcmodel/netbeans/modules/autoload/java-src-model.jar" />
34
        <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
34
        <pathelement location="../openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
35
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
35
        <pathelement location="../openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
36
        <pathelement location="../debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
36
        <pathelement location="../core/netbeans/lib/core.jar"/>
37
        <pathelement location="../core/netbeans/lib/core.jar"/>
37
        <fileset dir="../core/external">
38
        <fileset dir="../core/external">
38
          <include name="xml-apis*.jar" />
39
          <include name="xml-apis*.jar" />
(-)projects/manifest.mf (-2 / +2 lines)
Lines 3-11 Link Here
3
OpenIDE-Module-Layer: org/netbeans/modules/projects/resources/projects-layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/projects/resources/projects-layer.xml
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
5
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
6
OpenIDE-Module-Specification-Version: 1.10
6
OpenIDE-Module-Specification-Version: 1.11
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
8
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.9, org.openide.deprecated > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0
8
OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.9, org.openide.deprecated > 1.2, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
9
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projects/Bundle.properties
9
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projects/Bundle.properties
10
10
11
Name: org/netbeans/modules/projects/ProjectDataLoader.class
11
Name: org/netbeans/modules/projects/ProjectDataLoader.class
(-)projects/src/org/netbeans/modules/projects/actions/DebuggerPerformer.java (-1 lines)
Lines 141-147 Link Here
141
        }
141
        }
142
        if (!installed) return;
142
        if (!installed) return;
143
        installed = false;
143
        installed = false;
144
        ((AddWatchAction) SystemAction.get (AddWatchAction.class)).setActionPerformer (null);
145
    }
144
    }
146
145
147
    void setDebuggerRunning (boolean b) {
146
    void setDebuggerRunning (boolean b) {
(-)rmi/build.xml (+1 lines)
Lines 70-75 Link Here
70
        <pathelement location="${nbroot}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
70
        <pathelement location="${nbroot}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
71
	<pathelement location="${nbroot}/java/netbeans/modules/java.jar"/>
71
	<pathelement location="${nbroot}/java/netbeans/modules/java.jar"/>
72
	<pathelement location="${nbroot}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
72
	<pathelement location="${nbroot}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
73
	<pathelement location="${nbroot}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
73
        <!-- Hopefully set up by nbbuild/build.xml: -->
74
        <!-- Hopefully set up by nbbuild/build.xml: -->
74
        <pathelement location="${jdkhome}/lib/tools.jar"/>
75
        <pathelement location="${jdkhome}/lib/tools.jar"/>
75
      </classpath>
76
      </classpath>
(-)rmi/manifest.mf (-2 / +2 lines)
Lines 3-11 Link Here
3
OpenIDE-Module-Install: org/netbeans/modules/rmi/RMIModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/rmi/RMIModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/rmi/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/rmi/resources/mf-layer.xml
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
5
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.6, org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1 > 1.11, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0
6
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.6, org.netbeans.modules.debugger.core/3, org.netbeans.modules.debugger.jpda/1 > 1.11, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
7
OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl, org.netbeans.api.javahelp.Help, org.openide.TopManager, dataloader.group, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
7
OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl, org.netbeans.api.javahelp.Help, org.openide.TopManager, dataloader.group, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine
8
OpenIDE-Module-Specification-Version: 1.7
8
OpenIDE-Module-Specification-Version: 1.8
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
9
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
10
Class-Path: docs/rmi.jar
10
Class-Path: docs/rmi.jar
11
11
(-)tomcatint/tomcat40/build.xml (+1 lines)
Lines 89-94 Link Here
89
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
89
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
90
        <pathelement location="${nb_root}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/> <!-- used only indirectly -->
90
        <pathelement location="${nb_root}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/> <!-- used only indirectly -->
91
        <pathelement location="${nb_root}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
91
        <pathelement location="${nb_root}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
92
        <pathelement location="${nb_root}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
92
        <pathelement location="${nb_root}/openide/io/netbeans/modules/autoload/openide-io.jar"/>
93
        <pathelement location="${nb_root}/openide/io/netbeans/modules/autoload/openide-io.jar"/>
93
        <pathelement location="${nb_root}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
94
        <pathelement location="${nb_root}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
94
      </classpath>
95
      </classpath>
(-)tomcatint/tomcat40/manifest.mf (-2 / +2 lines)
Lines 1-11 Link Here
1
OpenIDE-Module: org.netbeans.modules.web.tomcat.tomcat40/1
1
OpenIDE-Module: org.netbeans.modules.web.tomcat.tomcat40/1
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tomcat/tomcat40/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tomcat/tomcat40/Bundle.properties
3
OpenIDE-Module-Layer: org/netbeans/modules/tomcat/tomcat40/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/tomcat/tomcat40/resources/layer.xml
4
OpenIDE-Module-Specification-Version: 1.6
4
OpenIDE-Module-Specification-Version: 1.7
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Install: org/netbeans/modules/tomcat/tomcat40/Tomcat40ModuleInstall.class
6
OpenIDE-Module-Install: org/netbeans/modules/tomcat/tomcat40/Tomcat40ModuleInstall.class
7
OpenIDE-Module-Provides: org.netbeans.modules.tomcatint.tomcat40
7
OpenIDE-Module-Provides: org.netbeans.modules.tomcatint.tomcat40
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.j2eeserver/2, org.netbeans.modules.web.core/1 > 1.8, org.netbeans.modules.schema2beans/1, org.netbeans.modules.servletapi23/1, org.netbeans.modules.web.jspparser/1 > 1.2, org.netbeans.modules.debugger.core/3, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.netbeans.modules.java/1, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.j2eeserver/2, org.netbeans.modules.web.core/1 > 1.8, org.netbeans.modules.schema2beans/1, org.netbeans.modules.servletapi23/1, org.netbeans.modules.web.jspparser/1 > 1.2, org.netbeans.modules.debugger.core/3, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.netbeans.modules.java/1, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.openide.debugger > 1.0
9
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
9
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
10
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
10
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
11
OpenIDE-Module-Package-Dependencies: [javax.servlet.ServletException], [org.apache.jasper.Constants], [org.apache.jasper.Options], [org.apache.xml.serialize.EncodingInfo]
11
OpenIDE-Module-Package-Dependencies: [javax.servlet.ServletException], [org.apache.jasper.Constants], [org.apache.jasper.Options], [org.apache.xml.serialize.EncodingInfo]
(-)web/advanced/manifest.mf (-2 / +2 lines)
Lines 2-8 Link Here
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/ie/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/ie/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/web/ie/WebModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/web/ie/WebModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/web/ie/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/web/ie/layer.xml
5
OpenIDE-Module-Specification-Version: 1.12
5
OpenIDE-Module-Specification-Version: 1.13
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1 > 1.10, 
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1 > 1.10, 
Lines 14-20 Link Here
14
   org.netbeans.modules.html/1,
14
   org.netbeans.modules.html/1,
15
   org.openidex.util/2,
15
   org.openidex.util/2,
16
   org.netbeans.core/1 > 1.0,
16
   org.netbeans.core/1 > 1.0,
17
   org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.execution > 1.0
17
   org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.execution > 1.0
18
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine
18
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine
19
Class-Path: docs/jspie.jar
19
Class-Path: docs/jspie.jar
20
20
(-)web/advanced/src/org/netbeans/modules/web/config/ConfigLoader.java (-4 / +1 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 29-35 Link Here
29
import org.openide.loaders.DataObjectExistsException;
29
import org.openide.loaders.DataObjectExistsException;
30
import org.openide.text.EditorSupport;
30
import org.openide.text.EditorSupport;
31
import org.openide.loaders.OpenSupport;
31
import org.openide.loaders.OpenSupport;
32
import org.openide.loaders.ExecSupport;
33
import org.openide.filesystems.FileObject;
32
import org.openide.filesystems.FileObject;
34
import org.openide.filesystems.FileStateInvalidException;
33
import org.openide.filesystems.FileStateInvalidException;
35
import org.openide.nodes.Children;
34
import org.openide.nodes.Children;
Lines 39-46 Link Here
39
import org.openide.windows.CloneableTopComponent;
38
import org.openide.windows.CloneableTopComponent;
40
import org.openide.execution.NbClassPath;
39
import org.openide.execution.NbClassPath;
41
import org.openide.filesystems.*;
40
import org.openide.filesystems.*;
42
43
import org.netbeans.modules.j2ee.impl.ServerExecSupport;
44
41
45
/**
42
/**
46
* Loader for Server Configuration DataObjects.
43
* Loader for Server Configuration DataObjects.
(-)web/advanced/src/org/netbeans/modules/web/ie/JspLoaderIE.java (-2 / +1 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 17-23 Link Here
17
17
18
import org.openide.TopManager;
18
import org.openide.TopManager;
19
import org.openide.actions.*;
19
import org.openide.actions.*;
20
import org.openide.cookies.DebuggerCookie;
21
import org.openide.loaders.UniFileLoader;
20
import org.openide.loaders.UniFileLoader;
22
import org.openide.loaders.MultiDataObject;
21
import org.openide.loaders.MultiDataObject;
23
import org.openide.loaders.DataObject;
22
import org.openide.loaders.DataObject;
(-)web/core/build.xml (+1 lines)
Lines 71-76 Link Here
71
        <pathelement location="${nb_root}/java/netbeans/modules/java.jar"/>
71
        <pathelement location="${nb_root}/java/netbeans/modules/java.jar"/>
72
        <pathelement location="${nb_root}/jarpackager/netbeans/modules/jarpackager.jar"/>
72
        <pathelement location="${nb_root}/jarpackager/netbeans/modules/jarpackager.jar"/>
73
        <pathelement location="${nb_root}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
73
        <pathelement location="${nb_root}/debuggercore/netbeans/modules/autoload/debuggerCore.jar"/>
74
        <pathelement location="${nb_root}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
74
        <pathelement location="${nb_root}/schema2beans/netbeans/modules/schema2beans.jar" />
75
        <pathelement location="${nb_root}/schema2beans/netbeans/modules/schema2beans.jar" />
75
        <pathelement location="${nb_root}/openide/netbeans/lib/openide.jar"/>
76
        <pathelement location="${nb_root}/openide/netbeans/lib/openide.jar"/>
76
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
77
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
(-)web/core/manifest.mf (-2 / +2 lines)
Lines 2-11 Link Here
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/core/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/core/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/web/core/ServletSupportModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/web/core/ServletSupportModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/web/core/resources/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/web/core/resources/layer.xml
5
OpenIDE-Module-Specification-Version: 1.12
5
OpenIDE-Module-Specification-Version: 1.13
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1,org.netbeans.modules.debugger.core/3, org.netbeans.modules.j2eeserver/2, org.netbeans.modules.schema2beans/1, org.netbeans.modules.html/1, org.netbeans.modules.jarpackager/2, org.openidex.util/2, org.netbeans.api.xml/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.netbeans.core/1 > 1.0
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1,org.netbeans.modules.debugger.core/3, org.netbeans.modules.j2eeserver/2, org.netbeans.modules.schema2beans/1, org.netbeans.modules.html/1, org.netbeans.modules.jarpackager/2, org.openidex.util/2, org.netbeans.api.xml/1, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.io > 1.0, org.netbeans.core/1 > 1.0, org.openide.debugger > 1.0
9
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
9
OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider
10
10
11
Name: org/netbeans/modules/web/dd/DDDataLoader.class
11
Name: org/netbeans/modules/web/dd/DDDataLoader.class
(-)web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditor.java (-4 / +2 lines)
Lines 306-313 Link Here
306
        }
306
        }
307
307
308
        /* This method is called when parent window of this component has focus,
308
        /* This method is called when parent window of this component has focus,
309
        * and this component is preferred one in it. This implementation adds 
309
        * and this component is preferred one in it.
310
        * performer to the ToggleBreakpointAction.
311
        */
310
        */
312
        protected void componentActivated () {
311
        protected void componentActivated () {
313
            getEditorPane().addCaretListener(caretListener);
312
            getEditorPane().addCaretListener(caretListener);
Lines 316-323 Link Here
316
315
317
        /*
316
        /*
318
        * This method is called when parent window of this component losts focus,
317
        * This method is called when parent window of this component losts focus,
319
        * or when this component losts preferrence in the parent window. This 
318
        * or when this component losts preferrence in the parent window.
320
        * implementation removes performer from the ToggleBreakpointAction.
321
        */
319
        */
322
        protected void componentDeactivated () {
320
        protected void componentDeactivated () {
323
            getEditorPane().removeCaretListener(caretListener);
321
            getEditorPane().removeCaretListener(caretListener);
(-)web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java (-4 / +2 lines)
Lines 298-305 Link Here
298
        }
298
        }
299
        
299
        
300
        /* This method is called when parent window of this component has focus,
300
        /* This method is called when parent window of this component has focus,
301
         * and this component is preferred one in it. This implementation adds
301
         * and this component is preferred one in it.
302
         * performer to the ToggleBreakpointAction.
303
         */
302
         */
304
        protected void componentActivated() {
303
        protected void componentActivated() {
305
            getEditorPane().addCaretListener(caretListener);
304
            getEditorPane().addCaretListener(caretListener);
Lines 308-315 Link Here
308
        
307
        
309
        /*
308
        /*
310
         * This method is called when parent window of this component losts focus,
309
         * This method is called when parent window of this component losts focus,
311
         * or when this component losts preferrence in the parent window. This
310
         * or when this component losts preferrence in the parent window.
312
         * implementation removes performer from the ToggleBreakpointAction.
313
         */
311
         */
314
        protected void componentDeactivated() {
312
        protected void componentDeactivated() {
315
            getEditorPane().removeCaretListener(caretListener);
313
            getEditorPane().removeCaretListener(caretListener);
(-)web/jspdebug/build.xml (+1 lines)
Lines 43-48 Link Here
43
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
43
        <pathelement location="${nb_root}/openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar"/> <!-- XXX -->
44
        <pathelement location="${nb_root}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
44
        <pathelement location="${nb_root}/openide/compiler/netbeans/modules/autoload/openide-compiler.jar"/>
45
        <pathelement location="${nb_root}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
45
        <pathelement location="${nb_root}/openide/execution/netbeans/modules/autoload/openide-execution.jar"/>
46
        <pathelement location="${nb_root}/debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar"/>
46
        <pathelement location="${nb_root}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
47
        <pathelement location="${nb_root}/java/srcmodel/netbeans/modules/autoload/java-src-model.jar"/>
47
        <!-- Hopefully set up by nbbuild/build.xml: -->
48
        <!-- Hopefully set up by nbbuild/build.xml: -->
48
        <pathelement location="${jdkhome}/lib/tools.jar"/>
49
        <pathelement location="${jdkhome}/lib/tools.jar"/>
(-)web/jspdebug/manifest.mf (-2 / +2 lines)
Lines 2-10 Link Here
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/debug/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/debug/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/web/debug/DebugModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/web/debug/DebugModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/web/debug/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/web/debug/layer.xml
5
OpenIDE-Module-Specification-Version: 1.5
5
OpenIDE-Module-Specification-Version: 1.6
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1 > 1.10, org.netbeans.modules.j2eeserver/2, org.netbeans.modules.debugger.core/3, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.netbeans.modules.debugger.jpda/1, org.openide.compiler > 1.0, org.openide.execution > 1.0
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1 > 1.10, org.netbeans.modules.j2eeserver/2, org.netbeans.modules.debugger.core/3, org.openide.deprecated > 1.2, org.openide.src > 1.0, org.netbeans.modules.debugger.jpda/1, org.openide.compiler > 1.0, org.openide.execution > 1.0, org.openide.debugger > 1.0
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
9
OpenIDE-Module-Requires: org.openide.TopManager
9
OpenIDE-Module-Requires: org.openide.TopManager
10
10
(-)web/jspdebug/src/org/netbeans/modules/web/debug/JspEditor.java (-42 / +52 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 16-25 Link Here
16
import java.io.IOException;
16
import java.io.IOException;
17
import java.io.InputStream;
17
import java.io.InputStream;
18
import java.io.ObjectInput;
18
import java.io.ObjectInput;
19
import java.util.Enumeration;
19
import java.util.*;
20
import java.util.List;
20
import java.awt.event.ActionEvent;
21
import java.util.ArrayList;
22
import javax.swing.JEditorPane;
21
import javax.swing.JEditorPane;
22
import javax.swing.AbstractAction;
23
import javax.swing.text.BadLocationException;
23
import javax.swing.text.BadLocationException;
24
import javax.swing.text.EditorKit;
24
import javax.swing.text.EditorKit;
25
import javax.swing.text.StyledDocument;
25
import javax.swing.text.StyledDocument;
Lines 34-46 Link Here
34
import org.openide.windows.CloneableTopComponent;
34
import org.openide.windows.CloneableTopComponent;
35
import org.openide.windows.Mode;
35
import org.openide.windows.Mode;
36
import org.openide.windows.Workspace;
36
import org.openide.windows.Workspace;
37
import org.openide.util.NbBundle;
38
import org.netbeans.modules.web.core.jsploader.BaseJspEditor;
37
import org.netbeans.modules.web.core.jsploader.BaseJspEditor;
39
import org.openide.util.actions.SystemAction;
38
import org.openide.util.actions.SystemAction;
40
import org.openide.util.actions.ActionPerformer;
41
import org.openide.text.NbDocument;
39
import org.openide.text.NbDocument;
42
import org.openide.ErrorManager;
40
import org.openide.ErrorManager;
43
import org.openide.util.RequestProcessor;
41
import org.openide.util.*;
44
import org.netbeans.modules.debugger.CoreBreakpoint;
42
import org.netbeans.modules.debugger.CoreBreakpoint;
45
43
46
44
Lines 111-116 Link Here
111
        /** Default constructor */
109
        /** Default constructor */
112
        public JspEditorComponent() {
110
        public JspEditorComponent() {
113
            super();
111
            super();
112
            initialize();
114
        }
113
        }
115
114
116
        /**
115
        /**
Lines 119-124 Link Here
119
         */
118
         */
120
        public JspEditorComponent(DataObject obj) {
119
        public JspEditorComponent(DataObject obj) {
121
            super(obj);
120
            super(obj);
121
            initialize();
122
        }
123
124
        public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException {
125
            super.readExternal(in);
126
            initialize();
127
        }
128
129
        private void initialize() {
130
            getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N
131
        }
132
133
        /**
134
         * Locally bound action to toggle breakpoint on the current line.
135
         * @see "#29914"
136
         */
137
        private final class ToggleBreakpointAction extends AbstractAction implements LookupListener {
138
            private final Lookup.Result debuggerR;
139
            public ToggleBreakpointAction() {
140
                debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class));
141
                debuggerR.addLookupListener(this);
142
                resultChanged(null);
143
            }
144
            public void actionPerformed(ActionEvent e) {
145
                int row = NbDocument.findLineNumber (getSupport().getDocument (), 
146
                                                     getPane().getCaret ().getDot () );
147
                Line line = (getSupport().getLineSet ()).getCurrent (row);
148
                synchronized (this) {
149
                    Iterator it = debuggerR.allInstances().iterator();
150
                    if (it.hasNext()) {
151
                        Debugger debugger = (Debugger)it.next();
152
                        Breakpoint b = debugger.findBreakpoint (line);
153
                        if (b != null) {
154
//                          JspCompoundEvent jspCE = (JspCompoundEvent)((CoreBreakpoint)b).getEvent();
155
//                          jspCE.clearEvents();
156
                            b.remove ();
157
                        } else {
158
                            debugger.createBreakpoint (line);
159
                        }
160
                    }
161
                }
162
            }
163
            public void resultChanged(LookupEvent e) {
164
                setEnabled(!debuggerR.allInstances().isEmpty());
165
            }
122
        }
166
        }
123
167
124
        /* return editor support
168
        /* return editor support
Lines 160-196 Link Here
160
*/    
204
*/    
161
        
205
        
162
        /** This method is called when parent window of this component has focus,
206
        /** This method is called when parent window of this component has focus,
163
         * and this component is preferred one in it. This implementation adds
207
         * and this component is preferred one in it.
164
         * performer to the ToggleBreakpointAction.
165
         */
208
         */
166
        protected void componentActivated() {
209
        protected void componentActivated() {
167
            
168
            setFocusedJspEditor(true);
210
            setFocusedJspEditor(true);
169
211
170
            // set the performer
171
            try {
172
                final Debugger debugger = TopManager.getDefault ().getDebugger ();
173
                ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)).
174
                    setActionPerformer (new ActionPerformer () {
175
                                            public void performAction (SystemAction a) {
176
                                                int row = NbDocument.findLineNumber (getSupport().getDocument (), 
177
                                                                                     getPane().getCaret ().getDot () );
178
                                                Line line = (getSupport().getLineSet ()).getCurrent (row);
179
                                                Breakpoint b = debugger.findBreakpoint (line);
180
                                                if (b != null) {
181
//                                                    JspCompoundEvent jspCE = (JspCompoundEvent)((CoreBreakpoint)b).getEvent();
182
//                                                    jspCE.clearEvents();
183
                                                    b.remove ();
184
                                                } else {
185
                                                    debugger.createBreakpoint (line);
186
                                                }
187
                                            }
188
                                        } );
189
            }
190
            catch (DebuggerNotFoundException e) {
191
                TopManager.getDefault().getErrorManager().notify(ErrorManager.EXCEPTION, e);
192
            }
193
194
            super.componentActivated();
212
            super.componentActivated();
195
        }
213
        }
196
214
Lines 198-206 Link Here
198
        */
216
        */
199
217
200
        protected void componentDeactivated() {
218
        protected void componentDeactivated() {
201
            // unset the performer for ToggleBreakpointAction
202
            ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)).
203
                setActionPerformer (null);
204
            super.componentDeactivated();
219
            super.componentDeactivated();
205
            //jspSupport.enableJspLineMapping(true);
220
            //jspSupport.enableJspLineMapping(true);
206
        }
221
        }
Lines 209-215 Link Here
209
            SystemAction[] sa = super.getSystemActions ();
224
            SystemAction[] sa = super.getSystemActions ();
210
            SystemAction[] jspServletActions = new SystemAction[] {
225
            SystemAction[] jspServletActions = new SystemAction[] {
211
                null,
226
                null,
212
                SystemAction.get(org.openide.actions.ToggleBreakpointAction.class),
213
                SystemAction.get(ShowServlet.class),
227
                SystemAction.get(ShowServlet.class),
214
                SystemAction.get(ToggleJspStepMode.class)
228
                SystemAction.get(ToggleJspStepMode.class)
215
            };
229
            };
Lines 238-244 Link Here
238
        return focus;
252
        return focus;
239
    }
253
    }
240
}
254
}
241
242
243
244
(-)web/jspdebug/src/org/netbeans/modules/web/debug/JspEditorSupport.java (-39 / +52 lines)
Lines 7-18 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
14
package org.netbeans.modules.web.debug;
14
package org.netbeans.modules.web.debug;
15
15
16
import java.awt.event.ActionEvent;
17
import java.io.IOException;
18
import java.io.ObjectInput;
19
import java.util.Iterator;
20
import javax.swing.AbstractAction;
16
import org.netbeans.modules.web.core.jsploader.BaseJspEditorSupport;
21
import org.netbeans.modules.web.core.jsploader.BaseJspEditorSupport;
17
import org.netbeans.modules.web.core.jsploader.JspDataObject;
22
import org.netbeans.modules.web.core.jsploader.JspDataObject;
18
import org.openide.TopManager;
23
import org.openide.TopManager;
Lines 20-33 Link Here
20
import org.openide.text.Line;
25
import org.openide.text.Line;
21
import org.openide.windows.CloneableTopComponent;
26
import org.openide.windows.CloneableTopComponent;
22
import org.openide.util.actions.SystemAction;
27
import org.openide.util.actions.SystemAction;
23
import org.openide.actions.ToggleBreakpointAction;
24
import org.netbeans.modules.web.debug.ShowServlet;
28
import org.netbeans.modules.web.debug.ShowServlet;
25
import org.netbeans.modules.web.debug.ToggleJspStepMode;
29
import org.netbeans.modules.web.debug.ToggleJspStepMode;
26
import org.openide.debugger.Debugger;
30
import org.openide.debugger.Debugger;
27
import org.openide.util.actions.ActionPerformer;
28
import org.openide.text.NbDocument;
31
import org.openide.text.NbDocument;
29
import org.openide.debugger.Breakpoint;
32
import org.openide.debugger.Breakpoint;
30
import org.openide.debugger.DebuggerNotFoundException;
33
import org.openide.debugger.DebuggerNotFoundException;
34
import org.openide.util.*;
31
35
32
36
33
/** Editor for JSP pages */
37
/** Editor for JSP pages */
Lines 69-74 Link Here
69
        /** Default constructor */
73
        /** Default constructor */
70
        public JspEditor() {
74
        public JspEditor() {
71
            super();
75
            super();
76
            initialize();
72
        }
77
        }
73
78
74
        /**
79
        /**
Lines 77-132 Link Here
77
         */
82
         */
78
        public JspEditor(BaseJspEditorSupport s) {
83
        public JspEditor(BaseJspEditorSupport s) {
79
            super(s);
84
            super(s);
85
            initialize();
86
        }
87
88
        public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException {
89
            super.readExternal(in);
90
            initialize();
91
        }
92
93
        private void initialize() {
94
            getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N
95
        }
96
97
        /**
98
         * Locally bound action to toggle breakpoint on the current line.
99
         * @see "#29914"
100
         */
101
        private final class ToggleBreakpointAction extends AbstractAction implements LookupListener {
102
            private final Lookup.Result debuggerR;
103
            public ToggleBreakpointAction() {
104
                debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class));
105
                debuggerR.addLookupListener(this);
106
                resultChanged(null);
107
            }
108
            public void actionPerformed(ActionEvent e) {
109
                synchronized (this) {
110
                    Iterator it = debuggerR.allInstances().iterator();
111
                    if (it.hasNext()) {
112
                        Debugger debugger = (Debugger)it.next();
113
                        int row = NbDocument.findLineNumber (cloneableEditorSupport().getDocument(), 
114
                                                             getEditorPane().getCaret().getDot() );
115
                        Line line = (cloneableEditorSupport().getLineSet()).getCurrent(row);
116
                        Breakpoint b = debugger.findBreakpoint(line);
117
                        if (b != null) {
118
                            b.remove();
119
                        } else {
120
                            debugger.createBreakpoint(line);
121
                        }
122
                    }
123
                }
124
            }
125
            public void resultChanged(LookupEvent e) {
126
                setEnabled(!debuggerR.allInstances().isEmpty());
127
            }
80
        }
128
        }
81
129
82
        /** This method is called when parent window of this component has focus,
130
        /** This method is called when parent window of this component has focus,
83
         * and this component is preferred one in it. This implementation adds
131
         * and this component is preferred one in it.
84
         * performer to the ToggleBreakpointAction.
85
         */
132
         */
86
        protected void componentActivated() {
133
        protected void componentActivated() {
87
            setFocusedJspEditor(true);
134
            setFocusedJspEditor(true);
88
          
89
90
            // set the performer
91
            try {
92
                final Debugger debugger = TopManager.getDefault ().getDebugger ();
93
                ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)).
94
                    setActionPerformer (new ActionPerformer () {
95
                                            public void performAction (SystemAction a) {
96
                                                int row = NbDocument.findLineNumber (cloneableEditorSupport().getDocument(), 
97
                                                                                     getEditorPane().getCaret().getDot() );
98
                                                Line line = (cloneableEditorSupport().getLineSet()).getCurrent(row);
99
                                                Breakpoint b = debugger.findBreakpoint(line);
100
                                                if (b != null) {
101
                                                    b.remove();
102
                                                } else {
103
                                                    debugger.createBreakpoint(line);
104
                                                }
105
                                            }
106
                                        } );
107
            }
108
            catch (DebuggerNotFoundException e) {
109
                TopManager.getDefault().getErrorManager().notify(ErrorManager.EXCEPTION, e);
110
            }
111
135
112
            super.componentActivated();
136
            super.componentActivated();
113
        }
137
        }
114
138
115
        /* This method is called when this component loses focus
116
        */
117
118
        protected void componentDeactivated() {
119
            // unset the performer for ToggleBreakpointAction
120
            ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)).
121
                setActionPerformer (null);
122
            super.componentDeactivated();
123
        }
124
       
125
        public SystemAction[] getSystemActions() {
139
        public SystemAction[] getSystemActions() {
126
            SystemAction[] sa = super.getSystemActions ();
140
            SystemAction[] sa = super.getSystemActions ();
127
            SystemAction[] jspServletActions = new SystemAction[] {
141
            SystemAction[] jspServletActions = new SystemAction[] {
128
                null,
142
                null,
129
                SystemAction.get(ToggleBreakpointAction.class),
130
                SystemAction.get(ShowServlet.class),
143
                SystemAction.get(ShowServlet.class),
131
                SystemAction.get(ToggleJspStepMode.class)
144
                SystemAction.get(ToggleJspStepMode.class)
132
            };
145
            };
(-)web/jspdebug/src/org/netbeans/modules/web/debug/JspServletEditor.java (-37 / +52 lines)
Lines 7-23 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
14
package org.netbeans.modules.web.debug;
14
package org.netbeans.modules.web.debug;
15
15
16
import java.awt.Color;
16
import java.awt.Color;
17
import java.awt.event.ActionEvent;
17
import java.io.IOException;
18
import java.io.IOException;
18
import java.io.InputStream;
19
import java.io.InputStream;
19
import java.io.ObjectInput;
20
import java.io.ObjectInput;
21
import java.util.Iterator;
20
import java.util.Vector;
22
import java.util.Vector;
23
import javax.swing.AbstractAction;
21
import javax.swing.JEditorPane;
24
import javax.swing.JEditorPane;
22
import javax.swing.SwingUtilities;
25
import javax.swing.SwingUtilities;
23
import javax.swing.text.Style;
26
import javax.swing.text.Style;
Lines 45-58 Link Here
45
import org.openide.text.Line;
48
import org.openide.text.Line;
46
import org.openide.text.NbDocument;
49
import org.openide.text.NbDocument;
47
import org.openide.text.CloneableEditor;
50
import org.openide.text.CloneableEditor;
48
import org.openide.util.NbBundle;
49
import org.openide.util.actions.ActionPerformer;
50
import org.openide.util.actions.SystemAction;
51
import org.openide.util.actions.SystemAction;
51
import org.openide.windows.CloneableTopComponent;
52
import org.openide.windows.CloneableTopComponent;
52
import org.openide.windows.Mode;
53
import org.openide.windows.Mode;
53
import org.openide.windows.Workspace;
54
import org.openide.windows.Workspace;
54
import org.openide.ErrorManager;
55
import org.openide.ErrorManager;
55
import org.openide.util.RequestProcessor;
56
import org.openide.util.*;
56
57
57
/*
58
/*
58
/** Editor for servlet files generated from JSP files. Main features:
59
/** Editor for servlet files generated from JSP files. Main features:
Lines 160-170 Link Here
160
        /** Default constructor */
161
        /** Default constructor */
161
        public ServletEditorComponentIE() {
162
        public ServletEditorComponentIE() {
162
            super();
163
            super();
164
            initialize();
163
        }
165
        }
164
166
165
        /** Default constructor */
167
        /** Default constructor */
166
        public ServletEditorComponentIE(ServletEditor support) {
168
        public ServletEditorComponentIE(ServletEditor support) {
167
            super(support);
169
            super(support);
170
            initialize();
171
        }
172
173
        public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException {
174
            super.readExternal(in);
175
            initialize();
176
        }
177
178
        private void initialize() {
179
            getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N
180
        }
181
182
        /**
183
         * Locally bound action to toggle breakpoint on the current line.
184
         * @see "#29914"
185
         */
186
        private final class ToggleBreakpointAction extends AbstractAction implements LookupListener {
187
            private final Lookup.Result debuggerR;
188
            public ToggleBreakpointAction() {
189
                debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class));
190
                debuggerR.addLookupListener(this);
191
                resultChanged(null);
192
            }
193
            public void actionPerformed(ActionEvent e) {
194
                synchronized (this) {
195
                    Iterator it = debuggerR.allInstances().iterator();
196
                    if (it.hasNext()) {
197
                        Debugger debugger = (Debugger)it.next();
198
                        int l = NbDocument.findLineNumber (
199
                            getSupport().getDocument (),
200
                            getPane().getCaret ().getDot ()
201
                            );
202
                        Line line = getSupport().getLineSet ().getCurrent (l);
203
                        Breakpoint b = debugger.findBreakpoint (line);
204
                        if (b != null) { 
205
                            b.remove ();
206
                        } else {//create brerakpoint
207
                            debugger.createBreakpoint (line);
208
                        }
209
                    }
210
                }
211
            }
212
            public void resultChanged(LookupEvent e) {
213
                setEnabled(!debuggerR.allInstances().isEmpty());
214
            }
168
        }
215
        }
169
216
170
        /** get pane
217
        /** get pane
Lines 182-229 Link Here
182
        }
229
        }
183
230
184
        /* This method is called when parent window of this component has focus,
231
        /* This method is called when parent window of this component has focus,
185
         * and this component is preferred one in it. This implementation adds
232
         * and this component is preferred one in it.
186
         * performer to the ToggleBreakpointAction.
187
         */
233
         */
188
        protected void componentActivated () {
234
        protected void componentActivated () {
189
            JspEditorSupport.setFocusedJspEditor(false);
235
            JspEditorSupport.setFocusedJspEditor(false);
190
            try {
191
                final Debugger debugger = TopManager.getDefault ().getDebugger ();
192
                ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)).
193
                    setActionPerformer (
194
                        new ActionPerformer () {
195
                            public void performAction (SystemAction a) {
196
                                int l = NbDocument.findLineNumber (
197
                                            getSupport().getDocument (),
198
                                            getPane().getCaret ().getDot ()
199
                                        );
200
                                Line line = getSupport().getLineSet ().getCurrent (l);
201
                                Breakpoint b = debugger.findBreakpoint (line);
202
                                if (b != null) { 
203
                                    b.remove ();
204
                                } else {//create brerakpoint
205
                                    debugger.createBreakpoint (line);
206
                                }
207
                            }
208
                        }
209
                    );
210
            } catch (DebuggerNotFoundException e) {
211
            }
212
            super.componentActivated ();
236
            super.componentActivated ();
213
        }
237
        }
214
238
215
        /* This method is called when this component loses focus
216
         */
217
        protected void componentDeactivated () {
218
            ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)).
219
                setActionPerformer (null);
220
            super.componentDeactivated();
221
        }
222
        
223
         public SystemAction[] getSystemActions() {
239
         public SystemAction[] getSystemActions() {
224
             SystemAction[] sa = super.getSystemActions ();
240
             SystemAction[] sa = super.getSystemActions ();
225
             SystemAction[] jspServletActions = new SystemAction[] {
241
             SystemAction[] jspServletActions = new SystemAction[] {
226
//                 SystemAction.get(org.openide.actions.ToggleBreakpointAction.clas s),
227
                 SystemAction.get(ShowJsp.class),
242
                 SystemAction.get(ShowJsp.class),
228
                 SystemAction.get(ToggleJspStepMode.class)
243
                 SystemAction.get(ToggleJspStepMode.class)
229
             };
244
             };
(-)web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspMultiSettingsInitializer.java (-1 / +1 lines)
Lines 78-84 Link Here
78
                                              new String[] {
78
                                              new String[] {
79
                                                  TopComponent.class.getName(),
79
                                                  TopComponent.class.getName(),
80
                                                  null,
80
                                                  null,
81
                                                  // org.openide.actions.ToggleBreakpointAction.class.getName(),
81
                                                  // "org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction",
82
                                                  // JavaKit.addWatchAction,
82
                                                  // JavaKit.addWatchAction,
83
                                                  // null,
83
                                                  // null,
84
                                                  CutAction.class.getName(),
84
                                                  CutAction.class.getName(),
(-)web/taglibed/manifest.mf (-2 / +2 lines)
Lines 2-10 Link Here
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/taglibed/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/taglibed/Bundle.properties
3
OpenIDE-Module-Install: org/netbeans/modules/web/taglibed/TaglibModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/web/taglibed/TaglibModule.class
4
OpenIDE-Module-Layer: org/netbeans/modules/web/taglibed/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/web/taglibed/layer.xml
5
OpenIDE-Module-Specification-Version: 1.8
5
OpenIDE-Module-Specification-Version: 1.9
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1,   org.netbeans.modules.jarpackager/2,   org.netbeans.modules.xml.core/1,    org.netbeans.modules.servletapi/1,  org.netbeans.api.java/1,  org.openide.src > 1.0, org.openide.io > 1.0
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1,   org.netbeans.modules.jarpackager/2,   org.netbeans.modules.xml.core/1,    org.netbeans.modules.servletapi/1,  org.netbeans.api.java/1,  org.openide.src > 1.0, org.openide.io > 1.0, org.openide.deprecated > 1.2
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17
9
OpenIDE-Module-Requires: org.openide.windows.IOProvider
9
OpenIDE-Module-Requires: org.openide.windows.IOProvider
10
10
(-)web/taglibed/src/org/netbeans/modules/web/taglibed/control/IDEHelper.java (-3 / +1 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 50-59 Link Here
50
50
51
import org.openide.loaders.DataObject;
51
import org.openide.loaders.DataObject;
52
import org.openide.loaders.MultiDataObject;
52
import org.openide.loaders.MultiDataObject;
53
import org.openide.loaders.ExecSupport;
54
import org.openide.execution.Executor;
53
import org.openide.execution.Executor;
55
54
56
import org.openide.debugger.DebuggerType;
57
import org.openide.loaders.DataFolder;
55
import org.openide.loaders.DataFolder;
58
import org.openide.DialogDisplayer;
56
import org.openide.DialogDisplayer;
59
import org.openide.filesystems.Repository;
57
import org.openide.filesystems.Repository;
(-)web/test/Common/src/org/netbeans/web/test/actions/ToggleBreakpointAction.java (-2 / +2 lines)
Lines 28-33 Link Here
28
28
29
    /** creates new ToggleBreakpointAction instance */    
29
    /** creates new ToggleBreakpointAction instance */    
30
    public ToggleBreakpointAction() {
30
    public ToggleBreakpointAction() {
31
        super(toggleBreakpointMenu, toggleBreakpointPopup, "org.openide.actions.ToggleBreakpointAction", toggleBreakpointShortcut);
31
        super(toggleBreakpointMenu, toggleBreakpointPopup, "org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", toggleBreakpointShortcut);
32
    }
32
    }
33
}
33
}
(-)openide/l10n.list (-1 lines)
Lines 1-5 Link Here
1
openide/compiler/src/org/openide/compiler/Bundle.properties
1
openide/compiler/src/org/openide/compiler/Bundle.properties
2
openide/deprecated/src/org/openide/debugger/Bundle.properties
3
openide/deprecated/src/org/openide/deprecated/Bundle.properties
2
openide/deprecated/src/org/openide/deprecated/Bundle.properties
4
openide/deprecated/src/org/openide/explorer/propertysheet/editors/Bundle.properties
3
openide/deprecated/src/org/openide/explorer/propertysheet/editors/Bundle.properties
5
openide/deprecated/src/org/openide/modules/Bundle.properties
4
openide/deprecated/src/org/openide/modules/Bundle.properties
(-)debuggercore/l10n.list (-2 / +2 lines)
Lines 7-11 Link Here
7
debuggercore/src/org/netbeans/modules/debugger/support/java/Bundle.properties
7
debuggercore/src/org/netbeans/modules/debugger/support/java/Bundle.properties
8
debuggercore/src/org/netbeans/modules/debugger/support/java/nodes/Bundle.properties
8
debuggercore/src/org/netbeans/modules/debugger/support/java/nodes/Bundle.properties
9
debuggercore/src/org/netbeans/modules/debugger/multisession/Bundle.properties
9
debuggercore/src/org/netbeans/modules/debugger/multisession/Bundle.properties
10
debuggercore/src/org/netbeans/modules/debugger/multisession/actions/Bundle.properties
10
debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties
11
debuggercore/src/org/netbeans/modules/debugger/multisession/nodes/Bundle.properties
11
debuggercore/oldapi/src/org/openide/debugger/Bundle.properties

Return to bug 29914