Index: ant/manifest.mf =================================================================== RCS file: /cvs/ant/manifest.mf,v retrieving revision 1.51 diff -u -r1.51 manifest.mf --- ant/manifest.mf 27 Jan 2003 15:50:18 -0000 1.51 +++ ant/manifest.mf 27 Jan 2003 19:35:00 -0000 @@ -1,12 +1,12 @@ Manifest-Version: 1.0 OpenIDE-Module: org.apache.tools.ant.module/2 OpenIDE-Module-Localizing-Bundle: org/apache/tools/ant/module/Bundle.properties -OpenIDE-Module-Specification-Version: 2.15 +OpenIDE-Module-Specification-Version: 2.16 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ 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.** OpenIDE-Module-Install: org/apache/tools/ant/module/AntModule.class OpenIDE-Module-Layer: org/apache/tools/ant/module/resources/AntModuleLayer.xml -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 +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 OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider OpenIDE-Module-Package-Dependencies: [org.apache.tools.ant.Location], [org.apache.xerces.parsers.DOMParser], [org.apache.xml.serialize.EncodingInfo] Index: ant/src/org/apache/tools/ant/module/loader/AntExecSupport.java =================================================================== RCS file: /cvs/ant/src/org/apache/tools/ant/module/loader/AntExecSupport.java,v retrieving revision 1.2 diff -u -r1.2 AntExecSupport.java --- ant/src/org/apache/tools/ant/module/loader/AntExecSupport.java 3 Jul 2001 08:03:11 -0000 1.2 +++ ant/src/org/apache/tools/ant/module/loader/AntExecSupport.java 27 Jan 2003 19:35:00 -0000 @@ -16,12 +16,12 @@ package org.apache.tools.ant.module.loader; import org.openide.execution.Executor; -import org.openide.loaders.ExecSupport; +import org.openide.loaders.ExecutionSupport; import org.openide.loaders.MultiDataObject; import org.apache.tools.ant.module.AntSettings; -public class AntExecSupport extends ExecSupport { +public class AntExecSupport extends ExecutionSupport { public AntExecSupport (MultiDataObject.Entry entry) { super (entry); Index: ant/src/org/apache/tools/ant/module/loader/AntProjectDataObject.java =================================================================== RCS file: /cvs/ant/src/org/apache/tools/ant/module/loader/AntProjectDataObject.java,v retrieving revision 1.8 diff -u -r1.8 AntProjectDataObject.java --- ant/src/org/apache/tools/ant/module/loader/AntProjectDataObject.java 27 Sep 2002 15:56:40 -0000 1.8 +++ ant/src/org/apache/tools/ant/module/loader/AntProjectDataObject.java 27 Jan 2003 19:35:00 -0000 @@ -18,7 +18,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import org.openide.cookies.DebuggerCookie; import org.openide.cookies.SaveCookie; import org.openide.filesystems.FileObject; import org.openide.loaders.*; @@ -52,14 +51,6 @@ cookies.add (new AntActionInstance (proj)); } addPropertyChangeListener (this); - } - - // #12864: AntExecSupport only incidentally implements DebuggerCookie - public Node.Cookie getCookie (Class clazz) { - if (clazz == DebuggerCookie.class) { - return null; - } - return super.getCookie (clazz); } public HelpCtx getHelpCtx () { Index: ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java =================================================================== RCS file: /cvs/ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java,v retrieving revision 1.28 diff -u -r1.28 AntProjectNode.java --- ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java 9 Jan 2003 14:53:13 -0000 1.28 +++ ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java 27 Jan 2003 19:35:00 -0000 @@ -154,10 +154,9 @@ exec.setShortDescription (NbBundle.getMessage (AntProjectNode.class, "HINT_execution")); CompilerSupport csupp = (CompilerSupport) getCookie (CompilerSupport.class); if (csupp != null) csupp.addProperties (exec); - ExecSupport xsupp = (ExecSupport) getCookie (ExecSupport.class); + ExecutionSupport xsupp = (ExecutionSupport) getCookie (ExecutionSupport.class); if (xsupp != null) xsupp.addProperties (exec); - exec.remove (ExecSupport.PROP_FILE_PARAMS); - exec.remove (ExecSupport.PROP_DEBUGGER_TYPE); + exec.remove (ExecutionSupport.PROP_FILE_PARAMS); if (csupp != null || xsupp != null) { sheet.put (exec); } Index: apisupport/apidocs/build.xml =================================================================== RCS file: /cvs/apisupport/apidocs/build.xml,v retrieving revision 1.8 diff -u -r1.8 build.xml --- apisupport/apidocs/build.xml 20 Dec 2002 19:38:58 -0000 1.8 +++ apisupport/apidocs/build.xml 27 Jan 2003 19:35:00 -0000 @@ -8,7 +8,7 @@ http://www.sun.com/ The Original Code is NetBeans. The Initial Developer of the Original -Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun +Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. --> @@ -40,6 +40,7 @@ + @@ -55,6 +56,8 @@ + + Index: apisupport/apidocs/manifest.mf =================================================================== RCS file: /cvs/apisupport/apidocs/manifest.mf,v retrieving revision 1.7 diff -u -r1.7 manifest.mf --- apisupport/apidocs/manifest.mf 20 Dec 2002 19:38:58 -0000 1.7 +++ apisupport/apidocs/manifest.mf 27 Jan 2003 19:35:00 -0000 @@ -2,7 +2,7 @@ OpenIDE-Module: org.netbeans.modules.apisupport.apidocs OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/apidocs/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/apisupport/apidocs/layer.xml -OpenIDE-Module-Specification-Version: 2.15 +OpenIDE-Module-Specification-Version: 2.16 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.13, org.netbeans.modules.javadoc/1 > 1.10 Index: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/Bundle.properties =================================================================== RCS file: /cvs/apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/Bundle.properties,v retrieving revision 1.6 diff -u -r1.6 Bundle.properties --- apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/Bundle.properties 21 Dec 2002 08:25:31 -0000 1.6 +++ apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/Bundle.properties 27 Jan 2003 19:35:00 -0000 @@ -23,6 +23,7 @@ Mount/Javadoc/org-netbeans-modules-apisupport-javadoc.xml=OpenAPIs.zip (Open APIs Javadoc) Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-compiler.xml=CompilerAPI.zip (Compiler API Javadoc) Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-execution.xml=ExecutionAPI.zip (Execution API Javadoc) +Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-debugger.xml=DebuggerAPI.zip (Debugger API Javadoc) Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-io.xml=InputOutputAPI.zip (Input/Output API Javadoc) Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-javahelp.xml=JavaHelpAPI.zip (JavaHelp Integration API Javadoc) Mount/Javadoc/org-netbeans-modules-apisupport-javadoc-settings.xml=SettingsAPI.zip (Settings API Javadoc) @@ -31,6 +32,7 @@ Mount/java/org-netbeans-modules-apisupport-openide-main.xml=openide.jar (Open APIs Library) Mount/java/org-netbeans-modules-apisupport-openide-compiler.xml=openide-compiler.jar (Compiler API Library) Mount/java/org-netbeans-modules-apisupport-openide-execution.xml=openide-execution.jar (Execution API Library) +Mount/java/org-netbeans-modules-apisupport-openide-debugger.xml=openide-debugger.jar (Debugger API Library) Mount/java/org-netbeans-modules-apisupport-openide-io.xml=openide-io.jar (Input/Output API Library) Mount/java/org-netbeans-modules-apisupport-javahelp-api.xml=javahelp-api.jar (JavaHelp Integration API Library) Mount/java/org-netbeans-modules-apisupport-core-settings.xml=core-settings.jar (Settings API Library) Index: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/javadoc-debugger.xml =================================================================== RCS file: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/javadoc-debugger.xml diff -N apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/javadoc-debugger.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/javadoc-debugger.xml 27 Jan 2003 19:35:00 -0000 @@ -0,0 +1,19 @@ + + + + + + Index: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/layer.xml =================================================================== RCS file: /cvs/apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/layer.xml,v retrieving revision 1.7 diff -u -r1.7 layer.xml --- apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/layer.xml 20 Dec 2002 19:39:00 -0000 1.7 +++ apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/layer.xml 27 Jan 2003 19:35:00 -0000 @@ -23,6 +23,11 @@ + + + + + @@ -55,6 +60,11 @@ + + + + + Index: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/openide-debugger-jar.xml =================================================================== RCS file: apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/openide-debugger-jar.xml diff -N apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/openide-debugger-jar.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ apisupport/apidocs/src/org/netbeans/modules/apisupport/apidocs/openide-debugger-jar.xml 27 Jan 2003 19:35:00 -0000 @@ -0,0 +1,17 @@ + + + + + + Index: applet/build.xml =================================================================== RCS file: /cvs/applet/build.xml,v retrieving revision 1.29 diff -u -r1.29 build.xml --- applet/build.xml 11 Dec 2002 17:06:47 -0000 1.29 +++ applet/build.xml 27 Jan 2003 19:35:01 -0000 @@ -33,6 +33,7 @@ + Index: applet/manifest.mf =================================================================== RCS file: /cvs/applet/manifest.mf,v retrieving revision 1.46 diff -u -r1.46 manifest.mf --- applet/manifest.mf 2 Nov 2002 21:05:59 -0000 1.46 +++ applet/manifest.mf 27 Jan 2003 19:35:01 -0000 @@ -3,7 +3,7 @@ OpenIDE-Module-Layer: org/netbeans/modules/applet/layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine -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 -OpenIDE-Module-Specification-Version: 1.10 +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 +OpenIDE-Module-Specification-Version: 1.11 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ Index: clazz/build.xml =================================================================== RCS file: /cvs/clazz/build.xml,v retrieving revision 1.29 diff -u -r1.29 build.xml --- clazz/build.xml 11 Dec 2002 17:06:49 -0000 1.29 +++ clazz/build.xml 27 Jan 2003 19:35:01 -0000 @@ -8,7 +8,7 @@ http://www.sun.com/ The Original Code is NetBeans. The Initial Developer of the Original -Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun +Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. --> @@ -31,6 +31,7 @@ + Index: clazz/manifest.mf =================================================================== RCS file: /cvs/clazz/manifest.mf,v retrieving revision 1.37 diff -u -r1.37 manifest.mf --- clazz/manifest.mf 2 Nov 2002 21:06:00 -0000 1.37 +++ clazz/manifest.mf 27 Jan 2003 19:35:01 -0000 @@ -4,8 +4,8 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/clazz/Bundle.properties OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ -OpenIDE-Module-Specification-Version: 1.11 -OpenIDE-Module-Module-Dependencies: org.netbeans.modules.classfile/1, org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.execution > 1.0 +OpenIDE-Module-Specification-Version: 1.12 +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 OpenIDE-Module: org.netbeans.modules.clazz/1 OpenIDE-Module-Requires: org.openide.execution.ExecutionEngine Index: core/manifest.mf =================================================================== RCS file: /cvs/core/manifest.mf,v retrieving revision 1.16 diff -u -r1.16 manifest.mf --- core/manifest.mf 21 Jan 2003 13:00:45 -0000 1.16 +++ core/manifest.mf 27 Jan 2003 19:35:54 -0000 @@ -1,7 +1,7 @@ OpenIDE-Module: org.netbeans.core/1 -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ -OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.32 +OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.33 OpenIDE-Module-Localizing-Bundle: org/netbeans/core/Bundle.properties OpenIDE-Module-Layer: org/netbeans/core/resources/mf-layer.xml OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator Index: core/deprecated/manifest.mf =================================================================== RCS file: /cvs/core/deprecated/manifest.mf,v retrieving revision 1.6 diff -u -r1.6 manifest.mf --- core/deprecated/manifest.mf 18 Dec 2002 23:05:03 -0000 1.6 +++ core/deprecated/manifest.mf 27 Jan 2003 19:35:54 -0000 @@ -1,11 +1,9 @@ OpenIDE-Module: org.netbeans.core.deprecated OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -OpenIDE-Module-Specification-Version: 1.1 +OpenIDE-Module-Specification-Version: 1.2 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.7, org.openide.deprecated > 1.0, org.openide.execution > 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/core/deprecated/Bundle.properties -OpenIDE-Module-Install: org/netbeans/core/deprecated/Install.class OpenIDE-Module-Provides: org.openide.TopManager -OpenIDE-Module-Layer: org/netbeans/core/deprecated/layer.xml OpenIDE-Module-Deprecated: true Index: core/deprecated/src/org/netbeans/core/deprecated/Bundle.properties =================================================================== RCS file: /cvs/core/deprecated/src/org/netbeans/core/deprecated/Bundle.properties,v retrieving revision 1.4 diff -u -r1.4 Bundle.properties --- core/deprecated/src/org/netbeans/core/deprecated/Bundle.properties 3 Nov 2002 01:57:51 -0000 1.4 +++ core/deprecated/src/org/netbeans/core/deprecated/Bundle.properties 27 Jan 2003 19:35:54 -0000 @@ -6,7 +6,7 @@ # http://www.sun.com/ # # The Original Code is NetBeans. The Initial Developer of the Original -# Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun # Microsystems, Inc. All Rights Reserved. OpenIDE-Module-Name=Deprecated Core @@ -23,16 +23,6 @@ CTL_ControlPanel=Control Panel CTL_Project_Settings=Project Settings CTL_Project_Settings_Hint=Contains project-specific settings. - -LAB_DebuggerTypeDefault=Default Debugging -HINT_DebuggerTypeDefault=Simple debugging according to the debugger's own preferences. - -LAB_DebuggerType=Debugger Types -HINT_DebuggerType=All types of debuggers registered in the system. - -LAB_NoDebugger=(do not debug) -# {0} - class name -EXC_NoDebugger=The class {0} is not configured to be debugged.\nYou may change this if you wish. EXC_WorkspaceLoadFail=Cannot load workspaces. Using default configuration. EXC_CorruptedProject=Your saved project files are corrupted. Index: core/deprecated/src/org/netbeans/core/deprecated/DebuggerType.java =================================================================== RCS file: core/deprecated/src/org/netbeans/core/deprecated/DebuggerType.java diff -N core/deprecated/src/org/netbeans/core/deprecated/DebuggerType.java --- core/deprecated/src/org/netbeans/core/deprecated/DebuggerType.java 19 Dec 2002 04:21:44 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,51 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.core.deprecated; - -import java.beans.*; -import java.util.ResourceBundle; -import org.openide.util.NbBundle; - -/** -* -* @author jtulach -*/ -public abstract class DebuggerType { - private DebuggerType () {} - - /** Object that provides beaninfo for {@link DebuggerType.Default}. - * - * @author Jaroslav Tulach - */ - public static class DefaultBeanInfo extends SimpleBeanInfo { - - public BeanDescriptor getBeanDescriptor () { - BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.Default.class); - ResourceBundle bundle = NbBundle.getBundle(DebuggerType.DefaultBeanInfo.class); - descr.setDisplayName (bundle.getString("LAB_DebuggerTypeDefault")); // NOI18N - descr.setShortDescription (bundle.getString("HINT_DebuggerTypeDefault")); // NOI18N - return descr; - } - - public BeanInfo[] getAdditionalBeanInfo () { - try { - return new BeanInfo[] { Introspector.getBeanInfo (org.openide.debugger.DebuggerType.class) }; - } catch (IntrospectionException ie) { - org.openide.ErrorManager.getDefault().notify(ie); - return null; - } - } - - } -} Index: core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeBeanInfo.java =================================================================== RCS file: core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeBeanInfo.java diff -N core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeBeanInfo.java --- core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeBeanInfo.java 19 Dec 2002 04:21:44 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,58 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.core.deprecated; - -import java.awt.Image; -import java.beans.*; -import java.util.ResourceBundle; - -import org.openide.util.NbBundle; -import org.openide.util.Utilities; - -/** Object that provides beaninfo for {@link DebuggerType}. -* -* @author Jaroslav Tulach -*/ -public class DebuggerTypeBeanInfo extends SimpleBeanInfo { - - public BeanDescriptor getBeanDescriptor () { - BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.class); - ResourceBundle bundle = NbBundle.getBundle(DebuggerTypeBeanInfo.class); - descr.setDisplayName (bundle.getString ("LAB_DebuggerType")); // NOI18N - descr.setShortDescription (bundle.getString ("HINT_DebuggerType")); // NOI18N - descr.setValue ("helpID", org.openide.debugger.DebuggerType.class.getName ()); // NOI18N - return descr; - } - - public BeanInfo[] getAdditionalBeanInfo () { - try { - return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) }; - } catch (IntrospectionException ie) { - org.openide.ErrorManager.getDefault().notify(ie); - return null; - } - } - - - /** - * Return the icon - */ - public Image getIcon(int type) { - if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) - return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes.gif"); // NOI18N - else - return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes32.gif"); // NOI18N - } - -} Index: core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeEditor.java =================================================================== RCS file: core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeEditor.java diff -N core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeEditor.java --- core/deprecated/src/org/netbeans/core/deprecated/DebuggerTypeEditor.java 13 Jan 2003 17:56:36 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,79 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.core.deprecated; - -import java.io.*; -import java.text.MessageFormat; -import org.netbeans.beaninfo.editors.NoServiceTypeBeanInfo; -import org.netbeans.beaninfo.editors.ServiceTypeEditor; -import org.openide.ErrorManager; - -import org.openide.debugger.*; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; -import org.openide.execution.ExecInfo; - -/** Support for property editor for DebuggerType. -* -* @author Petr Jiricka -*/ - -public class DebuggerTypeEditor extends ServiceTypeEditor { - - public static final org.openide.debugger.DebuggerType NO_DEBUGGER = new NoDebugger (); - - public DebuggerTypeEditor () { - super (org.openide.debugger.DebuggerType.class, "LAB_ChooseServiceType"); // NOI18N - } - - /** Accessor for creating instance */ - public static org.openide.debugger.DebuggerType getNoDebugger() { - return NO_DEBUGGER; - } - - public static final class NoDebugger extends org.openide.debugger.DebuggerType { - - static final long serialVersionUID =-6872256326426790372L; - private NoDebugger () { - } - - protected String displayName () { - return NbBundle.getBundle (DebuggerTypeEditor.class).getString ("LAB_NoDebugger"); - } - - public HelpCtx getHelpCtx () { - return new HelpCtx (NoDebugger.class); - } - - public void startDebugger (final ExecInfo info, boolean ign) throws DebuggerException { - DebuggerException e = new DebuggerException("do not debug"); // NOI18N - ErrorManager.getDefault().annotate(e, NbBundle.getMessage(DebuggerTypeEditor.class, "EXC_NoDebugger", info.getClassName())); - throw e; - } - - private Object readResolve () throws ObjectStreamException { - return NO_DEBUGGER; - } - - } - - public static final class NoDebuggerBeanInfo extends NoServiceTypeBeanInfo { - - protected String iconResource () { - return "/org/netbeans/beaninfo/editors/resources/noDebugger.gif"; // NOI18N - } - - } - -} Index: core/deprecated/src/org/netbeans/core/deprecated/Install.java =================================================================== RCS file: core/deprecated/src/org/netbeans/core/deprecated/Install.java diff -N core/deprecated/src/org/netbeans/core/deprecated/Install.java --- core/deprecated/src/org/netbeans/core/deprecated/Install.java 16 Oct 2002 06:03:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.core.deprecated; - -import java.beans.Introspector; -import java.beans.PropertyEditorManager; - -import org.openide.modules.ModuleInstall; - -public class Install extends ModuleInstall { - - /** Make sure BeanInfo and PropertyEditor for DebuggerType can be found. - */ - public void restored() { - String[] sysbisp = Introspector.getBeanInfoSearchPath(); - String[] nbbisp = new String[] { - "org.netbeans.core.deprecated", // NOI18N - }; - String[] allbisp = new String[sysbisp.length + nbbisp.length]; - System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length); - System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length); - Introspector.setBeanInfoSearchPath(allbisp); - String[] syspesp = PropertyEditorManager.getEditorSearchPath(); - String[] nbpesp = new String[] { - "org.netbeans.core.deprecated", // NOI18N - }; - String[] allpesp = new String[syspesp.length + nbpesp.length]; - System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length); - System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length); - PropertyEditorManager.setEditorSearchPath(allpesp); - } - -} Index: core/deprecated/src/org/netbeans/core/deprecated/layer.xml =================================================================== RCS file: core/deprecated/src/org/netbeans/core/deprecated/layer.xml diff -N core/deprecated/src/org/netbeans/core/deprecated/layer.xml --- core/deprecated/src/org/netbeans/core/deprecated/layer.xml 25 Oct 2002 15:49:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - Index: core/release/system/ModuleAutoDeps/org-netbeans-core.xml =================================================================== RCS file: core/release/system/ModuleAutoDeps/org-netbeans-core.xml diff -N core/release/system/ModuleAutoDeps/org-netbeans-core.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/release/system/ModuleAutoDeps/org-netbeans-core.xml 27 Jan 2003 19:35:54 -0000 @@ -0,0 +1,34 @@ + + + + + + + + + API separation phase II (#19443) - terminalemulator + + + + + + + + + + + + + + Index: core/src/org/netbeans/core/modules/AutomaticDependencies.java =================================================================== RCS file: core/src/org/netbeans/core/modules/AutomaticDependencies.java diff -N core/src/org/netbeans/core/modules/AutomaticDependencies.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/src/org/netbeans/core/modules/AutomaticDependencies.java 27 Jan 2003 19:35:55 -0000 @@ -0,0 +1,689 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.netbeans.core.modules; + +import java.io.*; +import java.net.URL; +import java.util.*; +import org.xml.sax.*; + +import org.openide.ErrorManager; +import org.openide.modules.*; +import org.openide.xml.XMLUtil; + +/** + * Parser and interpreter for automatic module dependencies. + * Public for possible access from AU (see #29577). + * Usage: see implementation of {@link NbInstaller#refineDependencies}. + *

You may run this class standalone, with just openide.jar and core.jarin the classpath. + * @author Jesse Glick, with help from NB XML module + * @see "#30161" + * @see -//NetBeans//DTD Module Automatic Dependencies 1.0//EN + * @since org.netbeans.core/1 1.12 + */ +public final class AutomaticDependencies { + + private AutomaticDependencies() {} + + /** + * Create an empty list of transformations. + * @return an empty list + */ + public static AutomaticDependencies empty() { + return new AutomaticDependencies(); + } + + /** + * Create a list of transformations based on some XML files. + * They must be valid (this method may not validate them). + * Doctype must be <transformations> from + * -//NetBeans//DTD Module Automatic Dependencies 1.0//EN. + * @param urls the XML files + * @throws SAXException if malformed + * @throws IOException if unloadable + * @return a list of parsed transformations + */ + public static AutomaticDependencies parse(URL[] urls) throws SAXException, IOException { + AutomaticDependencies h = new AutomaticDependencies(); + Parser p = new Parser(h.new Handler()); + for (int i = 0; i < urls.length; i++) { + String id = urls[i].toExternalForm(); + try { + p.parse(new InputSource(id)); + } catch (SAXException e) { + Util.err.annotate(e, ErrorManager.UNKNOWN, "While parsing: " + id, null, null, null); + throw e; + } catch (IOException e) { + Util.err.annotate(e, ErrorManager.UNKNOWN, "While parsing: " + id, null, null, null); + throw e; + } + } + return h; + } + + /** + * For testing purposes only. Should dump file structure. + * @param x list of URLs to parse + */ + public static void main(String[] x) throws Exception { + URL[] urls = new URL[x.length]; + for (int i = 0; i < x.length; i++) { + urls[i] = new URL(x[i]); + } + parse(urls); // warm up classes + long time = System.currentTimeMillis(); + System.out.println(parse(urls)); + long taken = System.currentTimeMillis() - time; + System.out.println("Time taken: " + taken + " msec"); + } + + // ------------- INTERPRETATION -------------- + + /** + * Interpret the transformations on a module. + * The module's dependencies may be added to, changed, or removed, according + * to the configuration of this transformations list. + * @param cnb the code name base of the module being considered + * @param dependencies a mutable set of type {@link Dependency}; call-by-reference + */ + public void refineDependencies(String cnb, Set dependencies) { + // First, collect all deps of each type by name, for quick access. + // Also note that transformations apply *in parallel* so we cannot + // check triggers of a transformation based on the in-progress set. + Map modDeps = new HashMap(); // Map + Map tokDeps = new HashMap(); // Map + Map pkgDeps = new HashMap(); // Map + Iterator it = dependencies.iterator(); + while (it.hasNext()) { + Dependency d = (Dependency)it.next(); + switch (d.getType()) { + case Dependency.TYPE_MODULE: + String dcnb = (String)Util.parseCodeName(d.getName())[0]; + modDeps.put(dcnb, d); + break; + case Dependency.TYPE_PACKAGE: + String name = packageBaseName(d.getName()); + if (name != null) { + pkgDeps.put(name, d); + } + break; + case Dependency.TYPE_REQUIRES: + tokDeps.put(d.getName(), d); + break; + case Dependency.TYPE_IDE: + throw new IllegalArgumentException("No TYPE_IDE dependencies permitted for " + cnb); + case Dependency.TYPE_JAVA: + // ignored + break; + default: + throw new IllegalStateException(d.toString()); + } + } + // Now go through transformations and see if they apply. + it = groups.iterator(); + while (it.hasNext()) { + TransformationGroup g = (TransformationGroup)it.next(); + if (g.isExcluded(cnb)) { + continue; + } + Iterator it2 = g.transformations.iterator(); + while (it2.hasNext()) { + Transformation t = (Transformation)it2.next(); + t.apply(modDeps, tokDeps, pkgDeps, dependencies); + } + } + } + + // ---------------- STRUCTS -------------------- + + private final List groups = new ArrayList(); // List + + public String toString() { + return "AutomaticDependencies[" + groups + "]"; + } + + private static final class Exclusion { + public String codenamebase; + public boolean prefix; + public String toString() { + return "Exclusion[" + codenamebase + ",prefix=" + prefix + "]"; + } + + /** + * Does this exclusion apply to the given code name base? + */ + public boolean matches(String cnb) { + return cnb.equals(codenamebase) || + (prefix && cnb.startsWith(codenamebase + ".")); // NOI18N + } + + } + + private static final class TransformationGroup { + // public String description; + public final List exclusions = new ArrayList(); // List + public final List transformations = new ArrayList(); // List + public String toString() { + return "TransformationGroup[" + exclusions + "," + transformations + "]"; + } + + /** + * Is the given code name base excluded from this group of transformations? + */ + public boolean isExcluded(String cnb) { + Iterator it = exclusions.iterator(); + while (it.hasNext()) { + if (((Exclusion)it.next()).matches(cnb)) { + return true; + } + } + return false; + } + + } + + private static final class Transformation { + public Dep trigger; + public String triggerType; + public final List results = new ArrayList(); // List + public String toString() { + return "Transformation[trigger=" + trigger + ",triggerType=" + triggerType + ",results=" + results + "]"; + } + + /** + * Transform some dependencies. + */ + public void apply(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) { + Dependency d = trigger.applies(modDeps, tokDeps, pkgDeps, dependencies, triggerType); + if (d != null) { + // It matched. + if (triggerType.equals("cancel")) { + // Remove it now. + dependencies.remove(d); + } else if (triggerType.equals("older")) { + // Fine, don't. + } else { + throw new IllegalStateException(triggerType); + } + // Add in results. + Iterator it = results.iterator(); + while (it.hasNext()) { + Dep nue = (Dep)it.next(); + nue.update(modDeps, tokDeps, pkgDeps, dependencies); + } + } + } + + } + + private static abstract class Dep { + public final String toString() { + return manifestKey() + ": " + toManifestForm(); + } + + /** + * The form of the dependency in a manifest (value only). + */ + public abstract String toManifestForm(); + + /** + * The form of the dependency in a manifest (key part). + */ + public abstract String manifestKey(); + + /** + * The type of dependency according to {@link Dependency}. + */ + public abstract int type(); + + /** + * Make a real dependency from this pattern. + */ + public final Dependency createDependency() { + return (Dependency)Dependency.create(type(), toManifestForm()).iterator().next(); + } + + /** + * Check whether this dependency pattern applies as a trigger. + * @return the triggered actual dependency if so, else null + */ + public abstract Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type); + + /** + * Update actual dependencies assuming a trigger matched. + * This dependency pattern is to be added to the dependencies set + * (possibly upgrading an existing dependency). + */ + public abstract void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies); + + } + + private static final class ModuleDep extends Dep { + public String codenamebase; + public int major = -1; + public SpecificationVersion spec = null; + + public String toManifestForm() { + return codenamebase + (major == -1 ? "" : "/" + major) + (spec == null ? "" : " > " + spec); + } + + public String manifestKey() { + return "OpenIDE-Module-Module-Dependencies"; + } + + public int type() { + return Dependency.TYPE_MODULE; + } + + public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) { + Dependency d = (Dependency)modDeps.get(codenamebase); + if (d == null) return null; + if (type.equals("cancel")) { + // That's enough. + return d; + } else if (type.equals("older")) { + if (spec == null) throw new IllegalStateException(); + // Compare. Check that d < this + return older(d) ? d : null; + } else { + throw new IllegalStateException(type); + } + } + + /** + * Is the given dependency older than this pattern? + */ + private boolean older(Dependency d) { + if (d.getType() != Dependency.TYPE_MODULE) throw new IllegalArgumentException(); + Integer dRelI = (Integer)Util.parseCodeName(d.getName())[1]; + int dRel = (dRelI == null) ? -1 : dRelI.intValue(); + if (dRel < major) return true; + if (dRel > major) return false; + if (spec == null) return false; + String dSpec = d.getVersion(); + if (dSpec == null) return true; + return new SpecificationVersion(dSpec).compareTo(spec) < 0; + } + + public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) { + Dependency d = (Dependency)modDeps.get(codenamebase); + if (d != null && older(d)) { + dependencies.remove(d); + dependencies.add(createDependency()); + } else if (d == null) { + dependencies.add(createDependency()); + } + } + + } + + /** + * Find actual package name (or null) from a package dep name. + * "javax.tv" -> "javax.tv" + * "javax.tv[Tuner]" -> "javax.tv" + * "[javax.tv.Tuner]" -> null + */ + private static String packageBaseName(String name) { + int i = name.indexOf('['); + if (i == -1) { + return name; + } else if (i > 0) { + return name.substring(0, i); + } else { + return null; + } + } + + private static final class PackageDep extends Dep { + public String name; + public String bname; + public SpecificationVersion spec = null; + + public String toManifestForm() { + return name + (spec == null ? "" : " > " + spec); + } + + public String manifestKey() { + return "OpenIDE-Module-Package-Dependencies"; + } + + public int type() { + return Dependency.TYPE_PACKAGE; + } + + /** + * Is the given dependency older than this pattern? + */ + private boolean older(Dependency d) { + if (d.getType() != Dependency.TYPE_PACKAGE) throw new IllegalArgumentException(); + if (spec == null) return false; + String dSpec = d.getVersion(); + if (dSpec == null) return true; + return new SpecificationVersion(dSpec).compareTo(spec) < 0; + } + + public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) { + Dependency d = (Dependency)pkgDeps.get(bname); + if (d == null) { + return null; + } + if (type.equals("cancel")) { + // That's enough. + return d; + } else if (type.equals("older")) { + if (spec == null) throw new IllegalStateException(); + // Compare. Check that d < this + return older(d) ? d : null; + } else { + throw new IllegalStateException(type); + } + } + + public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) { + Dependency d = (Dependency)pkgDeps.get(bname); + if (d != null && older(d)) { + dependencies.remove(d); + dependencies.add(createDependency()); + } else if (d == null) { + dependencies.add(createDependency()); + } + } + + } + + private static final class TokenDep extends Dep { + public String name; + + public String toManifestForm() { + return name; + } + + public String manifestKey() { + return "OpenIDE-Module-Requires"; + } + + public int type() { + return Dependency.TYPE_REQUIRES; + } + + public Dependency applies(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies, String type) { + Dependency d = (Dependency)tokDeps.get(name); + if (d == null) { + return null; + } + if (type.equals("cancel")) { + // That's enough. + return d; + } else { + // older is not supported + throw new IllegalStateException(type); + } + } + + public void update(Map modDeps, Map tokDeps, Map pkgDeps, Set dependencies) { + if (tokDeps.get(name) == null) { + dependencies.add(createDependency()); + } + } + + } + + // ---------------------- PARSING ----------------------- + + private final class Handler { + + private TransformationGroup currentGroup = null; + private Transformation currentTransformation = null; + private boolean inTrigger = false; + + public void start_trigger(final Attributes meta) throws SAXException { + inTrigger = true; + currentTransformation.triggerType = meta.getValue("type"); + } + + public void end_trigger() throws SAXException { + inTrigger = false; + } + + public void start_transformation(final Attributes meta) throws SAXException { + currentTransformation = new Transformation(); + } + + public void end_transformation() throws SAXException { + currentGroup.transformations.add(currentTransformation); + currentTransformation = null; + } + + private void handleDep(Dep d) throws SAXException { + if (inTrigger) { + currentTransformation.trigger = d; + } else { + currentTransformation.results.add(d); + } + } + + public void handle_module_dependency(final Attributes meta) throws SAXException { + ModuleDep d = new ModuleDep(); + String major = meta.getValue("major"); + if (major != null) { + d.major = Integer.parseInt(major); + } + d.codenamebase = meta.getValue("codenamebase"); + String s = meta.getValue("spec"); + d.spec = (s == null) ? null : new SpecificationVersion(s); + handleDep(d); + } + + public void handle_token_dependency(final Attributes meta) throws SAXException { + TokenDep d = new TokenDep(); + d.name = meta.getValue("name"); + handleDep(d); + } + + public void handle_package_dependency(final Attributes meta) throws SAXException { + PackageDep d = new PackageDep(); + d.name = meta.getValue("name"); + d.bname = packageBaseName(d.name); + if (inTrigger) { + if (d.bname == null) throw new SAXException("No actual package name in trigger"); + if (!d.name.equals(d.bname)) throw new SAXException("Cannot use test class in trigger"); + } + String s = meta.getValue("spec"); + d.spec = (s == null) ? null : new SpecificationVersion(s); + handleDep(d); + } + + public void start_transformationgroup(final Attributes meta) throws SAXException { + currentGroup = new TransformationGroup(); + } + + public void end_transformationgroup() throws SAXException { + groups.add(currentGroup); + currentGroup = null; + } + + public void start_result(final Attributes meta) throws SAXException { + // do nothing + } + + public void end_result() throws SAXException { + // do nothing + } + + public void handle_exclusion(final Attributes meta) throws SAXException { + Exclusion excl = new Exclusion(); + excl.codenamebase = meta.getValue("codenamebase"); + excl.prefix = Boolean.valueOf(meta.getValue("prefix")).booleanValue(); + currentGroup.exclusions.add(excl); + } + + public void handle_description(final String data, final Attributes meta) throws SAXException { + //currentGroup.description = data; + } + + public void start_transformations(final Attributes meta) throws SAXException { + if (!"1.0".equals(meta.getValue("version"))) throw new SAXException("Unsupported DTD"); + // do nothing + } + + public void end_transformations() throws SAXException { + // do nothing + } + + public void start_results(final Attributes meta) throws SAXException { + // do nothing + } + + public void end_results() throws SAXException { + // do nothing + } + + } + + private static final class Parser implements ContentHandler, ErrorHandler, EntityResolver { + + private java.lang.StringBuffer buffer; + + private Handler handler; + + private java.util.Stack context; + + public Parser(final Handler handler) { + this.handler = handler; + buffer = new StringBuffer(111); + context = new java.util.Stack(); + } + + public final void setDocumentLocator(Locator locator) { + } + + public final void startDocument() throws SAXException { + } + + public final void endDocument() throws SAXException { + } + + public final void startElement(java.lang.String ns, java.lang.String name, java.lang.String qname, Attributes attrs) throws SAXException { + dispatch(true); + context.push(new Object[] {qname, new org.xml.sax.helpers.AttributesImpl(attrs)}); + if ("trigger-dependency".equals(qname)) { + handler.start_trigger(attrs); + } else if ("transformation".equals(qname)) { + handler.start_transformation(attrs); + } else if ("module-dependency".equals(qname)) { + handler.handle_module_dependency(attrs); + } else if ("transformationgroup".equals(qname)) { + handler.start_transformationgroup(attrs); + } else if ("result".equals(qname)) { + handler.start_result(attrs); + } else if ("exclusion".equals(qname)) { + handler.handle_exclusion(attrs); + } else if ("token-dependency".equals(qname)) { + handler.handle_token_dependency(attrs); + } else if ("package-dependency".equals(qname)) { + handler.handle_package_dependency(attrs); + } else if ("transformations".equals(qname)) { + handler.start_transformations(attrs); + } else if ("implies".equals(qname)) { + handler.start_results(attrs); + } + } + + public final void endElement(java.lang.String ns, java.lang.String name, java.lang.String qname) throws SAXException { + dispatch(false); + context.pop(); + if ("trigger-dependency".equals(qname)) { + handler.end_trigger(); + } else if ("transformation".equals(qname)) { + handler.end_transformation(); + } else if ("transformationgroup".equals(qname)) { + handler.end_transformationgroup(); + } else if ("result".equals(qname)) { + handler.end_result(); + } else if ("transformations".equals(qname)) { + handler.end_transformations(); + } else if ("implies".equals(qname)) { + handler.end_results(); + } + } + + public final void characters(char[] chars, int start, int len) throws SAXException { + buffer.append(chars, start, len); + } + + public final void ignorableWhitespace(char[] chars, int start, int len) throws SAXException { + } + + public final void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException { + } + + public final void startPrefixMapping(final java.lang.String prefix, final java.lang.String uri) throws SAXException { + } + + public final void endPrefixMapping(final java.lang.String prefix) throws SAXException { + } + + public final void skippedEntity(java.lang.String name) throws SAXException { + } + + private void dispatch(final boolean fireOnlyIfMixed) throws SAXException { + if (fireOnlyIfMixed && buffer.length() == 0) return; //skip it + + Object[] ctx = (Object[]) context.peek(); + String here = (String) ctx[0]; + Attributes attrs = (Attributes) ctx[1]; + if ("description".equals(here)) { + if (fireOnlyIfMixed) throw new IllegalStateException("Unexpected characters() event! (Missing DTD?)"); + handler.handle_description(buffer.length() == 0 ? null : buffer.toString(), attrs); + } else { + //do not care + } + buffer.delete(0, buffer.length()); + } + + /** + * The recognizer entry method taking an InputSource. + * @param input InputSource to be parsed. + * @throws IOException on I/O error. + * @throws SAXException propagated exception thrown by a DocumentHandler. + */ + public void parse(final InputSource input) throws SAXException, IOException { + XMLReader parser = XMLUtil.createXMLReader(false, false); // fastest mode + parser.setContentHandler(this); + parser.setErrorHandler(this); + parser.setEntityResolver(this); + parser.parse(input); + } + + public void error(SAXParseException ex) throws SAXException { + //if (context.isEmpty()) System.err.println("Missing DOCTYPE."); + throw ex; + } + + public void fatalError(SAXParseException ex) throws SAXException { + throw ex; + } + + public void warning(SAXParseException ex) throws SAXException { + // ignore + } + + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + // Not validating, so skip DTD. + return new InputSource(new ByteArrayInputStream(new byte[0])); + } + + } + +} Index: core/src/org/netbeans/core/modules/Module.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/Module.java,v retrieving revision 1.44 diff -u -r1.44 Module.java --- core/src/org/netbeans/core/modules/Module.java 10 Jan 2003 22:21:08 -0000 1.44 +++ core/src/org/netbeans/core/modules/Module.java 27 Jan 2003 19:35:55 -0000 @@ -453,7 +453,17 @@ } // Dependencies Set dependencies = new HashSet(20); // Set - dependencies.addAll(Dependency.create(Dependency.TYPE_IDE, attr.getValue("OpenIDE-Module-IDE-Dependencies"))); // NOI18N + // First convert IDE/1 -> org.openide/1, so we never have to deal with + // "IDE deps" internally: + Set openideDeps = Dependency.create(Dependency.TYPE_IDE, attr.getValue("OpenIDE-Module-IDE-Dependencies")); // NOI18N + if (!openideDeps.isEmpty()) { + // If empty, leave it that way; NbInstaller will add it anyway. + Dependency d = (Dependency)openideDeps.iterator().next(); + String name = d.getName(); + if (!name.startsWith("IDE/")) throw new IllegalStateException("Weird IDE dep: " + name); // NOI18N + dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, "org.openide/" + name.substring(4) + " > " + d.getVersion())); // NOI18N + if (dependencies.size() != 1) throw new IllegalStateException("Should be singleton: " + dependencies); // NOI18N + } dependencies.addAll(Dependency.create(Dependency.TYPE_JAVA, attr.getValue("OpenIDE-Module-Java-Dependencies"))); // NOI18N dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, attr.getValue("OpenIDE-Module-Module-Dependencies"))); // NOI18N dependencies.addAll(Dependency.create(Dependency.TYPE_PACKAGE, attr.getValue("OpenIDE-Module-Package-Dependencies"))); // NOI18N Index: core/src/org/netbeans/core/modules/ModuleManager.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/ModuleManager.java,v retrieving revision 1.54 diff -u -r1.54 ModuleManager.java --- core/src/org/netbeans/core/modules/ModuleManager.java 10 Jan 2003 22:12:31 -0000 1.54 +++ core/src/org/netbeans/core/modules/ModuleManager.java 27 Jan 2003 19:35:55 -0000 @@ -1399,8 +1399,8 @@ } } } else { - // Java/IDE dependency. Fixed for lifetime of the IDE, safe to check once and keep. - if (! Util.checkJavaOrIDEDependency(dep)) { + // Java dependency. Fixed for whole VM session, safe to check once and keep. + if (! Util.checkJavaDependency(dep)) { // Bad. probs.add(dep); } Index: core/src/org/netbeans/core/modules/NbEvents.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/NbEvents.java,v retrieving revision 1.30 diff -u -r1.30 NbEvents.java --- core/src/org/netbeans/core/modules/NbEvents.java 18 Dec 2002 23:13:11 -0000 1.30 +++ core/src/org/netbeans/core/modules/NbEvents.java 27 Jan 2003 19:35:55 -0000 @@ -342,8 +342,6 @@ return NbBundle.getMessage(NbEvents.class, "MSG_problem_package_not_loaded_or_old", name); } } - case Dependency.TYPE_IDE: - return dep.toString();//XXX case Dependency.TYPE_JAVA: return dep.toString();//XXX default: Index: core/src/org/netbeans/core/modules/NbInstaller.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/NbInstaller.java,v retrieving revision 1.63 diff -u -r1.63 NbInstaller.java --- core/src/org/netbeans/core/modules/NbInstaller.java 7 Jan 2003 16:02:37 -0000 1.63 +++ core/src/org/netbeans/core/modules/NbInstaller.java 27 Jan 2003 19:35:55 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -31,7 +31,8 @@ import org.openide.util.lookup.InstanceContent; import java.util.jar.Manifest; import org.openide.ErrorManager; -import org.openide.filesystems.FileUtil; +import org.openide.filesystems.*; +import org.xml.sax.SAXException; /** Concrete implementation of the module installation functionality. * This class can pay attention to the details of manifest format, @@ -716,222 +717,63 @@ } } - /** Get IDE dependency, if any, for a module. - * @param dependencies module dependencies - * @return a fake spec version: major release version of IDE followed by actual spec; or null if no dep - */ - private static SpecificationVersion getIDEDep(Set dependencies) { - SpecificationVersion openide = null; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_IDE && - d.getComparison() == Dependency.COMPARE_SPEC) { - try { - int rel; - int idx = d.getName().lastIndexOf('/'); // NOI18N - if (idx != -1) { - rel = Integer.parseInt(d.getName().substring(idx + 1)); - } else { - rel = 0; - } - openide = new SpecificationVersion("" + rel + "." + d.getVersion()); // NOI18N - } catch (NumberFormatException nfe) { - Util.err.notify(nfe); - } - break; - } - } - return openide; - } - - /** If true, no automatic deps are made on modules for old client modules. - * Useful for unit tests. - */ - private static final boolean NO_COMPAT_AUTO_DEPS_JH = Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH"); - private static final boolean NO_COMPAT_AUTO_DEPS_DEPRECATED = Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED"); - 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"); + private AutomaticDependencies autoDepsHandler = null; + private final Map autoDepsByModule = new HashMap(); // Map /** Overridden to perform automatic API upgrades. * That is, should do nothing on new modules, but for older ones will * automatically make them depend on things they need. + * This is now all handled from declarative configuration files: + * in the system filesystem, ModuleAutoDeps/*.xml may be added + * according to the DTD "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN". */ public void refineDependencies(Module m, Set dependencies) { - // Special cases. - if (m.getCodeNameBase().equals("org.netbeans.core")) return; // NOI18N - if (m.getCodeNameBase().startsWith("org.netbeans.core.")) return; // NOI18N - if (m.getCodeNameBase().equals("org.openide")) return; // NOI18N - if (m.getCodeNameBase().startsWith("org.openide.")) return; // NOI18N - // First find out what API this module is expecting. - // Format: release.major.minor, e.g. IDE/1 > 2.3 => "1.2.3" - SpecificationVersion openide = getIDEDep(dependencies); - // Handle JavaHelp. For modules before API 2.2, they should have an - // automatic dependency on token org.netbeans.api.javahelp.Help. - if (!NO_COMPAT_AUTO_DEPS_JH && !m.getCodeNameBase().equals("org.netbeans.modules.javahelp") && // NOI18N - (openide == null || openide.compareTo(new SpecificationVersion("1.2.2")) < 0)) { // NOI18N - // Older than IDE/1 2.2, or at least does not claim to be newer. - // First make sure it does not *already* depend on this module. - boolean alreadyHaveJH = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_REQUIRES && - d.getName().equals("org.netbeans.api.javahelp.Help")) { // NOI18N - alreadyHaveJH = true; - break; - } - } - if (!alreadyHaveJH) { - Util.err.log("Adding automatic dependency on org.netbeans.api.javahelp.Help for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES, - "org.netbeans.api.javahelp.Help")); // NOI18N - } - // #27776: need to also handle package deps on javax.help, - // which should now be module deps on - // org.netbeans.modules.javahelp. - alreadyHaveJH = false; - it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_MODULE && - d.getName().startsWith("org.netbeans.modules.javahelp/")) { // NOI18N - alreadyHaveJH = true; - break; - } - } - if (!alreadyHaveJH) { - boolean needPackageJH = false; - it = dependencies.iterator(); - String pkg = "javax.help"; // NOI18N - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - String name = d.getName(); - if (d.getType() == Dependency.TYPE_PACKAGE && - (name.equals(pkg) || name.startsWith("[" + pkg + ".") || name.startsWith(pkg + "["))) { // NOI18N - needPackageJH = true; - it.remove(); // it will not work any more - break; - } - } - if (needPackageJH) { - Util.err.log("Adding automatic dependency on org.netbeans.modules.javahelp for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, - "org.netbeans.modules.javahelp/1 > 1.0")); // NOI18N - } - } + // All modules implicitly depend on the APIs somehow. + if (!m.getCodeNameBase().equals("org.openide") && + Util.getModuleDep(dependencies, "org.openide") == null) { + dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, "org.openide/1 > 0")); // NOI18N } - // For pre-3.14, add automatic deps on org.openide.src and org.openide.deprecated. - if (!NO_COMPAT_AUTO_DEPS_DEPRECATED && (openide == null || openide.compareTo(new SpecificationVersion("1.3.14")) < 0)) { // NOI18N - String[] nue = { - "org.openide.deprecated", // NOI18N - "org.openide.src", // NOI18N - }; - for (int i = 0; i < nue.length; i++) { - boolean alreadyHave = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_MODULE && - d.getName().equals(nue[i])) { - alreadyHave = true; - break; - } - } - if (!alreadyHave) { - Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, nue[i] + " > 1.0")); // NOI18N - } - } - boolean alreadyHave = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_REQUIRES && - d.getName().equals("org.openide.TopManager")) { // NOI18N - alreadyHave = true; - break; - } - } - if (!alreadyHave) { - Util.err.log("Adding automatic dependency on org.openide.TopManager for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES, "org.openide.TopManager")); // NOI18N - } - } - // For pre-3.17, add an automatic dep on org.openide.compiler, org.openide.execution, org.openide.io. - // Translate package deps on term to module deps. - if (!NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO && (openide == null || openide.compareTo(new SpecificationVersion("1.3.17")) < 0)) { // NOI18N - String[] nue = { - "org.openide.compiler", // NOI18N - "org.openide.execution", // NOI18N - "org.openide.io", // NOI18N - }; - for (int i = 0; i < nue.length; i++) { - boolean alreadyHave = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_MODULE && - d.getName().equals(nue[i])) { - alreadyHave = true; - break; - } - } - if (!alreadyHave) { - Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, nue[i] + " > 1.0")); // NOI18N - } - } - nue = new String[] { - "org.openide.compiler.CompilationEngine", // NOI18N - "org.openide.execution.ExecutionEngine", // NOI18N - "org.openide.windows.IOProvider", // NOI18N - }; - for (int i = 0; i < nue.length; i++) { - boolean alreadyHave = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_REQUIRES && - d.getName().equals(nue[i])) { - alreadyHave = true; - break; - } - } - if (!alreadyHave) { - Util.err.log("Adding automatic dependency on " + nue[i] + " for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_REQUIRES, nue[i])); - } - } - boolean alreadyHaveTerm = false; - Iterator it = dependencies.iterator(); - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - if (d.getType() == Dependency.TYPE_MODULE && - d.getName().equals("org.netbeans.lib.terminalemulator")) { // NOI18N - alreadyHaveTerm = true; - break; - } - } - if (!alreadyHaveTerm) { - boolean needPackageTerm = false; - it = dependencies.iterator(); - String pkg = "org.netbeans.lib.terminalemulator"; // NOI18N - while (it.hasNext()) { - Dependency d = (Dependency)it.next(); - String name = d.getName(); - if (d.getType() == Dependency.TYPE_PACKAGE && - (name.equals(pkg) || name.startsWith("[" + pkg + ".") || name.startsWith(pkg + "["))) { // NOI18N - needPackageTerm = true; - it.remove(); // it will not work any more - break; + if (Boolean.getBoolean("org.netbeans.core.modules.NbInstaller.noAutoDeps")) { + // Skip them all - useful for unit tests. + return; + } + if (autoDepsHandler == null) { + FileObject depsFolder = Repository.getDefault().getDefaultFileSystem().findResource("ModuleAutoDeps"); + if (depsFolder != null) { + FileObject[] kids = depsFolder.getChildren(); + List urls = new ArrayList(Math.max(kids.length, 1)); // List + for (int i = 0; i < kids.length; i++) { + if (kids[i].hasExt("xml")) { // NOI18N + try { + urls.add(kids[i].getURL()); + } catch (FileStateInvalidException e) { + Util.err.notify(e); + } } } - if (needPackageTerm) { - Util.err.log("Adding automatic dependency on org.netbeans.lib.terminalemulator for module " + m.getCodeNameBase()); - dependencies.addAll(Dependency.create(Dependency.TYPE_MODULE, - "org.netbeans.lib.terminalemulator > 1.0")); // NOI18N - } - } + try { + autoDepsHandler = AutomaticDependencies.parse((URL[])urls.toArray(new URL[urls.size()])); + } catch (IOException e) { + Util.err.notify(e); + } catch (SAXException e) { + Util.err.notify(e); + } + } + if (autoDepsHandler == null) { + // Parsing failed, or no files. + autoDepsHandler = AutomaticDependencies.empty(); + } + if (Util.err.isLoggable(ErrorManager.INFORMATIONAL)) { + Util.err.log(ErrorManager.INFORMATIONAL, "Auto deps: " + autoDepsHandler); + } + } + Set oldDependencies = new HashSet(dependencies); + autoDepsHandler.refineDependencies(m.getCodeNameBase(), dependencies); + if (!oldDependencies.equals(dependencies)) { + Set added = new HashSet(dependencies); + added.removeAll(oldDependencies); + oldDependencies.removeAll(dependencies); + Util.err.log(ErrorManager.WARNING, "Dependencies for module " + m.getCodeNameBase() + " were upgraded: added = " + added + " removed = " + oldDependencies); } } @@ -941,8 +783,9 @@ // interpret them recursively to force its classloader to "see" accessible // classes from even indirect dependencies. public void refineClassLoader(Module m, List parents) { - SpecificationVersion openide = getIDEDep(m.getDependencies()); + SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N if (!NO_COMPAT_AUTO_TRANSITIVE_DEPS && (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0)) { // NOI18N + Util.err.log(ErrorManager.WARNING, "Adding automatic recursive dependencies for module " + m.getCodeNameBase()); Dependency[] deps = m.getDependenciesArray(); Set parentModules = new HashSet(deps.length * 3 + 5); // Set addLoadersRecursively(parents, deps, parentModules, m); @@ -1003,8 +846,6 @@ // package prefixes can simply be deleted) "org/netbeans/core/", // NOI18N "org/netbeans/beaninfo/", // NOI18N - // terminalemulator.jar - "org/netbeans/lib/terminalemulator/", // NOI18N // regexp.jar "org/apache/regexp/", // NOI18N // crimson.jar @@ -1022,7 +863,7 @@ if (s == null) { s = new HashSet(); // Set Dependency[] deps = m.getDependenciesArray(); - SpecificationVersion openide = getIDEDep(m.getDependencies()); + SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N for (int i = 0; i < deps.length; i++) { // Extend this for other classpath modules: @@ -1093,7 +934,6 @@ */ private static final String[][] CLASSPATH_JARS = { {"core", "org/netbeans/core/", "org/netbeans/beaninfo/"}, // NOI18N - {"terminalemulator", "org/netbeans/lib/terminalemulator/"}, // NOI18N {"regexp", "org/apache/regexp/"}, // NOI18N {"crimson", "org/apache/crimson/"}, // NOI18N {"xerces", "org/apache/xerces/", "org/apache/xml/serialize/"}, // NOI18N @@ -1153,7 +993,7 @@ implDeps.add(deps[i].getName()); } } - SpecificationVersion openide = getIDEDep(m.getDependencies()); + SpecificationVersion openide = Util.getModuleDep(m.getDependencies(), "org.openide"); // NOI18N boolean pre27853 = (openide == null || openide.compareTo(new SpecificationVersion("1.3.12")) < 0); // NOI18N // #27853: only make recursive for old modules. addModuleClasspathEntries(m, m, modulesConsidered, implDeps, l, pre27853 ? Integer.MAX_VALUE : 1); Index: core/src/org/netbeans/core/modules/Util.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/Util.java,v retrieving revision 1.17 diff -u -r1.17 Util.java --- core/src/org/netbeans/core/modules/Util.java 18 Dec 2002 23:24:53 -0000 1.17 +++ core/src/org/netbeans/core/modules/Util.java 27 Jan 2003 19:35:55 -0000 @@ -139,20 +139,11 @@ // XXX ought to be some way to get localized messages for these... /** Check whether a simple dependency is met. - * Only applicable to Java and IDE dependencies. + * Only applicable to Java dependencies. */ - static boolean checkJavaOrIDEDependency(Dependency dep) throws IllegalArgumentException { - // Note that "any" comparison is not possible for these types. - if (dep.getType() == Dependency.TYPE_IDE) { - if (! dep.getName().equals(Dependency.IDE_NAME)) { - return false; - } - if (dep.getComparison() == Dependency.COMPARE_SPEC) { - return new SpecificationVersion(dep.getVersion()).compareTo(Dependency.IDE_SPEC) <= 0; - } else { - return dep.getVersion().equals(Dependency.IDE_IMPL); - } - } else if (dep.getType() == Dependency.TYPE_JAVA) { + static boolean checkJavaDependency(Dependency dep) throws IllegalArgumentException { + // Note that "any" comparison is not possible for this type. + if (dep.getType() == Dependency.TYPE_JAVA) { if (dep.getName().equals(Dependency.JAVA_NAME)) { if (dep.getComparison() == Dependency.COMPARE_SPEC) { return new SpecificationVersion(dep.getVersion()).compareTo(Dependency.JAVA_SPEC) <= 0; @@ -606,4 +597,32 @@ } } + /** Get API module dependency, if any, for a module. + * @param dependencies module dependencies + * @param cnb code name base of API module + * @return a fake spec version (0.x.y if x.y w/ no major release, else r.x.y); or null if no dep + */ + static SpecificationVersion getModuleDep(Set dependencies, String cnb) { + Iterator it = dependencies.iterator(); + while (it.hasNext()) { + Dependency d = (Dependency)it.next(); + if (d.getType() == Dependency.TYPE_MODULE && + d.getComparison() == Dependency.COMPARE_SPEC) { + try { + Object[] p = parseCodeName(d.getName()); + if (!p[0].equals(cnb)) { + continue; + } + int rel = ((Integer)p[1]).intValue(); // ignore any end range, consider only start + if (rel == -1) rel = 0; + return new SpecificationVersion("" + rel + "." + d.getVersion()); // NOI18N + } catch (NumberFormatException nfe) { + Util.err.notify(nfe); + return null; + } + } + } + return null; + } + } Index: core/src/org/netbeans/core/modules/auto-deps-1_0.dtd =================================================================== RCS file: core/src/org/netbeans/core/modules/auto-deps-1_0.dtd diff -N core/src/org/netbeans/core/modules/auto-deps-1_0.dtd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/src/org/netbeans/core/modules/auto-deps-1_0.dtd 27 Jan 2003 19:35:55 -0000 @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: core/src/org/netbeans/core/modules/package.html =================================================================== RCS file: /cvs/core/src/org/netbeans/core/modules/package.html,v retrieving revision 1.4 diff -u -r1.4 package.html --- core/src/org/netbeans/core/modules/package.html 13 Sep 2001 20:55:16 -0000 1.4 +++ core/src/org/netbeans/core/modules/package.html 27 Jan 2003 19:35:55 -0000 @@ -76,6 +76,9 @@

{@link org.netbeans.core.modules.TestModuleDeployer} is a service available via lookup which deploys test modules; accessible separately with a thin API for use by modules such as the API Support. +

{@link AutomaticDependencies} is used to parse the auto-deps.xml + file and automatically update dependencies used by old modules as a result. This is very + useful for maintaining backward compatibility across major refactorings.

Also of interest: {@link org.netbeans.core.ui.ModuleBean} provides a Swing-safe UI wrapper for Module and ModuleManager, used by the Modules node.

Those interested in using the independent parts of the module system as a standalone JAR Index: core/src/org/netbeans/core/resources/mf-layer.xml =================================================================== RCS file: /cvs/core/src/org/netbeans/core/resources/mf-layer.xml,v retrieving revision 1.122 diff -u -r1.122 mf-layer.xml --- core/src/org/netbeans/core/resources/mf-layer.xml 14 Jan 2003 13:30:21 -0000 1.122 +++ core/src/org/netbeans/core/resources/mf-layer.xml 27 Jan 2003 19:36:08 -0000 @@ -139,6 +139,9 @@ + + + Index: core/test/cfg-unit.xml =================================================================== RCS file: /cvs/core/test/cfg-unit.xml,v retrieving revision 1.34 diff -u -r1.34 cfg-unit.xml --- core/test/cfg-unit.xml 10 Jan 2003 22:14:04 -0000 1.34 +++ core/test/cfg-unit.xml 27 Jan 2003 19:36:09 -0000 @@ -50,9 +50,8 @@ - - - + + Index: core/test/unit/src/org/netbeans/core/modules/AutomaticDependenciesTest.java =================================================================== RCS file: core/test/unit/src/org/netbeans/core/modules/AutomaticDependenciesTest.java diff -N core/test/unit/src/org/netbeans/core/modules/AutomaticDependenciesTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/test/unit/src/org/netbeans/core/modules/AutomaticDependenciesTest.java 27 Jan 2003 19:36:09 -0000 @@ -0,0 +1,147 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.netbeans.core.modules; + +import java.net.URL; +import java.util.*; +import org.netbeans.junit.*; +import junit.textui.TestRunner; +import org.openide.modules.Dependency; + +/** Test AutomaticDependencies (end-to-end). + * @author Jesse Glick + */ +public class AutomaticDependenciesTest extends NbTestCase { + + public AutomaticDependenciesTest(String name) { + super(name); + } + + public static void main(String[] args) { + TestRunner.run(new NbTestSuite(AutomaticDependenciesTest.class)); + } + + private AutomaticDependencies ad; + protected void setUp() throws Exception { + ad = AutomaticDependencies.parse(new URL[] { + AutomaticDependenciesTest.class.getResource("data/auto-deps-1.xml"), + AutomaticDependenciesTest.class.getResource("data/auto-deps-2.xml"), + }); + } + + public void testBasicOperation() throws Exception { + Set deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_JAVA, "Java > 1.3")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "unrelated")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.0")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig2/1 > 1.5.1")); + Set _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("Java > 1.3, Nue, nue > 1.0, nue2 > 1.0, orig > 1.0, orig2/1 > 1.5.1, unrelated", normal(_deps)); + } + + public void testExcludes() throws Exception { + Set deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.0")); + Set _deps = new HashSet(deps); + ad.refineDependencies("a", _deps); + assertEquals("orig > 1.0", normal(_deps)); + _deps = new HashSet(deps); + ad.refineDependencies("a.x", _deps); + assertEquals("Nue, nue > 1.0, orig > 1.0", normal(_deps)); + _deps = new HashSet(deps); + ad.refineDependencies("b", _deps); + assertEquals("orig > 1.0", normal(_deps)); + _deps = new HashSet(deps); + ad.refineDependencies("b.x", _deps); + assertEquals("orig > 1.0", normal(_deps)); + } + + public void testVersionSensitivity() throws Exception { + Set deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig > 1.1")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "orig2/2 > 0.1")); + Set _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("orig > 1.1, orig2/2 > 0.1", normal(_deps)); + } + + public void testCancellations() throws Exception { + Set deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0")); + Set _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("javax.death/1 > 1.0", normal(_deps)); + } + + public void testMerges() throws Exception { + Set deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 1.0")); + Set _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("javax.death/1 > 1.0", normal(_deps)); + deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 0.3")); + _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("javax.death/1 > 1.0", normal(_deps)); + deps = new HashSet(); // Set + deps.addAll(Dependency.create(Dependency.TYPE_PACKAGE, "javax.death[AbstractCoffin] > 1.0")); + deps.addAll(Dependency.create(Dependency.TYPE_MODULE, "javax.death/1 > 1.3")); + _deps = new HashSet(deps); + ad.refineDependencies("random", _deps); + assertEquals("javax.death/1 > 1.3", normal(_deps)); + } + + private static String normal(Set deps) { + SortedSet s = new TreeSet(); // Set + Iterator it = deps.iterator(); + while (it.hasNext()) { + Dependency d = (Dependency)it.next(); + s.add(dep2String(d)); + } + StringBuffer b = new StringBuffer(); + it = s.iterator(); + while (it.hasNext()) { + b.append(it.next()); + if (it.hasNext()) { + b.append(", "); + } + } + return b.toString(); + } + + private static String dep2String(Dependency d) { + StringBuffer b = new StringBuffer(); + b.append(d.getName()); + switch (d.getComparison()) { + case Dependency.COMPARE_ANY: + break; + case Dependency.COMPARE_IMPL: + b.append(" = "); + b.append(d.getVersion()); + break; + case Dependency.COMPARE_SPEC: + b.append(" > "); + b.append(d.getVersion()); + break; + default: + throw new IllegalStateException(); + } + return b.toString(); + } + +} Index: core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java,v retrieving revision 1.26 diff -u -r1.26 ModuleManagerTest.java --- core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java 18 Dec 2002 23:41:32 -0000 1.26 +++ core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java 27 Jan 2003 19:36:09 -0000 @@ -173,6 +173,8 @@ } catch (IllegalArgumentException iae) { // Good. m1 should not have been passed to it. } + assertEquals(Collections.EMPTY_SET, m1.getProblems()); + assertEquals(Collections.EMPTY_SET, m2.getProblems()); List toEnable = mgr.simulateEnable(Collections.singleton(m2)); assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable); mgr.enable(Collections.singleton(m2)); @@ -224,6 +226,8 @@ } catch (IllegalArgumentException iae) { // Good. m2 should not have been passed to it. } + assertEquals(Collections.EMPTY_SET, m1.getProblems()); + assertEquals(Collections.EMPTY_SET, m2.getProblems()); List toEnable = mgr.simulateEnable(Collections.singleton(m1)); assertEquals("correct result of simulateEnable", Arrays.asList(new Module[] {m1, m2}), toEnable); mgr.enable(Collections.singleton(m1)); @@ -1436,6 +1440,7 @@ ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents()); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); Module m1 = mgr.create(new File(jars, "api-mod-export-all.jar"), null, false, false, false); Module m2 = mgr.create(new File(jars, "uses-api-simple-dep.jar"), null, false, false, false); mgr.enable(m1); @@ -1548,6 +1553,7 @@ ModuleManager mgr = new ModuleManager(new FakeModuleInstaller(), new FakeEvents()); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); Module m1 = mgr.create(new File(jars, "api-mod-export-api.jar"), null, false, false, false); Module m2 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false); Module m3 = mgr.create(new File(jars, "uses-api-transitively.jar"), null, false, false, false); Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest2.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest2.java,v retrieving revision 1.3 diff -u -r1.3 NbInstallerTest2.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest2.java 16 Oct 2002 06:05:12 -0000 1.3 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest2.java 27 Jan 2003 19:36:09 -0000 @@ -37,18 +37,19 @@ protected void setUp() throws Exception { super.setUp(); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true"); + System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true"); } /** Test #21173/#23595: overriding layers by localization. */ public void testLocLayerOverrides() throws Exception { NbTopManager.get(); // init module system final FakeEvents ev = new FakeEvents(); - ModuleInstaller installer = new NbInstaller(ev); + NbInstaller installer = new NbInstaller(ev); ModuleManager mgr = new ModuleManager(installer, ev); + installer.registerManager(mgr); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); Locale orig = Locale.getDefault(); Locale.setDefault(new Locale("cs", "CZ")); try { Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest3.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest3.java,v retrieving revision 1.3 diff -u -r1.3 NbInstallerTest3.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest3.java 16 Oct 2002 06:05:13 -0000 1.3 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest3.java 27 Jan 2003 19:36:09 -0000 @@ -38,10 +38,12 @@ public void testBrandingLayerOverrides() throws Exception { NbTopManager.get(); // init module system final FakeEvents ev = new FakeEvents(); - ModuleInstaller installer = new NbInstaller(ev); + NbInstaller installer = new NbInstaller(ev); ModuleManager mgr = new ModuleManager(installer, ev); + installer.registerManager(mgr); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); String orig = NbBundle.getBranding(); NbBundle.setBranding("foo"); try { Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest4.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest4.java,v retrieving revision 1.5 diff -u -r1.5 NbInstallerTest4.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest4.java 16 Oct 2002 06:05:13 -0000 1.5 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest4.java 27 Jan 2003 19:36:09 -0000 @@ -59,6 +59,7 @@ installer.registerManager(mgr); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false); Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false); assertEquals(Collections.EMPTY_SET, m2.getProblems()); Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest5.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest5.java,v retrieving revision 1.4 diff -u -r1.4 NbInstallerTest5.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest5.java 16 Oct 2002 06:05:13 -0000 1.4 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest5.java 27 Jan 2003 19:36:09 -0000 @@ -49,6 +49,7 @@ installer.registerManager(mgr); mgr.mutexPrivileged().enterWriteAccess(); try { + addOpenide(mgr); Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false); Module m2 = mgr.create(new File(jars, "override-layer-mod.jar"), null, false, false, false); Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest7.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest7.java,v retrieving revision 1.3 diff -u -r1.3 NbInstallerTest7.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest7.java 2 Nov 2002 21:07:40 -0000 1.3 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest7.java 27 Jan 2003 19:36:09 -0000 @@ -47,9 +47,7 @@ protected void setUp() throws Exception { super.setUp(); System.setProperty("netbeans.suppress.sysprop.warning", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO", "true"); + System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true"); // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false clearWorkDir(); File workdir = getWorkDir(); Index: core/test/unit/src/org/netbeans/core/modules/NbInstallerTest8.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/NbInstallerTest8.java,v retrieving revision 1.1 diff -u -r1.1 NbInstallerTest8.java --- core/test/unit/src/org/netbeans/core/modules/NbInstallerTest8.java 5 Nov 2002 23:09:31 -0000 1.1 +++ core/test/unit/src/org/netbeans/core/modules/NbInstallerTest8.java 27 Jan 2003 19:36:09 -0000 @@ -49,9 +49,7 @@ protected void setUp() throws Exception { super.setUp(); System.setProperty("netbeans.suppress.sysprop.warning", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_JH", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_DEPRECATED", "true"); - System.setProperty("org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_DEPS_COMP_EXEC_IO", "true"); + System.setProperty("org.netbeans.core.modules.NbInstaller.noAutoDeps", "true"); // leave NO_COMPAT_AUTO_TRANSITIVE_DEPS=false clearWorkDir(); File workdir = getWorkDir(); Index: core/test/unit/src/org/netbeans/core/modules/SetupHid.java =================================================================== RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/SetupHid.java,v retrieving revision 1.8 diff -u -r1.8 SetupHid.java --- core/test/unit/src/org/netbeans/core/modules/SetupHid.java 16 Oct 2002 06:05:14 -0000 1.8 +++ core/test/unit/src/org/netbeans/core/modules/SetupHid.java 27 Jan 2003 19:36:09 -0000 @@ -18,6 +18,8 @@ import java.io.*; import java.util.*; import java.beans.*; +import java.net.URL; +import java.util.jar.Manifest; import org.openide.filesystems.*; import org.openide.filesystems.FileSystem; // override java.io.FileSystem import org.netbeans.core.NbTopManager; @@ -96,6 +98,22 @@ text.append(new String(buf, 0, read, "US-ASCII")); } return text.toString(); + } + + protected void addOpenide(ModuleManager mgr) throws Exception { + ClassLoader l = SetupHid.class.getClassLoader(); + Enumeration e = l.getResources("META-INF/MANIFEST.MF"); + Manifest mani = null; + while (e.hasMoreElements()) { + URL u = (URL)e.nextElement(); + Manifest m = new Manifest(u.openStream()); + if ("org.openide/1".equals(m.getMainAttributes().getValue("OpenIDE-Module"))) { + mani = m; + break; + } + } + if (mani == null) throw new IllegalStateException("openide.jar not in classpath?"); + mgr.enable(mgr.createFixed(mani, null, l)); } protected static class FakeModuleInstaller extends ModuleInstaller { Index: core/test/unit/src/org/netbeans/core/modules/data/auto-deps-1.xml =================================================================== RCS file: core/test/unit/src/org/netbeans/core/modules/data/auto-deps-1.xml diff -N core/test/unit/src/org/netbeans/core/modules/data/auto-deps-1.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/test/unit/src/org/netbeans/core/modules/data/auto-deps-1.xml 27 Jan 2003 19:36:09 -0000 @@ -0,0 +1,47 @@ + + + + + + + + La la + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: core/test/unit/src/org/netbeans/core/modules/data/auto-deps-2.xml =================================================================== RCS file: core/test/unit/src/org/netbeans/core/modules/data/auto-deps-2.xml diff -N core/test/unit/src/org/netbeans/core/modules/data/auto-deps-2.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ core/test/unit/src/org/netbeans/core/modules/data/auto-deps-2.xml 27 Jan 2003 19:36:09 -0000 @@ -0,0 +1,32 @@ + + + + + + + + La la + + + + + + + + + + + + + Index: debuggercore/build.xml =================================================================== RCS file: /cvs/debuggercore/build.xml,v retrieving revision 1.36 diff -u -r1.36 build.xml --- debuggercore/build.xml 11 Dec 2002 17:06:57 -0000 1.36 +++ debuggercore/build.xml 27 Jan 2003 19:36:15 -0000 @@ -50,6 +50,7 @@ + @@ -68,11 +69,11 @@ - + - + - + + Index: debuggercore/manifest.mf =================================================================== RCS file: /cvs/debuggercore/manifest.mf,v retrieving revision 1.54 diff -u -r1.54 manifest.mf --- debuggercore/manifest.mf 2 Nov 2002 21:07:48 -0000 1.54 +++ debuggercore/manifest.mf 27 Jan 2003 19:36:15 -0000 @@ -3,8 +3,8 @@ OpenIDE-Module-Install: org/netbeans/modules/debugger/multisession/EnterpriseModule.class OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -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 +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 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider -OpenIDE-Module-Specification-Version: 2.5 +OpenIDE-Module-Specification-Version: 2.7 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ Index: debuggercore/oldapi/.cvsignore =================================================================== RCS file: debuggercore/oldapi/.cvsignore diff -N debuggercore/oldapi/.cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/.cvsignore 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,5 @@ +manifest-subst.mf +netbeans +Info +openide-debugger.nbm +javadoc Index: debuggercore/oldapi/build.xml =================================================================== RCS file: debuggercore/oldapi/build.xml diff -N debuggercore/oldapi/build.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/build.xml 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: debuggercore/oldapi/manifest.mf =================================================================== RCS file: debuggercore/oldapi/manifest.mf diff -N debuggercore/oldapi/manifest.mf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/manifest.mf 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,11 @@ +OpenIDE-Module: org.openide.debugger +OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.31 +OpenIDE-Module-Specification-Version: 1.0 +OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ +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 +OpenIDE-Module-Requires: org.openide.compiler.CompilationEngine +OpenIDE-Module-Localizing-Bundle: org/openide/debugger/module/Bundle.properties +OpenIDE-Module-Install: org/openide/debugger/module/Install.class +OpenIDE-Module-Layer: org/openide/debugger/module/layer.xml +OpenIDE-Module-Public-Packages: org.openide.debugger.*, org.openide.cookies.*, org.openide.loaders.* + Index: debuggercore/oldapi/api/doc/changes/apichanges.xml =================================================================== RCS file: debuggercore/oldapi/api/doc/changes/apichanges.xml diff -N debuggercore/oldapi/api/doc/changes/apichanges.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/api/doc/changes/apichanges.xml 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,116 @@ + + + + + + + Debugger API + + + + + + +

Un-deprecation of Debugger API + + + + +

+ Old modules should run unchanged, though they are encouraged + to depend explicitly on the new API. +

+

+ Code which set a performer for + ToggleBreakpointAction (or, perhaps, + AddWatchAction) should be changed to use the new + action context system: add bindings for + "org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction" + (resp. + "org.netbeans.modules.debugger.support.actions.AddWatchAction") + to the TopComponent's action map, rather than + overriding componentActivated and + componentDeactivated. +

+

+ Modules depending on org.openide.deprecated + versions prior to 1.2 will automatically receive + a dependency on the new module. +

+
+ +

+ Most of the Debugger API has been restored in non-deprecated + form in a separate autoload module. Only the actions in + org.openide.actions.* were not moved from + openide-deprecated.jar as they should not be + needed. +

+
+ + + + + + + + + + + + Change History for the Debugger API + + + + + +

+ See also: Separation of the Debugger API +

+

+ There were no recorded pre-separation changes for the Debugger + API. +

+ +

Index of APIs

+ + +

Incompatible changes by date

+ + +

All changes by date

+ + +

Changes by version

+ + +

Changes by affected class

+ + +

Details of all changes by API and date

+ + +
+ + Index: debuggercore/oldapi/api/doc/org/openide/debugger/package.html =================================================================== RCS file: debuggercore/oldapi/api/doc/org/openide/debugger/package.html diff -N debuggercore/oldapi/api/doc/org/openide/debugger/package.html --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/api/doc/org/openide/debugger/package.html 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,32 @@ + + + + + +The IDE can support plugged-in implementations of an abstract + +debugger + +interface. + +

The Debugger API permits a +new debugger to be inserted into the system, largely reusing the +existing user interface, and permitting extra functionality to be +exposed via nodes if needed. The API may also be used to control the +system debugger, especially to add private variable watches to the +debugged process that may be used to create a richer debugging +environment. + + + Index: debuggercore/oldapi/api/doc/org/openide/debugger/doc-files/api.html =================================================================== RCS file: debuggercore/oldapi/api/doc/org/openide/debugger/doc-files/api.html diff -N debuggercore/oldapi/api/doc/org/openide/debugger/doc-files/api.html --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/api/doc/org/openide/debugger/doc-files/api.html 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,821 @@ + + + + +Debugger API + + + + +

Overview

+ +

Javadoc

+ +The Javadoc resides in + +org.openide.debugger. + +

Contents

+ + + +

Debugger API

+ +The Debugger API provides a thin interface between the IDE and various +possible debugger implementations, including the IDE's standard +debugger. The API is designed to work with Java programs, although it +could also be used for + +any language + +compiled to the JVM. + +

Note that the API itself defines only the basic methods of +communication, and does not specify a rich level of +functionality. However, what it provides is sufficient to implement +all of the connections between the standard debugger module and the +debugging-related actions and UI components, including with the +Editor. Real debuggers will very likely have more features than are +specified here, but it is not difficult to make the + +added functionality + +visible to the user. + +

There are two different aspects to adding debugging capabilities to the IDE. +One is to create the debugger itself, i.e. a set of implementations +which specify how the debugger will be run, its current dynamic status, manipulation +of breakpoints and watches, etc. The other half is to create debugger types +which specify how the debugger should be invoked for particular types of objects - for +example, applets need to be debugged by means of launching the AppletViewer pointing to the correct +applet class or HTML page; but once the AppletViewer's main class has been launched with the correct +arguments, the remaining implementation is entirely up to the debugger. These two halves can (and typically +are) treated quite separately, so that the standard IDE debugger module installs a debugger as well as a +couple of simple, generic debugger types, while modules providing support for more exotic data types such +as applets or servlets provide their own specialized debugger types. + +

+ +

In practice, the specification of debugger functionality in the +Open APIs is insufficient for most projects to supply an integrated +alternate debugger for NetBeans. Generally it is necessary to rely on +additional SPIs contained in the Debugger Core module. These however +may not have the same standards of API design, documentation, and +compatibility as the Open APIs.

+ +

The + +debugger module's home page + +has a certain amount of documentation for how to use these extended +SPIs, and a trivial example. As of this writing, the documentation is +not sufficient to cover all aspects of the module's SPI, so additional +help from the mailing lists and examination of NetBeans source code +will likely be necessary.

+ +
+ +

Creating a Debugger

+ +To create a debugger, you must implement the + +Debugger + +abstract class. It must provide the following sets of features: + +
    + +
  1. Access to, and control of, the debugger's basic state. The state should be queriable by means of + +Debugger.getState(). + +Initially, the debugger will be + +Debugger.DEBUGGER_NOT_RUNNING + +When some other part of the system starts it up with + +Debugger.startDebugger(...), + +it may indicate its state during the initialization phase as + +Debugger.DEBUGGER_STARTING. + +When it is ready, it will be either + +Debugger.DEBUGGER_RUNNING + +(if actually executing user code at the time), + +or + +Debugger.DEBUGGER_STOPPED + +(if stopped at a breakpoint). + +

    Once it is running, the debugger should respond to the basic commands + +Debugger.traceInto(), + +Debugger.traceOver(), + +and + +Debugger.stepOut(), + +all of which return it to the stopped state; and + +Debugger.go(), + +putting it into the running state (unless a breakpoint is encountered). + +Debugger.finishDebugger() + +should stop the debugger as soon as possible (some cleanup may be +required) and leave it in the not-running state. + +

    The + +DebuggerInfo + +provides the basic information needed for the debugger to start - the +name of the main class; a list of "command-line" parameters to pass to +its main(String[]) method, which may be empty; and +(optionally) the name of a class to first stop execution on (as if +there were breakpoints on all of its methods). + +

    The debugger can look in the + +repository + +to find source code; and for a normal external +debugger, determine how to prepare the classpath correctly, which +generally involves scanning through + +all filesystems, + +asking each to + +add information + +to an object supplied by the debugger implementing + +FileSystem.Environment. + +If classes should be compiled before being used in the debugger, the +debugger should take care of that using the + +Compiler API. + +

  2. The debugger should be able to create breakpoints and watches when +requested by + +Debugger.createBreakpoint(...) + +(and related methods) or + +Debugger.createWatch(...). + +The debugger must create an implementation +of these objects. + +
  3. The debugger should + +fire events + +for a few properties, so that other parts of the system (such as the + +Trace Over + +action) can be sensitive to changes in the debugger's state. + +
  4. Most debuggers (including the standard module) will +need to provide certain options not specified in the API, such as +whether to compile automatically before debugging; extra class path +elements to use; parameters to connect to an external debugger; +etc. These should be handled by providing a + +system option + +in the debugger's module. + +
+ +

Special breakpoint & watch implementation

+ +

The debugger is not required to do anything for implementation of +breakpoints and watches beyond the small interfaces specified in + +Breakpoint + +and + +Watch, + +which essentially only specify abstract points in debugged code and +request that listeners be notified of changes in these basic +properties. These objects need only be created by the main debugger +class, as mentioned above.

+ +
+ +

However, it is likely that the debugger implementation will want to +provide additional functionality, possibly pertaining to these +objects. For example: + +

    + +
  • Breakpoints could be made conditional, not absolute, based on some +(possibly Java) expression to evaluate. + +
  • Threads and thread groups could be explicitly represented. + +
  • Inspection of objects in the debugged process could be provided. + +
  • Watches could be real expressions (say, a function call), not just +the name of a variable. + +
+ +

None of this interferes with the use of the API - the only likely +caveat is that the Editor might expect a watch to operate correctly +when its expression is an unqualified (local or member) variable name, +so this should be considered. (This most common usage of watches is +the one that a user will expect anyway.)

+ +
+ +

Any additional functionality built onto the debugger itself, or +onto its breakpoints or watches, ought to be exposed as JavaBeans +properties, and events fired upon their change - this convention +ensures that if such objects are used by any other part of the system +(say, inspected in a property sheet, customized in some action...), +that the extended functionality will be properly presented. +See the section on + +extra implementation + +for ideas on how to present additional functionality. + +

Installation tips

+ +

Installation of the debugger itself is quite simple thanks to the + +Services API - + +you need only register an instance of it to lookup

+ +

A typical debugger implementation will, however, want to install +some other components to support it, such as a system option +(mentioned above), or an environment node +to represent the state of the running debugger, its breakpoints and +watches, possibly threads, etc. - see the + +Nodes API + +for instructions on doing this.

+ +

Creating Extra Debugger-Related Implementation

+ +While the previous section described what is required of +the debugger by the APIs, in practice a good debugger module will +present more of a user interface than the APIs specify. By default, +the implementation of the IDE does not do much with the debugger +directly: + +
    + +
  1. DebuggerType.Default + +is available as a bare-bones + +debugger type + +which just invokes the debugger via the public interface; you may +want to write your own debugger types to complement it. + +
+ +
+ +The following subsections describe things which the IDE +implementation does not do automatically, and ideas on how +to implement them suitably for your debugger. They are all optional +for a compliant debugger implementation, since they affect the UI +rather than the interactions of other parts of the IDE with the +debugger; most are desirable nevertheless. + +Writing debugger types + +is also a good idea, but is described separately since it may also +be done in modules outside of the debugger proper, as debugger +types are specific to certain kinds of development support +(e.g. RMI, servlet, etc.). + +

Handling the current line

+ +It is desirable (though not strictly required) that a debugger update +the Editor to track the current line as it moves through source code +(if such movement can be tracked properly, and the current source is +available). This is the debugger's responsibility, not the Editor's +nor the system's. + +

Though different debuggers may of course vary in exactly how they +wish to do this, the basic implementation is not difficult once you +know where to look: + +

    + +
  1. Keep track of the current line in a variable of type + +Line, + +which is designed for exactly this sort of purpose. You may use + +Line.markCurrentLine() + +and + +Line.unmarkCurrentLine() + +whenever control enters or exits this line. + +
  2. To find the current source file based on the classname, + +Repository.find(...) + +is easiest. You may instead wish to get all filesystems marked as +supporting debugging via + +FileSystemCapability.DEBUG + +and then call + +FileSystemCapability.find(...) + +to find the source file within these filesystems only. + +
  3. Knowing the file containing source, the lines in it are available +by first getting the data object (with + +DataObject.find(...)), + +then using + +DataObject.getCookie(...) + +to look for a + +LineCookie + +(which ought to have been provided by, e.g., the + +EditorSupport + +attached by the standard Java loader), + +and finally getting the desired line with + +LineCookie.getLineSet() + +and + +Line.Set.getOriginal(int) + +(which finds the line based on the original line numbering, even if +the user has since edited the document). + +
+ +

Adding extra actions

+ +Many debuggers will provide additional functionality as regards +their running state over that specified in the APIs. For example, +the standard IDE debugger supports suspending and resuming the +debugger, which is not required by the APIs and not accessible via +them. For this reason, you may want to create your own user-visible +actions to support extended debugger manipulation using the + +Actions API. + +

The IDE's default menu and toolbar configurations should include +the basic (API-supplied) actions in sensible positions. If you do +not agree with these positions, or wish to add your own special +actions to the menus or toolbars, the Actions API again describes + +how to do this. + +

Finally, you may want to provide context-menu actions on + +any nodes + +which you create for your debugger; if so, please use the + +Nodes API + +for guidance. + +

Adding nodes to "Runtime"

+ +The standard debugger installs a new master node into the +Runtime tab in the Explorer, containing lists of current +breakpoints and watches, as well as extra functionality it has such +as current threads (and thread groups), and debugging sessions in +the case of a multiple-session debugger. Debugger implementors who +wish to provide similar functionality should do so themselves; +although there is no direct API support for this, in practice +creating basic lists of objects is not difficult. + +

The basic idea is to use the + +Nodes API + +to create simple lists of all objects in your debugger's current +state. For starters, you could create a master node (the one +directly under Runtime) as an + +AbstractNode + +using + +Children.Array: + +the children can just be listed as is, since you will want one +child for each category (breakpoints, watches, etc.). + +

Now, each category node (e.g. list of all watches) can again be +an AbstractNode, but this time using + +Children.Keys + +so that its children are dynamically determined; in the + +Children.addNotify() + +method, call + +Children.Keys.setKeys(Collection) + +to update the list of keys. Probably you will want each key to just +be one actual watch object from the debugger. Also, attach a +listener to your debugger so that when the set of watches changes, +setKeys will be called again with the new list of +children to update the display. Note that if your implementation +supports hidden breakpoints, as determined by + +Breakpoint.isHidden(), + +then these should of course be excluded from the visible list. + +

In the + +Children.Keys.createNodes(Object) + +method, you know your key is a watch object, so just use + +new BeanNode(Object) + +to represent it. Remember, watches and breakpoints should have +bound properties and bean info just like any JavaBean, so using a +BeanNode for them should provide all the right +behavior automatically. You can also subclass BeanNode +and implement + +BeanNode.canDestroy() + +and + +BeanNode.destroy() + +(etc.) to permit the user to delete watches from this view - the +method should simply remove the watch from the debugger, and then +the parent node will get routinely notified via its listener of the +change and refresh the display. + +

Other types of objects such as threads and so on can also be +represented in similar ways, but of course the details of how to +set up the nodes will vary depending on how you represent such +objects; refer to the Nodes API for this. + +

Finally, the master node can be installed by your module using the + +Modules API. + +

Adding a debugging workspace, windows, etc.

+ +You can check how the IDE looks without your debugger module (or +the standard debugger module) installed and then decide if you need +to customize workspaces, windows, and so on. If you wish, you can +create your own customized workspaces and so on for the purpose of +giving a characteristic feel and UI to a user's debugging sessions; +refer to the + +Window System API + +for all details. + +

If you wish to provide a window (possibly multitabbed) showing +your debugging nodes, the way the standard module does, you can +create + +ExplorerPanels + +to hold e.g. a + +BeanTreeView + +and a + +PropertySheetView, + +then assign the root node to such a window using + +ExplorerPanel.getExplorerManager() + +and + +ExplorerManager.setRootContext(Node). + +The multitabbed look can be achieved simply using + +window manager modes. + +

Adding a system option

+ +You will probably want to add a + +system option + +to the IDE representing general configuration of your debugger +(specifics of how to debug particular files, such as the path to +any required debugger executable, ought to be left to + +debugger types). + +

Persisting debugger state

+ +Finally, it is important for the user experience of the IDE that as +much as possible of their environment persist across IDE +restarts. This is generally done by storing various types of +configurations in the project state. In the case of debuggers, +conventionally at least the list of breakpoints and watches should +be stored, so that a user does not need to set up their debugging +environment afresh each time the IDE is restarted. Fortunately, +implementing this is rather easy; it is suggested that you: + +
    + +
  1. Make sure your watches and breakpoints are really safely +serializable (as required by the API interfaces). + +
  2. Create a bean holding the set of watches and breakpoints +as properties. It should be serializable and fire property +changes. + +
  3. Register +an instance of this bean to lookup. It need not have any visible +representation. + +
  4. You can now ask lookup for the instance of the bean, and changes +should be saved to disk automatically. + +
+ +
+ +

Creating a Debugger Type

+ +You may create debugger types in order to provide special +support for debugging objects other than simple Java classes with +main methods. For example, debugging applets may +entail launching the debugger on the AppletViewer application, +passing in the HTML URL for the applet to be debugged. (For classes +with main methods, the standard default implementation + +DebuggerType.Default + +suffices.) Thus, debugger types are the bridge between the specifics of how +a file should be started (in this way resembling + +Executors) + +and the debugger implementation (which assumes that it is being started +on a class with a main method). + +

Creating and installing the debugger type with its associated +configuration is a fairly uniform process, according to the + +Services API, since + +the required superclass + +DebuggerType + +is a variety of + +ServiceType. + +Only issues pertaining specifically to subclassing +DebuggerType will be discussed here. + +

There is just one abstract method to implement: + +DebuggerType.startDebugger(ExecInfo,boolean). + +When a user of debugger types (such as ExecSupport, +see below) wishes to start debugging some +object (say, an applet), it will call this method on the debugger +type, passing it an + +DataObject + +containing the class to be debugged; and a flag indicating whether the +debugger should initially break on the "main class" of the object +(however that should be interpreted).

+ +
+ +

Typically, the debugger type will do a few simple steps:

+ +
    + +
  1. Construct a + +new DebuggerInfo(...) + +according to the information passed in the ExecInfo, +as well as the specifics of the debugger type. For example, in the +case of applets, the DebuggerInfo should specify the +main class as being that of the AppletViewer application, and the +class name of the applet should be used to look up an HTML page +which can then be passed in the argument list along with other +options. + +
  2. Handle the stop-on-main flag appropriately. If the flag is +clear, typically + +
    +new DebuggerInfo (mainClass, arguments, null)
    +
    + +should be used, to prevent the debugger from breaking except at +user-specified points. If the flag is set, you may use the +two-argument constructor, but this will break at the beginning of +the real main class (e.g. AppletViewer); you may instead prefer to +explicitly specify the class to break on, such as the applet class. + +
  3. Actually launch the debugger with: + +
    +TopManager.getDefault ().getDebugger ().startDebugger (myDebugInfo);
    +
    + +
+ +
+ +

Note that general problems occurring during this problem can be reported with a + +DebuggerException. + +

You have the option of what exactly to include in the +DebuggerInfo option passed to the +startDebugger method. If the debugger type is to be +generic (work with any installed debugger), then you should only +assume the API minimum and use an actual instance of +DebuggerInfo. But, it is permissible to provide +additional debugger-specific information, if that information can +be used to good effect by the debugger implementation.

+ +

For example, the standard IDE debugger actually defines several +additional subclasses of DebuggerInfo and provides a +special API to these (outside of the Open APIs), such as an +extended info which contains descriptions of the exact process name +to be used to start the Java launcher in debug mode, special VM +options, and so on. It also defines standard debugger-type +superclasses which already have all of this configuration present +as Bean properties. So, debugger types (such as those for applets) +can specify an applet style of debugging, along with special VM +characteristics for the user to configure. If the debugger is +handed a plain DebuggerInfo, it simply uses default +settings for all the specifics; conversely, an extended +DebuggerInfo could be passed to an alternate debugger +implementation without harm, as the alternate debugger would just +not recognize the extra information in the subclass.

+ +
+ +

Invoking the Debugger

+ +There is little to say about how to invoke an existing debugger +programmatically - the essential methods are all provided in the +Debugger interface, and the debugger can be started with +only a + +small amount + +of information. The debugger instance itself should be obtained via + +lookup + +(currently the system expects only one debugger to be installed at +a time; the APIs permit the implementation to keep multiple +debuggers loaded with only one active at a time, though currently +the implementation does not do this). + +

You may also wish to start debugging a particular file by means +of its + +DebuggerCookie; + +most frequently this implementation is an + +ExecSupport + +which will delegate the request to an associated debugger type, +which then launches the system debugger with the correct +arguments. This more natural method is that used by the standard +debugger-launching actions. + +

The + +Services API + +also permits you to look for specific debugger types which could +then be applied manually to a specific file. + +

+ +

Using hidden watches

+ +A sophisticated editor implementation, and potentially other +components as well, may want to monitor the current value of a +variable mentioned in source code (e.g.) while the debugger is in +operation. This is possible using a hidden watch, which +functions exactly like a regular watch but is not created by the user +and not intended for direct display to the user. To create one, just +get the debugger and call + +Debugger.createWatch(...) + +(with the second argument true). Typically the watched +expression will be an unqualified variable name, but of course this +depends on the watch's use, and what the debugger implementation is +capable of handling (only assume bare variable names are supported). + +

Now, the current display value of the watch is available with + +Watch.getAsText(), + +and the + +corresponding property + +may be listened to in order to update some user-oriented display (such +as a tool tip). + +

Remember to call + +Watch.remove() + +as soon as the watch is no longer required, so as not to waste memory. + +


@FOOTER@ + + Index: debuggercore/oldapi/src/org/openide/cookies/DebuggerCookie.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/cookies/DebuggerCookie.java diff -N debuggercore/oldapi/src/org/openide/cookies/DebuggerCookie.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/cookies/DebuggerCookie.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,30 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.cookies; + +import org.openide.debugger.DebuggerException; +import org.openide.nodes.Node; + +/** Cookie for debugger. Any data object or node that supports +* debugging can implement this cookie. +* +* @author Jan Jancura +*/ +public interface DebuggerCookie extends Node.Cookie { + /** Start debugging of associated object. + * @param stopOnMain if true, debugger stops on the first line of debugged code + * @exception DebuggerException if the session cannot be started + */ + public void debug (boolean stopOnMain) throws DebuggerException; +} Index: debuggercore/oldapi/src/org/openide/debugger/Breakpoint.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/Breakpoint.java diff -N debuggercore/oldapi/src/org/openide/debugger/Breakpoint.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/Breakpoint.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,109 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +import java.beans.PropertyChangeListener; + +import org.openide.text.Line; +import org.openide.src.ConstructorElement; + +/** +* Represents one breakpoint. +* Breakpoints are created and returned +* by the {@link Debugger} implementation. A breakpoint may be assigned either to a source line +* of a class, or to a method (or constructor) of a class. +* The current set of breakpoints is stored +* in the implementation of {@link Debugger}. +*

+* The abstract class contains only the necessary manipulation methods +* used by the IDE, like enabling/disabling the breakpoint and obtaining its +* position. A good implementation can offer the user much better ways to +* deal with the breakpoint (conditional breakpoints, etc.). Such information should +* be presented as properties--so it is assumed that the +* breakpoint itself is a serializable JavaBean. +* +* +* @author Jan Jancura, Jaroslav Tulach +*/ +public abstract class Breakpoint implements java.io.Serializable { + /** Property name for validity of the breakpoint. */ + public static final String PROP_VALID = "valid"; // NOI18N + /** Property name for enabled status of the breakpoint. */ + public static final String PROP_ENABLED = "enabled"; // NOI18N + + static final long serialVersionUID =4899621215676971003L; + /** Destroy this breakpoint. + * Removes it from the list of all breakpoints in the system. + */ + public abstract void remove (); + + /** Get the line assigned to the breakpoint. + * + * @return the source line or null if no line is specified (it is assigned to a method) + */ + public abstract Line getLine (); + + /** Get the name of the class the breakpoint is in. + * + * @return the class name + */ + public abstract String getClassName (); + + /** Get the method the breakpoint is in. + * + * @return the method (or constructor) element or null if it assigned to a line + */ + public abstract ConstructorElement getMethod (); + + /** + * Test whether the breakpoint is enabled. + * + * @return true if so + */ + public abstract boolean isEnabled (); + + /** + * Set whether the breakpoint is enabled. + * + * @param state true to enable, false to disable + */ + public abstract void setEnabled (boolean enabled); + + /** + * Test whether the breakpoint is valid. + * Invalidity might be caused by an inability to find the class it is supposed to be in, for example. + * @return true if it is valid + */ + public abstract boolean isValid (); + + /** Test whether the breakpoint is hidden. + * If so, it + * is not presented in the list of all breakpoints. Such a breakpoint can be used + * for the IDE's (or some module's) private use, not displaying anything to the user. + * @return true if the breakpoint is hidden + */ + public abstract boolean isHidden (); + + /** + * Add a property change listener. + * @param listener the listener to add + */ + public abstract void addPropertyChangeListener (PropertyChangeListener listener); + + /** + * Remove a property change listener. + * @param listener the listener to remove + */ + public abstract void removePropertyChangeListener (PropertyChangeListener listener); +} Index: debuggercore/oldapi/src/org/openide/debugger/Bundle.properties =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/Bundle.properties diff -N debuggercore/oldapi/src/org/openide/debugger/Bundle.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/Bundle.properties 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,17 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun +# Microsystems, Inc. All Rights Reserved. + +# DebuggerType.Default.class - debugger type +LAB_DefaultDebuggerType=Default Debugging + +# ExecSupport +PROP_debuggerType=Debugger +HINT_debuggerType=Style of debugger to use for this file. Index: debuggercore/oldapi/src/org/openide/debugger/Bundle_ja.properties =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/Bundle_ja.properties diff -N debuggercore/oldapi/src/org/openide/debugger/Bundle_ja.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/Bundle_ja.properties 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,23 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun +# Microsystems, Inc. All Rights Reserved. + + + + + +# + +# DebuggerType.Default.class - debugger type + +# +# LAB_DefaultDebuggerType=Default Debugging +LAB_DefaultDebuggerType=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30d0\u30c3\u30ac + Index: debuggercore/oldapi/src/org/openide/debugger/Debugger.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/Debugger.java diff -N debuggercore/oldapi/src/org/openide/debugger/Debugger.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/Debugger.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,227 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +import java.beans.PropertyChangeListener; + +import org.openide.text.Line; +import org.openide.src.ConstructorElement; + +/** +* Provides a minimal interface between the IDE and a debugger. +* It permits +* control of the state of the debugger and creation of breakpoints and +* watches. +*

You may find an instance in {@link org.openide.util.Lookup}. +* @author Jan Jancura, Jaroslav Tulach +*/ +public abstract class Debugger { + /** Debugger state when the debugger is not running at all. */ + public static final int DEBUGGER_NOT_RUNNING = 1; + /** Debugger state when the debugger is starting to run. */ + public static final int DEBUGGER_STARTING = 2; + /** Debugger state when the debugger is running user code. */ + public static final int DEBUGGER_RUNNING = 3; + /** Debugger state when the debugger is stopped, for example at a breakpoint. */ + public static final int DEBUGGER_STOPPED = 4; + + /** Name of property for the debugger's state. */ + public static final String PROP_STATE = "state"; // NOI18N + /** Name of property for the set of breakpoints in the system. */ + public static final String PROP_BREAKPOINTS = "breakpoints"; // NOI18N + /** Name of property for the set of watches in the system. */ + public static final String PROP_WATCHES = "watches"; // NOI18N + /** Name of property for the debugger's current line. */ + public static final String PROP_CURRENT_LINE = "currentLine"; // NOI18N + + /** */ + public static final int ACTION_BREAKPOINT_HIT = 1; + /** */ + public static final int ACTION_TRACE_OVER = 2; + /** */ + public static final int ACTION_TRACE_INTO = 3; + /** */ + public static final int ACTION_STEP_OUT = 4; + + /** Start a new debugging session. + * The current debugging session, if any, should be stopped first. + * The provided information specifies the class to start and + * arguments to pass it, and the name of class to stop debugging in, if applicable. + * + * @param info debugger startup info + * @exception DebuggerException if an error occurs while starting the debugger + */ + public abstract void startDebugger (DebuggerInfo info) throws DebuggerException; + + /** + * Finish the debugger session. + * @throws DebuggerException if there was problem during cleanup + */ + public abstract void finishDebugger () throws DebuggerException; + + /** + * Trace into (a statement). + * @throws DebuggerException if there is a problem during execution + */ + public abstract void traceInto () throws DebuggerException; + + /** + * Trace over (a statement). + * @throws DebuggerException if there is a problem during execution + */ + public abstract void traceOver () throws DebuggerException; + + /** + * Go. + * This should continue executing user code until a breakpoint is hit or the debugger finishes. + * @throws DebuggerException if there is a problem during execution + */ + public abstract void go () throws DebuggerException; + + /** + * Step out (of a statement). + * @throws DebuggerException if there is a problem during execution + */ + public abstract void stepOut () throws DebuggerException; + + // BREAKPOINTS + + /** Create a new breakpoint assigned to a specific line. + * The line is represented by a line object that can change its + * position as the text is modified. + * + * @param l line to create breakpoint at + * @return the new breakpoint + */ + public abstract Breakpoint createBreakpoint (Line l); + + /** Create a new breakpoint assigned to a specific line. + * Allows creation of a hidden breakpoint. + * + * @param l line to create breakpoint at + * @param hidden true if the breakpoint should be hidden from the user + * @return the new breakpoint + */ + public abstract Breakpoint createBreakpoint (Line l, boolean hidden); + + /** Find the breakpoint assigned to a given line. + * + * @param l line to find the breakpoint at + * @return the breakpoint or null if there is no such breakpoint + */ + public abstract Breakpoint findBreakpoint (Line l); + + /** Create a new breakpoint assigned to a method (or constructor). + * The method is represented by a method (or constructor) source element that + * must have a declaring class. + * + * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class + * @return the new breakpoint + * @exception IllegalArgumentException if the method does not have a declaring class + */ + public abstract Breakpoint createBreakpoint (ConstructorElement method); + + /** Create a new breakpoint assigned to a method (or constructor). + * The method is represented by a method (or constructor) source element that + * must have a declaring class. + * Allows creation of a hidden breakpoint. + * + * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class + * @param hidden true if the breakpoint should be hidden from the user + * @return the new breakpoint + * @exception IllegalArgumentException if the method does not have a declaring class + */ + public abstract Breakpoint createBreakpoint (ConstructorElement method, boolean hidden); + + /** Find the breakpoint assigned to a method (or constructor). + * + * @param method method or constructor to find the breakpoint of + * @return the breakpoint or null if there is no such breakpoint + * @exception IllegalArgumentException if the method does not have a declaring class + */ + public abstract Breakpoint findBreakpoint (ConstructorElement method); + + /** Get all breakpoints in the system. + * + * @return all breakpoints + */ + public abstract Breakpoint[] getBreakpoints (); + + /** + * Remove all breakpoints from the system. + */ + public abstract void removeAllBreakpoints (); + + + + // WATCHES + + /** Create new uninitialized watch. The watch is visible (not hidden). + * + * @return the new watch + */ + public abstract Watch createWatch (); + + /** Create a watch with its expression set to an initial value. + * Also + * allows creation of a hidden watch (not presented to the user), for example + * for internal use in the editor to obtain values of variables + * under the mouse pointer. + * + * @param expr expression to watch for (the format is the responsibility of the debugger implementation, but it is typically a variable name) + * @param hidden true if the watch should be hidden from the user + * @return the new watch + */ + public abstract Watch createWatch (String expr, boolean hidden); + + /** + * Get all watches in the system. + * + * @return all watches + */ + public abstract Watch[] getWatches (); + + /** + * Remove all watches from the system. + */ + public abstract void removeAllWatches (); + + // PROPERTIES + + /** Get the state of the debugger. + * + * @return {@link #DEBUGGER_NOT_RUNNING}, {@link #DEBUGGER_RUNNING}, {@link #DEBUGGER_STOPPED}, or {@link #DEBUGGER_STARTING} + */ + public abstract int getState (); + + /** Get the current line of debugger. + * + * @return current line + */ + public abstract Line getCurrentLine (); + + /** + * Add a property change listener. + * + * @param l the listener to add + */ + public abstract void addPropertyChangeListener (PropertyChangeListener l); + + /** + * Remove a property change listener. + * + * @param l the listener to remove + */ + public abstract void removePropertyChangeListener (PropertyChangeListener l); +} Index: debuggercore/oldapi/src/org/openide/debugger/DebuggerException.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/DebuggerException.java diff -N debuggercore/oldapi/src/org/openide/debugger/DebuggerException.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/DebuggerException.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,56 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +/** +* An exception occurring in the debugger. +* This exception +* is thrown in the debugger from all methods which may involve running user code. +* +* @author Jan Jancura +* @version 0.11, Jan 30, 1998 +*/ +public class DebuggerException extends java.lang.reflect.InvocationTargetException { + + /** generated Serialized Version UID */ + static final long serialVersionUID = -3112649137515905742L; + + /** + * Construct a DebuggerException for a specified inner exception. + * @param throwable the basic exception + */ + public DebuggerException (Throwable throwable) { + super (throwable); + } + + /** + * Construct a DebuggerException with a description. + * + * @param message message text + */ + public DebuggerException (String description) { + super (new Exception (), description); + } + + /** + * Construct a DebuggerException with a description and base error. + * + * @param message description of the exception + * @param throwable original exception + */ + public DebuggerException (String description, Throwable throwable) { + super (throwable, description); + } + +} Index: debuggercore/oldapi/src/org/openide/debugger/DebuggerInfo.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/DebuggerInfo.java diff -N debuggercore/oldapi/src/org/openide/debugger/DebuggerInfo.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/DebuggerInfo.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,97 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + + +/** +* Contains information about a class to debug. +* Consists of these pieces of information: +*

    +*
  • the class to run +*
  • parameters for its main method +*
  • a class name to stop execution in, if desired +*
+* +* @author Jan Jancura, Jaroslav Tulach +*/ +public class DebuggerInfo extends org.openide.execution.ExecInfo { + /** class to stop at */ + private String stopClassName; + + /** + * Construct a new DebuggerInfo with the class to run and its parameters specified. + * Sets class to stop in to be the class to run. + * + * @param className name of debugged class + * @param argv command-line arguments used for debugging this class; may be empty but not null + */ + public DebuggerInfo ( + String className, + String[] argv + ) { + this ( + className, + argv, + className + ); + } + + /** + * Construct a new DebuggerInfo with the class to run, parameters, and a class to stop at. + * + * @param className name of debugged class + * @param argv command-line arguments used for debugging this class; may be empty but not null + * @param stopClassName name of class to stop in (may be null) + */ + public DebuggerInfo ( + String className, + String[] argv, + String stopClassName + ) { + super (className, argv); + this.stopClassName = stopClassName; + } + + /** Checks whether the method has declaring class. + * @param m method + * @return the same method + * @exception IllegalArgumentException if the stopMethod does not have + * declaring class + * + private static MethodElement method (MethodElement m) { + if (m.getDeclaringClass () == null) { + throw new IllegalArgumentException ("No declaring class for method: " + m.getName ()); + } + return m; +} + */ + + + /** Get the class to stop execution in. + * + * @return the class name or null + */ + public String getStopClassName () { + return stopClassName; + } + + /** Getter for a method to stop at. If the method is not null + * it has a declaring class. So + * @return method or null + * + public MethodElement getStopMethod () { + return stopMethod; +} + */ +} Index: debuggercore/oldapi/src/org/openide/debugger/DebuggerNotFoundException.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/DebuggerNotFoundException.java diff -N debuggercore/oldapi/src/org/openide/debugger/DebuggerNotFoundException.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/DebuggerNotFoundException.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,34 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +/** +* Exception indicating that the debugger itself could not be loaded properly. +* +* @author Jan Jancura +* @deprecated Not used by anything except deprecated TopManager. +* You may instead find a {@link Debugger} via lookup. +*/ +public class DebuggerNotFoundException extends DebuggerException { + + /** generated Serialized Version UID */ + static final long serialVersionUID = -3112649144515905742L; + + /** + * Construct a new exception. + */ + public DebuggerNotFoundException () { + super (new Exception ()); + } +} Index: debuggercore/oldapi/src/org/openide/debugger/DebuggerType.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/DebuggerType.java diff -N debuggercore/oldapi/src/org/openide/debugger/DebuggerType.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/DebuggerType.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,167 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +import java.util.Collections; +import java.util.Enumeration; + +import org.openide.execution.ExecInfo; +import org.openide.ServiceType; +import org.openide.util.HelpCtx; +import org.openide.loaders.DataObject; +import org.openide.cookies.ArgumentsCookie; +import org.openide.util.Lookup; + +/** Defines one debugger type. It has method start that accepts ExecInfo and should +* probably create new DebuggerInfo and call Debugger.startDebug (debuggerInfo). +* The type should be serializable, so it can be attached to file attributes +* of any object that wishes to be especially debugged. +* +*

This class currently has a property editor in the IDE's +* default editor search path. +* +* @author Jaroslav Tulach +*/ +public abstract class DebuggerType extends ServiceType { + static final long serialVersionUID =-3659300496270314301L; + /** Should start the debugging of this type. + * @param info class and parameters to run + * @param stopOnMain should the debugging stop on main method or go to first breakpoint + * @exception DebuggerException if debugger is not installed or cannot be started + * @deprecated This method is a relic of Java-specific execution. New DebuggerType + * implementations are encouraged to implement this method to throw an + * exception, and override {@link #startDebugger(DataObject,boolean)} to be the actual implementation. + */ + public abstract void startDebugger (ExecInfo info, boolean stopOnMain) throws DebuggerException; + + /** Starts debugging for a data object. + * The default implementation assumes this object behaves akin to a Java class + * by having a package-qualified object name and arguments as given by + * {@link ArgumentsCookie} and delegates to {@link #startDebugger(ExecInfo,boolean)}. + * @param obj object to run + * @param stopOnMain should the debugging stop on main method or go to first breakpoint + * @exception DebuggerException if debugger is not installed or cannot be started + */ + public void startDebugger(DataObject obj, boolean stopOnMain) throws DebuggerException { + String[] params; + ArgumentsCookie ac = (ArgumentsCookie) obj.getCookie(getKlass("org.openide.cookies.ArgumentsCookie")); + if (ac != null) { + params = ac.getArguments(); + } else { + params = new String[0]; + } + startDebugger(new ExecInfo(obj.getPrimaryFile().getPackageName ('.'), params), stopOnMain); + } + + public HelpCtx getHelpCtx () { + return new HelpCtx (DebuggerType.class); + } + + /** Get all registered executors in the system's execution engine. + * @return enumeration of DebuggerTypes + * @deprecated Please use {@link org.openide.util.Lookup} instead. + */ + public static Enumeration debuggerTypes () { + return Collections.enumeration(Lookup.getDefault().lookup(new Lookup.Template(DebuggerType.class)).allInstances()); + } + + /** Find the + * debugger implemented as a given class, among the executors registered to the + * execution engine. + *

+ * This should be used during (de-)serialization + * of the specific debugger for a data object: only store its class name + * and then try to find the debugger implemented by that class later. + * + * @param clazz the class of the debugger looked for + * @return the desired debugger or null if it does not exist + * @deprecated Please use {@link org.openide.util.Lookup} instead. + */ + public static DebuggerType find (Class clazz) { + return (DebuggerType)Lookup.getDefault().lookup(clazz); + } + + /** Find the + * debugger with requested name, among the executors registered to the + * execution engine. + *

+ * This should be used during (de-)serialization + * of the specific debugger for a data object: only store its name + * and then try to find the debugger later. + * + * @param name (display) name of debugger to find + * @return the desired debugger or null if it does not exist + */ + public static DebuggerType find (String name) { + ServiceType.Registry r = (ServiceType.Registry)Lookup.getDefault().lookup(ServiceType.Registry.class); + ServiceType t = r.find (name); + if (t instanceof DebuggerType) { + return (DebuggerType)t; + } else { + return null; + } + } + + /** Get the default debugger for the system's execution engine. + *

You may actually want {@link org.openide.loaders.ExecSupport#getExecutor}. + * @return the default debugger + * @deprecated There is probably not a single debugger type meaningfully applicable to all file types. + * If you explicitly want to invoke the plain Debugger interfaces, use {@link DebuggerType.Default} instead. + */ + public static DebuggerType getDefault () { + Enumeration en = debuggerTypes (); + if (en.hasMoreElements ()) { + return (DebuggerType)en.nextElement (); + } else { + return new Default (); + } + } + + // lazily loads a class + private final Class getKlass(String name) { + try { + return Class.forName(name, false, getClass().getClassLoader()); + } catch (ClassNotFoundException e) { + throw new NoClassDefFoundError(e.getLocalizedMessage()); + } + } + + /** Default debugger type. */ + public static class Default extends DebuggerType { + static final long serialVersionUID =6286540187114472027L; + + /* Gets the display name for this debugger type. */ + public String displayName() { + return org.openide.util.NbBundle.getBundle( + Default.class + ).getString("LAB_DefaultDebuggerType"); + } + + public HelpCtx getHelpCtx () { + return new HelpCtx (Default.class); + } + + /* Starts the debugger. */ + public void startDebugger(ExecInfo info, boolean stopOnMain) throws DebuggerException { + Debugger d = (Debugger)Lookup.getDefault().lookup(Debugger.class); + if (stopOnMain) + d.startDebugger(new DebuggerInfo( + info.getClassName(), info.getArguments())); + else + d.startDebugger(new DebuggerInfo( + info.getClassName(), info.getArguments(), null)); + } + } // end of inner class DefaultDebuggerType + +} Index: debuggercore/oldapi/src/org/openide/debugger/Watch.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/Watch.java diff -N debuggercore/oldapi/src/org/openide/debugger/Watch.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/Watch.java 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,103 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger; + +import java.beans.PropertyChangeListener; + +/** Represents one debugger watch. +* It contains only basic information +* that can be used by the core of the IDE. +* For example, the editor can use this object +* to display tooltips above variable names in the edited text. +*

+* It is likely that the real implementation of the watch can offer more +* functionality to the user--in which case it should expose properties +* as a JavaBean. +* +* @author Jan Jancura, Jaroslav Tulach +*/ +public abstract class Watch implements java.io.Serializable { + /** Name of the property for the watched variable name. */ + public static final String PROP_VARIABLE_NAME = "variableName"; // NOI18N + /** Name of the property for the value of the watched expression as a string. */ + public static final String PROP_AS_TEXT = "asText"; // NOI18N + /** Name of the property for the type of the watch value. */ + public static final String PROP_TYPE = "type"; // NOI18N + + + static final long serialVersionUID =2309154226451869624L; + /** Remove the watch from the list of all watches in the system. + */ + public abstract void remove (); + + /** Get the name of the variable to watch. + * + * @return the variable name + */ + public abstract String getVariableName (); + + /** Set the variable name to watch. + * + * @param name string name of the variable to watch + */ + public abstract void setVariableName (String name); + + /** Get a textual representation of the value. + * The watch should convert + * the real value to a string representation. So if the watch represents + * a null reference, the returned string will be for example "null". + * + * @return the value of this watch, or null if the watch is not in scope + */ + public abstract String getAsText (); + + /** Set the value of the watched variable (as text). + * + * @param value text representation of the new value + * @exception DebuggerException if the value cannot be changed, or the + * string does not represent valid value, or the value type cannot reasonably be set as text + */ + public abstract void setAsText (String value) throws DebuggerException; + + /** Get the string representation of the type of the variable. + * + * @return type string (i.e. the class name, or for a primitive e.g. "int") + */ + public abstract String getType (); + + /** Test whether the watch is hidden. + * If so, it + * is not presented in the list of all watches. Such a watch can be used + * for the IDE's (or some module's) private use, not displaying anything to the user. + * @return true if the watch is hidden + * @see Debugger#createWatch(String, boolean) + */ + public abstract boolean isHidden (); + + /** + * Add a property change listener. + * Change events should be fired for the properties {@link #PROP_VARIABLE_NAME}, {@link #PROP_AS_TEXT}, and {@link #PROP_TYPE}. + * + * @param l the listener to add + */ + public abstract void addPropertyChangeListener (PropertyChangeListener l); + + /** + * Remove a property change listener. + * + * @param l the listener to remove + */ + public abstract void removePropertyChangeListener (PropertyChangeListener l); + +} Index: debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties diff -N debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties 27 Jan 2003 19:36:15 -0000 @@ -0,0 +1,28 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun +# Microsystems, Inc. All Rights Reserved. + +OpenIDE-Module-Name=Debugger API +OpenIDE-Module-Display-Category=Infrastructure +OpenIDE-Module-Short-Description=The original Debugger API from the Open APIs. +OpenIDE-Module-Long-Description=\ + A simple API for controlling basic aspects of debugging. \ + Likely to be replaced in the future with a more comprehensive API, \ + but available for compatibility purposes in the meantime. + +LAB_DebuggerTypeDefault=Default Debugging +HINT_DebuggerTypeDefault=Simple debugging according to the debugger's own preferences. + +LAB_DebuggerType=Debugger Types +HINT_DebuggerType=All types of debuggers registered in the system. + +LAB_NoDebugger=(do not debug) +# {0} - class name +EXC_NoDebugger=The class {0} is not configured to be debugged.\nYou may change this if you wish. Index: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerType.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerType.java diff -N debuggercore/oldapi/src/org/openide/debugger/module/DebuggerType.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/DebuggerType.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,51 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger.module; + +import java.beans.*; +import java.util.ResourceBundle; +import org.openide.util.NbBundle; + +/** +* +* @author jtulach +*/ +public abstract class DebuggerType { + private DebuggerType () {} + + /** Object that provides beaninfo for {@link DebuggerType.Default}. + * + * @author Jaroslav Tulach + */ + public static class DefaultBeanInfo extends SimpleBeanInfo { + + public BeanDescriptor getBeanDescriptor () { + BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.Default.class); + ResourceBundle bundle = NbBundle.getBundle(DebuggerType.DefaultBeanInfo.class); + descr.setDisplayName (bundle.getString("LAB_DebuggerTypeDefault")); // NOI18N + descr.setShortDescription (bundle.getString("HINT_DebuggerTypeDefault")); // NOI18N + return descr; + } + + public BeanInfo[] getAdditionalBeanInfo () { + try { + return new BeanInfo[] { Introspector.getBeanInfo (org.openide.debugger.DebuggerType.class) }; + } catch (IntrospectionException ie) { + org.openide.ErrorManager.getDefault().notify(ie); + return null; + } + } + + } +} Index: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeBeanInfo.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeBeanInfo.java diff -N debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeBeanInfo.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeBeanInfo.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,58 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger.module; + +import java.awt.Image; +import java.beans.*; +import java.util.ResourceBundle; + +import org.openide.util.NbBundle; +import org.openide.util.Utilities; + +/** Object that provides beaninfo for {@link DebuggerType}. +* +* @author Jaroslav Tulach +*/ +public class DebuggerTypeBeanInfo extends SimpleBeanInfo { + + public BeanDescriptor getBeanDescriptor () { + BeanDescriptor descr = new BeanDescriptor (org.openide.debugger.DebuggerType.class); + ResourceBundle bundle = NbBundle.getBundle(DebuggerTypeBeanInfo.class); + descr.setDisplayName (bundle.getString ("LAB_DebuggerType")); // NOI18N + descr.setShortDescription (bundle.getString ("HINT_DebuggerType")); // NOI18N + descr.setValue ("helpID", org.openide.debugger.DebuggerType.class.getName ()); // NOI18N + return descr; + } + + public BeanInfo[] getAdditionalBeanInfo () { + try { + return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) }; + } catch (IntrospectionException ie) { + org.openide.ErrorManager.getDefault().notify(ie); + return null; + } + } + + + /** + * Return the icon + */ + public Image getIcon(int type) { + if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) + return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes.gif"); // NOI18N + else + return Utilities.loadImage("org/netbeans/core/resources/debuggerTypes32.gif"); // NOI18N + } + +} Index: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeEditor.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeEditor.java diff -N debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeEditor.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/DebuggerTypeEditor.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,79 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger.module; + +import java.io.*; +import java.text.MessageFormat; +import org.netbeans.beaninfo.editors.NoServiceTypeBeanInfo; +import org.netbeans.beaninfo.editors.ServiceTypeEditor; +import org.openide.ErrorManager; + +import org.openide.debugger.*; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.execution.ExecInfo; + +/** Support for property editor for DebuggerType. +* +* @author Petr Jiricka +*/ + +public class DebuggerTypeEditor extends ServiceTypeEditor { + + public static final org.openide.debugger.DebuggerType NO_DEBUGGER = new NoDebugger (); + + public DebuggerTypeEditor () { + super (org.openide.debugger.DebuggerType.class, "LAB_ChooseServiceType"); // NOI18N + } + + /** Accessor for creating instance */ + public static org.openide.debugger.DebuggerType getNoDebugger() { + return NO_DEBUGGER; + } + + public static final class NoDebugger extends org.openide.debugger.DebuggerType { + + static final long serialVersionUID =-6872256326426790372L; + private NoDebugger () { + } + + protected String displayName () { + return NbBundle.getBundle (DebuggerTypeEditor.class).getString ("LAB_NoDebugger"); + } + + public HelpCtx getHelpCtx () { + return new HelpCtx (NoDebugger.class); + } + + public void startDebugger (final ExecInfo info, boolean ign) throws DebuggerException { + DebuggerException e = new DebuggerException("do not debug"); // NOI18N + ErrorManager.getDefault().annotate(e, NbBundle.getMessage(DebuggerTypeEditor.class, "EXC_NoDebugger", info.getClassName())); + throw e; + } + + private Object readResolve () throws ObjectStreamException { + return NO_DEBUGGER; + } + + } + + public static final class NoDebuggerBeanInfo extends NoServiceTypeBeanInfo { + + protected String iconResource () { + return "/org/netbeans/beaninfo/editors/resources/noDebugger.gif"; // NOI18N + } + + } + +} Index: debuggercore/oldapi/src/org/openide/debugger/module/Install.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/Install.java diff -N debuggercore/oldapi/src/org/openide/debugger/module/Install.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/Install.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,44 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.debugger.module; + +import java.beans.Introspector; +import java.beans.PropertyEditorManager; + +import org.openide.modules.ModuleInstall; + +public class Install extends ModuleInstall { + + /** Make sure BeanInfo and PropertyEditor for DebuggerType can be found. + */ + public void restored() { + String[] sysbisp = Introspector.getBeanInfoSearchPath(); + String[] nbbisp = new String[] { + "org.openide.debugger.module", // NOI18N + }; + String[] allbisp = new String[sysbisp.length + nbbisp.length]; + System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length); + System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length); + Introspector.setBeanInfoSearchPath(allbisp); + String[] syspesp = PropertyEditorManager.getEditorSearchPath(); + String[] nbpesp = new String[] { + "org.openide.debugger.module", // NOI18N + }; + String[] allpesp = new String[syspesp.length + nbpesp.length]; + System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length); + System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length); + PropertyEditorManager.setEditorSearchPath(allpesp); + } + +} Index: debuggercore/oldapi/src/org/openide/debugger/module/layer.xml =================================================================== RCS file: debuggercore/oldapi/src/org/openide/debugger/module/layer.xml diff -N debuggercore/oldapi/src/org/openide/debugger/module/layer.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/debugger/module/layer.xml 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + Index: debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java =================================================================== RCS file: debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java diff -N debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,243 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.openide.loaders; + +import java.beans.*; +import java.awt.event.*; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +import org.openide.*; +import org.openide.compiler.*; +import org.openide.compiler.Compiler; +import org.openide.debugger.*; +import org.openide.execution.*; +import org.openide.explorer.propertysheet.*; +import org.openide.filesystems.*; +import org.openide.cookies.CompilerCookie; +import org.openide.cookies.DebuggerCookie; +import org.openide.nodes.Sheet; +import org.openide.nodes.PropertySupport; +import org.openide.util.NbBundle; +import org.openide.util.Mutex; +import org.openide.util.Lookup; + +/** Support for execution and debugging. +* Use {@link org.openide.loaders.ExecutionSupport} unless you need support for debugging too. +* @author Jaroslav Tulach, Jesse Glick +*/ +public class ExecSupport extends ExecutionSupport + implements DebuggerCookie { + /** extended attribute for debugger type */ + private static final String EA_DEBUGGER_TYPE = "NetBeansAttrDebuggerType"; // NOI18N + + /** Name of property providing a custom {@link DebuggerType} for a file. */ + public static final String PROP_DEBUGGER_TYPE = "debuggerType"; // NOI18N + + /** @deprecated use {@link #getEntry} */ + protected MultiDataObject.Entry entry; + /** @deprecated useless */ + protected boolean isReadOnly; + + /** Create new support for given entry. The file is taken from the + * entry and is updated if the entry moves or renames itself. + * @param entry entry to create instance from + */ + public ExecSupport (MultiDataObject.Entry entry) { + super(entry); + this.entry = entry; + Boolean ro = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES); + isReadOnly = (ro == null)?false:(!ro.booleanValue()); + } + + /* Start debugging of associated object. + * @param stopOnMain if true, debugger stops on the first line of debugged code + * @exception DebuggerException if the session cannot be started + */ + public void debug (final boolean stopOnMain) throws DebuggerException { + DebuggerType t = getDebuggerType (entry); + if (t == null) { + t = defaultDebuggerType (); + } + + try { + t.startDebugger (entry.getDataObject(), stopOnMain); + // ok, debugger started + return; + } catch (final DebuggerException ex) { + try { + Mutex.EVENT.readAccess (new Mutex.ExceptionAction () { + public Object run () throws DebuggerException { + if (debugFailed (ex)) { + // restart + debug (stopOnMain); + } + return null; + } + }); + } catch (org.openide.util.MutexException mx) { + if (mx.getException() instanceof DebuggerException) { + throw (DebuggerException)mx.getException(); + } else { + throw new DebuggerException(mx.getException()); + } + } + } + } + + /** Check if this object is up to date or in need of compilation. + * Should compile it if necessary. + *

The default implementation checks whether {@link CompilerCookie} is provided and + * if so, creates a job and compiles the object. This behavior may be + * overridden by subclasses. + * + * @return true if the object was successfully brought up to date, false if the attempt failed (and it may be still be out of date) + * @deprecated The check should be done in an action - ExecAction, ... + */ + protected boolean checkCompiled () { + DataObject obj = entry.getDataObject (); + + CompilerCookie c = (CompilerCookie)obj.getCookie (CompilerCookie.class); + + if (c != null) { + CompilerJob job = new CompilerJob (Compiler.DEPTH_ZERO); + job.setDisplayName (obj.getName ()); + c.addToJob (job, Compiler.DEPTH_ZERO); + if (!job.isUpToDate ()) { + // add name + // compile it + CompilerTask t = job.start (); + return t.isSuccessful (); + } + } + return true; + } + + /** Called when invocation of the debugger fails. Allows to do some + * modifications to the type of debugging and try it again. + * + * @param ex exeception that occured during execution + * @return true if the debugging should be started again + */ + protected boolean debugFailed (DebuggerException ex) { + DebuggerType e = (DebuggerType)choose (getDebuggerType (entry), DebuggerType.class, ex); + if (e == null) { + return false; + } else { + try { + setDebuggerType (entry, e); + return true; + } catch (IOException exc) { + return false; + } + } + } + + /** This method allows subclasses to override the default + * debugger type they want to use for debugging. + * + * @return current implementation returns DebuggerType.getDefault () + */ + protected DebuggerType defaultDebuggerType () { + return DebuggerType.getDefault (); + } + + // + // debugger support + // + + /** Assignes a debugger type to an entry. + * @param entry the object's entry + * @param type the debugger type for this entry + * @exception IOException if arguments cannot be set + */ + public static void setDebuggerType (MultiDataObject.Entry entry, DebuggerType type) throws IOException { + entry.getFile ().setAttribute (EA_DEBUGGER_TYPE, + type == null ? null : new ServiceType.Handle (type) + ); + } + + /** Retrieves the debugger type for this entry. + * @param entry the entry + * @return the debugger type or null if no type assigned + */ + public static DebuggerType getDebuggerType (MultiDataObject.Entry entry) { + Object handle = entry.getFile ().getAttribute (EA_DEBUGGER_TYPE); + if (handle != null && (handle instanceof ServiceType.Handle)) { + ServiceType dbg = ((ServiceType.Handle) handle).getServiceType (); + if (dbg instanceof DebuggerType) { + return (DebuggerType) dbg; + } + } + + Lookup l = Environment.find (entry.getDataObject ()); + DebuggerType dt = (DebuggerType)l.lookup (DebuggerType.class); + if (dt != null) { + return dt; + } + + return null; + } + + /** Helper method that creates default properties for execution of + * a given support. + * Includes properties to set the executor; debugger; and arguments. + * + * @param set sheet set to add properties to + */ + public void addProperties (Sheet.Set set) { + super.addProperties(set); + set.put(createDebuggerProperty ()); + } + + /** Creates the debugger property for entry. + * @return the property + */ + private PropertySupport createDebuggerProperty () { + return new PropertySupport.ReadWrite ( + PROP_DEBUGGER_TYPE, + DebuggerType.class, + NbBundle.getMessage(DebuggerType.class, "PROP_debuggerType"), + NbBundle.getMessage(DebuggerType.class, "HINT_debuggerType") + ) { + public Object getValue() { + DebuggerType dt = getDebuggerType (entry); + if (dt == null) + return defaultDebuggerType (); + else + return dt; + } + public void setValue (Object val) throws InvocationTargetException { + try { + setDebuggerType (entry, (DebuggerType) val); + } catch (IOException ex) { + throw new InvocationTargetException (ex); + } + } + public boolean supportsDefaultValue () { + return true; + } + + public void restoreDefaultValue () throws InvocationTargetException { + setValue (null); + } + + public boolean canWrite () { + Boolean isReadOnly = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES); + return (isReadOnly == null)?false:(!isReadOnly.booleanValue()); + } + }; + } + +} Index: debuggercore/src/org/netbeans/modules/debugger/delegator/DelegatingDebugger.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/delegator/DelegatingDebugger.java,v retrieving revision 1.59 diff -u -r1.59 DelegatingDebugger.java --- debuggercore/src/org/netbeans/modules/debugger/delegator/DelegatingDebugger.java 17 Oct 2002 00:02:41 -0000 1.59 +++ debuggercore/src/org/netbeans/modules/debugger/delegator/DelegatingDebugger.java 27 Jan 2003 19:36:16 -0000 @@ -30,7 +30,6 @@ import org.openide.DialogDescriptor; import org.openide.ErrorManager; import org.openide.NotifyDescriptor; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.*; import org.openide.text.Line; import org.openide.util.NbBundle; @@ -39,7 +38,6 @@ import org.openide.windows.InputOutput; import org.openide.windows.WindowManager; import org.openide.windows.Workspace; -import org.openide.actions.StartDebuggerAction; import org.openide.src.ClassElement; import org.openide.src.ConstructorElement; Index: debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseDebugger.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseDebugger.java,v retrieving revision 1.37 diff -u -r1.37 EnterpriseDebugger.java --- debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseDebugger.java 9 Jan 2003 15:56:21 -0000 1.37 +++ debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseDebugger.java 27 Jan 2003 19:36:16 -0000 @@ -24,7 +24,6 @@ import org.openide.TopManager; import org.openide.DialogDescriptor; import org.openide.NotifyDescriptor; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.*; import org.openide.text.Line; import org.openide.util.actions.SystemAction; Index: debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseModule.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseModule.java,v retrieving revision 1.13 diff -u -r1.13 EnterpriseModule.java --- debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseModule.java 10 Sep 2002 14:42:05 -0000 1.13 +++ debuggercore/src/org/netbeans/modules/debugger/multisession/EnterpriseModule.java 27 Jan 2003 19:36:16 -0000 @@ -21,7 +21,6 @@ /*//REFACTOR*/import org.netbeans.modules.debugger.support.java.nodes.*; /*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaProjectSettings; -import org.openide.actions.StartDebuggerAction; import org.openide.util.actions.SystemAction; import org.openide.debugger.DebuggerException; import org.openide.loaders.*; Index: debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml,v retrieving revision 1.52 diff -u -r1.52 mf-layer.xml --- debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml 4 Nov 2002 12:11:10 -0000 1.52 +++ debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml 27 Jan 2003 19:36:16 -0000 @@ -18,8 +18,8 @@ - - + + @@ -122,8 +122,8 @@ - - + + @@ -173,8 +173,8 @@ - - + + @@ -188,10 +188,10 @@ - + - + @@ -352,6 +352,13 @@ + + + + + + + Index: debuggercore/src/org/netbeans/modules/debugger/support/DebuggerContextSettings.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/DebuggerContextSettings.java,v retrieving revision 1.9 diff -u -r1.9 DebuggerContextSettings.java --- debuggercore/src/org/netbeans/modules/debugger/support/DebuggerContextSettings.java 15 Sep 2002 20:22:53 -0000 1.9 +++ debuggercore/src/org/netbeans/modules/debugger/support/DebuggerContextSettings.java 27 Jan 2003 19:36:16 -0000 @@ -15,13 +15,13 @@ import org.netbeans.modules.debugger.Register; import org.openide.options.ContextSystemOption; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.DebuggerNotFoundException; import org.openide.execution.NbClassPath; import org.openide.TopManager; import org.openide.util.NbBundle; import org.openide.util.HelpCtx; import org.netbeans.modules.debugger.support.nodes.DebuggerWindow; +import org.openide.util.SharedClassObject; /** * Settings for java debugger. @@ -55,6 +55,10 @@ */ public static final String PROP_DW_ORIENTATION = "dwOrientation"; + public static DebuggerContextSettings getDefault() { + return (DebuggerContextSettings)SharedClassObject.findObject(DebuggerContextSettings.class, true); + } + /* SERIALIZATION public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException { S ystem.out.println("DebuggerContextSettings.writeExternal"); Index: debuggercore/src/org/netbeans/modules/debugger/support/DebuggerModule.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/DebuggerModule.java,v retrieving revision 1.92 diff -u -r1.92 DebuggerModule.java --- debuggercore/src/org/netbeans/modules/debugger/support/DebuggerModule.java 9 Jan 2003 15:56:23 -0000 1.92 +++ debuggercore/src/org/netbeans/modules/debugger/support/DebuggerModule.java 27 Jan 2003 19:36:16 -0000 @@ -31,7 +31,6 @@ import org.netbeans.modules.debugger.delegator.DelegatingDebuggerImpl; import org.openide.awt.*; -import org.openide.actions.*; import org.openide.debugger.*; import org.openide.explorer.*; import org.openide.explorer.propertysheet.*; @@ -211,8 +210,6 @@ setActionPerformer (new AddWatchPerformer ()); ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)). setActionPerformer (new DebuggerWindowPerformer ()); - ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)). - setMultisession (true); register (); } @@ -234,8 +231,6 @@ Register.setDebuggerCoreImpl (new DelegatingDebuggerImpl ()); ((AddWatchAction) SystemAction.get (AddWatchAction.class)). setActionPerformer (new AddWatchPerformer ()); - ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)). - setMultisession (true); ((DebuggerWindowAction) SystemAction.get (DebuggerWindowAction.class)). setActionPerformer (new DebuggerWindowPerformer ()); register (); @@ -246,9 +241,6 @@ /** Module was uninstalled. */ public void uninstalled () { - ((StartDebuggerAction) SystemAction.get (StartDebuggerAction.class)). - setMultisession (false); - // Remove all breakpoints. BreakpointGroup group = Register.getCoreDebugger ().getRootBreakpointGroup (); int x; @@ -350,7 +342,7 @@ public static void changeWorkspace () { WindowManager dp = TopManager.getDefault ().getWindowManager (); - Workspace d = dp.findWorkspace (org.openide.actions.StartDebuggerAction.getWorkspace()); + Workspace d = dp.findWorkspace (DebuggerContextSettings.getDefault().getDesktop()); if (d != null) d.activate (); } } Index: debuggercore/src/org/netbeans/modules/debugger/support/DebuggerSettings.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/DebuggerSettings.java,v retrieving revision 1.38 diff -u -r1.38 DebuggerSettings.java --- debuggercore/src/org/netbeans/modules/debugger/support/DebuggerSettings.java 15 Sep 2002 20:22:53 -0000 1.38 +++ debuggercore/src/org/netbeans/modules/debugger/support/DebuggerSettings.java 27 Jan 2003 19:36:16 -0000 @@ -14,7 +14,6 @@ package org.netbeans.modules.debugger.support; import org.openide.options.SystemOption; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.DebuggerNotFoundException; import org.openide.execution.NbClassPath; import org.openide.util.NbBundle; @@ -22,6 +21,7 @@ /*//REFACTOR*/import org.netbeans.modules.debugger.support.java.JavaDebuggerSettings; +import org.openide.util.SharedClassObject; /** * Settings for java debugger. Used for backward compatibility only. @@ -53,8 +53,19 @@ public static final String PROP_RUN_COMPILATION = "runCompilation"; // NOI18N + public static DebuggerSettings getDefault() { + return (DebuggerSettings)SharedClassObject.findObject(DebuggerSettings.class, true); + } + + protected void initialize() { + super.initialize(); + putProperty(PROP_RUN_MULTISESSION, Boolean.TRUE, false); + } + // backward compability + /* private boolean runCompilation = true; + */ /* SERIALIZATION public void writeExternal (java.io.ObjectOutput oo) throws java.io.IOException { @@ -98,6 +109,7 @@ /** * Getter for desktop property. + * @deprecated See {@link DebuggerContextSettings#getDesktop} */ public String getDesktop () { return (String) getProperty (PROP_DESKTOP); @@ -105,6 +117,7 @@ /** * Setter for desktop property. + * @deprecated See {@link DebuggerContextSettings#setDesktop} */ public void setDesktop (String desktop) { putProperty (PROP_DESKTOP, desktop, true); @@ -136,14 +149,13 @@ public boolean getRunCompilation () { Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION); - return (b != null) ? b.booleanValue () : StartDebuggerAction.getRunCompilation (); + if (b != null) return b.booleanValue(); +/*//REFACTOR*/ return JavaDebuggerSettings.getDefault().getRunCompilation (); } public void setRunCompilation (boolean value) { putProperty (PROP_RUN_COMPILATION, value ? Boolean.TRUE : Boolean.FALSE, true); - /*//REFACTOR*/ JavaDebuggerSettings settings = ((JavaDebuggerSettings) JavaDebuggerSettings.findObject - /*//REFACTOR*/ (JavaDebuggerSettings.class, true)); -/*//REFACTOR*/ settings.setRunCompilation (value); +/*//REFACTOR*/ JavaDebuggerSettings.getDefault().setRunCompilation (value); } Index: debuggercore/src/org/netbeans/modules/debugger/support/DelegatingDebugger.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/DelegatingDebugger.java,v retrieving revision 1.5 diff -u -r1.5 DelegatingDebugger.java --- debuggercore/src/org/netbeans/modules/debugger/support/DelegatingDebugger.java 3 Sep 2002 15:00:03 -0000 1.5 +++ debuggercore/src/org/netbeans/modules/debugger/support/DelegatingDebugger.java 27 Jan 2003 19:36:16 -0000 @@ -30,7 +30,6 @@ import org.openide.DialogDescriptor; import org.openide.ErrorManager; import org.openide.NotifyDescriptor; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.*; import org.openide.text.Line; import org.openide.util.NbBundle; @@ -38,7 +37,6 @@ import org.openide.util.actions.*; import org.openide.windows.InputOutput; import org.openide.windows.WindowManager; -import org.openide.actions.StartDebuggerAction; import org.openide.src.ClassElement; import org.openide.src.ConstructorElement; Index: debuggercore/src/org/netbeans/modules/debugger/support/actions/AddWatchAction.java =================================================================== RCS file: debuggercore/src/org/netbeans/modules/debugger/support/actions/AddWatchAction.java diff -N debuggercore/src/org/netbeans/modules/debugger/support/actions/AddWatchAction.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/src/org/netbeans/modules/debugger/support/actions/AddWatchAction.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,55 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.netbeans.modules.debugger.support.actions; + +import java.util.Locale; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallbackSystemAction; + +// XXX should this still be a CallbackSystemAction? Does anyone set a performer +// other than DebuggerModule.restored? + +/** Add a debugger watch. +* +* @author Jan Jancura +*/ +public class AddWatchAction extends CallbackSystemAction { + /** generated Serialized Version UID */ + static final long serialVersionUID = 4192338605369205946L; + + protected void initialize() { + super.initialize(); + // XXX revisit: + setSurviveFocusChange(true); + } + + /* @return the action's icon */ + public String getName() { + return NbBundle.getMessage(AddWatchAction.class, "AddWatch"); + } + + /* @return the action's help context */ + public HelpCtx getHelpCtx() { + return new HelpCtx (AddWatchAction.class); + } + + /* Icon resource. + * @return name of resource for icon + */ + protected String iconResource () { + return "org/openide/resources/actions/addWatch.gif"; // NOI18N + } + +} Index: debuggercore/src/org/netbeans/modules/debugger/support/actions/Bundle.properties =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/actions/Bundle.properties,v retrieving revision 1.46 diff -u -r1.46 Bundle.properties --- debuggercore/src/org/netbeans/modules/debugger/support/actions/Bundle.properties 7 Oct 2002 07:11:44 -0000 1.46 +++ debuggercore/src/org/netbeans/modules/debugger/support/actions/Bundle.properties 27 Jan 2003 19:36:16 -0000 @@ -154,3 +154,9 @@ CTL_Pop_topmost_frame_action_name=&Pop Topmost Call CTL_Debugger_Window=Debugger Window + +# AddWatchAction +AddWatch=New &Watch... + +# ToggleBreakpointAction +ToggleBreakpoint=&Toggle Breakpoint Index: debuggercore/src/org/netbeans/modules/debugger/support/actions/ToggleBreakpointAction.java =================================================================== RCS file: debuggercore/src/org/netbeans/modules/debugger/support/actions/ToggleBreakpointAction.java diff -N debuggercore/src/org/netbeans/modules/debugger/support/actions/ToggleBreakpointAction.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ debuggercore/src/org/netbeans/modules/debugger/support/actions/ToggleBreakpointAction.java 27 Jan 2003 19:36:16 -0000 @@ -0,0 +1,52 @@ +/* + * Sun Public License Notice + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"). You may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is NetBeans. The Initial Developer of the Original + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun + * Microsystems, Inc. All Rights Reserved. + */ + +package org.netbeans.modules.debugger.support.actions; + +import java.util.Locale; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallbackSystemAction; + +/** Toggle a breakpoint (e.g. in the Editor). +* +* @author Jan Jancura +*/ +public class ToggleBreakpointAction extends CallbackSystemAction { + /** generated Serialized Version UID */ + static final long serialVersionUID = 2293420959009110628L; + + protected void initialize() { + super.initialize(); + // XXX revisit: + setSurviveFocusChange(true); + } + + /* @return the action's icon */ + public String getName() { + return NbBundle.getMessage(ToggleBreakpointAction.class, "ToggleBreakpoint"); + } + + /* @return the action's help context */ + public HelpCtx getHelpCtx() { + return new HelpCtx (ToggleBreakpointAction.class); + } + + /* Icon resource. + * @return name of resource for icon + */ + protected String iconResource () { + return "org/openide/resources/actions/toggleBreakpoint.gif"; // NOI18N + } + +} Index: debuggercore/src/org/netbeans/modules/debugger/support/java/JavaDebuggerSettings.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/java/JavaDebuggerSettings.java,v retrieving revision 1.9 diff -u -r1.9 JavaDebuggerSettings.java --- debuggercore/src/org/netbeans/modules/debugger/support/java/JavaDebuggerSettings.java 15 Sep 2002 20:22:55 -0000 1.9 +++ debuggercore/src/org/netbeans/modules/debugger/support/java/JavaDebuggerSettings.java 27 Jan 2003 19:36:22 -0000 @@ -15,7 +15,6 @@ import org.openide.options.SystemOption; import org.openide.options.ContextSystemOption; -import org.openide.actions.StartDebuggerAction; import org.openide.debugger.DebuggerNotFoundException; import org.openide.execution.NbClassPath; import org.openide.util.NbBundle; @@ -23,6 +22,7 @@ import org.netbeans.modules.debugger.support.DebuggerSettings; import org.netbeans.modules.debugger.support.DebuggerContextSettings; +import org.openide.util.SharedClassObject; /** @@ -75,6 +75,10 @@ DebuggerContextSettings.findObject (DebuggerContextSettings.class, true); ds.addOption (this); } + + public static JavaDebuggerSettings getDefault() { + return (JavaDebuggerSettings)SharedClassObject.findObject(JavaDebuggerSettings.class, true); + } /** * Returns name of this setings. @@ -155,9 +159,8 @@ public boolean getRunCompilation () { Boolean b = (Boolean) getProperty (PROP_RUN_COMPILATION); if (b == null) { - DebuggerSettings settings = ((DebuggerSettings) DebuggerSettings.findObject - (DebuggerSettings.class, true)); - return settings.getRunCompilation (); + // ??? avoid recursion + return true; } return b.booleanValue (); } @@ -168,8 +171,6 @@ public void setRunCompilation (boolean value) { boolean oldValue = getRunCompilation (); if (value == oldValue) return; - if (!value && StartDebuggerAction.getRunCompilation ()) - StartDebuggerAction.setRunCompilation (value); putProperty ( PROP_RUN_COMPILATION, value ? Boolean.TRUE : Boolean.FALSE, Index: debuggercore/src/org/netbeans/modules/debugger/support/nodes/WatchesRootNode.java =================================================================== RCS file: /cvs/debuggercore/src/org/netbeans/modules/debugger/support/nodes/WatchesRootNode.java,v retrieving revision 1.32 diff -u -r1.32 WatchesRootNode.java --- debuggercore/src/org/netbeans/modules/debugger/support/nodes/WatchesRootNode.java 9 Jan 2003 15:56:31 -0000 1.32 +++ debuggercore/src/org/netbeans/modules/debugger/support/nodes/WatchesRootNode.java 27 Jan 2003 19:36:22 -0000 @@ -23,7 +23,6 @@ import java.lang.ref.WeakReference; import org.openide.debugger.*; -import org.openide.actions.AddWatchAction; import org.openide.actions.PropertiesAction; import org.openide.actions.ToolsAction; import org.openide.util.actions.SystemAction; @@ -34,6 +33,7 @@ import org.netbeans.modules.debugger.*; import org.netbeans.modules.debugger.support.DebuggerModule; +import org.netbeans.modules.debugger.support.actions.AddWatchAction; import org.netbeans.modules.debugger.support.actions.DeleteAllCookie; import org.netbeans.modules.debugger.support.actions.DeleteAllAction; import org.netbeans.modules.debugger.support.util.*; Index: debuggerjpda/build.xml =================================================================== RCS file: /cvs/debuggerjpda/build.xml,v retrieving revision 1.29 diff -u -r1.29 build.xml --- debuggerjpda/build.xml 11 Dec 2002 17:06:58 -0000 1.29 +++ debuggerjpda/build.xml 27 Jan 2003 19:36:22 -0000 @@ -69,6 +69,7 @@ + Index: debuggerjpda/manifest.mf =================================================================== RCS file: /cvs/debuggerjpda/manifest.mf,v retrieving revision 1.45 diff -u -r1.45 manifest.mf --- debuggerjpda/manifest.mf 2 Nov 2002 21:07:50 -0000 1.45 +++ debuggerjpda/manifest.mf 27 Jan 2003 19:36:22 -0000 @@ -2,10 +2,11 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/debugger/jpda/JPDADebuggerModule.class OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml -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 +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 OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Provides: org.openide.debugger.Debugger +OpenIDE-Module-Specification-Version: 1.14 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] Index: debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ActionsPresenceTestCase.java =================================================================== RCS file: /cvs/debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ActionsPresenceTestCase.java,v retrieving revision 1.1 diff -u -r1.1 ActionsPresenceTestCase.java --- debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ActionsPresenceTestCase.java 16 Oct 2001 07:29:07 -0000 1.1 +++ debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ActionsPresenceTestCase.java 27 Jan 2003 19:36:22 -0000 @@ -30,13 +30,13 @@ private static final String ACTION_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction"; private static final String ACTION_DEBUGGER_WINDOW="org-netbeans-modules-debugger-support-actions-DebuggerWindowAction"; private static final String ACTION_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction"; - private static final String ACTION_ADD_WATCH="org-openide-actions-AddWatchAction"; + private static final String ACTION_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction"; private static final String ACTION_FINISH="org-netbeans-modules-debugger-support-actions-FinishAction"; private static final String ACTION_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction"; private static final String ACTION_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction"; private static final String ACTION_START="org-netbeans-modules-debugger-support-actions-StartAction"; private static final String ACTION_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction"; - private static final String ACTION_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction"; + private static final String ACTION_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction"; private static final String ACTION_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction"; private static final String ACTION_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction"; private static final String ACTION_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction"; Index: debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/MenusPresenceTestCase.java =================================================================== RCS file: /cvs/debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/MenusPresenceTestCase.java,v retrieving revision 1.2 diff -u -r1.2 MenusPresenceTestCase.java --- debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/MenusPresenceTestCase.java 5 Sep 2002 11:59:06 -0000 1.2 +++ debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/MenusPresenceTestCase.java 27 Jan 2003 19:36:22 -0000 @@ -37,9 +37,9 @@ private static final String MENUITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction"; private static final String MENUITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction"; private static final String MENUITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction"; - private static final String MENUITEM_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction"; + private static final String MENUITEM_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction"; private static final String MENUITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction"; - private static final String MENUITEM_ADD_WATCH="org-openide-actions-AddWatchAction"; + private static final String MENUITEM_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction"; private static final String MENUITEM_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction"; private static final String MENUITEM_GO_TO_CALLING="org-netbeans-modules-debugger-support-actions-GoToCallingMethodAction"; Index: debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ToolBarsPresenceTestCase.java =================================================================== RCS file: /cvs/debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ToolBarsPresenceTestCase.java,v retrieving revision 1.3 diff -u -r1.3 ToolBarsPresenceTestCase.java --- debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ToolBarsPresenceTestCase.java 5 Sep 2002 12:40:22 -0000 1.3 +++ debuggerjpda/test/unit/src/org/netbeans/test/debugger/basic/ToolBarsPresenceTestCase.java 27 Jan 2003 19:36:22 -0000 @@ -31,7 +31,7 @@ private static final String TOOLBARITEM_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction"; private static final String TOOLBARITEM_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction"; private static final String TOOLBARITEM_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction"; - private static final String TOOLBARITEM_ADD_WATCH="org-openide-actions-AddWatchAction"; + private static final String TOOLBARITEM_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction"; private static final String TOOLBAR_DEBUG_FULL="DebugFull"; private static final String TOOLBARITEM_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction"; private static final String TOOLBARITEM_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction"; @@ -39,7 +39,7 @@ private static final String TOOLBARITEM_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction"; private static final String TOOLBARITEM_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction"; private static final String TOOLBARITEM_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction"; - private static final String TOOLBARITEM_TOGGLE_BREAKPOINT="org-openide-actions-ToggleBreakpointAction"; + private static final String TOOLBARITEM_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction"; private static final String TOOLBARITEM_FIX="org-netbeans-modules-debugger-support-actions-FixAction"; public ToolBarsPresenceTestCase(String name) { Index: editor/build.xml =================================================================== RCS file: /cvs/editor/build.xml,v retrieving revision 1.33 diff -u -r1.33 build.xml --- editor/build.xml 11 Dec 2002 17:06:59 -0000 1.33 +++ editor/build.xml 27 Jan 2003 19:36:22 -0000 @@ -38,6 +38,7 @@ + Index: editor/manifest.mf =================================================================== RCS file: /cvs/editor/manifest.mf,v retrieving revision 1.48 diff -u -r1.48 manifest.mf --- editor/manifest.mf 2 Nov 2002 21:07:51 -0000 1.48 +++ editor/manifest.mf 27 Jan 2003 19:36:22 -0000 @@ -1,11 +1,11 @@ OpenIDE-Module: org.netbeans.modules.editor/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/editor/EditorModule.class -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Layer: org/netbeans/modules/editor/resources/layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -OpenIDE-Module-Module-Dependencies: org.netbeans.core/1 > 1.0, org.openide.deprecated > 1.0, org.openide.src > 1.0 +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 OpenIDE-Module-Requires: org.openide.TopManager Class-Path: ext/nb-editor.jar Index: editor/libsrc/org/netbeans/editor/GlyphGutter.java =================================================================== RCS file: /cvs/editor/libsrc/org/netbeans/editor/GlyphGutter.java,v retrieving revision 1.20 diff -u -r1.20 GlyphGutter.java --- editor/libsrc/org/netbeans/editor/GlyphGutter.java 2 Aug 2002 09:50:20 -0000 1.20 +++ editor/libsrc/org/netbeans/editor/GlyphGutter.java 27 Jan 2003 19:36:22 -0000 @@ -531,12 +531,13 @@ annos.activateNextAnnotation(line); } else { Action a = ImplementationProvider.getDefault().getToggleBreakpointAction(); - if (a != null) { + if (a != null && a.isEnabled()) { int line = (int)( (float)e.getY() / (float)lineHeight ); int currentLine = -1; try { currentLine = Utilities.getLineOffset(doc, editorUI.getComponent().getCaret().getDot()); } catch (BadLocationException ex) { + // XXX what should this do? } if (line != currentLine) { int offset = Utilities.getRowStartFromLineOffset(doc, line); @@ -544,6 +545,8 @@ editorUI.getComponent().getCaret().setDot(offset); } a.actionPerformed(new ActionEvent(editorUI.getComponent(), 0, "")); + } else { + Toolkit.getDefaultToolkit().beep(); } } } Index: editor/src/org/netbeans/modules/editor/NbImplementationProvider.java =================================================================== RCS file: /cvs/editor/src/org/netbeans/modules/editor/NbImplementationProvider.java,v retrieving revision 1.2 diff -u -r1.2 NbImplementationProvider.java --- editor/src/org/netbeans/modules/editor/NbImplementationProvider.java 19 Oct 2001 14:34:49 -0000 1.2 +++ editor/src/org/netbeans/modules/editor/NbImplementationProvider.java 27 Jan 2003 19:36:44 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -18,7 +18,7 @@ import org.netbeans.editor.ImplementationProvider; import javax.swing.Action; import org.openide.util.actions.SystemAction; -import org.openide.actions.ToggleBreakpointAction; +import org.openide.util.Lookup; /** This is NetBeans specific provider of functionality. * See base class for detailed comments. @@ -35,7 +35,17 @@ } public Action getToggleBreakpointAction() { - return SystemAction.get(org.openide.actions.ToggleBreakpointAction.class); + try { + ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class); + Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N + if (SystemAction.class.isAssignableFrom(c)) { + return SystemAction.get(c); + } else { + return (Action)c.newInstance(); + } + } catch (Exception e) { + return null; + } } } Index: editor/src/org/netbeans/modules/editor/resources/layer.xml =================================================================== RCS file: /cvs/editor/src/org/netbeans/modules/editor/resources/layer.xml,v retrieving revision 1.32 diff -u -r1.32 layer.xml --- editor/src/org/netbeans/modules/editor/resources/layer.xml 21 Jan 2003 10:36:58 -0000 1.32 +++ editor/src/org/netbeans/modules/editor/resources/layer.xml 27 Jan 2003 19:36:44 -0000 @@ -258,13 +258,8 @@ - - - - - - + Index: form/manifest.mf =================================================================== RCS file: /cvs/form/manifest.mf,v retrieving revision 1.54 diff -u -r1.54 manifest.mf --- form/manifest.mf 13 Nov 2002 22:50:33 -0000 1.54 +++ form/manifest.mf 27 Jan 2003 19:36:45 -0000 @@ -1,9 +1,9 @@ OpenIDE-Module: org.netbeans.modules.form/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/form/Bundle2.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Install: org/netbeans/modules/form/FormEditorModule.class -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 +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 OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.modules.InstalledFileLocator OpenIDE-Module-Layer: org/netbeans/modules/form/resources/layer.xml Index: form/src/org/netbeans/modules/form/FormNode.java =================================================================== RCS file: /cvs/form/src/org/netbeans/modules/form/FormNode.java,v retrieving revision 1.5 diff -u -r1.5 FormNode.java --- form/src/org/netbeans/modules/form/FormNode.java 8 Jul 2002 17:25:54 -0000 1.5 +++ form/src/org/netbeans/modules/form/FormNode.java 27 Jan 2003 19:36:45 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -56,7 +56,7 @@ && (CompilerCookie.class.isAssignableFrom(type) || SaveCookie.class.isAssignableFrom(type) || ExecCookie.class.isAssignableFrom(type) - || DebuggerCookie.class.isAssignableFrom(type) + || type.getName().equals("org.openide.cookies.DebuggerCookie") // NOI18N || CloseCookie.class.isAssignableFrom(type) || ArgumentsCookie.class.isAssignableFrom(type) || PrintCookie.class.isAssignableFrom(type))) Index: j2eeserver/build.xml =================================================================== RCS file: /cvs/j2eeserver/build.xml,v retrieving revision 1.24 diff -u -r1.24 build.xml --- j2eeserver/build.xml 11 Dec 2002 17:07:05 -0000 1.24 +++ j2eeserver/build.xml 27 Jan 2003 19:36:45 -0000 @@ -176,6 +176,7 @@ + Index: j2eeserver/manifest.mf =================================================================== RCS file: /cvs/j2eeserver/manifest.mf,v retrieving revision 1.13 diff -u -r1.13 manifest.mf --- j2eeserver/manifest.mf 21 Jan 2003 20:43:12 -0000 1.13 +++ j2eeserver/manifest.mf 27 Jan 2003 19:36:45 -0000 @@ -1,9 +1,9 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2eeserver/2 -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine -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 +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 OpenIDE-Module-Layer: org/netbeans/modules/j2ee/impl/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/impl/Bundle.properties Index: jarpackager/manifest.mf =================================================================== RCS file: /cvs/jarpackager/manifest.mf,v retrieving revision 1.53 diff -u -r1.53 manifest.mf --- jarpackager/manifest.mf 2 Nov 2002 21:08:06 -0000 1.53 +++ jarpackager/manifest.mf 27 Jan 2003 19:37:33 -0000 @@ -1,10 +1,10 @@ OpenIDE-Module: org.netbeans.modules.jarpackager/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jarpackager/Bundle.properties OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -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 +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 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE] -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Layer: org/netbeans/modules/jarpackager/resources/mf-layer.xml Index: jarpackager/src/org/netbeans/modules/jarpackager/JarChildren.java =================================================================== RCS file: /cvs/jarpackager/src/org/netbeans/modules/jarpackager/JarChildren.java,v retrieving revision 1.17 diff -u -r1.17 JarChildren.java --- jarpackager/src/org/netbeans/modules/jarpackager/JarChildren.java 21 Jan 2003 16:21:26 -0000 1.17 +++ jarpackager/src/org/netbeans/modules/jarpackager/JarChildren.java 27 Jan 2003 19:37:33 -0000 @@ -8,7 +8,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -175,10 +175,9 @@ // fill execution properties // #10827: subclasses might not have JarExecSupport cookie //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps); - ExecSupport exec = (ExecSupport)getCookie(ExecSupport.class); + ExecutionSupport exec = (ExecutionSupport)getCookie(ExecutionSupport.class); if (exec != null) { exec.addProperties(ps); - ps.remove(ExecSupport.PROP_DEBUGGER_TYPE); } sheet.put(ps); Index: jarpackager/src/org/netbeans/modules/jarpackager/JarExecutor.java =================================================================== RCS file: /cvs/jarpackager/src/org/netbeans/modules/jarpackager/JarExecutor.java,v retrieving revision 1.9 diff -u -r1.9 JarExecutor.java --- jarpackager/src/org/netbeans/modules/jarpackager/JarExecutor.java 2 May 2002 08:37:05 -0000 1.9 +++ jarpackager/src/org/netbeans/modules/jarpackager/JarExecutor.java 27 Jan 2003 19:37:33 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original -* Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun +* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -78,7 +78,7 @@ * overridden to create the correct sort of ExecInfo */ protected Process createProcess (DataObject obj) throws IOException { - String[] params = ExecSupport.getArguments (new org.openide.loaders.FileEntry( + String[] params = ExecutionSupport.getArguments (new org.openide.loaders.FileEntry( null, obj.getPrimaryFile() )); if (checkSimpleClass(obj)) { Index: jarpackager/src/org/netbeans/modules/jarpackager/SimpleJarDataObject.java =================================================================== RCS file: /cvs/jarpackager/src/org/netbeans/modules/jarpackager/SimpleJarDataObject.java,v retrieving revision 1.2 diff -u -r1.2 SimpleJarDataObject.java --- jarpackager/src/org/netbeans/modules/jarpackager/SimpleJarDataObject.java 21 Jan 2003 16:21:25 -0000 1.2 +++ jarpackager/src/org/netbeans/modules/jarpackager/SimpleJarDataObject.java 27 Jan 2003 19:37:33 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -336,10 +336,9 @@ // fill execution properties // #10827: subclasses might not have JarExecSupport cookie //((JarExecSupport)getCookie(JarExecSupport.class)).addProperties(ps); - ExecSupport exec = (ExecSupport)getCookie(ExecSupport.class); + ExecutionSupport exec = (ExecutionSupport)getCookie(ExecutionSupport.class); if (exec != null) { exec.addProperties(ps); - ps.remove(ExecSupport.PROP_DEBUGGER_TYPE); } sheet.put(ps); return sheet; @@ -386,7 +385,7 @@ } // end of JarNode inner class /** A class which provides the information needed to execute a jar file */ - static class JarExecSupport extends ExecSupport { + static class JarExecSupport extends ExecutionSupport { /** Create new support for given entry. The file is taken from the * entry and is updated if the entry moves or renames itself. Index: java/build.xml =================================================================== RCS file: /cvs/java/build.xml,v retrieving revision 1.49 diff -u -r1.49 build.xml --- java/build.xml 11 Dec 2002 17:07:06 -0000 1.49 +++ java/build.xml 27 Jan 2003 19:37:34 -0000 @@ -46,6 +46,7 @@ + Index: java/manifest.mf =================================================================== RCS file: /cvs/java/manifest.mf,v retrieving revision 1.65 diff -u -r1.65 manifest.mf --- java/manifest.mf 13 Nov 2002 22:50:34 -0000 1.65 +++ java/manifest.mf 27 Jan 2003 19:37:34 -0000 @@ -3,9 +3,9 @@ OpenIDE-Module-Install: org/netbeans/modules/java/JavaModule.class OpenIDE-Module-Layer: org/netbeans/modules/java/resources/mf-layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21 -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 +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 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.compiler.CompilationEngine, org.openide.modules.InstalledFileLocator -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Package-Dependencies: [org.netbeans.modules.java.gj.JavaCompilerType], [org.netbeans.lib.javac.Main], org.apache.regexp[RE], [com.sun.tools.javamake.Main] Class-Path: ext/javac.jar ext/java-gj.jar ext/javamake-1.2.12.jar Index: java/src/org/netbeans/modules/java/JavaEditor.java =================================================================== RCS file: /cvs/java/src/org/netbeans/modules/java/JavaEditor.java,v retrieving revision 1.133 diff -u -r1.133 JavaEditor.java --- java/src/org/netbeans/modules/java/JavaEditor.java 9 Jan 2003 11:45:45 -0000 1.133 +++ java/src/org/netbeans/modules/java/JavaEditor.java 27 Jan 2003 19:37:39 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -19,6 +19,7 @@ import java.io.*; import java.text.MessageFormat; import java.util.*; +import javax.swing.AbstractAction; import javax.swing.SwingUtilities; import javax.swing.JEditorPane; import javax.swing.Timer; @@ -31,7 +32,6 @@ import org.openide.TopManager; import org.openide.ErrorManager; import org.openide.NotifyDescriptor; -import org.openide.actions.ToggleBreakpointAction; import org.openide.cookies.SaveCookie; import org.openide.cookies.SourceCookie; import org.openide.cookies.LineCookie; @@ -44,10 +44,9 @@ import org.openide.loaders.DataObject; import org.openide.loaders.MultiDataObject; import org.openide.src.SourceElement; -import org.openide.util.TaskListener; +import org.openide.util.*; import org.openide.util.actions.ActionPerformer; import org.openide.util.actions.SystemAction; -import org.openide.util.NbBundle; import org.openide.filesystems.*; import org.openide.filesystems.FileSystem; // override java.io.FileSystem import org.openide.windows.CloneableTopComponent; @@ -1089,7 +1088,42 @@ } } }; - + + getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N + } + + /** + * Locally bound action to toggle breakpoint on the current line. + * @see "#29914" + */ + private final class ToggleBreakpointAction extends AbstractAction implements LookupListener { + private final Lookup.Result debuggerR; + public ToggleBreakpointAction() { + debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class)); + debuggerR.addLookupListener(this); + resultChanged(null); + } + public void actionPerformed(ActionEvent e) { + int lineNumber = NbDocument.findLineNumber ( + support.getDocument (), + getEditorPane ().getCaret ().getDot () + ); + Line line = support.getLineSet ().getCurrent (lineNumber); + synchronized (this) { + Iterator it = debuggerR.allInstances().iterator(); + if (it.hasNext()) { + Debugger debugger = (Debugger)it.next(); + Breakpoint breakpoint = debugger.findBreakpoint (line); + if (breakpoint == null) + debugger.createBreakpoint (line); + else + breakpoint.remove (); + } + } + } + public void resultChanged(LookupEvent e) { + setEnabled(!debuggerR.allInstances().isEmpty()); + } } /** Restart the timer which updates the selected nodes after the specified delay from @@ -1117,31 +1151,9 @@ } /* This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated () { - try { - final Debugger debugger = TopManager.getDefault ().getDebugger (); - ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)). - setActionPerformer (new ActionPerformer () { - public void performAction (SystemAction a) { - int lineNumber = NbDocument.findLineNumber ( - support.getDocument (), - getEditorPane ().getCaret ().getDot () - ); - Line line = support.getLineSet ().getCurrent (lineNumber); - synchronized (this) { - Breakpoint breakpoint = debugger.findBreakpoint (line); - if (breakpoint == null) - debugger.createBreakpoint (line); - else - breakpoint.remove (); - } - } - }); - } catch (DebuggerNotFoundException e) { - } JEditorPane p = getEditorPane(); if (p != null) p.addCaretListener(caretListener); @@ -1162,12 +1174,9 @@ /* * This method is called when parent window of this component losts focus, - * or when this component losts preferrence in the parent window. This - * implementation removes performer from the ToggleBreakpointAction. + * or when this component losts preferrence in the parent window. */ protected void componentDeactivated () { - ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)). - setActionPerformer (null); getEditorPane().removeCaretListener(caretListener); Parsing.removeParsingListener(parsingListener); synchronized (this) { Index: nbbuild/build.properties =================================================================== RCS file: /cvs/nbbuild/build.properties,v retrieving revision 1.62 diff -u -r1.62 build.properties --- nbbuild/build.properties 27 Jan 2003 18:00:55 -0000 1.62 +++ nbbuild/build.properties 27 Jan 2003 19:37:40 -0000 @@ -65,6 +65,7 @@ core/output, \ core/deprecated, \ java/srcmodel, \ + debuggercore/oldapi, \ core/javahelp, \ core/compiler, \ core/execution, \ @@ -270,6 +271,7 @@ diff, \ java/api, \ java/srcmodel, \ + debuggercore/oldapi, \ lexer, \ openidex/looks, \ mdr, \ Index: nbbuild/build.xml =================================================================== RCS file: /cvs/nbbuild/build.xml,v retrieving revision 1.271 diff -u -r1.271 build.xml --- nbbuild/build.xml 27 Jan 2003 15:10:40 -0000 1.271 +++ nbbuild/build.xml 27 Jan 2003 19:37:40 -0000 @@ -131,7 +131,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -258,11 +258,15 @@ - + + + + + - + @@ -271,7 +275,7 @@ - + @@ -327,7 +331,7 @@ - + @@ -339,7 +343,7 @@ - + @@ -421,7 +425,7 @@ - + @@ -433,7 +437,7 @@ - + @@ -509,7 +513,7 @@ - + @@ -578,7 +582,7 @@ - + @@ -590,7 +594,7 @@ - + Index: nbbuild/antsrc/org/netbeans/nbbuild/MakeParserDB.java =================================================================== RCS file: /cvs/nbbuild/antsrc/org/netbeans/nbbuild/MakeParserDB.java,v retrieving revision 1.9 diff -u -r1.9 MakeParserDB.java --- nbbuild/antsrc/org/netbeans/nbbuild/MakeParserDB.java 19 Dec 2002 19:41:38 -0000 1.9 +++ nbbuild/antsrc/org/netbeans/nbbuild/MakeParserDB.java 27 Jan 2003 19:37:40 -0000 @@ -117,6 +117,7 @@ "java/srcmodel/netbeans/modules/autoload/java-src-model.jar", "java/netbeans/modules/java.jar", "editor/netbeans/modules/editor.jar", + "debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar", // XXX delete these when java + editor no longer use TopManager! "openide/deprecated/netbeans/modules/autoload/openide-deprecated.jar", "core/deprecated/netbeans/modules/autoload/core-deprecated.jar", Index: openide/build.xml =================================================================== RCS file: /cvs/openide/build.xml,v retrieving revision 1.132 diff -u -r1.132 build.xml --- openide/build.xml 20 Jan 2003 23:01:17 -0000 1.132 +++ openide/build.xml 27 Jan 2003 19:37:40 -0000 @@ -345,7 +345,13 @@ - + + + + + + + Index: openide/openide-spec-vers.properties =================================================================== RCS file: /cvs/openide/openide-spec-vers.properties,v retrieving revision 1.97 diff -u -r1.97 openide-spec-vers.properties --- openide/openide-spec-vers.properties 21 Jan 2003 13:00:43 -0000 1.97 +++ openide/openide-spec-vers.properties 27 Jan 2003 19:37:40 -0000 @@ -5,5 +5,4 @@ # Must always be numeric (numbers separated by '.', e.g. 1.11.3). # See http://openide.netbeans.org/versioning-policy.html for more. - -org.openide.specification.version=3.32 +org.openide.specification.version=3.33 Index: openide/api/doc/changes/apichanges.xml =================================================================== RCS file: /cvs/openide/api/doc/changes/apichanges.xml,v retrieving revision 1.130 diff -u -r1.130 apichanges.xml --- openide/api/doc/changes/apichanges.xml 21 Jan 2003 13:00:43 -0000 1.130 +++ openide/api/doc/changes/apichanges.xml 27 Jan 2003 19:37:41 -0000 @@ -3657,6 +3657,25 @@ +

Modules can declare their own dependency transformations + + + + + +

+ Modules may now declare their own transformations of module + dependencies using a declarative XML syntax in the folder + ModuleAutoDeps/ in the system filesystem. This is useful + for being able to manage major refactorings of functionality in a + manner that will retain binary compatibility. +

+
+ + + + + Short description for modules Index: openide/api/doc/org/openide/doc-files/upgrade.html =================================================================== RCS file: /cvs/openide/api/doc/org/openide/doc-files/upgrade.html,v retrieving revision 1.52 diff -u -r1.52 upgrade.html --- openide/api/doc/org/openide/doc-files/upgrade.html 17 Jan 2003 15:48:41 -0000 1.52 +++ openide/api/doc/org/openide/doc-files/upgrade.html 27 Jan 2003 19:37:42 -0000 @@ -475,6 +475,51 @@ issue #19443.

+

Phase III

+ +

The Debugger API is no longer deprecated in this phase, and is +available in the new autoload module +debuggercore/oldapi/netbeans/modules/autoload/openide-debugger.jar. +This new module contains all of org.openide.debugger.*, +plus org.openide.cookies.DebuggerCookie and +org.openide.loaders.ExecSupport.

+ +

The module does not contain any actions. In the event that +you were setting action performers for e.g. +ToggleBreakpointAction, please note that the action +implementations now reside in the +org.netbeans.modules.debugger.support.actions.* package +(in debuggerCore.jar); and that you need not refer +directly to the action in order to set a performer - rather, modify +the action map for your TopComponent (or other component) +to bind e.g. +"org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction" +to a javax.swing.Action of your choice. This is easier +and safer than setting and unsetting action performers.

+ +

Modules should declare a dependency:

+ +
+OpenIDE-Module-Module-Dependencies: org.openide.debugger > 1.0
+
+ +

Any modules depending on org.openide.deprecated prior +to version 1.2 will receive this dependency +automatically.

+ +

You may if you wish also:

+ +
+OpenIDE-Module-Requires: org.openide.debugger.Debugger
+
+ +

in case your module cannot work without a debugger implementation +being installed.

+ +

For more details, see + +issue #29914.

+

Indirect dependencies do not count for a module's "effective classpath"

In NetBeans 3.4, if module A exposes some API packages (either Index: openide/api/doc/org/openide/modules/doc-files/api.html =================================================================== RCS file: /cvs/openide/api/doc/org/openide/modules/doc-files/api.html,v retrieving revision 1.86 diff -u -r1.86 api.html --- openide/api/doc/org/openide/modules/doc-files/api.html 23 Dec 2002 18:04:25 -0000 1.86 +++ openide/api/doc/org/openide/modules/doc-files/api.html 27 Jan 2003 19:37:56 -0000 @@ -71,6 +71,7 @@

  • Related Files
  • Deprecation +
  • Refactoring
  • Downloading
  • Module install order
  • List of all modules @@ -1351,6 +1352,31 @@ This message may be displayed somehow if a non-deprecated module depending on your deprecated module is enabled.

    + +

    Refactoring

    + +

    Sometimes as the developer of an API module, you may wish to make +major changes in how your APIs are laid out physically in modules. +Most commonly, you determine that it would be desirable to split one +big API module into several smaller pieces. However you wish to retain +compatibility for existing client modules, so that if they used your +old monolithic module, they will now automatically get access to the +newer, smaller pieces.

    + +

    This is straightforward: create an XML file according to the DTD + +-//NetBeans//DTD Module Automatic Dependencies 1.0//EN + +and + +install it + +in the system filesystem under ModuleAutoDeps/ +(system/ModuleAutoDeps/*.xml). Note that it will probably +not work to do this using an XML layer since the information +must be available before any module is even loaded.

    + +

    As of 3.33

    Index: openide/deprecated/build.xml =================================================================== RCS file: /cvs/openide/deprecated/build.xml,v retrieving revision 1.8 diff -u -r1.8 build.xml --- openide/deprecated/build.xml 18 Dec 2002 23:05:03 -0000 1.8 +++ openide/deprecated/build.xml 27 Jan 2003 19:37:57 -0000 @@ -33,6 +33,7 @@ + @@ -56,7 +57,13 @@ - + + + + + + + Index: openide/deprecated/manifest.mf =================================================================== RCS file: /cvs/openide/deprecated/manifest.mf,v retrieving revision 1.6 diff -u -r1.6 manifest.mf --- openide/deprecated/manifest.mf 18 Dec 2002 23:05:03 -0000 1.6 +++ openide/deprecated/manifest.mf 27 Jan 2003 19:37:57 -0000 @@ -1,9 +1,9 @@ OpenIDE-Module: org.openide.deprecated -OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.18 -OpenIDE-Module-Specification-Version: 1.1 +OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.33 +OpenIDE-Module-Specification-Version: 1.2 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Localizing-Bundle: org/openide/deprecated/Bundle.properties -OpenIDE-Module-Module-Dependencies: org.openide.src > 1.0, org.openide.compiler > 1.0, org.openide.io > 1.0, org.openide.execution > 1.0 +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 OpenIDE-Module-Requires: org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider OpenIDE-Module-Deprecated: true Index: openide/deprecated/release/system/ModuleAutoDeps/org-openide-deprecated.xml =================================================================== RCS file: openide/deprecated/release/system/ModuleAutoDeps/org-openide-deprecated.xml diff -N openide/deprecated/release/system/ModuleAutoDeps/org-openide-deprecated.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openide/deprecated/release/system/ModuleAutoDeps/org-openide-deprecated.xml 27 Jan 2003 19:37:57 -0000 @@ -0,0 +1,47 @@ + + + + + + + + + Debugger API separation (#29914) + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openide/deprecated/src/org/openide/actions/AddWatchAction.java =================================================================== RCS file: /cvs/openide/deprecated/src/org/openide/actions/AddWatchAction.java,v retrieving revision 1.3 diff -u -r1.3 AddWatchAction.java --- openide/deprecated/src/org/openide/actions/AddWatchAction.java 2 Nov 2002 21:09:18 -0000 1.3 +++ openide/deprecated/src/org/openide/actions/AddWatchAction.java 27 Jan 2003 19:37:57 -0000 @@ -14,9 +14,13 @@ package org.openide.actions; import java.util.Locale; +import org.openide.ErrorManager; import org.openide.util.HelpCtx; +import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.actions.ActionPerformer; import org.openide.util.actions.CallbackSystemAction; +import org.openide.util.actions.SystemAction; /** Add a debugger watch. * @@ -31,6 +35,24 @@ super.initialize(); // XXX revisit: setSurviveFocusChange(true); + } + + /* + * Tries to also delegate to the new impl, for compatibility. + */ + public void setActionPerformer(ActionPerformer p) { + super.setActionPerformer(p); + try { + ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class); + Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N + CallbackSystemAction a = (CallbackSystemAction)SystemAction.get(c); + a.setActionPerformer(p); + } catch (ClassNotFoundException cnfe) { + // Not installed, ignore it. + } catch (Exception e) { + // Oh well, ignore it. + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); + } } /* @return the action's icon */ Index: openide/deprecated/src/org/openide/actions/ToggleBreakpointAction.java =================================================================== RCS file: /cvs/openide/deprecated/src/org/openide/actions/ToggleBreakpointAction.java,v retrieving revision 1.3 diff -u -r1.3 ToggleBreakpointAction.java --- openide/deprecated/src/org/openide/actions/ToggleBreakpointAction.java 2 Nov 2002 21:09:23 -0000 1.3 +++ openide/deprecated/src/org/openide/actions/ToggleBreakpointAction.java 27 Jan 2003 19:37:57 -0000 @@ -14,9 +14,13 @@ package org.openide.actions; import java.util.Locale; +import org.openide.ErrorManager; import org.openide.util.HelpCtx; +import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.actions.ActionPerformer; import org.openide.util.actions.CallbackSystemAction; +import org.openide.util.actions.SystemAction; /** Toggle a breakpoint (e.g. in the Editor). * @@ -31,6 +35,24 @@ super.initialize(); // XXX revisit: setSurviveFocusChange(true); + } + + /* + * Tries to also delegate to the new impl, for compatibility. + */ + public void setActionPerformer(ActionPerformer p) { + super.setActionPerformer(p); + try { + ClassLoader l = (ClassLoader)Lookup.getDefault().lookup(ClassLoader.class); + Class c = l.loadClass("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction"); // NOI18N + CallbackSystemAction a = (CallbackSystemAction)SystemAction.get(c); + a.setActionPerformer(p); + } catch (ClassNotFoundException cnfe) { + // Not installed, ignore it. + } catch (Exception e) { + // Oh well, ignore it. + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); + } } /* @return the action's icon */ Index: openide/deprecated/src/org/openide/cookies/DebuggerCookie.java =================================================================== RCS file: openide/deprecated/src/org/openide/cookies/DebuggerCookie.java diff -N openide/deprecated/src/org/openide/cookies/DebuggerCookie.java --- openide/deprecated/src/org/openide/cookies/DebuggerCookie.java 3 Dec 2002 14:11:15 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.cookies; - -import org.openide.debugger.DebuggerException; -import org.openide.nodes.Node; - -/** Cookie for debugger. Any data object or node that supports -* debugging can implement this cookie. -* -* @author Jan Jancura -*/ -public interface DebuggerCookie extends Node.Cookie { - /** Start debugging of associated object. - * @param stopOnMain if true, debugger stops on the first line of debugged code - * @exception DebuggerException if the session cannot be started - */ - public void debug (boolean stopOnMain) throws DebuggerException; -} Index: openide/deprecated/src/org/openide/debugger/Breakpoint.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/Breakpoint.java diff -N openide/deprecated/src/org/openide/debugger/Breakpoint.java --- openide/deprecated/src/org/openide/debugger/Breakpoint.java 16 Oct 2002 06:06:54 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,109 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -import java.beans.PropertyChangeListener; - -import org.openide.text.Line; -import org.openide.src.ConstructorElement; - -/** -* Represents one breakpoint. -* Breakpoints are created and returned -* by the {@link Debugger} implementation. A breakpoint may be assigned either to a source line -* of a class, or to a method (or constructor) of a class. -* The current set of breakpoints is stored -* in the implementation of {@link Debugger}. -*

    -* The abstract class contains only the necessary manipulation methods -* used by the IDE, like enabling/disabling the breakpoint and obtaining its -* position. A good implementation can offer the user much better ways to -* deal with the breakpoint (conditional breakpoints, etc.). Such information should -* be presented as properties--so it is assumed that the -* breakpoint itself is a serializable JavaBean. -* -* -* @author Jan Jancura, Jaroslav Tulach -*/ -public abstract class Breakpoint implements java.io.Serializable { - /** Property name for validity of the breakpoint. */ - public static final String PROP_VALID = "valid"; // NOI18N - /** Property name for enabled status of the breakpoint. */ - public static final String PROP_ENABLED = "enabled"; // NOI18N - - static final long serialVersionUID =4899621215676971003L; - /** Destroy this breakpoint. - * Removes it from the list of all breakpoints in the system. - */ - public abstract void remove (); - - /** Get the line assigned to the breakpoint. - * - * @return the source line or null if no line is specified (it is assigned to a method) - */ - public abstract Line getLine (); - - /** Get the name of the class the breakpoint is in. - * - * @return the class name - */ - public abstract String getClassName (); - - /** Get the method the breakpoint is in. - * - * @return the method (or constructor) element or null if it assigned to a line - */ - public abstract ConstructorElement getMethod (); - - /** - * Test whether the breakpoint is enabled. - * - * @return true if so - */ - public abstract boolean isEnabled (); - - /** - * Set whether the breakpoint is enabled. - * - * @param state true to enable, false to disable - */ - public abstract void setEnabled (boolean enabled); - - /** - * Test whether the breakpoint is valid. - * Invalidity might be caused by an inability to find the class it is supposed to be in, for example. - * @return true if it is valid - */ - public abstract boolean isValid (); - - /** Test whether the breakpoint is hidden. - * If so, it - * is not presented in the list of all breakpoints. Such a breakpoint can be used - * for the IDE's (or some module's) private use, not displaying anything to the user. - * @return true if the breakpoint is hidden - */ - public abstract boolean isHidden (); - - /** - * Add a property change listener. - * @param listener the listener to add - */ - public abstract void addPropertyChangeListener (PropertyChangeListener listener); - - /** - * Remove a property change listener. - * @param listener the listener to remove - */ - public abstract void removePropertyChangeListener (PropertyChangeListener listener); -} Index: openide/deprecated/src/org/openide/debugger/Bundle.properties =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/Bundle.properties diff -N openide/deprecated/src/org/openide/debugger/Bundle.properties --- openide/deprecated/src/org/openide/debugger/Bundle.properties 13 Jan 2003 17:56:37 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -# Sun Public License Notice -# -# The contents of this file are subject to the Sun Public License -# Version 1.0 (the "License"). You may not use this file except in -# compliance with the License. A copy of the License is available at -# http://www.sun.com/ -# -# The Original Code is NetBeans. The Initial Developer of the Original -# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun -# Microsystems, Inc. All Rights Reserved. - -# DebuggerType.Default.class - debugger type -LAB_DefaultDebuggerType=Default Debugging - -# ExecSupport -PROP_debuggerType=Debugger -HINT_debuggerType=Style of debugger to use for this file. Index: openide/deprecated/src/org/openide/debugger/Debugger.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/Debugger.java diff -N openide/deprecated/src/org/openide/debugger/Debugger.java --- openide/deprecated/src/org/openide/debugger/Debugger.java 16 Oct 2002 06:06:55 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,227 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -import java.beans.PropertyChangeListener; - -import org.openide.text.Line; -import org.openide.src.ConstructorElement; - -/** -* Provides a minimal interface between the IDE and a debugger. -* It permits -* control of the state of the debugger and creation of breakpoints and -* watches. -* -* @author Jan Jancura, Jaroslav Tulach -*/ -public abstract class Debugger { - /** Debugger state when the debugger is not running at all. */ - public static final int DEBUGGER_NOT_RUNNING = 1; - /** Debugger state when the debugger is starting to run. */ - public static final int DEBUGGER_STARTING = 2; - /** Debugger state when the debugger is running user code. */ - public static final int DEBUGGER_RUNNING = 3; - /** Debugger state when the debugger is stopped, e.g. at a breakpoint. */ - public static final int DEBUGGER_STOPPED = 4; - - /** Name of property for the debugger's state. */ - public static final String PROP_STATE = "state"; // NOI18N - /** Name of property for the set of breakpoints in the system. */ - public static final String PROP_BREAKPOINTS = "breakpoints"; // NOI18N - /** Name of property for the set of watches in the system. */ - public static final String PROP_WATCHES = "watches"; // NOI18N - /** Name of property for the debugger's current line. */ - public static final String PROP_CURRENT_LINE = "currentLine"; // NOI18N - - /** */ - public static final int ACTION_BREAKPOINT_HIT = 1; - /** */ - public static final int ACTION_TRACE_OVER = 2; - /** */ - public static final int ACTION_TRACE_INTO = 3; - /** */ - public static final int ACTION_STEP_OUT = 4; - - /** Start a new debugging session. - * The current debugging session, if any, should be stopped first. - * The provided information specifies the class to start and - * arguments to pass it, and the name of class to stop debugging in, if applicable. - * - * @param info debugger startup info - * @exception DebuggerException if an error occurs while starting the debugger - */ - public abstract void startDebugger (DebuggerInfo info) throws DebuggerException; - - /** - * Finish the debugger session. - * @throws DebuggerException if there was problem during cleanup - */ - public abstract void finishDebugger () throws DebuggerException; - - /** - * Trace into (a statement). - * @throws DebuggerException if there is a problem during execution - */ - public abstract void traceInto () throws DebuggerException; - - /** - * Trace over (a statement). - * @throws DebuggerException if there is a problem during execution - */ - public abstract void traceOver () throws DebuggerException; - - /** - * Go. - * This should continue executing user code until a breakpoint is hit or the debugger finishes. - * @throws DebuggerException if there is a problem during execution - */ - public abstract void go () throws DebuggerException; - - /** - * Step out (of a statement). - * @throws DebuggerException if there is a problem during execution - */ - public abstract void stepOut () throws DebuggerException; - - // BREAKPOINTS - - /** Create a new breakpoint assigned to a specific line. - * The line is represented by a line object that can change its - * position as the text is modified. - * - * @param l line to create breakpoint at - * @return the new breakpoint - */ - public abstract Breakpoint createBreakpoint (Line l); - - /** Create a new breakpoint assigned to a specific line. - * Allows creation of a hidden breakpoint. - * - * @param l line to create breakpoint at - * @param hidden true if the breakpoint should be hidden from the user - * @return the new breakpoint - */ - public abstract Breakpoint createBreakpoint (Line l, boolean hidden); - - /** Find the breakpoint assigned to a given line. - * - * @param l line to find the breakpoint at - * @return the breakpoint or null if there is no such breakpoint - */ - public abstract Breakpoint findBreakpoint (Line l); - - /** Create a new breakpoint assigned to a method (or constructor). - * The method is represented by a method (or constructor) source element that - * must have a declaring class. - * - * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class - * @return the new breakpoint - * @exception IllegalArgumentException if the method does not have a declaring class - */ - public abstract Breakpoint createBreakpoint (ConstructorElement method); - - /** Create a new breakpoint assigned to a method (or constructor). - * The method is represented by a method (or constructor) source element that - * must have a declaring class. - * Allows creation of a hidden breakpoint. - * - * @param method method or constructor with {@link org.openide.src.MemberElement#getDeclaringClass valid} declaring class - * @param hidden true if the breakpoint should be hidden from the user - * @return the new breakpoint - * @exception IllegalArgumentException if the method does not have a declaring class - */ - public abstract Breakpoint createBreakpoint (ConstructorElement method, boolean hidden); - - /** Find the breakpoint assigned to a method (or constructor). - * - * @param method method or constructor to find the breakpoint of - * @return the breakpoint or null if there is no such breakpoint - * @exception IllegalArgumentException if the method does not have a declaring class - */ - public abstract Breakpoint findBreakpoint (ConstructorElement method); - - /** Get all breakpoints in the system. - * - * @return all breakpoints - */ - public abstract Breakpoint[] getBreakpoints (); - - /** - * Remove all breakpoints from the system. - */ - public abstract void removeAllBreakpoints (); - - - - // WATCHES - - /** Create new uninitialized watch. The watch is visible (not hidden). - * - * @return the new watch - */ - public abstract Watch createWatch (); - - /** Create a watch with its expression set to an initial value. - * Also - * allows creation of a hidden watch (not presented to the user), for example - * for internal use in the editor to obtain values of variables - * under the mouse pointer. - * - * @param expr expression to watch for (the format is the responsibility of the debugger implementation, but it is typically a variable name) - * @param hidden true if the watch should be hidden from the user - * @return the new watch - */ - public abstract Watch createWatch (String expr, boolean hidden); - - /** - * Get all watches in the system. - * - * @return all watches - */ - public abstract Watch[] getWatches (); - - /** - * Remove all watches from the system. - */ - public abstract void removeAllWatches (); - - // PROPERTIES - - /** Get the state of the debugger. - * - * @return {@link #DEBUGGER_NOT_RUNNING}, {@link #DEBUGGER_RUNNING}, {@link #DEBUGGER_STOPPED}, or {@link #DEBUGGER_STARTING} - */ - public abstract int getState (); - - /** Get the current line of debugger. - * - * @return current line - */ - public abstract Line getCurrentLine (); - - /** - * Add a property change listener. - * - * @param l the listener to add - */ - public abstract void addPropertyChangeListener (PropertyChangeListener l); - - /** - * Remove a property change listener. - * - * @param l the listener to remove - */ - public abstract void removePropertyChangeListener (PropertyChangeListener l); -} Index: openide/deprecated/src/org/openide/debugger/DebuggerException.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/DebuggerException.java diff -N openide/deprecated/src/org/openide/debugger/DebuggerException.java --- openide/deprecated/src/org/openide/debugger/DebuggerException.java 16 Oct 2002 06:06:55 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,56 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -/** -* An exception occurring in the debugger. -* This exception -* is thrown in the debugger from all methods which may involve running user code. -* -* @author Jan Jancura -* @version 0.11, Jan 30, 1998 -*/ -public class DebuggerException extends java.lang.reflect.InvocationTargetException { - - /** generated Serialized Version UID */ - static final long serialVersionUID = -3112649137515905742L; - - /** - * Construct a DebuggerException for a specified inner exception. - * @param throwable the basic exception - */ - public DebuggerException (Throwable throwable) { - super (throwable); - } - - /** - * Construct a DebuggerException with a description. - * - * @param message message text - */ - public DebuggerException (String description) { - super (new Exception (), description); - } - - /** - * Construct a DebuggerException with a description and base error. - * - * @param message description of the exception - * @param throwable original exception - */ - public DebuggerException (String description, Throwable throwable) { - super (throwable, description); - } - -} Index: openide/deprecated/src/org/openide/debugger/DebuggerInfo.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/DebuggerInfo.java diff -N openide/deprecated/src/org/openide/debugger/DebuggerInfo.java --- openide/deprecated/src/org/openide/debugger/DebuggerInfo.java 3 Dec 2002 14:11:15 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,97 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - - -/** -* Contains information about a class to debug. -* Consists of these pieces of information: -*

      -*
    • the class to run -*
    • parameters for its main method -*
    • a class name to stop execution in, if desired -*
    -* -* @author Jan Jancura, Jaroslav Tulach -*/ -public class DebuggerInfo extends org.openide.execution.ExecInfo { - /** class to stop at */ - private String stopClassName; - - /** - * Construct a new DebuggerInfo with the class to run and its parameters specified. - * Sets class to stop in to be the class to run. - * - * @param className name of debugged class - * @param argv command-line arguments used for debugging this class; may be empty but not null - */ - public DebuggerInfo ( - String className, - String[] argv - ) { - this ( - className, - argv, - className - ); - } - - /** - * Construct a new DebuggerInfo with the class to run, parameters, and a class to stop at. - * - * @param className name of debugged class - * @param argv command-line arguments used for debugging this class; may be empty but not null - * @param stopClassName name of class to stop in (may be null) - */ - public DebuggerInfo ( - String className, - String[] argv, - String stopClassName - ) { - super (className, argv); - this.stopClassName = stopClassName; - } - - /** Checks whether the method has declaring class. - * @param m method - * @return the same method - * @exception IllegalArgumentException if the stopMethod does not have - * declaring class - * - private static MethodElement method (MethodElement m) { - if (m.getDeclaringClass () == null) { - throw new IllegalArgumentException ("No declaring class for method: " + m.getName ()); - } - return m; -} - */ - - - /** Get the class to stop execution in. - * - * @return the class name or null - */ - public String getStopClassName () { - return stopClassName; - } - - /** Getter for a method to stop at. If the method is not null - * it has a declaring class. So - * @return method or null - * - public MethodElement getStopMethod () { - return stopMethod; -} - */ -} Index: openide/deprecated/src/org/openide/debugger/DebuggerNotFoundException.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/DebuggerNotFoundException.java diff -N openide/deprecated/src/org/openide/debugger/DebuggerNotFoundException.java --- openide/deprecated/src/org/openide/debugger/DebuggerNotFoundException.java 16 Oct 2002 06:06:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -/** -* Exception indicating that the debugger itself could not be loaded properly. -* -* @author Jan Jancura -*/ -public class DebuggerNotFoundException extends DebuggerException { - - /** generated Serialized Version UID */ - static final long serialVersionUID = -3112649144515905742L; - - /** - * Construct a new exception. - */ - public DebuggerNotFoundException () { - super (new Exception ()); - } -} Index: openide/deprecated/src/org/openide/debugger/DebuggerType.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/DebuggerType.java diff -N openide/deprecated/src/org/openide/debugger/DebuggerType.java --- openide/deprecated/src/org/openide/debugger/DebuggerType.java 3 Dec 2002 14:11:16 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,169 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -import java.util.Enumeration; - -import org.openide.TopManager; -import org.openide.execution.ExecInfo; -import org.openide.ServiceType; -import org.openide.util.HelpCtx; -import org.openide.loaders.DataObject; -import org.openide.cookies.ArgumentsCookie; - -/** Defines one debugger type. It has method start that accepts ExecInfo and should -* probably create new DebuggerInfo and call Debugger.startDebug (debuggerInfo). -* The type should be serializable, so it can be attached to file attributes -* of any object that wishes to be especially debugged. -* -*

    This class currently has a property editor in the IDE's -* default editor search path. -* -* @author Jaroslav Tulach -*/ -public abstract class DebuggerType extends ServiceType { - static final long serialVersionUID =-3659300496270314301L; - /** Should start the debugging of this type. - * @param info class and parameters to run - * @param stopOnMain should the debugging stop on main method or go to first breakpoint - * @exception DebuggerException if debugger is not installed or cannot be started - * @deprecated This method is a relic of Java-specific execution. New DebuggerType - * implementations are encouraged to implement this method to throw an - * exception, and override {@link #startDebugger(DataObject,boolean)} to be the actual implementation. - */ - public abstract void startDebugger (ExecInfo info, boolean stopOnMain) throws DebuggerException; - - /** Starts debugging for a data object. - * The default implementation assumes this object behaves akin to a Java class - * by having a package-qualified object name and arguments as given by - * {@link ArgumentsCookie} and delegates to {@link #startDebugger(ExecInfo,boolean)}. - * @param obj object to run - * @param stopOnMain should the debugging stop on main method or go to first breakpoint - * @exception DebuggerException if debugger is not installed or cannot be started - */ - public void startDebugger(DataObject obj, boolean stopOnMain) throws DebuggerException { - String[] params; - ArgumentsCookie ac = (ArgumentsCookie) obj.getCookie(getKlass("org.openide.cookies.ArgumentsCookie")); - if (ac != null) { - params = ac.getArguments(); - } else { - params = new String[0]; - } - startDebugger(new ExecInfo(obj.getPrimaryFile().getPackageName ('.'), params), stopOnMain); - } - - public HelpCtx getHelpCtx () { - return new HelpCtx (DebuggerType.class); - } - - /** Get all registered executors in the system's execution engine. - * @return enumeration of DebuggerTypes - * @deprecated Please use {@link org.openide.util.Lookup} instead. - */ - public static Enumeration debuggerTypes () { - return TopManager.getDefault ().getServices ().services (DebuggerType.class); - } - - /** Find the - * debugger implemented as a given class, among the executors registered to the - * execution engine. - *

    - * This should be used during (de-)serialization - * of the specific debugger for a data object: only store its class name - * and then try to find the debugger implemented by that class later. - * - * @param clazz the class of the debugger looked for - * @return the desired debugger or null if it does not exist - * @deprecated Please use {@link org.openide.util.Lookup} instead. - */ - public static DebuggerType find (Class clazz) { - ServiceType t = TopManager.getDefault ().getServices ().find (clazz); - if (t instanceof DebuggerType) { - return (DebuggerType)t; - } else { - return null; - } - } - - /** Find the - * debugger with requested name, among the executors registered to the - * execution engine. - *

    - * This should be used during (de-)serialization - * of the specific debugger for a data object: only store its name - * and then try to find the debugger later. - * - * @param name (display) name of debugger to find - * @return the desired debugger or null if it does not exist - */ - public static DebuggerType find (String name) { - ServiceType t = TopManager.getDefault ().getServices ().find (name); - if (t instanceof DebuggerType) { - return (DebuggerType)t; - } else { - return null; - } - } - - /** Get the default debugger for the system's execution engine. - *

    You may actually want {@link org.openide.loaders.ExecSupport#getExecutor}. - * @return the default debugger - * @deprecated There is probably not a single debugger type meaningfully applicable to all file types. - * If you explicitly want to invoke the plain Debugger interfaces, use {@link DebuggerType.Default} instead. - */ - public static DebuggerType getDefault () { - Enumeration en = debuggerTypes (); - if (en.hasMoreElements ()) { - return (DebuggerType)en.nextElement (); - } else { - return new Default (); - } - } - - // lazily loads a class - private final Class getKlass(String name) { - try { - return Class.forName(name, false, getClass().getClassLoader()); - } catch (ClassNotFoundException e) { - throw new NoClassDefFoundError(e.getLocalizedMessage()); - } - } - - /** Default debugger type. */ - public static class Default extends DebuggerType { - static final long serialVersionUID =6286540187114472027L; - - /* Gets the display name for this debugger type. */ - public String displayName() { - return org.openide.util.NbBundle.getBundle( - Default.class - ).getString("LAB_DefaultDebuggerType"); - } - - public HelpCtx getHelpCtx () { - return new HelpCtx (Default.class); - } - - /* Starts the debugger. */ - public void startDebugger(ExecInfo info, boolean stopOnMain) throws DebuggerException { - if (stopOnMain) - TopManager.getDefault().getDebugger().startDebugger(new DebuggerInfo( - info.getClassName(), info.getArguments())); - else - TopManager.getDefault().getDebugger().startDebugger(new DebuggerInfo( - info.getClassName(), info.getArguments(), null)); - } - } // end of inner class DefaultDebuggerType - -} Index: openide/deprecated/src/org/openide/debugger/Watch.java =================================================================== RCS file: openide/deprecated/src/org/openide/debugger/Watch.java diff -N openide/deprecated/src/org/openide/debugger/Watch.java --- openide/deprecated/src/org/openide/debugger/Watch.java 16 Oct 2002 06:06:57 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,103 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.debugger; - -import java.beans.PropertyChangeListener; - -/** Represents one debugger watch. -* It contains only basic information -* that can be used by the core of the IDE. -* For example, the editor can use this object -* to display tooltips above variable names in the edited text. -*

    -* It is likely that the real implementation of the watch can offer more -* functionality to the user--in which case it should expose properties -* as a JavaBean. -* -* @author Jan Jancura, Jaroslav Tulach -*/ -public abstract class Watch implements java.io.Serializable { - /** Name of the property for the watched variable name. */ - public static final String PROP_VARIABLE_NAME = "variableName"; // NOI18N - /** Name of the property for the value of the watched expression as a string. */ - public static final String PROP_AS_TEXT = "asText"; // NOI18N - /** Name of the property for the type of the watch value. */ - public static final String PROP_TYPE = "type"; // NOI18N - - - static final long serialVersionUID =2309154226451869624L; - /** Remove the watch from the list of all watches in the system. - */ - public abstract void remove (); - - /** Get the name of the variable to watch. - * - * @return the variable name - */ - public abstract String getVariableName (); - - /** Set the variable name to watch. - * - * @param name string name of the variable to watch - */ - public abstract void setVariableName (String name); - - /** Get a textual representation of the value. - * The watch should convert - * the real value to a string representation. So if the watch represents - * a null reference, the returned string will be for example "null". - * - * @return the value of this watch, or null if the watch is not in scope - */ - public abstract String getAsText (); - - /** Set the value of the watched variable (as text). - * - * @param value text representation of the new value - * @exception DebuggerException if the value cannot be changed, or the - * string does not represent valid value, or the value type cannot reasonably be set as text - */ - public abstract void setAsText (String value) throws DebuggerException; - - /** Get the string representation of the type of the variable. - * - * @return type string (i.e. the class name, or for a primitive e.g. "int") - */ - public abstract String getType (); - - /** Test whether the watch is hidden. - * If so, it - * is not presented in the list of all watches. Such a watch can be used - * for the IDE's (or some module's) private use, not displaying anything to the user. - * @return true if the watch is hidden - * @see Debugger#createWatch(String, boolean) - */ - public abstract boolean isHidden (); - - /** - * Add a property change listener. - * Change events should be fired for the properties {@link #PROP_VARIABLE_NAME}, {@link #PROP_AS_TEXT}, and {@link #PROP_TYPE}. - * - * @param l the listener to add - */ - public abstract void addPropertyChangeListener (PropertyChangeListener l); - - /** - * Remove a property change listener. - * - * @param l the listener to remove - */ - public abstract void removePropertyChangeListener (PropertyChangeListener l); - -} Index: openide/deprecated/src/org/openide/loaders/ExecSupport.java =================================================================== RCS file: openide/deprecated/src/org/openide/loaders/ExecSupport.java diff -N openide/deprecated/src/org/openide/loaders/ExecSupport.java --- openide/deprecated/src/org/openide/loaders/ExecSupport.java 13 Jan 2003 17:56:37 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,243 +0,0 @@ -/* - * Sun Public License Notice - * - * The contents of this file are subject to the Sun Public License - * Version 1.0 (the "License"). You may not use this file except in - * compliance with the License. A copy of the License is available at - * http://www.sun.com/ - * - * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.openide.loaders; - -import java.beans.*; -import java.awt.event.*; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import org.openide.*; -import org.openide.compiler.*; -import org.openide.compiler.Compiler; -import org.openide.debugger.*; -import org.openide.execution.*; -import org.openide.explorer.propertysheet.*; -import org.openide.filesystems.*; -import org.openide.cookies.CompilerCookie; -import org.openide.cookies.DebuggerCookie; -import org.openide.nodes.Sheet; -import org.openide.nodes.PropertySupport; -import org.openide.util.NbBundle; -import org.openide.util.Mutex; -import org.openide.util.Lookup; - -/** Support for execution and debugging. -* @author Jaroslav Tulach, Jesse Glick -* @deprecated Use {@link ExecutionSupport} unless you need support for debugging too. -*/ -public class ExecSupport extends ExecutionSupport - implements DebuggerCookie { - /** extended attribute for debugger type */ - private static final String EA_DEBUGGER_TYPE = "NetBeansAttrDebuggerType"; // NOI18N - - /** Name of property providing a custom {@link DebuggerType} for a file. */ - public static final String PROP_DEBUGGER_TYPE = "debuggerType"; // NOI18N - - /** @deprecated use {@link #getEntry} */ - protected MultiDataObject.Entry entry; - /** @deprecated useless */ - protected boolean isReadOnly; - - /** Create new support for given entry. The file is taken from the - * entry and is updated if the entry moves or renames itself. - * @param entry entry to create instance from - */ - public ExecSupport (MultiDataObject.Entry entry) { - super(entry); - this.entry = entry; - Boolean ro = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES); - isReadOnly = (ro == null)?false:(!ro.booleanValue()); - } - - /* Start debugging of associated object. - * @param stopOnMain if true, debugger stops on the first line of debugged code - * @exception DebuggerException if the session cannot be started - */ - public void debug (final boolean stopOnMain) throws DebuggerException { - DebuggerType t = getDebuggerType (entry); - if (t == null) { - t = defaultDebuggerType (); - } - - try { - t.startDebugger (entry.getDataObject(), stopOnMain); - // ok, debugger started - return; - } catch (final DebuggerException ex) { - try { - Mutex.EVENT.readAccess (new Mutex.ExceptionAction () { - public Object run () throws DebuggerException { - if (debugFailed (ex)) { - // restart - debug (stopOnMain); - } - return null; - } - }); - } catch (org.openide.util.MutexException mx) { - if (mx.getException() instanceof DebuggerException) { - throw (DebuggerException)mx.getException(); - } else { - throw new DebuggerException(mx.getException()); - } - } - } - } - - /** Check if this object is up to date or in need of compilation. - * Should compile it if necessary. - *

    The default implementation checks whether {@link CompilerCookie} is provided and - * if so, creates a job and compiles the object. This behavior may be - * overridden by subclasses. - * - * @return true if the object was successfully brought up to date, false if the attempt failed (and it may be still be out of date) - * @deprecated The check should be done in an action - ExecAction, ... - */ - protected boolean checkCompiled () { - DataObject obj = entry.getDataObject (); - - CompilerCookie c = (CompilerCookie)obj.getCookie (CompilerCookie.class); - - if (c != null) { - CompilerJob job = new CompilerJob (Compiler.DEPTH_ZERO); - job.setDisplayName (obj.getName ()); - c.addToJob (job, Compiler.DEPTH_ZERO); - if (!job.isUpToDate ()) { - // add name - // compile it - CompilerTask t = job.start (); - return t.isSuccessful (); - } - } - return true; - } - - /** Called when invocation of the debugger fails. Allows to do some - * modifications to the type of debugging and try it again. - * - * @param ex exeception that occured during execution - * @return true if the debugging should be started again - */ - protected boolean debugFailed (DebuggerException ex) { - DebuggerType e = (DebuggerType)choose (getDebuggerType (entry), DebuggerType.class, ex); - if (e == null) { - return false; - } else { - try { - setDebuggerType (entry, e); - return true; - } catch (IOException exc) { - return false; - } - } - } - - /** This method allows subclasses to override the default - * debugger type they want to use for debugging. - * - * @return current implementation returns DebuggerType.getDefault () - */ - protected DebuggerType defaultDebuggerType () { - return DebuggerType.getDefault (); - } - - // - // debugger support - // - - /** Assignes a debugger type to an entry. - * @param entry the object's entry - * @param type the debugger type for this entry - * @exception IOException if arguments cannot be set - */ - public static void setDebuggerType (MultiDataObject.Entry entry, DebuggerType type) throws IOException { - entry.getFile ().setAttribute (EA_DEBUGGER_TYPE, - type == null ? null : new ServiceType.Handle (type) - ); - } - - /** Retrieves the debugger type for this entry. - * @param entry the entry - * @return the debugger type or null if no type assigned - */ - public static DebuggerType getDebuggerType (MultiDataObject.Entry entry) { - Object handle = entry.getFile ().getAttribute (EA_DEBUGGER_TYPE); - if (handle != null && (handle instanceof ServiceType.Handle)) { - ServiceType dbg = ((ServiceType.Handle) handle).getServiceType (); - if (dbg instanceof DebuggerType) { - return (DebuggerType) dbg; - } - } - - Lookup l = Environment.find (entry.getDataObject ()); - DebuggerType dt = (DebuggerType)l.lookup (DebuggerType.class); - if (dt != null) { - return dt; - } - - return null; - } - - /** Helper method that creates default properties for execution of - * a given support. - * Includes properties to set the executor; debugger; and arguments. - * - * @param set sheet set to add properties to - */ - public void addProperties (Sheet.Set set) { - super.addProperties(set); - set.put(createDebuggerProperty ()); - } - - /** Creates the debugger property for entry. - * @return the property - */ - private PropertySupport createDebuggerProperty () { - return new PropertySupport.ReadWrite ( - PROP_DEBUGGER_TYPE, - DebuggerType.class, - NbBundle.getMessage(DebuggerType.class, "PROP_debuggerType"), - NbBundle.getMessage(DebuggerType.class, "HINT_debuggerType") - ) { - public Object getValue() { - DebuggerType dt = getDebuggerType (entry); - if (dt == null) - return defaultDebuggerType (); - else - return dt; - } - public void setValue (Object val) throws InvocationTargetException { - try { - setDebuggerType (entry, (DebuggerType) val); - } catch (IOException ex) { - throw new InvocationTargetException (ex); - } - } - public boolean supportsDefaultValue () { - return true; - } - - public void restoreDefaultValue () throws InvocationTargetException { - setValue (null); - } - - public boolean canWrite () { - Boolean isReadOnly = (Boolean)entry.getFile().getAttribute(READONLY_ATTRIBUTES); - return (isReadOnly == null)?false:(!isReadOnly.booleanValue()); - } - }; - } - -} Index: openide/release/system/ModuleAutoDeps/org-openide.xml =================================================================== RCS file: openide/release/system/ModuleAutoDeps/org-openide.xml diff -N openide/release/system/ModuleAutoDeps/org-openide.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openide/release/system/ModuleAutoDeps/org-openide.xml 27 Jan 2003 19:37:57 -0000 @@ -0,0 +1,100 @@ + + + + + + + + + JavaHelp was moved into a module + + + + + + + + + + + + + + + + + + + + + + + + + + + + API separation phase I (#19443) + + + + + + + + + + + + + + + + + + + + + + API separation phase II (#19443) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: projects/build.xml =================================================================== RCS file: /cvs/projects/build.xml,v retrieving revision 1.33 diff -u -r1.33 build.xml --- projects/build.xml 11 Dec 2002 17:07:26 -0000 1.33 +++ projects/build.xml 27 Jan 2003 19:38:08 -0000 @@ -33,6 +33,7 @@ + Index: projects/manifest.mf =================================================================== RCS file: /cvs/projects/manifest.mf,v retrieving revision 1.39 diff -u -r1.39 manifest.mf --- projects/manifest.mf 29 Nov 2002 09:25:20 -0000 1.39 +++ projects/manifest.mf 27 Jan 2003 19:38:08 -0000 @@ -3,9 +3,9 @@ OpenIDE-Module-Layer: org/netbeans/modules/projects/resources/projects-layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine -OpenIDE-Module-Specification-Version: 1.10 +OpenIDE-Module-Specification-Version: 1.11 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ -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 +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 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projects/Bundle.properties Name: org/netbeans/modules/projects/ProjectDataLoader.class Index: projects/src/org/netbeans/modules/projects/actions/DebuggerPerformer.java =================================================================== RCS file: /cvs/projects/src/org/netbeans/modules/projects/actions/DebuggerPerformer.java,v retrieving revision 1.2 diff -u -r1.2 DebuggerPerformer.java --- projects/src/org/netbeans/modules/projects/actions/DebuggerPerformer.java 7 Nov 2002 08:40:18 -0000 1.2 +++ projects/src/org/netbeans/modules/projects/actions/DebuggerPerformer.java 27 Jan 2003 19:38:08 -0000 @@ -141,7 +141,6 @@ } if (!installed) return; installed = false; - ((AddWatchAction) SystemAction.get (AddWatchAction.class)).setActionPerformer (null); } void setDebuggerRunning (boolean b) { Index: rmi/build.xml =================================================================== RCS file: /cvs/rmi/build.xml,v retrieving revision 1.47 diff -u -r1.47 build.xml --- rmi/build.xml 12 Dec 2002 22:05:18 -0000 1.47 +++ rmi/build.xml 27 Jan 2003 19:38:08 -0000 @@ -70,6 +70,7 @@ + Index: rmi/manifest.mf =================================================================== RCS file: /cvs/rmi/manifest.mf,v retrieving revision 1.73 diff -u -r1.73 manifest.mf --- rmi/manifest.mf 2 Nov 2002 21:11:08 -0000 1.73 +++ rmi/manifest.mf 27 Jan 2003 19:38:08 -0000 @@ -3,9 +3,9 @@ OpenIDE-Module-Install: org/netbeans/modules/rmi/RMIModule.class OpenIDE-Module-Layer: org/netbeans/modules/rmi/resources/mf-layer.xml OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -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 +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 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 -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ Class-Path: docs/rmi.jar Index: tomcatint/tomcat40/build.xml =================================================================== RCS file: /cvs/tomcatint/tomcat40/build.xml,v retrieving revision 1.42 diff -u -r1.42 build.xml --- tomcatint/tomcat40/build.xml 16 Dec 2002 19:32:05 -0000 1.42 +++ tomcatint/tomcat40/build.xml 27 Jan 2003 19:38:08 -0000 @@ -89,6 +89,7 @@ + Index: tomcatint/tomcat40/manifest.mf =================================================================== RCS file: /cvs/tomcatint/tomcat40/manifest.mf,v retrieving revision 1.26 diff -u -r1.26 manifest.mf --- tomcatint/tomcat40/manifest.mf 2 Nov 2002 21:11:12 -0000 1.26 +++ tomcatint/tomcat40/manifest.mf 27 Jan 2003 19:38:08 -0000 @@ -1,11 +1,11 @@ OpenIDE-Module: org.netbeans.modules.web.tomcat.tomcat40/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tomcat/tomcat40/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/tomcat/tomcat40/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-Install: org/netbeans/modules/tomcat/tomcat40/Tomcat40ModuleInstall.class OpenIDE-Module-Provides: org.netbeans.modules.tomcatint.tomcat40 -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 +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 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Package-Dependencies: [javax.servlet.ServletException], [org.apache.jasper.Constants], [org.apache.jasper.Options], [org.apache.xml.serialize.EncodingInfo] Index: web/advanced/manifest.mf =================================================================== RCS file: /cvs/web/advanced/manifest.mf,v retrieving revision 1.65 diff -u -r1.65 manifest.mf --- web/advanced/manifest.mf 17 Jan 2003 17:00:24 -0000 1.65 +++ web/advanced/manifest.mf 27 Jan 2003 19:38:09 -0000 @@ -2,7 +2,7 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/ie/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/web/ie/WebModule.class OpenIDE-Module-Layer: org/netbeans/modules/web/ie/layer.xml -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Module-Dependencies: org.netbeans.modules.web.core/1 > 1.10, @@ -14,7 +14,7 @@ org.netbeans.modules.html/1, org.openidex.util/2, org.netbeans.core/1 > 1.0, - org.openide.deprecated > 1.0, org.openide.src > 1.0, org.openide.execution > 1.0 + org.openide.deprecated > 1.2, org.openide.src > 1.0, org.openide.execution > 1.0 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.execution.ExecutionEngine Class-Path: docs/jspie.jar Index: web/advanced/src/org/netbeans/modules/web/config/ConfigLoader.java =================================================================== RCS file: /cvs/web/advanced/src/org/netbeans/modules/web/config/ConfigLoader.java,v retrieving revision 1.13 diff -u -r1.13 ConfigLoader.java --- web/advanced/src/org/netbeans/modules/web/config/ConfigLoader.java 10 Jan 2003 14:59:34 -0000 1.13 +++ web/advanced/src/org/netbeans/modules/web/config/ConfigLoader.java 27 Jan 2003 19:38:11 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -29,7 +29,6 @@ import org.openide.loaders.DataObjectExistsException; import org.openide.text.EditorSupport; import org.openide.loaders.OpenSupport; -import org.openide.loaders.ExecSupport; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileStateInvalidException; import org.openide.nodes.Children; @@ -39,8 +38,6 @@ import org.openide.windows.CloneableTopComponent; import org.openide.execution.NbClassPath; import org.openide.filesystems.*; - -import org.netbeans.modules.j2ee.impl.ServerExecSupport; /** * Loader for Server Configuration DataObjects. Index: web/advanced/src/org/netbeans/modules/web/ie/JspLoaderIE.java =================================================================== RCS file: /cvs/web/advanced/src/org/netbeans/modules/web/ie/JspLoaderIE.java,v retrieving revision 1.6 diff -u -r1.6 JspLoaderIE.java --- web/advanced/src/org/netbeans/modules/web/ie/JspLoaderIE.java 9 Nov 2001 15:20:54 -0000 1.6 +++ web/advanced/src/org/netbeans/modules/web/ie/JspLoaderIE.java 27 Jan 2003 19:38:11 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -17,7 +17,6 @@ import org.openide.TopManager; import org.openide.actions.*; -import org.openide.cookies.DebuggerCookie; import org.openide.loaders.UniFileLoader; import org.openide.loaders.MultiDataObject; import org.openide.loaders.DataObject; Index: web/core/build.xml =================================================================== RCS file: /cvs/web/core/build.xml,v retrieving revision 1.16 diff -u -r1.16 build.xml --- web/core/build.xml 11 Dec 2002 17:07:44 -0000 1.16 +++ web/core/build.xml 27 Jan 2003 19:38:11 -0000 @@ -71,6 +71,7 @@ + Index: web/core/manifest.mf =================================================================== RCS file: /cvs/web/core/manifest.mf,v retrieving revision 1.19 diff -u -r1.19 manifest.mf --- web/core/manifest.mf 23 Jan 2003 17:00:51 -0000 1.19 +++ web/core/manifest.mf 27 Jan 2003 19:38:11 -0000 @@ -2,10 +2,10 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/core/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/web/core/ServletSupportModule.class OpenIDE-Module-Layer: org/netbeans/modules/web/core/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 -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 +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 OpenIDE-Module-Requires: org.openide.TopManager, org.openide.compiler.CompilationEngine, org.openide.execution.ExecutionEngine, org.openide.windows.IOProvider Name: org/netbeans/modules/web/dd/DDDataLoader.class Index: web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditor.java =================================================================== RCS file: /cvs/web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditor.java,v retrieving revision 1.6 diff -u -r1.6 BaseJspEditor.java --- web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditor.java 26 Nov 2002 16:05:05 -0000 1.6 +++ web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditor.java 27 Jan 2003 19:38:11 -0000 @@ -306,8 +306,7 @@ } /* This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated () { getEditorPane().addCaretListener(caretListener); @@ -316,8 +315,7 @@ /* * This method is called when parent window of this component losts focus, - * or when this component losts preferrence in the parent window. This - * implementation removes performer from the ToggleBreakpointAction. + * or when this component losts preferrence in the parent window. */ protected void componentDeactivated () { getEditorPane().removeCaretListener(caretListener); Index: web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java =================================================================== RCS file: /cvs/web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java,v retrieving revision 1.6 diff -u -r1.6 BaseJspEditorSupport.java --- web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java 6 Dec 2002 14:02:41 -0000 1.6 +++ web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java 27 Jan 2003 19:38:11 -0000 @@ -298,8 +298,7 @@ } /* This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated() { getEditorPane().addCaretListener(caretListener); @@ -308,8 +307,7 @@ /* * This method is called when parent window of this component losts focus, - * or when this component losts preferrence in the parent window. This - * implementation removes performer from the ToggleBreakpointAction. + * or when this component losts preferrence in the parent window. */ protected void componentDeactivated() { getEditorPane().removeCaretListener(caretListener); Index: web/jspdebug/build.xml =================================================================== RCS file: /cvs/web/jspdebug/build.xml,v retrieving revision 1.9 diff -u -r1.9 build.xml --- web/jspdebug/build.xml 11 Dec 2002 17:07:45 -0000 1.9 +++ web/jspdebug/build.xml 27 Jan 2003 19:38:12 -0000 @@ -43,6 +43,7 @@ + Index: web/jspdebug/manifest.mf =================================================================== RCS file: /cvs/web/jspdebug/manifest.mf,v retrieving revision 1.10 diff -u -r1.10 manifest.mf --- web/jspdebug/manifest.mf 2 Nov 2002 21:11:22 -0000 1.10 +++ web/jspdebug/manifest.mf 27 Jan 2003 19:38:12 -0000 @@ -2,9 +2,9 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/debug/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/web/debug/DebugModule.class OpenIDE-Module-Layer: org/netbeans/modules/web/debug/layer.xml -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ -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 +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 OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.TopManager Index: web/jspdebug/src/org/netbeans/modules/web/debug/JspEditor.java =================================================================== RCS file: /cvs/web/jspdebug/src/org/netbeans/modules/web/debug/JspEditor.java,v retrieving revision 1.29 diff -u -r1.29 JspEditor.java --- web/jspdebug/src/org/netbeans/modules/web/debug/JspEditor.java 27 May 2002 13:15:05 -0000 1.29 +++ web/jspdebug/src/org/netbeans/modules/web/debug/JspEditor.java 27 Jan 2003 19:38:12 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -16,10 +16,10 @@ import java.io.IOException; import java.io.InputStream; import java.io.ObjectInput; -import java.util.Enumeration; -import java.util.List; -import java.util.ArrayList; +import java.util.*; +import java.awt.event.ActionEvent; import javax.swing.JEditorPane; +import javax.swing.AbstractAction; import javax.swing.text.BadLocationException; import javax.swing.text.EditorKit; import javax.swing.text.StyledDocument; @@ -34,13 +34,11 @@ import org.openide.windows.CloneableTopComponent; import org.openide.windows.Mode; import org.openide.windows.Workspace; -import org.openide.util.NbBundle; import org.netbeans.modules.web.core.jsploader.BaseJspEditor; import org.openide.util.actions.SystemAction; -import org.openide.util.actions.ActionPerformer; import org.openide.text.NbDocument; import org.openide.ErrorManager; -import org.openide.util.RequestProcessor; +import org.openide.util.*; import org.netbeans.modules.debugger.CoreBreakpoint; @@ -111,6 +109,7 @@ /** Default constructor */ public JspEditorComponent() { super(); + initialize(); } /** @@ -119,6 +118,51 @@ */ public JspEditorComponent(DataObject obj) { super(obj); + initialize(); + } + + public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { + super.readExternal(in); + initialize(); + } + + private void initialize() { + getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N + } + + /** + * Locally bound action to toggle breakpoint on the current line. + * @see "#29914" + */ + private final class ToggleBreakpointAction extends AbstractAction implements LookupListener { + private final Lookup.Result debuggerR; + public ToggleBreakpointAction() { + debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class)); + debuggerR.addLookupListener(this); + resultChanged(null); + } + public void actionPerformed(ActionEvent e) { + int row = NbDocument.findLineNumber (getSupport().getDocument (), + getPane().getCaret ().getDot () ); + Line line = (getSupport().getLineSet ()).getCurrent (row); + synchronized (this) { + Iterator it = debuggerR.allInstances().iterator(); + if (it.hasNext()) { + Debugger debugger = (Debugger)it.next(); + Breakpoint b = debugger.findBreakpoint (line); + if (b != null) { +// JspCompoundEvent jspCE = (JspCompoundEvent)((CoreBreakpoint)b).getEvent(); +// jspCE.clearEvents(); + b.remove (); + } else { + debugger.createBreakpoint (line); + } + } + } + } + public void resultChanged(LookupEvent e) { + setEnabled(!debuggerR.allInstances().isEmpty()); + } } /* return editor support @@ -160,37 +204,11 @@ */ /** This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated() { - setFocusedJspEditor(true); - // set the performer - try { - final Debugger debugger = TopManager.getDefault ().getDebugger (); - ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)). - setActionPerformer (new ActionPerformer () { - public void performAction (SystemAction a) { - int row = NbDocument.findLineNumber (getSupport().getDocument (), - getPane().getCaret ().getDot () ); - Line line = (getSupport().getLineSet ()).getCurrent (row); - Breakpoint b = debugger.findBreakpoint (line); - if (b != null) { -// JspCompoundEvent jspCE = (JspCompoundEvent)((CoreBreakpoint)b).getEvent(); -// jspCE.clearEvents(); - b.remove (); - } else { - debugger.createBreakpoint (line); - } - } - } ); - } - catch (DebuggerNotFoundException e) { - TopManager.getDefault().getErrorManager().notify(ErrorManager.EXCEPTION, e); - } - super.componentActivated(); } @@ -198,9 +216,6 @@ */ protected void componentDeactivated() { - // unset the performer for ToggleBreakpointAction - ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)). - setActionPerformer (null); super.componentDeactivated(); //jspSupport.enableJspLineMapping(true); } @@ -209,7 +224,6 @@ SystemAction[] sa = super.getSystemActions (); SystemAction[] jspServletActions = new SystemAction[] { null, - SystemAction.get(org.openide.actions.ToggleBreakpointAction.class), SystemAction.get(ShowServlet.class), SystemAction.get(ToggleJspStepMode.class) }; @@ -238,7 +252,3 @@ return focus; } } - - - - Index: web/jspdebug/src/org/netbeans/modules/web/debug/JspEditorSupport.java =================================================================== RCS file: /cvs/web/jspdebug/src/org/netbeans/modules/web/debug/JspEditorSupport.java,v retrieving revision 1.1 diff -u -r1.1 JspEditorSupport.java --- web/jspdebug/src/org/netbeans/modules/web/debug/JspEditorSupport.java 27 May 2002 12:58:50 -0000 1.1 +++ web/jspdebug/src/org/netbeans/modules/web/debug/JspEditorSupport.java 27 Jan 2003 19:38:12 -0000 @@ -7,12 +7,17 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.web.debug; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.io.ObjectInput; +import java.util.Iterator; +import javax.swing.AbstractAction; import org.netbeans.modules.web.core.jsploader.BaseJspEditorSupport; import org.netbeans.modules.web.core.jsploader.JspDataObject; import org.openide.TopManager; @@ -20,14 +25,13 @@ import org.openide.text.Line; import org.openide.windows.CloneableTopComponent; import org.openide.util.actions.SystemAction; -import org.openide.actions.ToggleBreakpointAction; import org.netbeans.modules.web.debug.ShowServlet; import org.netbeans.modules.web.debug.ToggleJspStepMode; import org.openide.debugger.Debugger; -import org.openide.util.actions.ActionPerformer; import org.openide.text.NbDocument; import org.openide.debugger.Breakpoint; import org.openide.debugger.DebuggerNotFoundException; +import org.openide.util.*; /** Editor for JSP pages */ @@ -69,6 +73,7 @@ /** Default constructor */ public JspEditor() { super(); + initialize(); } /** @@ -77,56 +82,64 @@ */ public JspEditor(BaseJspEditorSupport s) { super(s); + initialize(); + } + + public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { + super.readExternal(in); + initialize(); + } + + private void initialize() { + getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N + } + + /** + * Locally bound action to toggle breakpoint on the current line. + * @see "#29914" + */ + private final class ToggleBreakpointAction extends AbstractAction implements LookupListener { + private final Lookup.Result debuggerR; + public ToggleBreakpointAction() { + debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class)); + debuggerR.addLookupListener(this); + resultChanged(null); + } + public void actionPerformed(ActionEvent e) { + synchronized (this) { + Iterator it = debuggerR.allInstances().iterator(); + if (it.hasNext()) { + Debugger debugger = (Debugger)it.next(); + int row = NbDocument.findLineNumber (cloneableEditorSupport().getDocument(), + getEditorPane().getCaret().getDot() ); + Line line = (cloneableEditorSupport().getLineSet()).getCurrent(row); + Breakpoint b = debugger.findBreakpoint(line); + if (b != null) { + b.remove(); + } else { + debugger.createBreakpoint(line); + } + } + } + } + public void resultChanged(LookupEvent e) { + setEnabled(!debuggerR.allInstances().isEmpty()); + } } /** This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated() { setFocusedJspEditor(true); - - - // set the performer - try { - final Debugger debugger = TopManager.getDefault ().getDebugger (); - ((ToggleBreakpointAction) SystemAction.get (ToggleBreakpointAction.class)). - setActionPerformer (new ActionPerformer () { - public void performAction (SystemAction a) { - int row = NbDocument.findLineNumber (cloneableEditorSupport().getDocument(), - getEditorPane().getCaret().getDot() ); - Line line = (cloneableEditorSupport().getLineSet()).getCurrent(row); - Breakpoint b = debugger.findBreakpoint(line); - if (b != null) { - b.remove(); - } else { - debugger.createBreakpoint(line); - } - } - } ); - } - catch (DebuggerNotFoundException e) { - TopManager.getDefault().getErrorManager().notify(ErrorManager.EXCEPTION, e); - } super.componentActivated(); } - /* This method is called when this component loses focus - */ - - protected void componentDeactivated() { - // unset the performer for ToggleBreakpointAction - ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)). - setActionPerformer (null); - super.componentDeactivated(); - } - public SystemAction[] getSystemActions() { SystemAction[] sa = super.getSystemActions (); SystemAction[] jspServletActions = new SystemAction[] { null, - SystemAction.get(ToggleBreakpointAction.class), SystemAction.get(ShowServlet.class), SystemAction.get(ToggleJspStepMode.class) }; Index: web/jspdebug/src/org/netbeans/modules/web/debug/JspServletEditor.java =================================================================== RCS file: /cvs/web/jspdebug/src/org/netbeans/modules/web/debug/JspServletEditor.java,v retrieving revision 1.26 diff -u -r1.26 JspServletEditor.java --- web/jspdebug/src/org/netbeans/modules/web/debug/JspServletEditor.java 11 Jun 2002 16:03:34 -0000 1.26 +++ web/jspdebug/src/org/netbeans/modules/web/debug/JspServletEditor.java 27 Jan 2003 19:38:12 -0000 @@ -7,17 +7,20 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.web.debug; import java.awt.Color; +import java.awt.event.ActionEvent; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInput; +import java.util.Iterator; import java.util.Vector; +import javax.swing.AbstractAction; import javax.swing.JEditorPane; import javax.swing.SwingUtilities; import javax.swing.text.Style; @@ -45,14 +48,12 @@ import org.openide.text.Line; import org.openide.text.NbDocument; import org.openide.text.CloneableEditor; -import org.openide.util.NbBundle; -import org.openide.util.actions.ActionPerformer; import org.openide.util.actions.SystemAction; import org.openide.windows.CloneableTopComponent; import org.openide.windows.Mode; import org.openide.windows.Workspace; import org.openide.ErrorManager; -import org.openide.util.RequestProcessor; +import org.openide.util.*; /* /** Editor for servlet files generated from JSP files. Main features: @@ -160,11 +161,57 @@ /** Default constructor */ public ServletEditorComponentIE() { super(); + initialize(); } /** Default constructor */ public ServletEditorComponentIE(ServletEditor support) { super(support); + initialize(); + } + + public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { + super.readExternal(in); + initialize(); + } + + private void initialize() { + getActionMap().put("org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", new ToggleBreakpointAction()); // NOI18N + } + + /** + * Locally bound action to toggle breakpoint on the current line. + * @see "#29914" + */ + private final class ToggleBreakpointAction extends AbstractAction implements LookupListener { + private final Lookup.Result debuggerR; + public ToggleBreakpointAction() { + debuggerR = Lookup.getDefault().lookup(new Lookup.Template(Debugger.class)); + debuggerR.addLookupListener(this); + resultChanged(null); + } + public void actionPerformed(ActionEvent e) { + synchronized (this) { + Iterator it = debuggerR.allInstances().iterator(); + if (it.hasNext()) { + Debugger debugger = (Debugger)it.next(); + int l = NbDocument.findLineNumber ( + getSupport().getDocument (), + getPane().getCaret ().getDot () + ); + Line line = getSupport().getLineSet ().getCurrent (l); + Breakpoint b = debugger.findBreakpoint (line); + if (b != null) { + b.remove (); + } else {//create brerakpoint + debugger.createBreakpoint (line); + } + } + } + } + public void resultChanged(LookupEvent e) { + setEnabled(!debuggerR.allInstances().isEmpty()); + } } /** get pane @@ -182,48 +229,16 @@ } /* This method is called when parent window of this component has focus, - * and this component is preferred one in it. This implementation adds - * performer to the ToggleBreakpointAction. + * and this component is preferred one in it. */ protected void componentActivated () { JspEditorSupport.setFocusedJspEditor(false); - try { - final Debugger debugger = TopManager.getDefault ().getDebugger (); - ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)). - setActionPerformer ( - new ActionPerformer () { - public void performAction (SystemAction a) { - int l = NbDocument.findLineNumber ( - getSupport().getDocument (), - getPane().getCaret ().getDot () - ); - Line line = getSupport().getLineSet ().getCurrent (l); - Breakpoint b = debugger.findBreakpoint (line); - if (b != null) { - b.remove (); - } else {//create brerakpoint - debugger.createBreakpoint (line); - } - } - } - ); - } catch (DebuggerNotFoundException e) { - } super.componentActivated (); } - /* This method is called when this component loses focus - */ - protected void componentDeactivated () { - ((org.openide.actions.ToggleBreakpointAction) SystemAction.get (org.openide.actions.ToggleBreakpointAction.class)). - setActionPerformer (null); - super.componentDeactivated(); - } - public SystemAction[] getSystemActions() { SystemAction[] sa = super.getSystemActions (); SystemAction[] jspServletActions = new SystemAction[] { -// SystemAction.get(org.openide.actions.ToggleBreakpointAction.clas s), SystemAction.get(ShowJsp.class), SystemAction.get(ToggleJspStepMode.class) }; Index: web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspMultiSettingsInitializer.java =================================================================== RCS file: /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspMultiSettingsInitializer.java,v retrieving revision 1.5 diff -u -r1.5 JspMultiSettingsInitializer.java --- web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspMultiSettingsInitializer.java 2 Nov 2002 21:11:25 -0000 1.5 +++ web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspMultiSettingsInitializer.java 27 Jan 2003 19:38:12 -0000 @@ -78,7 +78,7 @@ new String[] { TopComponent.class.getName(), null, - // org.openide.actions.ToggleBreakpointAction.class.getName(), + // "org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", // JavaKit.addWatchAction, // null, CutAction.class.getName(), Index: web/taglibed/manifest.mf =================================================================== RCS file: /cvs/web/taglibed/manifest.mf,v retrieving revision 1.17 diff -u -r1.17 manifest.mf --- web/taglibed/manifest.mf 6 Nov 2002 02:09:04 -0000 1.17 +++ web/taglibed/manifest.mf 27 Jan 2003 19:38:12 -0000 @@ -2,9 +2,9 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/taglibed/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/web/taglibed/TaglibModule.class OpenIDE-Module-Layer: org/netbeans/modules/web/taglibed/layer.xml -OpenIDE-Module-Specification-Version: 1.8 +OpenIDE-Module-Specification-Version: 1.9 OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@ -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 +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 OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.17 OpenIDE-Module-Requires: org.openide.windows.IOProvider Index: web/taglibed/src/org/netbeans/modules/web/taglibed/control/IDEHelper.java =================================================================== RCS file: /cvs/web/taglibed/src/org/netbeans/modules/web/taglibed/control/IDEHelper.java,v retrieving revision 1.10 diff -u -r1.10 IDEHelper.java --- web/taglibed/src/org/netbeans/modules/web/taglibed/control/IDEHelper.java 19 Dec 2002 04:22:37 -0000 1.10 +++ web/taglibed/src/org/netbeans/modules/web/taglibed/control/IDEHelper.java 27 Jan 2003 19:38:16 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -50,10 +50,8 @@ import org.openide.loaders.DataObject; import org.openide.loaders.MultiDataObject; -import org.openide.loaders.ExecSupport; import org.openide.execution.Executor; -import org.openide.debugger.DebuggerType; import org.openide.loaders.DataFolder; import org.openide.DialogDisplayer; import org.openide.filesystems.Repository; Index: web/test/Common/src/org/netbeans/web/test/actions/ToggleBreakpointAction.java =================================================================== RCS file: /cvs/web/test/Common/src/org/netbeans/web/test/actions/ToggleBreakpointAction.java,v retrieving revision 1.1 diff -u -r1.1 ToggleBreakpointAction.java --- web/test/Common/src/org/netbeans/web/test/actions/ToggleBreakpointAction.java 7 Oct 2002 11:40:19 -0000 1.1 +++ web/test/Common/src/org/netbeans/web/test/actions/ToggleBreakpointAction.java 27 Jan 2003 19:38:17 -0000 @@ -28,6 +28,6 @@ /** creates new ToggleBreakpointAction instance */ public ToggleBreakpointAction() { - super(toggleBreakpointMenu, toggleBreakpointPopup, "org.openide.actions.ToggleBreakpointAction", toggleBreakpointShortcut); + super(toggleBreakpointMenu, toggleBreakpointPopup, "org.netbeans.modules.debugger.support.actions.ToggleBreakpointAction", toggleBreakpointShortcut); } -} \ No newline at end of file +} Index: openide/l10n.list =================================================================== RCS file: /cvs/openide/l10n.list,v retrieving revision 1.3 diff -u -r1.3 l10n.list --- openide/l10n.list 27 Jan 2003 15:28:08 -0000 1.3 +++ openide/l10n.list 27 Jan 2003 20:12:38 -0000 @@ -1,5 +1,4 @@ openide/compiler/src/org/openide/compiler/Bundle.properties -openide/deprecated/src/org/openide/debugger/Bundle.properties openide/deprecated/src/org/openide/deprecated/Bundle.properties openide/deprecated/src/org/openide/explorer/propertysheet/editors/Bundle.properties openide/deprecated/src/org/openide/modules/Bundle.properties Index: debuggercore/l10n.list =================================================================== RCS file: /cvs/debuggercore/l10n.list,v retrieving revision 1.5 diff -u -r1.5 l10n.list --- debuggercore/l10n.list 3 Jan 2002 13:19:43 -0000 1.5 +++ debuggercore/l10n.list 27 Jan 2003 20:12:38 -0000 @@ -7,5 +7,5 @@ debuggercore/src/org/netbeans/modules/debugger/support/java/Bundle.properties debuggercore/src/org/netbeans/modules/debugger/support/java/nodes/Bundle.properties debuggercore/src/org/netbeans/modules/debugger/multisession/Bundle.properties -debuggercore/src/org/netbeans/modules/debugger/multisession/actions/Bundle.properties -debuggercore/src/org/netbeans/modules/debugger/multisession/nodes/Bundle.properties +debuggercore/oldapi/src/org/openide/debugger/module/Bundle.properties +debuggercore/oldapi/src/org/openide/debugger/Bundle.properties