Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2002-08-05 18:14:16 +0000
committerJared Burns2002-08-05 18:14:16 +0000
commitfe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c (patch)
tree3c351c292e0c5a5b5c483a89c9f31adb64e5ca38
parent19dde7bbedba3a357349ab300ced8148b63fc4af (diff)
downloadeclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.tar.gz
eclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.tar.xz
eclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.zip
*** keyword substitution change ***
-rw-r--r--org.eclipse.debug.core/.project42
-rw-r--r--org.eclipse.debug.core/build.properties14
-rw-r--r--org.eclipse.debug.core/buildnotes_platform-debug.html82
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java796
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java140
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java1080
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java124
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java288
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java64
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java92
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java176
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java342
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java684
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java82
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java240
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java286
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java88
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java418
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java54
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java776
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java514
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java430
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java114
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java184
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java88
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java122
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java86
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java88
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java152
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java92
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java142
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java62
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java112
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java124
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java352
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java170
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java86
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java102
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java114
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java80
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java210
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java194
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java158
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java178
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java106
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html194
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/package.html128
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java1164
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java52
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties110
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java378
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java248
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java924
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java1042
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java304
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java978
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java2222
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java262
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java344
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ProcessMonitor.java158
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java580
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java198
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core.html80
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_breakpoints.html126
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_launch_configuration_types.html190
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_source_locators.html118
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_status_handlers.html142
-rw-r--r--org.eclipse.debug.core/plugin.properties36
-rw-r--r--org.eclipse.debug.core/plugin.xml98
-rw-r--r--org.eclipse.debug.core/scripts/exportplugin.xml64
-rw-r--r--org.eclipse.debug.ui/.project46
-rw-r--r--org.eclipse.debug.ui/build.properties18
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html72
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugActionGroups.html130
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugModelPresentations.html126
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html128
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTypeImages.html102
-rw-r--r--org.eclipse.debug.ui/plugin.properties162
-rw-r--r--org.eclipse.debug.ui/plugin.xml1410
-rw-r--r--org.eclipse.debug.ui/scripts/exportplugin.xml70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java482
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java1070
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPropertiesAdapterFactory.java164
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java584
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java396
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java646
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractListenerActionDelegate.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java132
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties212
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ChangeVariableValueAction.java284
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ClearOutputAction.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConsoleTerminateActionDelegate.java168
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyToClipboardActionDelegate.java400
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyVariablesToClipboardActionDelegate.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugDropDownAction.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java180
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisableBreakpointsAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisconnectActionDelegate.java116
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EnableBreakpointsAction.java492
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchDropDownAction.java674
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenBreakpointMarkerAction.java170
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java194
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchHistoryLaunchAction.java126
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java230
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllBreakpointsAction.java196
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllExpressionsAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java292
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveBreakpointAction.java160
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveExpressionAction.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ResumeActionDelegate.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunDropDownAction.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ShowTypesAction.java162
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepActionDelegate.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepIntoActionDelegate.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepOverActionDelegate.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepReturnActionDelegate.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SuspendActionDelegate.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateActionDelegate.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAllAction.java186
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAndRemoveActionDelegate.java150
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerAction.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerGotoLineAction.java214
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java166
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java6118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationHistoryElement.java220
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java224
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties174
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java562
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandler.java380
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandlerView.java96
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java1492
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java1476
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java554
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java266
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java1284
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java338
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java182
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java404
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java126
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html144
155 files changed, 23636 insertions, 23636 deletions
diff --git a/org.eclipse.debug.core/.project b/org.eclipse.debug.core/.project
index 7fa91f5ad..39bc07d38 100644
--- a/org.eclipse.debug.core/.project
+++ b/org.eclipse.debug.core/.project
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.debug.core</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.apache.xerces</project>
- <project>org.eclipse.core.resources</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.debug.core</name>
+ <comment></comment>
+ <projects>
+ <project>org.eclipse.core.boot</project>
+ <project>org.eclipse.core.runtime</project>
+ <project>org.apache.xerces</project>
+ <project>org.eclipse.core.resources</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.debug.core/build.properties b/org.eclipse.debug.core/build.properties
index 9a9904eb2..2696ed9f8 100644
--- a/org.eclipse.debug.core/build.properties
+++ b/org.eclipse.debug.core/build.properties
@@ -1,7 +1,7 @@
-bin.includes = .options,\
- plugin.xml,\
- plugin.properties,\
- *.jar,\
- about.html
-source.dtcore.jar = core/
-src.includes=about.html
+bin.includes = .options,\
+ plugin.xml,\
+ plugin.properties,\
+ *.jar,\
+ about.html
+source.dtcore.jar = core/
+src.includes=about.html
diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html
index 54ef7f58b..504927383 100644
--- a/org.eclipse.debug.core/buildnotes_platform-debug.html
+++ b/org.eclipse.debug.core/buildnotes_platform-debug.html
@@ -1,41 +1,41 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
- <title>Platform Debug Release Notes</title>
-</head>
-<body>
-
-<h1>
-Eclipse Platform Build Notes&nbsp;<br>
-Platform Debug</h1>
-August ??, 2002
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=21585">21585</a>: Evaluating expression switches editors<br>
-
-<h1>
-Eclipse Platform Build Notes&nbsp;<br>
-Platform Debug</h1>
-July 30, 2002
-
-<h3>
-Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=21504">21504</a>: Both "enable" and "disable" breakpoints actions are enabled when multiple breakpoints are selected<br>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20431">20431</a>: Run/debug include in favorites setting ineffective<br>
-
-<h1>
-Eclipse Platform Build Notes&nbsp;<br>
-Platform Debug</h1>
-July 16, 2002
-
-<h3>
-Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=19099">19099</a>: Console in different window keeps name of terminated and removed debug target<br>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20504">20504</a>: Launch view accelerator update workaround no longer needed<br>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20602">20602</a>: Potential NPE in AbstractDebugView when subclass does not persist state in memento<br>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20610">20610</a>: [Console] Terminate button disabled on Clear Console, even when app still running<br>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20713">20713</a>: 2 requests to change value of variable when enter pressed on invalid value.<br>
-
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="IBM">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <title>Platform Debug Release Notes</title>
+</head>
+<body>
+
+<h1>
+Eclipse Platform Build Notes&nbsp;<br>
+Platform Debug</h1>
+August ??, 2002
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=21585">21585</a>: Evaluating expression switches editors<br>
+
+<h1>
+Eclipse Platform Build Notes&nbsp;<br>
+Platform Debug</h1>
+July 30, 2002
+
+<h3>
+Problem Reports Fixed</h3>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=21504">21504</a>: Both "enable" and "disable" breakpoints actions are enabled when multiple breakpoints are selected<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20431">20431</a>: Run/debug include in favorites setting ineffective<br>
+
+<h1>
+Eclipse Platform Build Notes&nbsp;<br>
+Platform Debug</h1>
+July 16, 2002
+
+<h3>
+Problem Reports Fixed</h3>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=19099">19099</a>: Console in different window keeps name of terminated and removed debug target<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20504">20504</a>: Launch view accelerator update workaround no longer needed<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20602">20602</a>: Potential NPE in AbstractDebugView when subclass does not persist state in memento<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20610">20610</a>: [Console] Terminate button disabled on Clear Console, even when app still running<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=20713">20713</a>: 2 requests to change value of variable when enter pressed on invalid value.<br>
+
+</body>
+</html>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
index ff0454382..3db2baeb2 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
@@ -1,398 +1,398 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.EventObject;
-
-import org.eclipse.debug.internal.core.DebugCoreMessages;
-
-/**
- * A debug event describes an event in a program being debugged or
- * in a running process. Debug models and process implementations
- * are required to generate debug events as specified by this class.
- * <p>
- * The following list defines the events generated for each debug
- * model element.
- * The <code>getSource()</code> method of a debug event
- * returns the element associated with the event.
- * Creation events are guaranteed to occur in a top
- * down order - that is, parents are created before children.
- * Termination events are guaranteed to occur in a bottom up order -
- * that is, children before parents. However, termination events are not guaranteed
- * for all elements that are created. That is, terminate events can be coalesced - a
- * terminate event for a parent signals that all children have been terminated.
- * </p>
- * <p>
- * The generic <code>CHANGE</code> event can be fired at any time by any element.
- * Generally, a client of a debug model, such as as a UI, can get sufficient
- * information to update by listening/responding to the other event kinds. However,
- * if a debug model needs to inform clients of a change that is not specified
- * by create/terminate/suspend/resume, the <code>CHANGE</code> event may be used.
- * For example, generally, the only way a thread or any of its children can change
- * state between a suspend and resume operation, is if the thread or owning debug
- * target is terminated. However, if a debug model supports some other operation
- * that would allow a debug element to change state while suspended, the debug model
- * would fire a change event for that element. The valid detail codes for a
- * change event are:<ul>
- * <li><code>STATE</code> - indicates the state of an element has changed, but its
- * children are not affected. A client would use a state change event to update
- * a label of the affected element, but would not update any children.</li>
- * <li><code>CONTENT</code> - indicates that a debug element's value or contents have
- * changed in some way. For example, when the value of a variable is changed
- * explicitly, the variable should fire a content change event.</li>
- * </ul>
- * </p>
- * <ul>
- * <li><code>IProcess</code>
- * <ul>
- * <li><code>CREATE</code> - a process has been created and is executing.</li>
- * <li><code>TERMINATE</code> - a process has terminated.</li>
- * </ul>
- * <li><code>IDebugTarget</code>
- * <ul>
- * <li><code>CREATE</code> - a debug target has been created and is ready
- * to begin a debug session.</li>
- * <li><code>TERMINATE</code> - a debug target has terminated and the debug
- * session has ended.</li>
- * <li><code>SUSPEND</code> - a debug target has suspended. Event detail provides
- * the reason for the suspension:<ul>
- * <li><code>STEP_END</code> - a request to step has completed</li>
- * <li><code>BREAKPOINT</code> - a breakpoint has been hit</li>
- * <li><code>CLIENT_REQUEST</code> - a client request has caused the target to suspend
- * (i.e. an explicit call to <code>suspend()</code>)</li>
- * <li><code>UNSPECIFIED</code> - the reason for the suspend is not specified</li>
- * </ul>
- * </li>
- * <li><code>RESUME</code> - a debug target has resumed. Event detail provides
- * the reason for the resume:<ul>
- * <li><code>STEP_INTO</code> - a target is being resumed because of a request to step into</li>
- * <li><code>STEP_OVER</code> - a target is being resumed because of a request to step over</li>
- * <li><code>STEP_RETURN</code> - a target is being resumed because of a request to step return</li>
- * <li><code>CLIENT_REQUEST</code> - a client request has caused the target to be resumed
- * (i.e. an explicit call to <code>resume()</code>)</li>
- * <li><code>UNSPECIFIED</code> - The reason for the resume is not specified</li>
- * </ul>
- * </li>
- * </ul>
- * </li>
- * <li><code>IThread</code>
- * <ul>
- * <li><code>CREATE</code> - a thread has been created in a debug target.</li>
- * <li><code>TERMINATE</code> - a thread has terminated.</li>
- * <li><code>SUSPEND</code> - a thread has suspended execution. Event detail provides
- * the reason for the suspension:<ul>
- * <li><code>STEP_END</code> - a request to step has completed</li>
- * <li><code>BREAKPOINT</code> - a breakpoint has been hit</li>
- * <li><code>CLIENT_REQUEST</code> - a client request has caused the thread to suspend
- * (i.e. an explicit call to <code>suspend()</code>)</li>
- * <li><code>EVALUATION</code> - an expression evaluation has ended that may
- * have had side effects in the debug target.</li>
- * <li><code>EVALUATION_IMPLICIT</code> - an expression evaluation has ended that
- * had no side effects in the debug target.</li>
- * <li><code>UNSPECIFIED</code> - the reason for the suspend is not specified</li>
- * </ul>
- * </li>
- * <li><code>RESUME</code> - a thread has resumed execution. Event detail provides
- * the reason for the resume:<ul>
- * <li><code>STEP_INTO</code> - a thread is being resumed because of a request to step into</li>
- * <li><code>STEP_OVER</code> - a thread is being resumed because of a request to step over</li>
- * <li><code>STEP_RETURN</code> - a thread is being resumed because of a request to step return</li>
- * <li><code>CLIENT_REQUEST</code> - a client request has caused the thread to be resumed
- * (i.e. an explicit call to <code>resume()</code>)</li>
- * <li><code>EVALUATION</code> - an expression evaluation has started that may
- * have side effects in the debug target.</li>
- * <li><code>EVALUATION_IMPLICIT</code> - an expression evaluation has started that
- * will have no side effects in the debug target.</li>
- * <li><code>UNSPECIFIED</code> - The reason for the resume is not specified</li>
- * </ul>
- * </li>
- * </ul>
- * </li>
- * <li><code>IStackFrame</code> - no events are specified for stack frames.
- * When a thread is suspended, it has stack frames. When a thread resumes,
- * stack frames are unavailable.
- * </li>
- * <li><code>IVariable</code> - no events are specified for variables.
- * When a thread is suspended, stack frames have variables. When a thread resumes,
- * variables are unavailable.
- * </li>
- * <li><code>IValue</code> - no events are specified for values.
- * </li>
- * </ul>
- * <p>
- * Clients may instantiate this class. Clients are not intended to subclass this class.
- * </p>
- */
-public final class DebugEvent extends EventObject {
-
- /**
- * Resume event kind.
- */
- public static final int RESUME= 0x0001;
-
- /**
- * Suspend event kind.
- */
- public static final int SUSPEND= 0x0002;
-
- /**
- * Create event kind.
- */
- public static final int CREATE= 0x0004;
-
- /**
- * Terminate event kind.
- */
- public static final int TERMINATE= 0x0008;
-
- /**
- * Change event kind.
- */
- public static final int CHANGE= 0x0010;
-
- /**
- * Step start detail. Indicates a thread was resumed by a step
- * into action.
- * @since 2.0
- */
- public static final int STEP_INTO= 0x0001;
-
- /**
- * Step start detail. Indicates a thread was resumed by a step
- * over action.
- * @since 2.0
- */
- public static final int STEP_OVER= 0x0002;
-
- /**
- * Step start detail. Indicates a thread was resumed by a step
- * return action.
- * @since 2.0
- */
- public static final int STEP_RETURN= 0x0004;
-
- /**
- * Step end detail. Indicates a thread was suspended due
- * to the completion of a step action.
- */
- public static final int STEP_END= 0x0008;
-
- /**
- * Breakpoint detail. Indicates a thread was suspended by
- * a breakpoint.
- */
- public static final int BREAKPOINT= 0x0010;
-
- /**
- * Client request detail. Indicates a thread was suspended due
- * to a client request.
- */
- public static final int CLIENT_REQUEST= 0x0020;
-
- /**
- * Evaluation detail. Indicates that a thread was resumed or
- * suspended to perform an expression evaluation.
- *
- * @since 2.0
- */
- public static final int EVALUATION = 0x0040;
-
- /**
- * Evaluation detail. Indicates that a thread was resumed or
- * suspended to perform an implicit expression evaluation.
- * An implicit evaluation is an evaluation that is performed
- * as an indirect result of a user action.
- * Clients may use this detail event to decide whether or not
- * to alert the user that an evaluation is taking place..
- *
- * @since 2.0
- */
- public static final int EVALUATION_IMPLICIT = 0x0080;
-
- /**
- * State change detail. Indicates the state of a single
- * debug element has changed. Only valid for <code>CHANGE</code>
- * events.
- *
- * @since 2.0
- */
- public static final int STATE = 0x0100;
-
- /**
- * Content change detail. Indicates the content of a debug element
- * (and potentially its children) has changed. Only valid for
- * <code>CHANGE</code> events.
- *
- * @since 2.0
- */
- public static final int CONTENT = 0x0200;
-
- /**
- * Constant indicating that the kind or detail of a debug
- * event is unspecified.
- */
- public static final int UNSPECIFIED = 0;
-
- /**
- * The kind of event - one of the kind constants defined by
- * this class.
- */
- private int fKind= UNSPECIFIED;
-
- /**
- * The detail of the event - one of the detail constants defined by
- * this class.
- */
- private int fDetail= UNSPECIFIED;
- /**
- * Constructs a new debug event of the given kind with a detail code of
- * <code>UNSPECIFIED</code>.
- *
- * @param eventSource the object associated with the event
- * @param kind the kind of debug event (one of the
- * kind constants defined by this class)
- */
- public DebugEvent(Object eventSource, int kind) {
- this(eventSource, kind, UNSPECIFIED);
- }
-
- /**
- * Constructs a new debug event of the given kind with the given detail.
- *
- * @param eventSource the object associated with the event
- * @param kind the kind of debug event (one of the
- * kind constants defined by this class)
- * @param detail extra information about the event (one of the
- * detail constants defined by this class)
- */
- public DebugEvent(Object eventSource, int kind, int detail) {
- super(eventSource);
- if ((kind & (RESUME | SUSPEND | CREATE | TERMINATE | CHANGE)) == 0)
- throw new IllegalArgumentException(DebugCoreMessages.getString("DebugEvent.illegal_kind")); //$NON-NLS-1$
- if (detail != UNSPECIFIED && (detail & (STEP_END | STEP_INTO | STEP_OVER | STEP_RETURN | BREAKPOINT | CLIENT_REQUEST |EVALUATION | EVALUATION_IMPLICIT | STATE | CONTENT)) == 0)
- throw new IllegalArgumentException(DebugCoreMessages.getString("DebugEvent.illegal_detail")); //$NON-NLS-1$
- fKind= kind;
- fDetail= detail;
- }
-
- /**
- * Returns a constant describing extra detail about the event - one
- * of the detail constants defined by this class, possibly
- * <code>UNSPECIFIED</code>.
- *
- * @return the detail code
- */
- public int getDetail() {
- return fDetail;
- }
-
- /**
- * Returns this event's kind - one of the kind constants defined by this class.
- *
- * @return the kind code
- */
- public int getKind() {
- return fKind;
- }
-
- /**
- * Returns whether this event's detail indicates the
- * beginning of a step event. This event's detail is one
- * of <code>STEP_INTO</code>, <code>STEP_OVER</code>, or
- * <code>STEP_RETURN</code>.
- *
- * @return whether this event's detail indicates the beginning
- * of a step event.
- * @since 2.0
- */
- public boolean isStepStart() {
- return (getDetail() & (STEP_INTO | STEP_OVER | STEP_RETURN)) > 0;
- }
-
- /**
- * Returns whether this event's detail indicates an
- * evaluation. This event's detail is one
- * of <code>EVALUATION</code>, or <code>EVALUATION_IMPLICIT</code>.
- *
- * @return whether this event's detail indicates an evaluation.
- * @since 2.0
- */
- public boolean isEvaluation() {
- return (getDetail() & (EVALUATION | EVALUATION_IMPLICIT)) > 0;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buf = new StringBuffer("DebugEvent["); //$NON-NLS-1$
- if (getSource() != null) {
- buf.append(getSource().toString());
- } else {
- buf.append("null"); //$NON-NLS-1$
- }
- buf.append(", "); //$NON-NLS-1$
- switch (getKind()) {
- case CREATE:
- buf.append("CREATE"); //$NON-NLS-1$
- break;
- case TERMINATE:
- buf.append("TERMINATE"); //$NON-NLS-1$
- break;
- case RESUME:
- buf.append("RESUME"); //$NON-NLS-1$
- break;
- case SUSPEND:
- buf.append("SUSPEND"); //$NON-NLS-1$
- break;
- case CHANGE:
- buf.append("CHANGE"); //$NON-NLS-1$
- break;
- case UNSPECIFIED:
- buf.append("UNSPECIFIED"); //$NON-NLS-1$
- break;
- }
- buf.append(", "); //$NON-NLS-1$
- switch (getDetail()) {
- case BREAKPOINT:
- buf.append("BREAKPOINT"); //$NON-NLS-1$
- break;
- case CLIENT_REQUEST:
- buf.append("CLIENT_REQUEST"); //$NON-NLS-1$
- break;
- case STEP_END:
- buf.append("STEP_END"); //$NON-NLS-1$
- break;
- case STEP_INTO:
- buf.append("STEP_INTO"); //$NON-NLS-1$
- break;
- case STEP_OVER:
- buf.append("STEP_OVER"); //$NON-NLS-1$
- break;
- case STEP_RETURN:
- buf.append("STEP_RETURN"); //$NON-NLS-1$
- break;
- case EVALUATION:
- buf.append("EVALUATION"); //$NON-NLS-1$
- break;
- case EVALUATION_IMPLICIT:
- buf.append("EVALUATION_IMPLICIT"); //$NON-NLS-1$
- break;
- case STATE:
- buf.append("STATE"); //$NON-NLS-1$
- break;
- case CONTENT:
- buf.append("CONTENT"); //$NON-NLS-1$
- break;
- case UNSPECIFIED:
- buf.append("UNSPECIFIED"); //$NON-NLS-1$
- break;
- }
- buf.append("]"); //$NON-NLS-1$
- return buf.toString();
- }
-}
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.EventObject;
+
+import org.eclipse.debug.internal.core.DebugCoreMessages;
+
+/**
+ * A debug event describes an event in a program being debugged or
+ * in a running process. Debug models and process implementations
+ * are required to generate debug events as specified by this class.
+ * <p>
+ * The following list defines the events generated for each debug
+ * model element.
+ * The <code>getSource()</code> method of a debug event
+ * returns the element associated with the event.
+ * Creation events are guaranteed to occur in a top
+ * down order - that is, parents are created before children.
+ * Termination events are guaranteed to occur in a bottom up order -
+ * that is, children before parents. However, termination events are not guaranteed
+ * for all elements that are created. That is, terminate events can be coalesced - a
+ * terminate event for a parent signals that all children have been terminated.
+ * </p>
+ * <p>
+ * The generic <code>CHANGE</code> event can be fired at any time by any element.
+ * Generally, a client of a debug model, such as as a UI, can get sufficient
+ * information to update by listening/responding to the other event kinds. However,
+ * if a debug model needs to inform clients of a change that is not specified
+ * by create/terminate/suspend/resume, the <code>CHANGE</code> event may be used.
+ * For example, generally, the only way a thread or any of its children can change
+ * state between a suspend and resume operation, is if the thread or owning debug
+ * target is terminated. However, if a debug model supports some other operation
+ * that would allow a debug element to change state while suspended, the debug model
+ * would fire a change event for that element. The valid detail codes for a
+ * change event are:<ul>
+ * <li><code>STATE</code> - indicates the state of an element has changed, but its
+ * children are not affected. A client would use a state change event to update
+ * a label of the affected element, but would not update any children.</li>
+ * <li><code>CONTENT</code> - indicates that a debug element's value or contents have
+ * changed in some way. For example, when the value of a variable is changed
+ * explicitly, the variable should fire a content change event.</li>
+ * </ul>
+ * </p>
+ * <ul>
+ * <li><code>IProcess</code>
+ * <ul>
+ * <li><code>CREATE</code> - a process has been created and is executing.</li>
+ * <li><code>TERMINATE</code> - a process has terminated.</li>
+ * </ul>
+ * <li><code>IDebugTarget</code>
+ * <ul>
+ * <li><code>CREATE</code> - a debug target has been created and is ready
+ * to begin a debug session.</li>
+ * <li><code>TERMINATE</code> - a debug target has terminated and the debug
+ * session has ended.</li>
+ * <li><code>SUSPEND</code> - a debug target has suspended. Event detail provides
+ * the reason for the suspension:<ul>
+ * <li><code>STEP_END</code> - a request to step has completed</li>
+ * <li><code>BREAKPOINT</code> - a breakpoint has been hit</li>
+ * <li><code>CLIENT_REQUEST</code> - a client request has caused the target to suspend
+ * (i.e. an explicit call to <code>suspend()</code>)</li>
+ * <li><code>UNSPECIFIED</code> - the reason for the suspend is not specified</li>
+ * </ul>
+ * </li>
+ * <li><code>RESUME</code> - a debug target has resumed. Event detail provides
+ * the reason for the resume:<ul>
+ * <li><code>STEP_INTO</code> - a target is being resumed because of a request to step into</li>
+ * <li><code>STEP_OVER</code> - a target is being resumed because of a request to step over</li>
+ * <li><code>STEP_RETURN</code> - a target is being resumed because of a request to step return</li>
+ * <li><code>CLIENT_REQUEST</code> - a client request has caused the target to be resumed
+ * (i.e. an explicit call to <code>resume()</code>)</li>
+ * <li><code>UNSPECIFIED</code> - The reason for the resume is not specified</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * </li>
+ * <li><code>IThread</code>
+ * <ul>
+ * <li><code>CREATE</code> - a thread has been created in a debug target.</li>
+ * <li><code>TERMINATE</code> - a thread has terminated.</li>
+ * <li><code>SUSPEND</code> - a thread has suspended execution. Event detail provides
+ * the reason for the suspension:<ul>
+ * <li><code>STEP_END</code> - a request to step has completed</li>
+ * <li><code>BREAKPOINT</code> - a breakpoint has been hit</li>
+ * <li><code>CLIENT_REQUEST</code> - a client request has caused the thread to suspend
+ * (i.e. an explicit call to <code>suspend()</code>)</li>
+ * <li><code>EVALUATION</code> - an expression evaluation has ended that may
+ * have had side effects in the debug target.</li>
+ * <li><code>EVALUATION_IMPLICIT</code> - an expression evaluation has ended that
+ * had no side effects in the debug target.</li>
+ * <li><code>UNSPECIFIED</code> - the reason for the suspend is not specified</li>
+ * </ul>
+ * </li>
+ * <li><code>RESUME</code> - a thread has resumed execution. Event detail provides
+ * the reason for the resume:<ul>
+ * <li><code>STEP_INTO</code> - a thread is being resumed because of a request to step into</li>
+ * <li><code>STEP_OVER</code> - a thread is being resumed because of a request to step over</li>
+ * <li><code>STEP_RETURN</code> - a thread is being resumed because of a request to step return</li>
+ * <li><code>CLIENT_REQUEST</code> - a client request has caused the thread to be resumed
+ * (i.e. an explicit call to <code>resume()</code>)</li>
+ * <li><code>EVALUATION</code> - an expression evaluation has started that may
+ * have side effects in the debug target.</li>
+ * <li><code>EVALUATION_IMPLICIT</code> - an expression evaluation has started that
+ * will have no side effects in the debug target.</li>
+ * <li><code>UNSPECIFIED</code> - The reason for the resume is not specified</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * </li>
+ * <li><code>IStackFrame</code> - no events are specified for stack frames.
+ * When a thread is suspended, it has stack frames. When a thread resumes,
+ * stack frames are unavailable.
+ * </li>
+ * <li><code>IVariable</code> - no events are specified for variables.
+ * When a thread is suspended, stack frames have variables. When a thread resumes,
+ * variables are unavailable.
+ * </li>
+ * <li><code>IValue</code> - no events are specified for values.
+ * </li>
+ * </ul>
+ * <p>
+ * Clients may instantiate this class. Clients are not intended to subclass this class.
+ * </p>
+ */
+public final class DebugEvent extends EventObject {
+
+ /**
+ * Resume event kind.
+ */
+ public static final int RESUME= 0x0001;
+
+ /**
+ * Suspend event kind.
+ */
+ public static final int SUSPEND= 0x0002;
+
+ /**
+ * Create event kind.
+ */
+ public static final int CREATE= 0x0004;
+
+ /**
+ * Terminate event kind.
+ */
+ public static final int TERMINATE= 0x0008;
+
+ /**
+ * Change event kind.
+ */
+ public static final int CHANGE= 0x0010;
+
+ /**
+ * Step start detail. Indicates a thread was resumed by a step
+ * into action.
+ * @since 2.0
+ */
+ public static final int STEP_INTO= 0x0001;
+
+ /**
+ * Step start detail. Indicates a thread was resumed by a step
+ * over action.
+ * @since 2.0
+ */
+ public static final int STEP_OVER= 0x0002;
+
+ /**
+ * Step start detail. Indicates a thread was resumed by a step
+ * return action.
+ * @since 2.0
+ */
+ public static final int STEP_RETURN= 0x0004;
+
+ /**
+ * Step end detail. Indicates a thread was suspended due
+ * to the completion of a step action.
+ */
+ public static final int STEP_END= 0x0008;
+
+ /**
+ * Breakpoint detail. Indicates a thread was suspended by
+ * a breakpoint.
+ */
+ public static final int BREAKPOINT= 0x0010;
+
+ /**
+ * Client request detail. Indicates a thread was suspended due
+ * to a client request.
+ */
+ public static final int CLIENT_REQUEST= 0x0020;
+
+ /**
+ * Evaluation detail. Indicates that a thread was resumed or
+ * suspended to perform an expression evaluation.
+ *
+ * @since 2.0
+ */
+ public static final int EVALUATION = 0x0040;
+
+ /**
+ * Evaluation detail. Indicates that a thread was resumed or
+ * suspended to perform an implicit expression evaluation.
+ * An implicit evaluation is an evaluation that is performed
+ * as an indirect result of a user action.
+ * Clients may use this detail event to decide whether or not
+ * to alert the user that an evaluation is taking place..
+ *
+ * @since 2.0
+ */
+ public static final int EVALUATION_IMPLICIT = 0x0080;
+
+ /**
+ * State change detail. Indicates the state of a single
+ * debug element has changed. Only valid for <code>CHANGE</code>
+ * events.
+ *
+ * @since 2.0
+ */
+ public static final int STATE = 0x0100;
+
+ /**
+ * Content change detail. Indicates the content of a debug element
+ * (and potentially its children) has changed. Only valid for
+ * <code>CHANGE</code> events.
+ *
+ * @since 2.0
+ */
+ public static final int CONTENT = 0x0200;
+
+ /**
+ * Constant indicating that the kind or detail of a debug
+ * event is unspecified.
+ */
+ public static final int UNSPECIFIED = 0;
+
+ /**
+ * The kind of event - one of the kind constants defined by
+ * this class.
+ */
+ private int fKind= UNSPECIFIED;
+
+ /**
+ * The detail of the event - one of the detail constants defined by
+ * this class.
+ */
+ private int fDetail= UNSPECIFIED;
+ /**
+ * Constructs a new debug event of the given kind with a detail code of
+ * <code>UNSPECIFIED</code>.
+ *
+ * @param eventSource the object associated with the event
+ * @param kind the kind of debug event (one of the
+ * kind constants defined by this class)
+ */
+ public DebugEvent(Object eventSource, int kind) {
+ this(eventSource, kind, UNSPECIFIED);
+ }
+
+ /**
+ * Constructs a new debug event of the given kind with the given detail.
+ *
+ * @param eventSource the object associated with the event
+ * @param kind the kind of debug event (one of the
+ * kind constants defined by this class)
+ * @param detail extra information about the event (one of the
+ * detail constants defined by this class)
+ */
+ public DebugEvent(Object eventSource, int kind, int detail) {
+ super(eventSource);
+ if ((kind & (RESUME | SUSPEND | CREATE | TERMINATE | CHANGE)) == 0)
+ throw new IllegalArgumentException(DebugCoreMessages.getString("DebugEvent.illegal_kind")); //$NON-NLS-1$
+ if (detail != UNSPECIFIED && (detail & (STEP_END | STEP_INTO | STEP_OVER | STEP_RETURN | BREAKPOINT | CLIENT_REQUEST |EVALUATION | EVALUATION_IMPLICIT | STATE | CONTENT)) == 0)
+ throw new IllegalArgumentException(DebugCoreMessages.getString("DebugEvent.illegal_detail")); //$NON-NLS-1$
+ fKind= kind;
+ fDetail= detail;
+ }
+
+ /**
+ * Returns a constant describing extra detail about the event - one
+ * of the detail constants defined by this class, possibly
+ * <code>UNSPECIFIED</code>.
+ *
+ * @return the detail code
+ */
+ public int getDetail() {
+ return fDetail;
+ }
+
+ /**
+ * Returns this event's kind - one of the kind constants defined by this class.
+ *
+ * @return the kind code
+ */
+ public int getKind() {
+ return fKind;
+ }
+
+ /**
+ * Returns whether this event's detail indicates the
+ * beginning of a step event. This event's detail is one
+ * of <code>STEP_INTO</code>, <code>STEP_OVER</code>, or
+ * <code>STEP_RETURN</code>.
+ *
+ * @return whether this event's detail indicates the beginning
+ * of a step event.
+ * @since 2.0
+ */
+ public boolean isStepStart() {
+ return (getDetail() & (STEP_INTO | STEP_OVER | STEP_RETURN)) > 0;
+ }
+
+ /**
+ * Returns whether this event's detail indicates an
+ * evaluation. This event's detail is one
+ * of <code>EVALUATION</code>, or <code>EVALUATION_IMPLICIT</code>.
+ *
+ * @return whether this event's detail indicates an evaluation.
+ * @since 2.0
+ */
+ public boolean isEvaluation() {
+ return (getDetail() & (EVALUATION | EVALUATION_IMPLICIT)) > 0;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer("DebugEvent["); //$NON-NLS-1$
+ if (getSource() != null) {
+ buf.append(getSource().toString());
+ } else {
+ buf.append("null"); //$NON-NLS-1$
+ }
+ buf.append(", "); //$NON-NLS-1$
+ switch (getKind()) {
+ case CREATE:
+ buf.append("CREATE"); //$NON-NLS-1$
+ break;
+ case TERMINATE:
+ buf.append("TERMINATE"); //$NON-NLS-1$
+ break;
+ case RESUME:
+ buf.append("RESUME"); //$NON-NLS-1$
+ break;
+ case SUSPEND:
+ buf.append("SUSPEND"); //$NON-NLS-1$
+ break;
+ case CHANGE:
+ buf.append("CHANGE"); //$NON-NLS-1$
+ break;
+ case UNSPECIFIED:
+ buf.append("UNSPECIFIED"); //$NON-NLS-1$
+ break;
+ }
+ buf.append(", "); //$NON-NLS-1$
+ switch (getDetail()) {
+ case BREAKPOINT:
+ buf.append("BREAKPOINT"); //$NON-NLS-1$
+ break;
+ case CLIENT_REQUEST:
+ buf.append("CLIENT_REQUEST"); //$NON-NLS-1$
+ break;
+ case STEP_END:
+ buf.append("STEP_END"); //$NON-NLS-1$
+ break;
+ case STEP_INTO:
+ buf.append("STEP_INTO"); //$NON-NLS-1$
+ break;
+ case STEP_OVER:
+ buf.append("STEP_OVER"); //$NON-NLS-1$
+ break;
+ case STEP_RETURN:
+ buf.append("STEP_RETURN"); //$NON-NLS-1$
+ break;
+ case EVALUATION:
+ buf.append("EVALUATION"); //$NON-NLS-1$
+ break;
+ case EVALUATION_IMPLICIT:
+ buf.append("EVALUATION_IMPLICIT"); //$NON-NLS-1$
+ break;
+ case STATE:
+ buf.append("STATE"); //$NON-NLS-1$
+ break;
+ case CONTENT:
+ buf.append("CONTENT"); //$NON-NLS-1$
+ break;
+ case UNSPECIFIED:
+ buf.append("UNSPECIFIED"); //$NON-NLS-1$
+ break;
+ }
+ buf.append("]"); //$NON-NLS-1$
+ return buf.toString();
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
index bca34fc23..ce226d0e7 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
@@ -1,70 +1,70 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-
-
-/**
- * A checked exception representing a failure.
- * <p>
- * Defines status codes relevant to the debug plug-in. When a
- * debug exception is thrown, it contains a status object describing
- * the cause of the exception. The status objects originating from the
- * debug plug-in use the codes defined in this class.
- * </p>
- * <p>
- * Clients may instantiate this class. Clients are not intended to subclass this class.
- * </p>
- * @see IStatus
- */
-public class DebugException extends CoreException {
- /**
- * Indicates a request made of a debug element has failed
- * on the target side.
- */
- public static final int TARGET_REQUEST_FAILED = 5010;
-
- /**
- * Indicates a request is not supported by the capabilities of a debug element.
- * For example, a request was made to terminate an element that does not
- * support termination.
- */
- public static final int NOT_SUPPORTED = 5011;
-
- /**
- * Indicates that a request made of manager has failed, or a request made of a
- * debug element has failed on the client side (that is, before the request was
- * sent to the debug target).
- */
- public static final int REQUEST_FAILED = 5012;
-
- /**
- * Indicates an internal error. This is an unexpected state.
- */
- public static final int INTERNAL_ERROR = 5013;
-
- /**
- * Indicates an improperly configured breakpoint. Breakpoints have a minimal
- * set of required attributes as defined by the breakpoint manager.
- *
- * @see IBreakpointManager
- */
- public static final int CONFIGURATION_INVALID = 5014;
-
- /**
- * Constructs a new debug exception with the given status object.
- *
- * @param status the status object describing this exception
- * @see IStatus
- */
- public DebugException(IStatus status) {
- super(status);
- }
-
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+
+
+/**
+ * A checked exception representing a failure.
+ * <p>
+ * Defines status codes relevant to the debug plug-in. When a
+ * debug exception is thrown, it contains a status object describing
+ * the cause of the exception. The status objects originating from the
+ * debug plug-in use the codes defined in this class.
+ * </p>
+ * <p>
+ * Clients may instantiate this class. Clients are not intended to subclass this class.
+ * </p>
+ * @see IStatus
+ */
+public class DebugException extends CoreException {
+ /**
+ * Indicates a request made of a debug element has failed
+ * on the target side.
+ */
+ public static final int TARGET_REQUEST_FAILED = 5010;
+
+ /**
+ * Indicates a request is not supported by the capabilities of a debug element.
+ * For example, a request was made to terminate an element that does not
+ * support termination.
+ */
+ public static final int NOT_SUPPORTED = 5011;
+
+ /**
+ * Indicates that a request made of manager has failed, or a request made of a
+ * debug element has failed on the client side (that is, before the request was
+ * sent to the debug target).
+ */
+ public static final int REQUEST_FAILED = 5012;
+
+ /**
+ * Indicates an internal error. This is an unexpected state.
+ */
+ public static final int INTERNAL_ERROR = 5013;
+
+ /**
+ * Indicates an improperly configured breakpoint. Breakpoints have a minimal
+ * set of required attributes as defined by the breakpoint manager.
+ *
+ * @see IBreakpointManager
+ */
+ public static final int CONFIGURATION_INVALID = 5014;
+
+ /**
+ * Constructs a new debug exception with the given status object.
+ *
+ * @param status the status object describing this exception
+ * @see IStatus
+ */
+ public DebugException(IStatus status) {
+ super(status);
+ }
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index 4a7896780..e810dc4b6 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -1,540 +1,540 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.core.BreakpointManager;
-import org.eclipse.debug.internal.core.DebugCoreMessages;
-import org.eclipse.debug.internal.core.ExpressionManager;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.core.ListenerList;
-import org.eclipse.debug.internal.core.RuntimeProcess;
-
-/**
- * There is one instance of the debug plug-in available from
- * <code>DebugPlugin.getDefault()</code>. The debug plug-in provides:
- * <ul>
- * <li>access to the breakpoint manager</li>
- * <li>access to the launch manager</li>
- * <li>access to the expression manager</li>
- * <li>access to the registered launcher extensions</li>
- * <li>debug event notification</li>
- * <li>status handlers</li>
- * </ul>
- * <p>
- * Clients may not instantiate or subclass this class.
- * </p>
- */
-public class DebugPlugin extends Plugin {
-
- /**
- * Simple identifier constant (value <code>"launchConfigurationTypes"</code>)
- * for the launch configuration types extension point.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES= "launchConfigurationTypes"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"launchConfigurationComparators"</code>)
- * for the launch configuration comparators extension point.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS= "launchConfigurationComparators"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"breakpoints"</code>) for the
- * breakpoints extension point.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_BREAKPOINTS= "breakpoints"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"statusHandlers"</code>) for the
- * status handlers extension point.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_STATUS_HANDLERS= "statusHandlers"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"sourceLocators"</code>) for the
- * source locators extension point.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- /**
- * The singleton debug plug-in instance.
- */
- private static DebugPlugin fgDebugPlugin= null;
-
- /**
- * The singleton breakpoint manager.
- */
- private BreakpointManager fBreakpointManager;
-
- /**
- * The singleton expression manager.
- */
- private ExpressionManager fExpressionManager;
-
- /**
- * The singleton launch manager.
- */
- private LaunchManager fLaunchManager;
-
- /**
- * The collection of debug event listeners.
- */
- private ListenerList fEventListeners= new ListenerList(20);
-
- /**
- * Event filters, or <code>null</code> if none.
- */
- private ListenerList fEventFilters = null;
-
- /**
- * Whether this plugin is in the process of shutting
- * down.
- */
- private boolean fShuttingDown= false;
-
- /**
- * Table of status handlers. Keys are {plug-in identifier, status code}
- * pairs, and values are associated <code>IConfigurationElement</code>s.
- */
- private HashMap fStatusHandlers = null;
-
- /**
- * Returns the singleton instance of the debug plug-in.
- */
- public static DebugPlugin getDefault() {
- return fgDebugPlugin;
- }
-
- /**
- * Sets the singleton instance of the debug plug-in.
- *
- * @param plugin the debug plug-in, or <code>null</code>
- * when shutting down
- */
- private static void setDefault(DebugPlugin plugin) {
- fgDebugPlugin = plugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() == null) {
- // If the default instance is not yet initialized,
- // return a static identifier. This identifier must
- // match the plugin id defined in plugin.xml
- return "org.eclipse.debug.core"; //$NON-NLS-1$
- }
- return getDefault().getDescriptor().getUniqueIdentifier();
- }
-
- /**
- * Constructs the debug plug-in.
- * <p>
- * An instance of this plug-in runtime class is automatically created
- * when the facilities provided by this plug-in are required.
- * <b>Clients must never explicitly instantiate a plug-in runtime class.</b>
- * </p>
- *
- * @param pluginDescriptor the plug-in descriptor for the
- * debug plug-in
- */
- public DebugPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- setDefault(this);
- }
-
- /**
- * Adds the given listener to the collection of registered debug
- * event listeners. Has no effect if an identical listener is already
- * registered.
- *
- * @param listener the listener to add
- * @since 2.0
- */
- public void addDebugEventListener(IDebugEventSetListener listener) {
- fEventListeners.add(listener);
- }
-
- /**
- * Notifies all registered debug event set listeners of the given
- * debug events. Events which are filtered by a registered debug event
- * filter are not fired.
- *
- * @param events array of debug events to fire
- * @see IDebugEventFilter
- * @see IDebugEventSetListener
- * @since 2.0
- */
- public void fireDebugEventSet(DebugEvent[] events) {
- if (isShuttingDown() || events == null)
- return;
- events = filterEvents(events);
- if (events == null) {
- return;
- } else {
- Object[] listeners= getEventListeners();
- for (int i= 0; i < listeners.length; i++) {
- ((IDebugEventSetListener)listeners[i]).handleDebugEvents(events);
- }
- }
- }
-
- /**
- * Returns a collection of events, based on the given event
- * set, removing any events that are filtered by registered
- * debug event filters. Returns <code>null</code> or an empty
- * collection if all events are filtered.
- *
- * @param events the event set to filter
- * @return filtered event set
- */
- private DebugEvent[] filterEvents(DebugEvent[] events) {
- if (hasEventFilters()) {
- Object[] filters = fEventFilters.getListeners();
- for (int i = 0; i < filters.length; i++) {
- events = ((IDebugEventFilter)filters[i]).filterDebugEvents(events);
- if (events == null || events.length == 0) {
- break;
- }
- }
-
- }
- return events;
- }
-
- /**
- * Returns the breakpoint manager.
- *
- * @return the breakpoint manager
- * @see IBreakpointManager
- */
- public IBreakpointManager getBreakpointManager() {
- return fBreakpointManager;
- }
-
- /**
- * Returns the launch manager.
- *
- * @return the launch manager
- * @see ILaunchManager
- */
- public ILaunchManager getLaunchManager() {
- return fLaunchManager;
- }
-
- /**
- * Returns the status handler registered for the given
- * status, or <code>null</code> if none.
- *
- * @return the status handler registered for the given
- * status, or <code>null</code> if none
- * @since 2.0
- */
- public IStatusHandler getStatusHandler(IStatus status) {
- StatusHandlerKey key = new StatusHandlerKey(status.getPlugin(), status.getCode());
- if (fStatusHandlers == null) {
- try {
- initializeStatusHandlers();
- } catch (CoreException exception) {
- log(exception);
- return null;
- }
- }
- IConfigurationElement config = (IConfigurationElement)fStatusHandlers.get(key);
- if (config != null) {
- try {
- return (IStatusHandler)config.createExecutableExtension("class"); //$NON-NLS-1$
- } catch (CoreException e) {
- log(e);
- }
- }
- return null;
- }
-
- /**
- * Returns the expression manager.
- *
- * @return the expression manager
- * @see IExpressionManager
- * @since 2.0
- */
- public IExpressionManager getExpressionManager() {
- return fExpressionManager;
- }
-
- /**
- * Removes the given listener from the collection of registered debug
- * event listeners. Has no effect if an identical listener is not already
- * registered.
- *
- * @param listener the listener to remove
- * @since 2.0
- */
- public void removeDebugEventListener(IDebugEventSetListener listener) {
- fEventListeners.remove(listener);
- }
-
- /**
- * Shuts down this debug plug-in and discards all plug-in state.
- * <p>
- * This method will be automatically invoked by the platform when
- * the platform is shut down.
- * </p>
- * <b>Clients must never explicitly call this method.</b>
- *
- * @exception CoreException if this plug-in fails to shut down
- */
- public void shutdown() throws CoreException {
- setShuttingDown(true);
- super.shutdown();
- fLaunchManager.shutdown();
- fBreakpointManager.shutdown();
- fEventListeners.removeAll();
- setDefault(null);
- ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
- }
-
- /**
- * Starts up the debug plug-in. This involves creating the launch and
- * breakpoint managers, creating proxies to all launcher extensions,
- * and restoring all persisted breakpoints.
- * <p>
- * This method is automatically invoked by the platform
- * the first time any code in this plug-in is executed.
- * </p>
- * <b>Clients must never explicitly call this method.</b>
- *
- * @see Plugin#startup
- * @exception CoreException if this plug-in fails to start up
- */
- public void startup() throws CoreException {
- fLaunchManager= new LaunchManager();
- fLaunchManager.startup();
- fBreakpointManager= new BreakpointManager();
- fBreakpointManager.startup();
- fExpressionManager = new ExpressionManager();
- fExpressionManager.startup();
- }
-
- /**
- * Creates and returns a new process representing the given
- * <code>java.lang.Process</code>. A streams proxy is created
- * for the I/O streams in the system process. The process
- * is added to the given launch.
- *
- * @param launch the launch the process is conatined in
- * @param process the system process to wrap
- * @param label the label assigned to the process
- * @return the process
- * @see IProcess
- */
- public static IProcess newProcess(ILaunch launch, Process process, String label) {
- return new RuntimeProcess(launch, process, label);
- }
-
- /**
- * Returns whether this plug-in is in the process of
- * being shutdown.
- *
- * @return whether this plug-in is in the process of
- * being shutdown
- */
- private boolean isShuttingDown() {
- return fShuttingDown;
- }
-
- /**
- * Sets whether this plug-in is in the process of
- * being shutdown.
- *
- * @param value whether this plug-in is in the process of
- * being shutdown
- */
- private void setShuttingDown(boolean value) {
- fShuttingDown = value;
- }
-
- /**
- * Returns the collection of debug event listeners registered
- * with this plug-in.
- *
- * @return list of registered debug event listeners, instances
- * of <code>IDebugEventSetListeners</code>
- */
- private Object[] getEventListeners() {
- return fEventListeners.getListeners();
- }
-
- /**
- * Adds the given debug event filter to the registered
- * event filters. Has no effect if an identical filter
- * is already registerd.
- *
- * @param filter debug event filter
- * @since 2.0
- */
- public void addDebugEventFilter(IDebugEventFilter filter) {
- if (fEventFilters == null) {
- fEventFilters = new ListenerList(2);
- }
- fEventFilters.add(filter);
- }
-
- /**
- * Removes the given debug event filter from the registered
- * event filters. Has no effect if an identical filter
- * is not already registered.
- *
- * @param filter debug event filter
- * @since 2.0
- */
- public void removeDebugEventFilter(IDebugEventFilter filter) {
- if (fEventFilters != null) {
- fEventFilters.remove(filter);
- if (fEventFilters.size() == 0) {
- fEventFilters = null;
- }
- }
- }
-
- /**
- * Logs the given message if in debug mode.
- *
- * @param message the message to log
- * @since 2.0
- */
- public static void logDebugMessage(String message) {
- if (getDefault().isDebugging()) {
- // this message is intentionally not internationalized, as an exception may
- // be due to the resource bundle itself
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Internal message logged from Debug Core: " + message, null)); //$NON-NLS-1$
- }
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- * @since 2.0
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- * @since 2.0
- */
- public static void log(Throwable t) {
- IStatus status= new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Error logged from Debug Core: ", t); //$NON-NLS-1$
- log(status);
- }
-
- /**
- * Register status handlers.
- *
- * @exception CoreException if an exception occurs reading
- * the extensions
- */
- private void initializeStatusHandlers() throws CoreException {
- IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= descriptor.getExtensionPoint(EXTENSION_POINT_STATUS_HANDLERS);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fStatusHandlers = new HashMap(infos.length);
- for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- String id = configurationElement.getAttribute("plugin"); //$NON-NLS-1$
- String code = configurationElement.getAttribute("code"); //$NON-NLS-1$
-
- if (id != null && code != null) {
- try {
- StatusHandlerKey key = new StatusHandlerKey(id, Integer.parseInt(code));
- fStatusHandlers.put(key, configurationElement);
- } catch (NumberFormatException e) {
- // invalid status handler
- invalidStatusHandler(e, configurationElement.getAttribute("id")); //$NON-NLS-1$
- }
- } else {
- // invalid status handler
- invalidStatusHandler(null, configurationElement.getAttribute("id")); //$NON-NLS-1$
- }
- }
- }
-
- private void invalidStatusHandler(Exception e, String id) {
- log(new Status(IStatus.ERROR, getDescriptor().getUniqueIdentifier(), INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("DebugPlugin.Invalid_status_handler_extension__{0}_2"), new String[] {id}), e)); //$NON-NLS-1$
- }
-
- /**
- * Key for status handler extensions - a plug-in identifier/code pair
- */
- class StatusHandlerKey {
-
- String fPluginId;
- int fCode;
-
- StatusHandlerKey(String pluginId, int code) {
- fPluginId = pluginId;
- fCode = code;
- }
-
- public int hashCode() {
- return fPluginId.hashCode() + fCode;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof StatusHandlerKey) {
- StatusHandlerKey s = (StatusHandlerKey)obj;
- return fCode == s.fCode && fPluginId.equals(s.fPluginId);
- }
- return false;
- }
- }
-
- /**
- * Returns whether any event filters are registered
- *
- * @return whether any event filters are registered
- */
- private boolean hasEventFilters() {
- return fEventFilters != null && fEventFilters.size() > 0;
- }
-
-
-
-}
-
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.core.BreakpointManager;
+import org.eclipse.debug.internal.core.DebugCoreMessages;
+import org.eclipse.debug.internal.core.ExpressionManager;
+import org.eclipse.debug.internal.core.LaunchManager;
+import org.eclipse.debug.internal.core.ListenerList;
+import org.eclipse.debug.internal.core.RuntimeProcess;
+
+/**
+ * There is one instance of the debug plug-in available from
+ * <code>DebugPlugin.getDefault()</code>. The debug plug-in provides:
+ * <ul>
+ * <li>access to the breakpoint manager</li>
+ * <li>access to the launch manager</li>
+ * <li>access to the expression manager</li>
+ * <li>access to the registered launcher extensions</li>
+ * <li>debug event notification</li>
+ * <li>status handlers</li>
+ * </ul>
+ * <p>
+ * Clients may not instantiate or subclass this class.
+ * </p>
+ */
+public class DebugPlugin extends Plugin {
+
+ /**
+ * Simple identifier constant (value <code>"launchConfigurationTypes"</code>)
+ * for the launch configuration types extension point.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES= "launchConfigurationTypes"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"launchConfigurationComparators"</code>)
+ * for the launch configuration comparators extension point.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS= "launchConfigurationComparators"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"breakpoints"</code>) for the
+ * breakpoints extension point.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_BREAKPOINTS= "breakpoints"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"statusHandlers"</code>) for the
+ * status handlers extension point.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_STATUS_HANDLERS= "statusHandlers"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"sourceLocators"</code>) for the
+ * source locators extension point.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$
+
+ /**
+ * Status code indicating an unexpected internal error.
+ */
+ public static final int INTERNAL_ERROR = 120;
+
+ /**
+ * The singleton debug plug-in instance.
+ */
+ private static DebugPlugin fgDebugPlugin= null;
+
+ /**
+ * The singleton breakpoint manager.
+ */
+ private BreakpointManager fBreakpointManager;
+
+ /**
+ * The singleton expression manager.
+ */
+ private ExpressionManager fExpressionManager;
+
+ /**
+ * The singleton launch manager.
+ */
+ private LaunchManager fLaunchManager;
+
+ /**
+ * The collection of debug event listeners.
+ */
+ private ListenerList fEventListeners= new ListenerList(20);
+
+ /**
+ * Event filters, or <code>null</code> if none.
+ */
+ private ListenerList fEventFilters = null;
+
+ /**
+ * Whether this plugin is in the process of shutting
+ * down.
+ */
+ private boolean fShuttingDown= false;
+
+ /**
+ * Table of status handlers. Keys are {plug-in identifier, status code}
+ * pairs, and values are associated <code>IConfigurationElement</code>s.
+ */
+ private HashMap fStatusHandlers = null;
+
+ /**
+ * Returns the singleton instance of the debug plug-in.
+ */
+ public static DebugPlugin getDefault() {
+ return fgDebugPlugin;
+ }
+
+ /**
+ * Sets the singleton instance of the debug plug-in.
+ *
+ * @param plugin the debug plug-in, or <code>null</code>
+ * when shutting down
+ */
+ private static void setDefault(DebugPlugin plugin) {
+ fgDebugPlugin = plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() == null) {
+ // If the default instance is not yet initialized,
+ // return a static identifier. This identifier must
+ // match the plugin id defined in plugin.xml
+ return "org.eclipse.debug.core"; //$NON-NLS-1$
+ }
+ return getDefault().getDescriptor().getUniqueIdentifier();
+ }
+
+ /**
+ * Constructs the debug plug-in.
+ * <p>
+ * An instance of this plug-in runtime class is automatically created
+ * when the facilities provided by this plug-in are required.
+ * <b>Clients must never explicitly instantiate a plug-in runtime class.</b>
+ * </p>
+ *
+ * @param pluginDescriptor the plug-in descriptor for the
+ * debug plug-in
+ */
+ public DebugPlugin(IPluginDescriptor descriptor) {
+ super(descriptor);
+ setDefault(this);
+ }
+
+ /**
+ * Adds the given listener to the collection of registered debug
+ * event listeners. Has no effect if an identical listener is already
+ * registered.
+ *
+ * @param listener the listener to add
+ * @since 2.0
+ */
+ public void addDebugEventListener(IDebugEventSetListener listener) {
+ fEventListeners.add(listener);
+ }
+
+ /**
+ * Notifies all registered debug event set listeners of the given
+ * debug events. Events which are filtered by a registered debug event
+ * filter are not fired.
+ *
+ * @param events array of debug events to fire
+ * @see IDebugEventFilter
+ * @see IDebugEventSetListener
+ * @since 2.0
+ */
+ public void fireDebugEventSet(DebugEvent[] events) {
+ if (isShuttingDown() || events == null)
+ return;
+ events = filterEvents(events);
+ if (events == null) {
+ return;
+ } else {
+ Object[] listeners= getEventListeners();
+ for (int i= 0; i < listeners.length; i++) {
+ ((IDebugEventSetListener)listeners[i]).handleDebugEvents(events);
+ }
+ }
+ }
+
+ /**
+ * Returns a collection of events, based on the given event
+ * set, removing any events that are filtered by registered
+ * debug event filters. Returns <code>null</code> or an empty
+ * collection if all events are filtered.
+ *
+ * @param events the event set to filter
+ * @return filtered event set
+ */
+ private DebugEvent[] filterEvents(DebugEvent[] events) {
+ if (hasEventFilters()) {
+ Object[] filters = fEventFilters.getListeners();
+ for (int i = 0; i < filters.length; i++) {
+ events = ((IDebugEventFilter)filters[i]).filterDebugEvents(events);
+ if (events == null || events.length == 0) {
+ break;
+ }
+ }
+
+ }
+ return events;
+ }
+
+ /**
+ * Returns the breakpoint manager.
+ *
+ * @return the breakpoint manager
+ * @see IBreakpointManager
+ */
+ public IBreakpointManager getBreakpointManager() {
+ return fBreakpointManager;
+ }
+
+ /**
+ * Returns the launch manager.
+ *
+ * @return the launch manager
+ * @see ILaunchManager
+ */
+ public ILaunchManager getLaunchManager() {
+ return fLaunchManager;
+ }
+
+ /**
+ * Returns the status handler registered for the given
+ * status, or <code>null</code> if none.
+ *
+ * @return the status handler registered for the given
+ * status, or <code>null</code> if none
+ * @since 2.0
+ */
+ public IStatusHandler getStatusHandler(IStatus status) {
+ StatusHandlerKey key = new StatusHandlerKey(status.getPlugin(), status.getCode());
+ if (fStatusHandlers == null) {
+ try {
+ initializeStatusHandlers();
+ } catch (CoreException exception) {
+ log(exception);
+ return null;
+ }
+ }
+ IConfigurationElement config = (IConfigurationElement)fStatusHandlers.get(key);
+ if (config != null) {
+ try {
+ return (IStatusHandler)config.createExecutableExtension("class"); //$NON-NLS-1$
+ } catch (CoreException e) {
+ log(e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the expression manager.
+ *
+ * @return the expression manager
+ * @see IExpressionManager
+ * @since 2.0
+ */
+ public IExpressionManager getExpressionManager() {
+ return fExpressionManager;
+ }
+
+ /**
+ * Removes the given listener from the collection of registered debug
+ * event listeners. Has no effect if an identical listener is not already
+ * registered.
+ *
+ * @param listener the listener to remove
+ * @since 2.0
+ */
+ public void removeDebugEventListener(IDebugEventSetListener listener) {
+ fEventListeners.remove(listener);
+ }
+
+ /**
+ * Shuts down this debug plug-in and discards all plug-in state.
+ * <p>
+ * This method will be automatically invoked by the platform when
+ * the platform is shut down.
+ * </p>
+ * <b>Clients must never explicitly call this method.</b>
+ *
+ * @exception CoreException if this plug-in fails to shut down
+ */
+ public void shutdown() throws CoreException {
+ setShuttingDown(true);
+ super.shutdown();
+ fLaunchManager.shutdown();
+ fBreakpointManager.shutdown();
+ fEventListeners.removeAll();
+ setDefault(null);
+ ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
+ }
+
+ /**
+ * Starts up the debug plug-in. This involves creating the launch and
+ * breakpoint managers, creating proxies to all launcher extensions,
+ * and restoring all persisted breakpoints.
+ * <p>
+ * This method is automatically invoked by the platform
+ * the first time any code in this plug-in is executed.
+ * </p>
+ * <b>Clients must never explicitly call this method.</b>
+ *
+ * @see Plugin#startup
+ * @exception CoreException if this plug-in fails to start up
+ */
+ public void startup() throws CoreException {
+ fLaunchManager= new LaunchManager();
+ fLaunchManager.startup();
+ fBreakpointManager= new BreakpointManager();
+ fBreakpointManager.startup();
+ fExpressionManager = new ExpressionManager();
+ fExpressionManager.startup();
+ }
+
+ /**
+ * Creates and returns a new process representing the given
+ * <code>java.lang.Process</code>. A streams proxy is created
+ * for the I/O streams in the system process. The process
+ * is added to the given launch.
+ *
+ * @param launch the launch the process is conatined in
+ * @param process the system process to wrap
+ * @param label the label assigned to the process
+ * @return the process
+ * @see IProcess
+ */
+ public static IProcess newProcess(ILaunch launch, Process process, String label) {
+ return new RuntimeProcess(launch, process, label);
+ }
+
+ /**
+ * Returns whether this plug-in is in the process of
+ * being shutdown.
+ *
+ * @return whether this plug-in is in the process of
+ * being shutdown
+ */
+ private boolean isShuttingDown() {
+ return fShuttingDown;
+ }
+
+ /**
+ * Sets whether this plug-in is in the process of
+ * being shutdown.
+ *
+ * @param value whether this plug-in is in the process of
+ * being shutdown
+ */
+ private void setShuttingDown(boolean value) {
+ fShuttingDown = value;
+ }
+
+ /**
+ * Returns the collection of debug event listeners registered
+ * with this plug-in.
+ *
+ * @return list of registered debug event listeners, instances
+ * of <code>IDebugEventSetListeners</code>
+ */
+ private Object[] getEventListeners() {
+ return fEventListeners.getListeners();
+ }
+
+ /**
+ * Adds the given debug event filter to the registered
+ * event filters. Has no effect if an identical filter
+ * is already registerd.
+ *
+ * @param filter debug event filter
+ * @since 2.0
+ */
+ public void addDebugEventFilter(IDebugEventFilter filter) {
+ if (fEventFilters == null) {
+ fEventFilters = new ListenerList(2);
+ }
+ fEventFilters.add(filter);
+ }
+
+ /**
+ * Removes the given debug event filter from the registered
+ * event filters. Has no effect if an identical filter
+ * is not already registered.
+ *
+ * @param filter debug event filter
+ * @since 2.0
+ */
+ public void removeDebugEventFilter(IDebugEventFilter filter) {
+ if (fEventFilters != null) {
+ fEventFilters.remove(filter);
+ if (fEventFilters.size() == 0) {
+ fEventFilters = null;
+ }
+ }
+ }
+
+ /**
+ * Logs the given message if in debug mode.
+ *
+ * @param message the message to log
+ * @since 2.0
+ */
+ public static void logDebugMessage(String message) {
+ if (getDefault().isDebugging()) {
+ // this message is intentionally not internationalized, as an exception may
+ // be due to the resource bundle itself
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Internal message logged from Debug Core: " + message, null)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Logs the specified status with this plug-in's log.
+ *
+ * @param status status to log
+ * @since 2.0
+ */
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ /**
+ * Logs the specified throwable with this plug-in's log.
+ *
+ * @param t throwable to log
+ * @since 2.0
+ */
+ public static void log(Throwable t) {
+ IStatus status= new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Error logged from Debug Core: ", t); //$NON-NLS-1$
+ log(status);
+ }
+
+ /**
+ * Register status handlers.
+ *
+ * @exception CoreException if an exception occurs reading
+ * the extensions
+ */
+ private void initializeStatusHandlers() throws CoreException {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(EXTENSION_POINT_STATUS_HANDLERS);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fStatusHandlers = new HashMap(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ String id = configurationElement.getAttribute("plugin"); //$NON-NLS-1$
+ String code = configurationElement.getAttribute("code"); //$NON-NLS-1$
+
+ if (id != null && code != null) {
+ try {
+ StatusHandlerKey key = new StatusHandlerKey(id, Integer.parseInt(code));
+ fStatusHandlers.put(key, configurationElement);
+ } catch (NumberFormatException e) {
+ // invalid status handler
+ invalidStatusHandler(e, configurationElement.getAttribute("id")); //$NON-NLS-1$
+ }
+ } else {
+ // invalid status handler
+ invalidStatusHandler(null, configurationElement.getAttribute("id")); //$NON-NLS-1$
+ }
+ }
+ }
+
+ private void invalidStatusHandler(Exception e, String id) {
+ log(new Status(IStatus.ERROR, getDescriptor().getUniqueIdentifier(), INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("DebugPlugin.Invalid_status_handler_extension__{0}_2"), new String[] {id}), e)); //$NON-NLS-1$
+ }
+
+ /**
+ * Key for status handler extensions - a plug-in identifier/code pair
+ */
+ class StatusHandlerKey {
+
+ String fPluginId;
+ int fCode;
+
+ StatusHandlerKey(String pluginId, int code) {
+ fPluginId = pluginId;
+ fCode = code;
+ }
+
+ public int hashCode() {
+ return fPluginId.hashCode() + fCode;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof StatusHandlerKey) {
+ StatusHandlerKey s = (StatusHandlerKey)obj;
+ return fCode == s.fCode && fPluginId.equals(s.fPluginId);
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Returns whether any event filters are registered
+ *
+ * @return whether any event filters are registered
+ */
+ private boolean hasEventFilters() {
+ return fEventFilters != null && fEventFilters.size() > 0;
+ }
+
+
+
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java
index e25f2fc70..bf9b7c7ee 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java
@@ -1,63 +1,63 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * A breakpoint listener is notified of breakpoint additions,
- * removals, and changes. Listeners register and deregister with the
- * breakpoint manager.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IBreakpointManager
- */
-
-public interface IBreakpointListener {
-
- /**
- * Notifies this listener that the given breakpoint has been added
- * to the breakpoint manager.
- *
- * @param breakpoint the added breakpoint
- * @since 2.0
- */
- public void breakpointAdded(IBreakpoint breakpoint);
- /**
- * Notifies this listener that the given breakpoint has been removed
- * from the breakpoint manager.
- * If the given breakpoint has been removed because it has been deleted,
- * the associated marker delta is also provided.
- *
- * @param breakpoint the removed breakpoint
- * @param delta the associated marker delta, or <code>null</code> when
- * the breakpoint is removed from the breakpoint manager without
- * being deleted
- *
- * @see org.eclipse.core.resources.IMarkerDelta
- * @since 2.0
- */
- public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta);
-
- /**
- * Notifies this listener that an attribute of the given breakpoint has
- * changed, as described by the delta.
- *
- * @param breakpoint the changed breakpoint
- * @param delta the marker delta that describes the changes
- * with the marker associated with the given breakpoint, or
- * <code>null</code> when the breakpoint change does not generate
- * a marker delta
- *
- * @see org.eclipse.core.resources.IMarkerDelta
- * @since 2.0
- */
- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta);
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ * A breakpoint listener is notified of breakpoint additions,
+ * removals, and changes. Listeners register and deregister with the
+ * breakpoint manager.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IBreakpointManager
+ */
+
+public interface IBreakpointListener {
+
+ /**
+ * Notifies this listener that the given breakpoint has been added
+ * to the breakpoint manager.
+ *
+ * @param breakpoint the added breakpoint
+ * @since 2.0
+ */
+ public void breakpointAdded(IBreakpoint breakpoint);
+ /**
+ * Notifies this listener that the given breakpoint has been removed
+ * from the breakpoint manager.
+ * If the given breakpoint has been removed because it has been deleted,
+ * the associated marker delta is also provided.
+ *
+ * @param breakpoint the removed breakpoint
+ * @param delta the associated marker delta, or <code>null</code> when
+ * the breakpoint is removed from the breakpoint manager without
+ * being deleted
+ *
+ * @see org.eclipse.core.resources.IMarkerDelta
+ * @since 2.0
+ */
+ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta);
+
+ /**
+ * Notifies this listener that an attribute of the given breakpoint has
+ * changed, as described by the delta.
+ *
+ * @param breakpoint the changed breakpoint
+ * @param delta the marker delta that describes the changes
+ * with the marker associated with the given breakpoint, or
+ * <code>null</code> when the breakpoint change does not generate
+ * a marker delta
+ *
+ * @see org.eclipse.core.resources.IMarkerDelta
+ * @since 2.0
+ */
+ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta);
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
index 3bd08f9fa..55fafaec8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
@@ -1,144 +1,144 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * The breakpoint manager manages the collection of breakpoints
- * in the workspace. A breakpoint suspends the execution of a
- * program being debugged. The kinds of breakpoints supported by each
- * debug architecture and the information required to create those
- * breakpoints is defined by each debug architecture.
- * Breakpoint creation is a client responsibility.
- * <p>
- * Clients interested in breakpoint change notification may
- * register with the breakpoint manager - see
- * <code>IBreakpointListener</code>.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IBreakpointListener
- */
-public interface IBreakpointManager {
- /**
- * Adds the given breakpoint to the collection of registered breakpoints
- * in the workspace and notifies all registered listeners. This has no effect
- * if the given breakpoint is already registered.
- *
- * @param breakpoint the breakpoint to add
- *
- * @exception DebugException if adding fails. Reasons include:<ul>
- * <li>CONFIGURATION_INVALID - the required <code>MODEL_IDENTIFIER</code> attribute
- * is not set on the breakpoint marker.</li>
- * <li>A <code>CoreException</code> occurred while verifying the <code>MODEL_IDENTIFIER</code>
- * attribute.</li>
- * </ul>
- * @since 2.0
- */
- public void addBreakpoint(IBreakpoint breakpoint) throws CoreException;
-
- /**
- * Returns the breakpoint associated with the given marker or
- * <code>null</code> if no such breakpoint exists
- *
- * @param marker the marker
- * @return the breakpoint associated with the marker
- * or <code>null</code> if none exists
- * @since 2.0
- */
- public IBreakpoint getBreakpoint(IMarker marker);
-
- /**
- * Returns a collection of all registered breakpoints.
- * Returns an empty array if no breakpoints are registered.
- *
- * @return an array of breakpoints
- * @since 2.0
- */
- public IBreakpoint[] getBreakpoints();
-
- /**
- * Returns whether there are any registered breakpoints.
- *
- * @return whether there are any registered breakpoints
- * @since 2.0
- */
- public boolean hasBreakpoints();
-
- /**
- * Returns a collection of all breakpoints registered for the
- * given debug model. Answers an empty array if no breakpoints are registered
- * for the given debug model.
- *
- * @param modelIdentifier identifier of a debug model plug-in
- * @return an array of breakpoints
- * @since 2.0
- */
- public IBreakpoint[] getBreakpoints(String modelIdentifier);
-
- /**
- * Returns whether the given breakpoint is currently
- * registered with this breakpoint manager.
- *
- * @return whether the breakpoint is registered
- * @since 2.0
- */
- public boolean isRegistered(IBreakpoint breakpoint);
-
- /**
- * Notifies all registered listeners that the given
- * breakpoint has changed. Has no effect if the given
- * breakpoint is not currently registered.
- *
- * This method is intended to be used when a breakpoint
- * attribute is changed that does not alter the breakpoint's
- * underlying marker, that is, when notification will not occur
- * via the marker delta mechanism.
- *
- * @param breakpoint the breakpoint that has changed.
- * @since 2.0
- */
- public void fireBreakpointChanged(IBreakpoint breakpoint);
-
- /**
- * Removes the given breakpoint from the breakpoint manager, deletes
- * the marker associated with the breakpoint if the <code>delete</code> flag
- * is <code>true</code>, and notifies all registered
- * listeners. Has no effect if the given breakpoint is not currently
- * registered.
- *
- * @param breakpoint the breakpoint to remove
- * @param delete whether to delete the marker associated with the
- * breakpoint
- * @exception CoreException if an exception occurs while deleting the
- * underlying marker.
- * @since 2.0
- */
- public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException;
-
- /**
- * Adds the given listener to the collection of registered breakpoint listeners.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the listener to add
- */
- public void addBreakpointListener(IBreakpointListener listener);
-
- /**
- * Removes the given listener from the collection of registered breakpoint listeners.
- * Has no effect if an identical listener is not already registered.
- *
- * @param listener the listener to remove
- */
- public void removeBreakpointListener(IBreakpointListener listener);
-
-}
-
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ * The breakpoint manager manages the collection of breakpoints
+ * in the workspace. A breakpoint suspends the execution of a
+ * program being debugged. The kinds of breakpoints supported by each
+ * debug architecture and the information required to create those
+ * breakpoints is defined by each debug architecture.
+ * Breakpoint creation is a client responsibility.
+ * <p>
+ * Clients interested in breakpoint change notification may
+ * register with the breakpoint manager - see
+ * <code>IBreakpointListener</code>.
+ * </p>
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ * @see IBreakpointListener
+ */
+public interface IBreakpointManager {
+ /**
+ * Adds the given breakpoint to the collection of registered breakpoints
+ * in the workspace and notifies all registered listeners. This has no effect
+ * if the given breakpoint is already registered.
+ *
+ * @param breakpoint the breakpoint to add
+ *
+ * @exception DebugException if adding fails. Reasons include:<ul>
+ * <li>CONFIGURATION_INVALID - the required <code>MODEL_IDENTIFIER</code> attribute
+ * is not set on the breakpoint marker.</li>
+ * <li>A <code>CoreException</code> occurred while verifying the <code>MODEL_IDENTIFIER</code>
+ * attribute.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public void addBreakpoint(IBreakpoint breakpoint) throws CoreException;
+
+ /**
+ * Returns the breakpoint associated with the given marker or
+ * <code>null</code> if no such breakpoint exists
+ *
+ * @param marker the marker
+ * @return the breakpoint associated with the marker
+ * or <code>null</code> if none exists
+ * @since 2.0
+ */
+ public IBreakpoint getBreakpoint(IMarker marker);
+
+ /**
+ * Returns a collection of all registered breakpoints.
+ * Returns an empty array if no breakpoints are registered.
+ *
+ * @return an array of breakpoints
+ * @since 2.0
+ */
+ public IBreakpoint[] getBreakpoints();
+
+ /**
+ * Returns whether there are any registered breakpoints.
+ *
+ * @return whether there are any registered breakpoints
+ * @since 2.0
+ */
+ public boolean hasBreakpoints();
+
+ /**
+ * Returns a collection of all breakpoints registered for the
+ * given debug model. Answers an empty array if no breakpoints are registered
+ * for the given debug model.
+ *
+ * @param modelIdentifier identifier of a debug model plug-in
+ * @return an array of breakpoints
+ * @since 2.0
+ */
+ public IBreakpoint[] getBreakpoints(String modelIdentifier);
+
+ /**
+ * Returns whether the given breakpoint is currently
+ * registered with this breakpoint manager.
+ *
+ * @return whether the breakpoint is registered
+ * @since 2.0
+ */
+ public boolean isRegistered(IBreakpoint breakpoint);
+
+ /**
+ * Notifies all registered listeners that the given
+ * breakpoint has changed. Has no effect if the given
+ * breakpoint is not currently registered.
+ *
+ * This method is intended to be used when a breakpoint
+ * attribute is changed that does not alter the breakpoint's
+ * underlying marker, that is, when notification will not occur
+ * via the marker delta mechanism.
+ *
+ * @param breakpoint the breakpoint that has changed.
+ * @since 2.0
+ */
+ public void fireBreakpointChanged(IBreakpoint breakpoint);
+
+ /**
+ * Removes the given breakpoint from the breakpoint manager, deletes
+ * the marker associated with the breakpoint if the <code>delete</code> flag
+ * is <code>true</code>, and notifies all registered
+ * listeners. Has no effect if the given breakpoint is not currently
+ * registered.
+ *
+ * @param breakpoint the breakpoint to remove
+ * @param delete whether to delete the marker associated with the
+ * breakpoint
+ * @exception CoreException if an exception occurs while deleting the
+ * underlying marker.
+ * @since 2.0
+ */
+ public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException;
+
+ /**
+ * Adds the given listener to the collection of registered breakpoint listeners.
+ * Has no effect if an identical listener is already registered.
+ *
+ * @param listener the listener to add
+ */
+ public void addBreakpointListener(IBreakpointListener listener);
+
+ /**
+ * Removes the given listener from the collection of registered breakpoint listeners.
+ * Has no effect if an identical listener is not already registered.
+ *
+ * @param listener the listener to remove
+ */
+ public void removeBreakpointListener(IBreakpointListener listener);
+
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java
index 64c1c8e3a..269bb41f5 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java
@@ -1,32 +1,32 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * An event filter allows clients to intercept debug events.
- * Event filters are registered with the debug plug-in.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see DebugPlugin
- * @since 2.0
- */
-public interface IDebugEventFilter {
-
- /**
- * Filters the given set of debug events, and returns the set of debug
- * events that should be fired to registered listeners - <code>null</code>
- * or an empty collection if no debug events should be fired.
- * <p>
- * When multiple event filters are registered, events are passed through
- * all filters. That is, the events returned from the first filter are
- * passed through the second filter, and so on.
- * </p>
- *
- * @return the set of debug events to fire
- */
- public DebugEvent[] filterDebugEvents(DebugEvent[] events);
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * An event filter allows clients to intercept debug events.
+ * Event filters are registered with the debug plug-in.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see DebugPlugin
+ * @since 2.0
+ */
+public interface IDebugEventFilter {
+
+ /**
+ * Filters the given set of debug events, and returns the set of debug
+ * events that should be fired to registered listeners - <code>null</code>
+ * or an empty collection if no debug events should be fired.
+ * <p>
+ * When multiple event filters are registered, events are passed through
+ * all filters. That is, the events returned from the first filter are
+ * passed through the second filter, and so on.
+ * </p>
+ *
+ * @return the set of debug events to fire
+ */
+ public DebugEvent[] filterDebugEvents(DebugEvent[] events);
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java
index c34bcf944..e71a8f661 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java
@@ -1,47 +1,47 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import org.eclipse.debug.core.model.IExpression;
-
-/**
- * An expression listener is notified of expression additions,
- * removals, and changes. Listeners register and deregister with the
- * expression manager.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IExpressionManager
- * @since 2.0
- */
-
-public interface IExpressionListener {
-
- /**
- * Notifies this listener that the given expression has been added
- * to the expression manager.
- *
- * @param expression the added expression
- */
- public void expressionAdded(IExpression expression);
- /**
- * Notifies this listener that the given expression has been removed
- * from the expression manager.
- *
- * @param expression the removed expression
- */
- public void expressionRemoved(IExpression expression);
-
- /**
- * Notifies this listener that the given expression has
- * changed.
- *
- * @param expression the changed expression
- */
- public void expressionChanged(IExpression expression);
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+
+import org.eclipse.debug.core.model.IExpression;
+
+/**
+ * An expression listener is notified of expression additions,
+ * removals, and changes. Listeners register and deregister with the
+ * expression manager.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IExpressionManager
+ * @since 2.0
+ */
+
+public interface IExpressionListener {
+
+ /**
+ * Notifies this listener that the given expression has been added
+ * to the expression manager.
+ *
+ * @param expression the added expression
+ */
+ public void expressionAdded(IExpression expression);
+ /**
+ * Notifies this listener that the given expression has been removed
+ * from the expression manager.
+ *
+ * @param expression the removed expression
+ */
+ public void expressionRemoved(IExpression expression);
+
+ /**
+ * Notifies this listener that the given expression has
+ * changed.
+ *
+ * @param expression the changed expression
+ */
+ public void expressionChanged(IExpression expression);
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
index b04d82798..55443ac86 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
@@ -1,88 +1,88 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IExpression;
-
-/**
- * The expression manager manages the collection of registered
- * expressions in the workspace. An expression is a snippet of code
- * that can be evaluated to produce a value. Expression creation
- * and evaluation are client responsibilities.
- * <p>
- * Clients interested in expression change notification may
- * register with the expression manager - see
- * <code>IExpressionListener</code>.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IExpression
- * @see IExpressionListener
- * @since 2.0
- */
-public interface IExpressionManager {
- /**
- * Adds the given expression to the collection of registered expressions
- * in the workspace and notifies all registered listeners. This has no effect
- * if the given expression is already registered.
- *
- * @param expression the expression to add
- */
- public void addExpression(IExpression expression);
-
- /**
- * Returns a collection of all registered expressions,
- * possibly empty.
- *
- * @return an array of expressions
- */
- public IExpression[] getExpressions();
-
- /**
- * Returns whether there are any registered expressions
- *
- * @return whether there are any registered expressions
- */
- public boolean hasExpressions();
-
- /**
- * Returns a collection of all expressions registered for the
- * given debug model,possibly empty.
- *
- * @param modelIdentifier identifier of a debug model plug-in
- * @return an array of expressions
- */
- public IExpression[] getExpressions(String modelIdentifier);
-
- /**
- * Removes the given expression from the expression manager,
- * and notifies all registered listeners. Has no effect if the
- * given expression is not currently registered.
- *
- * @param expression the expression to remove
- */
- public void removeExpression(IExpression expression);
-
- /**
- * Adds the given listener to the collection of registered expression listeners.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the listener to add
- */
- public void addExpressionListener(IExpressionListener listener);
-
- /**
- * Removes the given listener from the collection of registered expression listeners.
- * Has no effect if an identical listener is not already registered.
- *
- * @param listener the listener to remove
- */
- public void removeExpressionListener(IExpressionListener listener);
-
-}
-
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IExpression;
+
+/**
+ * The expression manager manages the collection of registered
+ * expressions in the workspace. An expression is a snippet of code
+ * that can be evaluated to produce a value. Expression creation
+ * and evaluation are client responsibilities.
+ * <p>
+ * Clients interested in expression change notification may
+ * register with the expression manager - see
+ * <code>IExpressionListener</code>.
+ * </p>
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ * @see IExpression
+ * @see IExpressionListener
+ * @since 2.0
+ */
+public interface IExpressionManager {
+ /**
+ * Adds the given expression to the collection of registered expressions
+ * in the workspace and notifies all registered listeners. This has no effect
+ * if the given expression is already registered.
+ *
+ * @param expression the expression to add
+ */
+ public void addExpression(IExpression expression);
+
+ /**
+ * Returns a collection of all registered expressions,
+ * possibly empty.
+ *
+ * @return an array of expressions
+ */
+ public IExpression[] getExpressions();
+
+ /**
+ * Returns whether there are any registered expressions
+ *
+ * @return whether there are any registered expressions
+ */
+ public boolean hasExpressions();
+
+ /**
+ * Returns a collection of all expressions registered for the
+ * given debug model,possibly empty.
+ *
+ * @param modelIdentifier identifier of a debug model plug-in
+ * @return an array of expressions
+ */
+ public IExpression[] getExpressions(String modelIdentifier);
+
+ /**
+ * Removes the given expression from the expression manager,
+ * and notifies all registered listeners. Has no effect if the
+ * given expression is not currently registered.
+ *
+ * @param expression the expression to remove
+ */
+ public void removeExpression(IExpression expression);
+
+ /**
+ * Adds the given listener to the collection of registered expression listeners.
+ * Has no effect if an identical listener is already registered.
+ *
+ * @param listener the listener to add
+ */
+ public void addExpressionListener(IExpressionListener listener);
+
+ /**
+ * Removes the given listener from the collection of registered expression listeners.
+ * Has no effect if an identical listener is not already registered.
+ *
+ * @param listener the listener to remove
+ */
+ public void removeExpressionListener(IExpressionListener listener);
+
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java
index 9fc699083..d31975479 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java
@@ -1,171 +1,171 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.ITerminate;
-
-/**
- * A launch is the result of launching a debug session
- * and/or one or more system processes.
- * <p>
- * This interface is not intended to be implemented by clients. Clients
- * should create instances of this interface by using the implementation
- * provided by the class <code>Launch</code>.
- * </p>
- * @see Launch
- */
-public interface ILaunch extends ITerminate, IAdaptable {
- /**
- * Returns the children of this launch - a collection
- * of one or more debug targets and processes, possibly empty.
- *
- * @return an array (element type:<code>IDebugTarget</code> or <code>IProcess</code>),
- * or an empty array
- */
- public Object[] getChildren();
- /**
- * Returns the primary (first) debug target associated with this launch, or <code>null</code>
- * if no debug target is associated with this launch. All debug targets
- * associated with this launch may be retrieved by
- * <code>getDebugTargets()</code>.
- *
- * @return the primary debug target associated with this launch, or <code>null</code>
- */
- public IDebugTarget getDebugTarget();
-
- /**
- * Returns the processes that were launched,
- * or an empty collection if no processes were launched.
- *
- * @return array of processes
- */
- public IProcess[] getProcesses();
-
- /**
- * Returns all the debug targets associated with this launch,
- * or an empty collection if no debug targets are associated
- * with this launch. The primary debug target is the first
- * in the collection (if any).
- *
- * @return array of debug targets
- * @since 2.0
- */
- public IDebugTarget[] getDebugTargets();
-
- /**
- * Adds the given debug target to this launch. Has no effect
- * if the given debug target is already associated with this
- * launch. Registered listeners are notified that this launch
- * has changed.
- *
- * @param target debug target to add to this launch
- * @since 2.0
- */
- public void addDebugTarget(IDebugTarget target);
-
- /**
- * Removes the given debug target from this launch. Has no effect
- * if the given debug target is not already associated with this
- * launch. Registered listeners are notified that this launch
- * has changed.
- *
- * @param target debug target to remove from this launch
- * @since 2.0
- */
- public void removeDebugTarget(IDebugTarget target);
-
- /**
- * Adds the given process to this launch. Has no effect
- * if the given process is already associated with this
- * launch. Registered listeners are notified that this launch
- * has changed.
- *
- * @param process the process to add to this launch
- * @since 2.0
- */
- public void addProcess(IProcess process);
-
- /**
- * Removes the given process from this launch. Has no effect
- * if the given process is not already associated with this
- * launch. Registered listeners are notified that this launch
- * has changed.
- *
- * @param process the process to remove from this launch
- * @since 2.0
- */
- public void removeProcess(IProcess process);
-
- /**
- * Returns the source locator to use for locating source elements for
- * the debug target associated with this launch, or <code>null</code>
- * if source lookup is not supported.
- *
- * @return the source locator
- */
- public ISourceLocator getSourceLocator();
-
- /**
- * Sets the source locator to use for locating source elements for
- * the debug target associated with this launch, or <code>null</code>
- * if source lookup is not supported.
- *
- * @param sourceLocator source locator or <code>null</code>
- * @since 2.0
- */
- public void setSourceLocator(ISourceLocator sourceLocator);
-
- /**
- * Returns the mode of this launch - one of the mode constants defined by
- * the launch manager.
- *
- * @return the launch mode
- * @see ILaunchManager
- */
- public String getLaunchMode();
-
- /**
- * Returns the configuration that was launched, or <code>null</code>
- * if no configuration was launched.
- *
- * @return the launched configuration or <code>null</code>
- * @since 2.0
- */
- public ILaunchConfiguration getLaunchConfiguration();
-
- /**
- * Sets the value of a client defined attribute.
- *
- * @param key the attribute key
- * @param value the attribute value
- * @since 2.0
- */
- public void setAttribute(String key, String value);
-
- /**
- * Returns the value of a client defined attribute.
- *
- * @param key the attribute key
- * @return value the attribute value, or <code>null</code> if undefined
- * @since 2.0
- */
- public String getAttribute(String key);
-
- /**
- * Returns whether this launch contains at least one process
- * or debug target.
- *
- * @return whether this launch contains at least one process
- * or debug target
- * @since 2.0
- */
- public boolean hasChildren();
-
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.model.ITerminate;
+
+/**
+ * A launch is the result of launching a debug session
+ * and/or one or more system processes.
+ * <p>
+ * This interface is not intended to be implemented by clients. Clients
+ * should create instances of this interface by using the implementation
+ * provided by the class <code>Launch</code>.
+ * </p>
+ * @see Launch
+ */
+public interface ILaunch extends ITerminate, IAdaptable {
+ /**
+ * Returns the children of this launch - a collection
+ * of one or more debug targets and processes, possibly empty.
+ *
+ * @return an array (element type:<code>IDebugTarget</code> or <code>IProcess</code>),
+ * or an empty array
+ */
+ public Object[] getChildren();
+ /**
+ * Returns the primary (first) debug target associated with this launch, or <code>null</code>
+ * if no debug target is associated with this launch. All debug targets
+ * associated with this launch may be retrieved by
+ * <code>getDebugTargets()</code>.
+ *
+ * @return the primary debug target associated with this launch, or <code>null</code>
+ */
+ public IDebugTarget getDebugTarget();
+
+ /**
+ * Returns the processes that were launched,
+ * or an empty collection if no processes were launched.
+ *
+ * @return array of processes
+ */
+ public IProcess[] getProcesses();
+
+ /**
+ * Returns all the debug targets associated with this launch,
+ * or an empty collection if no debug targets are associated
+ * with this launch. The primary debug target is the first
+ * in the collection (if any).
+ *
+ * @return array of debug targets
+ * @since 2.0
+ */
+ public IDebugTarget[] getDebugTargets();
+
+ /**
+ * Adds the given debug target to this launch. Has no effect
+ * if the given debug target is already associated with this
+ * launch. Registered listeners are notified that this launch
+ * has changed.
+ *
+ * @param target debug target to add to this launch
+ * @since 2.0
+ */
+ public void addDebugTarget(IDebugTarget target);
+
+ /**
+ * Removes the given debug target from this launch. Has no effect
+ * if the given debug target is not already associated with this
+ * launch. Registered listeners are notified that this launch
+ * has changed.
+ *
+ * @param target debug target to remove from this launch
+ * @since 2.0
+ */
+ public void removeDebugTarget(IDebugTarget target);
+
+ /**
+ * Adds the given process to this launch. Has no effect
+ * if the given process is already associated with this
+ * launch. Registered listeners are notified that this launch
+ * has changed.
+ *
+ * @param process the process to add to this launch
+ * @since 2.0
+ */
+ public void addProcess(IProcess process);
+
+ /**
+ * Removes the given process from this launch. Has no effect
+ * if the given process is not already associated with this
+ * launch. Registered listeners are notified that this launch
+ * has changed.
+ *
+ * @param process the process to remove from this launch
+ * @since 2.0
+ */
+ public void removeProcess(IProcess process);
+
+ /**
+ * Returns the source locator to use for locating source elements for
+ * the debug target associated with this launch, or <code>null</code>
+ * if source lookup is not supported.
+ *
+ * @return the source locator
+ */
+ public ISourceLocator getSourceLocator();
+
+ /**
+ * Sets the source locator to use for locating source elements for
+ * the debug target associated with this launch, or <code>null</code>
+ * if source lookup is not supported.
+ *
+ * @param sourceLocator source locator or <code>null</code>
+ * @since 2.0
+ */
+ public void setSourceLocator(ISourceLocator sourceLocator);
+
+ /**
+ * Returns the mode of this launch - one of the mode constants defined by
+ * the launch manager.
+ *
+ * @return the launch mode
+ * @see ILaunchManager
+ */
+ public String getLaunchMode();
+
+ /**
+ * Returns the configuration that was launched, or <code>null</code>
+ * if no configuration was launched.
+ *
+ * @return the launched configuration or <code>null</code>
+ * @since 2.0
+ */
+ public ILaunchConfiguration getLaunchConfiguration();
+
+ /**
+ * Sets the value of a client defined attribute.
+ *
+ * @param key the attribute key
+ * @param value the attribute value
+ * @since 2.0
+ */
+ public void setAttribute(String key, String value);
+
+ /**
+ * Returns the value of a client defined attribute.
+ *
+ * @param key the attribute key
+ * @return value the attribute value, or <code>null</code> if undefined
+ * @since 2.0
+ */
+ public String getAttribute(String key);
+
+ /**
+ * Returns whether this launch contains at least one process
+ * or debug target.
+ *
+ * @return whether this launch contains at least one process
+ * or debug target
+ * @since 2.0
+ */
+ public boolean hasChildren();
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
index 93c828fb2..436657958 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
@@ -1,342 +1,342 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * A launch configuration describes how to launch an application.
- * Each launch configuration is an instance of a type of launch
- * configuration as described by a launch configuration type
- * extension. Each launch configuration has a launch configuration
- * delegate which performs the actual launching of a
- * configuration.
- * <p>
- * A launch configuration may be shared in a repository via
- * standard VCM mechanisms, or may be stored locally, essentially
- * making the launch configuration private for a single user.
- * Thus, a launch configuration may stored as a file in the
- * workspace (shared), or as a file in the debug plug-in's state
- * location.
- * </p>
- * A launch configuration is a handle to its underlying storage.
- * </p>
- * <p>
- * A launch configuration is modified by obtaining a working copy
- * of a launch configuration, modifying the working copy, and then
- * saving the working copy.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients. Clients
- * that define a launch configuration delegate extension implement the
- * <code>ILaunchConfigurationDelegate</code> interface.
- * </p>
- * @see ILaunchConfigurationType
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate
- * @see ILaunchConfigurationWorkingCopy
- * @since 2.0
- */
-public interface ILaunchConfiguration extends IAdaptable {
-
- /**
- * The file extension for launch configuration files
- * (value <code>"launch"</code>).
- */
- public static final String LAUNCH_CONFIGURATION_FILE_EXTENSION = "launch"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute storing an identifier of
- * a persistable source locator extension. When this attribute is
- * specified, a new source locator will be created automatically and
- * associated with the launch for this configuration.
- *
- * @see IPersistableSourceLocator
- */
- public static final String ATTR_SOURCE_LOCATOR_ID = DebugPlugin.getUniqueIdentifier() + ".source_locator_id"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute storing a memento of a
- * source locator. When this attribute is specified in
- * conjunction with a source locator id, the source locator
- * created for a launch will be initialized with this memento.
- * When not specified, but a source locator id is specified,
- * the source locator will be initialized to default values.
- *
- * @see IPersistableSourceLocator
- */
- public static final String ATTR_SOURCE_LOCATOR_MEMENTO = DebugPlugin.getUniqueIdentifier() + ".source_locator_memento"; //$NON-NLS-1$
-
- /**
- * Launches this configuration in the specified mode by delegating to
- * this configuration's launch configuration delegate, and returns the
- * resulting launch.
- * A new launch object is created and registered with the launch manager
- * before passing it to this configuration's delegate for contributions
- * (debug targets and processes).
- * If the delegate contributes a source locator to the launch, that
- * source locator is used. Otherwise an appropriate source locator is
- * contributed to the launch based on the values of
- * <code>ATTR_SOURCE_LOCAOTOR_ID</code> and <code>ATTR_SOURCE_LOCATOR_MEMENTO</code>.
- * If the launch is cancelled (via the given progress monitor), the
- * launch is removed from the launch manager. The launch is returned
- * whether cancelled or not.
- * Invoking this method causes the underlying launch configuration delegate
- * to be instantiated (if not already).
- *
- * @param mode the mode in which to launch, one of the mode constants
- * defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
- * @param monitor progress monitor, or <code>null</code>
- * @return the resulting launch.
- * @exception CoreException if this method fails. Reasons include:<ul>
- * <li>unable to instantiate the underlying launch configuration delegate</li>
- * <li>the launch fails (in the delegate)</code>
- * </ul>
- */
- public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns whether this launch configuration supports the
- * specified mode.
- *
- * @param mode a mode in which a configuration can be launched, one of
- * the mode constants defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or
- * <code>DEBUG_MODE</code>.
- * @return whether this launch configuration supports the
- * specified mode
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>Unable to retrieve this launch configuration's type.</li>
- * </ul>
- */
- public boolean supportsMode(String mode) throws CoreException;
-
- /**
- * Returns the name of this launch configuration.
- *
- * @return the name of this launch configuration
- */
- public String getName();
-
- /**
- * Returns the location of this launch configuration as a
- * path.
- *
- * @return the location of this launch configuration as a
- * path
- */
- public IPath getLocation();
-
- /**
- * Returns whether this launch configuration's underlying
- * storage exists.
- *
- * @return whether this launch configuration's underlying
- * storage exists
- */
- public boolean exists();
-
- /**
- * Returns the integer-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while retrieving the attribute from
- * underlying storage.</li>
- * <li>An attribute with the given name exists, but does not
- * have an integer value</li>
- * </ul>
- */
- public int getAttribute(String attributeName, int defaultValue) throws CoreException;
- /**
- * Returns the string-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while retrieving the attribute from
- * underlying storage.</li>
- * <li>An attribute with the given name exists, but does not
- * have a String value</li>
- * </ul>
- */
- public String getAttribute(String attributeName, String defaultValue) throws CoreException;
- /**
- * Returns the boolean-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while retrieving the attribute from
- * underlying storage.</li>
- * <li>An attribute with the given name exists, but does not
- * have a boolean value</li>
- * </ul>
- */
- public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException;
- /**
- * Returns the <code>java.util.List</code>-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while retrieving the attribute from
- * underlying storage.</li>
- * <li>An attribute with the given name exists, but does not
- * have a List value</li>
- * </ul>
- */
- public List getAttribute(String attributeName, List defaultValue) throws CoreException;
- /**
- * Returns the <code>java.util.Map</code>-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while retrieving the attribute from
- * underlying storage.</li>
- * <li>An attribute with the given name exists, but does not
- * have a Map value</li>
- * </ul>
- */
- public Map getAttribute(String attributeName, Map defaultValue) throws CoreException;
-
- /**
- * Returns the file this launch configuration is stored
- * in, or <code>null</code> if this configuration is stored
- * locally with the workspace.
- *
- * @return the file this launch configuration is stored
- * in, or <code>null</code> if this configuration is stored
- * locally with the workspace
- */
- public IFile getFile();
-
- /**
- * Returns the type of this launch configuration.
- *
- * @return the type of this launch configuration
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>Unable to retrieve or instantiate this launch configuration's type.</li>
- * </ul>
- * @see ILaunchConfigurationType
- */
- public ILaunchConfigurationType getType() throws CoreException;
-
- /**
- * Returns whether this launch configuration is stored
- * locally with the workspace.
- *
- * @return whether this launch configuration is stored
- * locally with the workspace
- */
- public boolean isLocal();
-
- /**
- * Returns a working copy of this launch configuration.
- * Changes to the working copy will be applied to this
- * launch configuration when saved. The working copy will
- * refer to this launch configuration as its original
- * launch configuration.
- *
- * @return a working copy of this launch configuration
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while initializing the contents of the
- * working copy from this configuration's underlying storage.</li>
- * </ul>
- * @see ILaunchConfigurationWorkingCopy#getOriginal()
- */
- public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException;
-
- /**
- * Returns a copy of this launch configuration, as a
- * working copy, with the specified name. The new
- * working copy does not refer back to this configuration
- * as its original launch configuration (the working copy
- * will return <code>null</code> for <code>getOriginal()</code>).
- * When the working copy is saved it will not effect this
- * launch configuration.
- *
- * @param name the name of the copy
- * @return a copy of this launch configuration
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while initializing the contents of the
- * working copy from this configuration's underlying storage.</li>
- * </ul>
- * @see ILaunchConfigurationWorkingCopy#getOriginal()
- */
- public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException;
-
- /**
- * Returns whether this launch configuration is a working
- * copy.
- *
- * @return whether this launch configuration is a working
- * copy
- */
- public boolean isWorkingCopy();
-
- /**
- * Deletes this launch configuration. This configuration's underlying
- * storage is deleted. Has no effect if this configuration
- * does not exist.
- *
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li>An exception occurs while deleting this configuration's
- * underlying storage.</li>
- * </ul>
- */
- public void delete() throws CoreException;
-
- /**
- * Returns a memento for this launch configuration, or <code>null</code>
- * if unable to generate a memento for this configuration. A memento
- * can be used to re-create a launch configuration, via the
- * launch manager.
- *
- * @return a memento for this configuration
- * @see ILaunchManager#getLaunchConfiguration(String)
- * @exception CoreException if an exception occurs generating this
- * launch configuration's memento
- */
- public String getMemento() throws CoreException;
-
- /**
- * Returns whether the contents of this launch configuration are
- * equal to the contents of the given launch configuration.
- *
- * @return whether the contents of this launch configuration are equal to the contents
- * of the specified launch configuration.
- */
- public boolean contentsEqual(ILaunchConfiguration configuration);
-
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * A launch configuration describes how to launch an application.
+ * Each launch configuration is an instance of a type of launch
+ * configuration as described by a launch configuration type
+ * extension. Each launch configuration has a launch configuration
+ * delegate which performs the actual launching of a
+ * configuration.
+ * <p>
+ * A launch configuration may be shared in a repository via
+ * standard VCM mechanisms, or may be stored locally, essentially
+ * making the launch configuration private for a single user.
+ * Thus, a launch configuration may stored as a file in the
+ * workspace (shared), or as a file in the debug plug-in's state
+ * location.
+ * </p>
+ * A launch configuration is a handle to its underlying storage.
+ * </p>
+ * <p>
+ * A launch configuration is modified by obtaining a working copy
+ * of a launch configuration, modifying the working copy, and then
+ * saving the working copy.
+ * </p>
+ * <p>
+ * This interface is not intended to be implemented by clients. Clients
+ * that define a launch configuration delegate extension implement the
+ * <code>ILaunchConfigurationDelegate</code> interface.
+ * </p>
+ * @see ILaunchConfigurationType
+ * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate
+ * @see ILaunchConfigurationWorkingCopy
+ * @since 2.0
+ */
+public interface ILaunchConfiguration extends IAdaptable {
+
+ /**
+ * The file extension for launch configuration files
+ * (value <code>"launch"</code>).
+ */
+ public static final String LAUNCH_CONFIGURATION_FILE_EXTENSION = "launch"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute storing an identifier of
+ * a persistable source locator extension. When this attribute is
+ * specified, a new source locator will be created automatically and
+ * associated with the launch for this configuration.
+ *
+ * @see IPersistableSourceLocator
+ */
+ public static final String ATTR_SOURCE_LOCATOR_ID = DebugPlugin.getUniqueIdentifier() + ".source_locator_id"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute storing a memento of a
+ * source locator. When this attribute is specified in
+ * conjunction with a source locator id, the source locator
+ * created for a launch will be initialized with this memento.
+ * When not specified, but a source locator id is specified,
+ * the source locator will be initialized to default values.
+ *
+ * @see IPersistableSourceLocator
+ */
+ public static final String ATTR_SOURCE_LOCATOR_MEMENTO = DebugPlugin.getUniqueIdentifier() + ".source_locator_memento"; //$NON-NLS-1$
+
+ /**
+ * Launches this configuration in the specified mode by delegating to
+ * this configuration's launch configuration delegate, and returns the
+ * resulting launch.
+ * A new launch object is created and registered with the launch manager
+ * before passing it to this configuration's delegate for contributions
+ * (debug targets and processes).
+ * If the delegate contributes a source locator to the launch, that
+ * source locator is used. Otherwise an appropriate source locator is
+ * contributed to the launch based on the values of
+ * <code>ATTR_SOURCE_LOCAOTOR_ID</code> and <code>ATTR_SOURCE_LOCATOR_MEMENTO</code>.
+ * If the launch is cancelled (via the given progress monitor), the
+ * launch is removed from the launch manager. The launch is returned
+ * whether cancelled or not.
+ * Invoking this method causes the underlying launch configuration delegate
+ * to be instantiated (if not already).
+ *
+ * @param mode the mode in which to launch, one of the mode constants
+ * defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
+ * @param monitor progress monitor, or <code>null</code>
+ * @return the resulting launch.
+ * @exception CoreException if this method fails. Reasons include:<ul>
+ * <li>unable to instantiate the underlying launch configuration delegate</li>
+ * <li>the launch fails (in the delegate)</code>
+ * </ul>
+ */
+ public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns whether this launch configuration supports the
+ * specified mode.
+ *
+ * @param mode a mode in which a configuration can be launched, one of
+ * the mode constants defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or
+ * <code>DEBUG_MODE</code>.
+ * @return whether this launch configuration supports the
+ * specified mode
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>Unable to retrieve this launch configuration's type.</li>
+ * </ul>
+ */
+ public boolean supportsMode(String mode) throws CoreException;
+
+ /**
+ * Returns the name of this launch configuration.
+ *
+ * @return the name of this launch configuration
+ */
+ public String getName();
+
+ /**
+ * Returns the location of this launch configuration as a
+ * path.
+ *
+ * @return the location of this launch configuration as a
+ * path
+ */
+ public IPath getLocation();
+
+ /**
+ * Returns whether this launch configuration's underlying
+ * storage exists.
+ *
+ * @return whether this launch configuration's underlying
+ * storage exists
+ */
+ public boolean exists();
+
+ /**
+ * Returns the integer-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have an integer value</li>
+ * </ul>
+ */
+ public int getAttribute(String attributeName, int defaultValue) throws CoreException;
+ /**
+ * Returns the string-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have a String value</li>
+ * </ul>
+ */
+ public String getAttribute(String attributeName, String defaultValue) throws CoreException;
+ /**
+ * Returns the boolean-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have a boolean value</li>
+ * </ul>
+ */
+ public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException;
+ /**
+ * Returns the <code>java.util.List</code>-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have a List value</li>
+ * </ul>
+ */
+ public List getAttribute(String attributeName, List defaultValue) throws CoreException;
+ /**
+ * Returns the <code>java.util.Map</code>-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have a Map value</li>
+ * </ul>
+ */
+ public Map getAttribute(String attributeName, Map defaultValue) throws CoreException;
+
+ /**
+ * Returns the file this launch configuration is stored
+ * in, or <code>null</code> if this configuration is stored
+ * locally with the workspace.
+ *
+ * @return the file this launch configuration is stored
+ * in, or <code>null</code> if this configuration is stored
+ * locally with the workspace
+ */
+ public IFile getFile();
+
+ /**
+ * Returns the type of this launch configuration.
+ *
+ * @return the type of this launch configuration
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>Unable to retrieve or instantiate this launch configuration's type.</li>
+ * </ul>
+ * @see ILaunchConfigurationType
+ */
+ public ILaunchConfigurationType getType() throws CoreException;
+
+ /**
+ * Returns whether this launch configuration is stored
+ * locally with the workspace.
+ *
+ * @return whether this launch configuration is stored
+ * locally with the workspace
+ */
+ public boolean isLocal();
+
+ /**
+ * Returns a working copy of this launch configuration.
+ * Changes to the working copy will be applied to this
+ * launch configuration when saved. The working copy will
+ * refer to this launch configuration as its original
+ * launch configuration.
+ *
+ * @return a working copy of this launch configuration
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while initializing the contents of the
+ * working copy from this configuration's underlying storage.</li>
+ * </ul>
+ * @see ILaunchConfigurationWorkingCopy#getOriginal()
+ */
+ public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException;
+
+ /**
+ * Returns a copy of this launch configuration, as a
+ * working copy, with the specified name. The new
+ * working copy does not refer back to this configuration
+ * as its original launch configuration (the working copy
+ * will return <code>null</code> for <code>getOriginal()</code>).
+ * When the working copy is saved it will not effect this
+ * launch configuration.
+ *
+ * @param name the name of the copy
+ * @return a copy of this launch configuration
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while initializing the contents of the
+ * working copy from this configuration's underlying storage.</li>
+ * </ul>
+ * @see ILaunchConfigurationWorkingCopy#getOriginal()
+ */
+ public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException;
+
+ /**
+ * Returns whether this launch configuration is a working
+ * copy.
+ *
+ * @return whether this launch configuration is a working
+ * copy
+ */
+ public boolean isWorkingCopy();
+
+ /**
+ * Deletes this launch configuration. This configuration's underlying
+ * storage is deleted. Has no effect if this configuration
+ * does not exist.
+ *
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while deleting this configuration's
+ * underlying storage.</li>
+ * </ul>
+ */
+ public void delete() throws CoreException;
+
+ /**
+ * Returns a memento for this launch configuration, or <code>null</code>
+ * if unable to generate a memento for this configuration. A memento
+ * can be used to re-create a launch configuration, via the
+ * launch manager.
+ *
+ * @return a memento for this configuration
+ * @see ILaunchManager#getLaunchConfiguration(String)
+ * @exception CoreException if an exception occurs generating this
+ * launch configuration's memento
+ */
+ public String getMemento() throws CoreException;
+
+ /**
+ * Returns whether the contents of this launch configuration are
+ * equal to the contents of the given launch configuration.
+ *
+ * @return whether the contents of this launch configuration are equal to the contents
+ * of the specified launch configuration.
+ */
+ public boolean contentsEqual(ILaunchConfiguration configuration);
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java
index 2653d8a08..fc2750b06 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java
@@ -1,41 +1,41 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Notified when a launch configuration is created,
- * deleted, or changed.
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @since 2.0
- */
-public interface ILaunchConfigurationListener {
-
- /**
- * The given launch configuration has been created.
- *
- * @param configuration the newly created launch configuration
- */
- public void launchConfigurationAdded(ILaunchConfiguration configuration);
-
- /**
- * The given launch configuration has changed in some way.
- * The configuration may be a working copy.
- *
- * @param configuration the launch configuration that has
- * changed
- */
- public void launchConfigurationChanged(ILaunchConfiguration configuration);
-
- /**
- * The given launch configuration has been deleted.
- *
- * @param configuration the deleted launch configuration
- */
- public void launchConfigurationRemoved(ILaunchConfiguration configuration);
-}
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * Notified when a launch configuration is created,
+ * deleted, or changed.
+ * <p>
+ * This interface is intended to be implemented by clients.
+ * </p>
+ * @since 2.0
+ */
+public interface ILaunchConfigurationListener {
+
+ /**
+ * The given launch configuration has been created.
+ *
+ * @param configuration the newly created launch configuration
+ */
+ public void launchConfigurationAdded(ILaunchConfiguration configuration);
+
+ /**
+ * The given launch configuration has changed in some way.
+ * The configuration may be a working copy.
+ *
+ * @param configuration the launch configuration that has
+ * changed
+ */
+ public void launchConfigurationChanged(ILaunchConfiguration configuration);
+
+ /**
+ * The given launch configuration has been deleted.
+ *
+ * @param configuration the deleted launch configuration
+ */
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration);
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
index 343b50c56..5dfc59411 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
@@ -1,120 +1,120 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-
-/**
- * Describes and creates instances of a specific type of
- * launch configuration. Launch configuration types are
- * defined by extensions.
- * <p>
- * A launch configuration type extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a launch configuration
- * type extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
- * &lt;launchConfigurationType
- * id="com.example.ExampleIdentifier"
- * delegate="com.example.ExampleLaunchConfigurationDelegate"
- * modes="run, debug"
- * name="Example Application"&gt;
- * &lt;/launchConfigurationType&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this launch configuration
- * type.</li>
- * <li><code>delegate</code> specifies the fully qualified name of the java class
- * that implements <code>ILaunchConfigurationDelegate</code>. Launch configuration
- * instances of this type will delegate to instances of this class
- * to perform launching.</li>
- * <li><code>modes</code> specifies a comma separated list of the modes this
- * type of launch configuration suports - <code>"run"</code> and/or <code>"debug"</code>.</li>
- * <li><code>name</code> specifies a human readable name for this type
- * of launch configuration.</li>
- * </ul>
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients. Clients
- * that define a launch configuration delegate extension implement the
- * <code>ILaunchConfigurationDelegate</code> interface.
- * </p>
- * @see ILaunchConfiguration
- * @since 2.0
- */
-public interface ILaunchConfigurationType {
-
- /**
- * Returns whether this type of launch configuration supports
- * the specified mode.
- *
- * @param mode a mode in which a configuration can be launched, one of
- * the mode constants defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or
- * <code>DEBUG_MODE</code>.
- * @return whether this kind of launch configuration supports the
- * specified mode
- */
- public boolean supportsMode(String mode);
-
- /**
- * Returns the name of this type of launch configuration.
- *
- * @return the name of this type of launch configuration
- */
- public String getName();
-
- /**
- * Returns the unique identifier for this type of launch configuration
- *
- * @return the unique identifier for this type of launch configuration
- */
- public String getIdentifier();
-
- /**
- * Returns whether this launch configuration type is public. Public configuration
- * types are available for use by the user, for example, the user can create new
- * configurations based on public types through the UI. Private types are not
- * accessbile in this way, but are still available through the methods on
- * <code>ILaunchManager</code>.
- *
- * @return whether this launch configuration type is public.
- */
- public boolean isPublic();
-
- /**
- * Returns a new launch configuration working copy of this type,
- * that resides in the specified container, with the given name.
- * When <code>container</code> is </code>null</code>, the configuration
- * will reside locally in the metadata area.
- * Note: a launch configuration is not actually created until the working copy is saved.
- *
- * @param container the container in which the new configuration will
- * reside, or <code>null</code> if the configuration should reside
- * locally with the metadata.
- * @param name name for the launch configuration
- * @return a new launch configuration working copy instance of this type
- * @exception CoreException if an instance of this type
- * of launch configuration could not be created for any
- * reason
- */
- public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException;
-
- /**
- * Returns the launch configuration delegate for launch
- * configurations of this type. The first time this method
- * is called, the delegate is instantiated.
- *
- * @return launch configuration delegate
- * @exception CoreException if unable to instantiate the
- * delegate
- */
- public ILaunchConfigurationDelegate getDelegate() throws CoreException;
-
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+
+/**
+ * Describes and creates instances of a specific type of
+ * launch configuration. Launch configuration types are
+ * defined by extensions.
+ * <p>
+ * A launch configuration type extension is defined in <code>plugin.xml</code>.
+ * Following is an example definition of a launch configuration
+ * type extension.
+ * <pre>
+ * &lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
+ * &lt;launchConfigurationType
+ * id="com.example.ExampleIdentifier"
+ * delegate="com.example.ExampleLaunchConfigurationDelegate"
+ * modes="run, debug"
+ * name="Example Application"&gt;
+ * &lt;/launchConfigurationType&gt;
+ * &lt;/extension&gt;
+ * </pre>
+ * The attributes are specified as follows:
+ * <ul>
+ * <li><code>id</code> specifies a unique identifier for this launch configuration
+ * type.</li>
+ * <li><code>delegate</code> specifies the fully qualified name of the java class
+ * that implements <code>ILaunchConfigurationDelegate</code>. Launch configuration
+ * instances of this type will delegate to instances of this class
+ * to perform launching.</li>
+ * <li><code>modes</code> specifies a comma separated list of the modes this
+ * type of launch configuration suports - <code>"run"</code> and/or <code>"debug"</code>.</li>
+ * <li><code>name</code> specifies a human readable name for this type
+ * of launch configuration.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * This interface is not intended to be implemented by clients. Clients
+ * that define a launch configuration delegate extension implement the
+ * <code>ILaunchConfigurationDelegate</code> interface.
+ * </p>
+ * @see ILaunchConfiguration
+ * @since 2.0
+ */
+public interface ILaunchConfigurationType {
+
+ /**
+ * Returns whether this type of launch configuration supports
+ * the specified mode.
+ *
+ * @param mode a mode in which a configuration can be launched, one of
+ * the mode constants defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or
+ * <code>DEBUG_MODE</code>.
+ * @return whether this kind of launch configuration supports the
+ * specified mode
+ */
+ public boolean supportsMode(String mode);
+
+ /**
+ * Returns the name of this type of launch configuration.
+ *
+ * @return the name of this type of launch configuration
+ */
+ public String getName();
+
+ /**
+ * Returns the unique identifier for this type of launch configuration
+ *
+ * @return the unique identifier for this type of launch configuration
+ */
+ public String getIdentifier();
+
+ /**
+ * Returns whether this launch configuration type is public. Public configuration
+ * types are available for use by the user, for example, the user can create new
+ * configurations based on public types through the UI. Private types are not
+ * accessbile in this way, but are still available through the methods on
+ * <code>ILaunchManager</code>.
+ *
+ * @return whether this launch configuration type is public.
+ */
+ public boolean isPublic();
+
+ /**
+ * Returns a new launch configuration working copy of this type,
+ * that resides in the specified container, with the given name.
+ * When <code>container</code> is </code>null</code>, the configuration
+ * will reside locally in the metadata area.
+ * Note: a launch configuration is not actually created until the working copy is saved.
+ *
+ * @param container the container in which the new configuration will
+ * reside, or <code>null</code> if the configuration should reside
+ * locally with the metadata.
+ * @param name name for the launch configuration
+ * @return a new launch configuration working copy instance of this type
+ * @exception CoreException if an instance of this type
+ * of launch configuration could not be created for any
+ * reason
+ */
+ public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException;
+
+ /**
+ * Returns the launch configuration delegate for launch
+ * configurations of this type. The first time this method
+ * is called, the delegate is instantiated.
+ *
+ * @return launch configuration delegate
+ * @exception CoreException if unable to instantiate the
+ * delegate
+ */
+ public ILaunchConfigurationDelegate getDelegate() throws CoreException;
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
index 62e5bfcd5..c958d6aca 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
@@ -1,143 +1,143 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * An editable copy of a launch configuration. Attributes of a
- * launch configuration are modified by modifying the attributes
- * of a working copy, and then saving the working copy.
- * <p>
- * This interface is not intended to be implemented by clients. Clients
- * that define a launch configuration delegate extension implement the
- * <code>ILaunchConfigurationDelegate</code> interface.
- * </p>
- * @see ILaunchConfiguration
- * @see ILaunchConfigurationType
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate
- * @since 2.0
- */
-public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, IAdaptable {
-
- /**
- * Returns whether this configuration has been modified
- * since it was last saved or created.
- *
- * @return whether this configuration has been modified
- * since it was last saved or created
- */
- public boolean isDirty();
-
- /**
- * Saves this working copy to its underlying file and returns
- * a handle to the resulting launch configuration.
- * Has no effect if this configuration does not need saving.
- * Creates the underlying file if not yet created.
- *
- * @exception CoreException if an exception occurs while
- * writing this configuration to its underlying file.
- */
- public ILaunchConfiguration doSave() throws CoreException;
-
- /**
- * Sets the integer-valued attribute with the given name.
- *
- * @param attributeName the name of the attribute
- * @param value the value
- */
- public void setAttribute(String attributeName, int value);
-
- /**
- * Sets the String-valued attribute with the given name.
- * If the value is <code>null</code>, the attribute is removed from
- * this launch configuration.
- *
- * @param attributeName the name of the attribute
- * @param value the value, or <code>null</code> if the attribute is to be undefined
- */
- public void setAttribute(String attributeName, String value);
-
- /**
- * Sets the <code>java.util.List</code>-valued attribute with the given name.
- * The specified List <em>must</em> contain only String-valued entries.
- * If the value is <code>null</code>, the attribute is removed from
- * this launch configuration.
- *
- * @param attributeName the name of the attribute
- * @param value the value, or <code>null</code> if the attribute is to be undefined
- */
- public void setAttribute(String attributeName, List value);
-
- /**
- * Sets the <code>java.util.Map</code>-valued attribute with the given name.
- * The specified Map <em>must</em> contain only String keys and String values.
- * If the value is <code>null</code>, the attribute is removed from
- * this launch configuration.
- *
- * @param attributeName the name of the attribute
- * @param value the value, or <code>null</code> if the attribute is to be undefined
- */
- public void setAttribute(String attributeName, Map value);
-
- /**
- * Sets the boolean-valued attribute with the given name.
- *
- * @param attributeName the name of the attribute
- * @param value the value
- */
- public void setAttribute(String attributeName, boolean value);
-
- /**
- * Returns the original launch configuration this working copy
- * was created from, or <code>null</code> if this is a new
- * working copy created from a launch configuration type.
- *
- * @return the original launch configuration, or <code>null</code>
- */
- public ILaunchConfiguration getOriginal();
-
- /**
- * Renames this launch configuration to the specified name.
- * The new name cannot be <code>null</code>. Has no effect if the name
- * is the same as the current name. If this working copy is based
- * on an existing launch configuration, this will cause
- * the underlying launch configuration file to be renamed when
- * this working copy is saved.
- *
- * @param name the new name for this configuration
- */
- public void rename(String name);
-
- /**
- * Sets the container this launch configuration will be stored
- * in when saved. When set to <code>null</code>, this configuration
- * will be stored locally with the workspace. The specified
- * container must exist, if specified.
- * <p>
- * If this configuration is changed from local to non-local,
- * a file will be created in the specified container when
- * saved. The local file associated with this configuration
- * will be deleted.
- * </p>
- * <p>
- * If this configuration is changed from non-local to local,
- * a file will be created locally when saved.
- * The original file associated with this configuration in
- * the workspace will be deleted.
- * </p>
- *
- * @param container the container in which to store this
- * launch configuration, or <code>null</code> if this
- * configuration is to be stored locally
- */
- public void setContainer(IContainer container);
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ * An editable copy of a launch configuration. Attributes of a
+ * launch configuration are modified by modifying the attributes
+ * of a working copy, and then saving the working copy.
+ * <p>
+ * This interface is not intended to be implemented by clients. Clients
+ * that define a launch configuration delegate extension implement the
+ * <code>ILaunchConfigurationDelegate</code> interface.
+ * </p>
+ * @see ILaunchConfiguration
+ * @see ILaunchConfigurationType
+ * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate
+ * @since 2.0
+ */
+public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, IAdaptable {
+
+ /**
+ * Returns whether this configuration has been modified
+ * since it was last saved or created.
+ *
+ * @return whether this configuration has been modified
+ * since it was last saved or created
+ */
+ public boolean isDirty();
+
+ /**
+ * Saves this working copy to its underlying file and returns
+ * a handle to the resulting launch configuration.
+ * Has no effect if this configuration does not need saving.
+ * Creates the underlying file if not yet created.
+ *
+ * @exception CoreException if an exception occurs while
+ * writing this configuration to its underlying file.
+ */
+ public ILaunchConfiguration doSave() throws CoreException;
+
+ /**
+ * Sets the integer-valued attribute with the given name.
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value
+ */
+ public void setAttribute(String attributeName, int value);
+
+ /**
+ * Sets the String-valued attribute with the given name.
+ * If the value is <code>null</code>, the attribute is removed from
+ * this launch configuration.
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value, or <code>null</code> if the attribute is to be undefined
+ */
+ public void setAttribute(String attributeName, String value);
+
+ /**
+ * Sets the <code>java.util.List</code>-valued attribute with the given name.
+ * The specified List <em>must</em> contain only String-valued entries.
+ * If the value is <code>null</code>, the attribute is removed from
+ * this launch configuration.
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value, or <code>null</code> if the attribute is to be undefined
+ */
+ public void setAttribute(String attributeName, List value);
+
+ /**
+ * Sets the <code>java.util.Map</code>-valued attribute with the given name.
+ * The specified Map <em>must</em> contain only String keys and String values.
+ * If the value is <code>null</code>, the attribute is removed from
+ * this launch configuration.
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value, or <code>null</code> if the attribute is to be undefined
+ */
+ public void setAttribute(String attributeName, Map value);
+
+ /**
+ * Sets the boolean-valued attribute with the given name.
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value
+ */
+ public void setAttribute(String attributeName, boolean value);
+
+ /**
+ * Returns the original launch configuration this working copy
+ * was created from, or <code>null</code> if this is a new
+ * working copy created from a launch configuration type.
+ *
+ * @return the original launch configuration, or <code>null</code>
+ */
+ public ILaunchConfiguration getOriginal();
+
+ /**
+ * Renames this launch configuration to the specified name.
+ * The new name cannot be <code>null</code>. Has no effect if the name
+ * is the same as the current name. If this working copy is based
+ * on an existing launch configuration, this will cause
+ * the underlying launch configuration file to be renamed when
+ * this working copy is saved.
+ *
+ * @param name the new name for this configuration
+ */
+ public void rename(String name);
+
+ /**
+ * Sets the container this launch configuration will be stored
+ * in when saved. When set to <code>null</code>, this configuration
+ * will be stored locally with the workspace. The specified
+ * container must exist, if specified.
+ * <p>
+ * If this configuration is changed from local to non-local,
+ * a file will be created in the specified container when
+ * saved. The local file associated with this configuration
+ * will be deleted.
+ * </p>
+ * <p>
+ * If this configuration is changed from non-local to local,
+ * a file will be created locally when saved.
+ * The original file associated with this configuration in
+ * the workspace will be deleted.
+ * </p>
+ *
+ * @param container the container in which to store this
+ * launch configuration, or <code>null</code> if this
+ * configuration is to be stored locally
+ */
+ public void setContainer(IContainer container);
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java
index 9ba10aed7..e85f7e06a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java
@@ -1,44 +1,44 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * A launch listener is notified of launches as they
- * are added and removed from the launch manager. Also,
- * when a process or debug target is added to a launch,
- * listeners are notified of a change.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see ILaunch
- */
-public interface ILaunchListener {
- /**
- * Notifies this listener that the specified
- * launch has been removed.
- *
- * @param launch the removed launch
- * @since 2.0
- */
- public void launchRemoved(ILaunch launch);
- /**
- * Notifies this listener that the specified launch
- * has been added.
- *
- * @param launch the newly added launch
- * @since 2.0
- */
- public void launchAdded(ILaunch launch);
- /**
- * Notifies this listener that the specified launch
- * has changed. For example, a process or debug target
- * has been added to the launch.
- *
- * @param launch the changed launch
- * @since 2.0
- */
- public void launchChanged(ILaunch launch);
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * A launch listener is notified of launches as they
+ * are added and removed from the launch manager. Also,
+ * when a process or debug target is added to a launch,
+ * listeners are notified of a change.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see ILaunch
+ */
+public interface ILaunchListener {
+ /**
+ * Notifies this listener that the specified
+ * launch has been removed.
+ *
+ * @param launch the removed launch
+ * @since 2.0
+ */
+ public void launchRemoved(ILaunch launch);
+ /**
+ * Notifies this listener that the specified launch
+ * has been added.
+ *
+ * @param launch the newly added launch
+ * @since 2.0
+ */
+ public void launchAdded(ILaunch launch);
+ /**
+ * Notifies this listener that the specified launch
+ * has changed. For example, a process or debug target
+ * has been added to the launch.
+ *
+ * @param launch the changed launch
+ * @since 2.0
+ */
+ public void launchChanged(ILaunch launch);
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
index 54df22b36..6e3d34ad0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
@@ -1,209 +1,209 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IPersistableSourceLocator;
-import org.eclipse.debug.core.model.IProcess;
-
-/**
- * The launch manager manages the set of registered launches, maintaining
- * a collection of active processes and debug targets. Clients interested
- * in launch notification may register with the launch manager.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @see ILaunch
- * @see ILaunchListener
- */
-public interface ILaunchManager {
- /**
- * A launch in a normal, non-debug mode(value <code>"run"</code>).
- */
- public static final String RUN_MODE= "run"; //$NON-NLS-1$
- /**
- * A launch in a special debug mode (value <code>"debug"</code>).
- */
- public static final String DEBUG_MODE= "debug"; //$NON-NLS-1$
-
- /**
- * Adds the given listener to the collection of registered launch listeners.
- * Has no effect if an identical listener is already registerd.
- *
- * @param listener the listener to register
- */
- public void addLaunchListener(ILaunchListener listener);
- /**
- * Removes the specified launch and notifies listeners.
- * Has no effect if an identical launch is not already
- * registered.
- *
- * @param launch the launch to remove
- * @since 2.0
- */
- public void removeLaunch(ILaunch launch);
- /**
- * Returns the collection of debug targets currently registered with this
- * launch manager.
- *
- * @return an array of debug targets
- */
- public IDebugTarget[] getDebugTargets();
- /**
- * Returns the collection of launches currently registered
- * with this launch manager.
- *
- * @return an array of launches
- */
- public ILaunch[] getLaunches();
- /**
- * Returns the collection of processes currently registered with this
- * launch manager.
- *
- * @return an array of processes
- */
- public IProcess[] getProcesses();
- /**
- * Adds the specified launch and notifies listeners. Has no
- * effect if an identical launch is already registered.
- *
- * @param launch the launch to add
- * @since 2.0
- */
- public void addLaunch(ILaunch launch);
- /**
- * Removes the given listener from the collection of registered launch listeners.
- * Has no effect if an identical listener is not already registerd.
- *
- * @param listener the listener to deregister
- */
- public void removeLaunchListener(ILaunchListener listener);
- /**
- * Returns all launch configurations defined in the workspace.
- *
- * @return all launch configurations defined in the workspace
- * @exception CoreException if an exception occurs retrieving configurations
- * @since 2.0
- */
- public ILaunchConfiguration[] getLaunchConfigurations() throws CoreException;
-
- /**
- * Returns all launch configurations of the specified type defined in the workspace
- *
- * @param type a launch configuration type
- * @return all launch configurations of the specified type defined in the workspace
- * @exception CoreException if an error occurs while retreiving
- * a launch configuration
- * @since 2.0
- */
- public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException;
-
- /**
- * Returns a handle to the launch configuration contained
- * in the specified file. The file is not verified to exist
- * or contain a launch configuration.
- *
- * @param file launch configuration file
- * @return a handle to the launch configuration contained
- * in the specified file
- * @since 2.0
- */
- public ILaunchConfiguration getLaunchConfiguration(IFile file);
-
- /**
- * Returns a handle to the launch configuration specified by
- * the given memento. The configuration may not exist.
- *
- * @return a handle to the launch configuration specified by
- * the given memento
- * @exception CoreException if the given memento is invalid or
- * an exception occurs parsing the memento
- * @see ILaunchConfiguration#getMemento()
- * @since 2.0
- */
- public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException;
-
- /**
- * Returns all defined launch configuration type extensions
- *
- * @return all defined launch configuration type extensions
- * @since 2.0
- */
- public ILaunchConfigurationType[] getLaunchConfigurationTypes();
-
- /**
- * Returns the launch configuration type extension with the specified
- * id, or <code>null</code> if it does not exist.
- *
- * @param id unique identifier for a launch configuration type extension
- * @return the launch configuration type extension with the specified
- * id, or <code>null</code> if it does not exist
- * @since 2.0
- */
- public ILaunchConfigurationType getLaunchConfigurationType(String id);
-
- /**
- * Adds the given launch configuration listener to the list
- * of listeners notified when a launch configuration is
- * added, removed, or changed. Has no effect if the given listener
- * is already registered.
- *
- * @param listener launch configuration listener
- * @since 2.0
- */
- public void addLaunchConfigurationListener(ILaunchConfigurationListener listener);
-
- /**
- * Removes the given launch configuration listener from the list
- * of listeners notified when a launch configuration is
- * added, removed, or changed. Has no effect if the given listener
- * is not already registered.
- *
- * @param listener launch configuration listener
- * @since 2.0
- */
- public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener);
-
- /**
- * Return <code>true</code> if there is a launch configuration with the specified name,
- * <code>false</code> otherwise.
- *
- * @param name the name of the launch configuration whose existence is being checked
- * @exception CoreException if unable to retrieve existing launch configuration names
- * @since 2.0
- */
- public boolean isExistingLaunchConfigurationName(String name) throws CoreException;
-
- /**
- * Return a String that can be used as the name of a launch configuration. The name
- * is guaranteed to be unique (no existing launch configurations will have this name).
- * The name that is returned uses the <code>namePrefix</code> as a starting point. If
- * there is no existing launch configuration with this name, then <code>namePrefix</code>
- * is returned. Otherwise, the value returned consists of the specified prefix plus
- * some suffix that guarantees uniqueness.
- *
- * @param namePrefix the String that the returned name must begin with
- * @since 2.0
- */
- public String generateUniqueLaunchConfigurationNameFrom(String namePrefix);
-
- /**
- * Creates and returns a new source locator of the specified
- * type.
- *
- * @param identifier the identifier associated with a
- * persistable source locator extension
- * @return a source locator
- * @exception CoreException if an exception occurs creating
- * the source locator
- * @since 2.0
- */
- public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException;
-}
-
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.eclipse.debug.core.model.IProcess;
+
+/**
+ * The launch manager manages the set of registered launches, maintaining
+ * a collection of active processes and debug targets. Clients interested
+ * in launch notification may register with the launch manager.
+ * <p>
+ * Clients are not intended to implement this interface.
+ * </p>
+ * @see ILaunch
+ * @see ILaunchListener
+ */
+public interface ILaunchManager {
+ /**
+ * A launch in a normal, non-debug mode(value <code>"run"</code>).
+ */
+ public static final String RUN_MODE= "run"; //$NON-NLS-1$
+ /**
+ * A launch in a special debug mode (value <code>"debug"</code>).
+ */
+ public static final String DEBUG_MODE= "debug"; //$NON-NLS-1$
+
+ /**
+ * Adds the given listener to the collection of registered launch listeners.
+ * Has no effect if an identical listener is already registerd.
+ *
+ * @param listener the listener to register
+ */
+ public void addLaunchListener(ILaunchListener listener);
+ /**
+ * Removes the specified launch and notifies listeners.
+ * Has no effect if an identical launch is not already
+ * registered.
+ *
+ * @param launch the launch to remove
+ * @since 2.0
+ */
+ public void removeLaunch(ILaunch launch);
+ /**
+ * Returns the collection of debug targets currently registered with this
+ * launch manager.
+ *
+ * @return an array of debug targets
+ */
+ public IDebugTarget[] getDebugTargets();
+ /**
+ * Returns the collection of launches currently registered
+ * with this launch manager.
+ *
+ * @return an array of launches
+ */
+ public ILaunch[] getLaunches();
+ /**
+ * Returns the collection of processes currently registered with this
+ * launch manager.
+ *
+ * @return an array of processes
+ */
+ public IProcess[] getProcesses();
+ /**
+ * Adds the specified launch and notifies listeners. Has no
+ * effect if an identical launch is already registered.
+ *
+ * @param launch the launch to add
+ * @since 2.0
+ */
+ public void addLaunch(ILaunch launch);
+ /**
+ * Removes the given listener from the collection of registered launch listeners.
+ * Has no effect if an identical listener is not already registerd.
+ *
+ * @param listener the listener to deregister
+ */
+ public void removeLaunchListener(ILaunchListener listener);
+ /**
+ * Returns all launch configurations defined in the workspace.
+ *
+ * @return all launch configurations defined in the workspace
+ * @exception CoreException if an exception occurs retrieving configurations
+ * @since 2.0
+ */
+ public ILaunchConfiguration[] getLaunchConfigurations() throws CoreException;
+
+ /**
+ * Returns all launch configurations of the specified type defined in the workspace
+ *
+ * @param type a launch configuration type
+ * @return all launch configurations of the specified type defined in the workspace
+ * @exception CoreException if an error occurs while retreiving
+ * a launch configuration
+ * @since 2.0
+ */
+ public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException;
+
+ /**
+ * Returns a handle to the launch configuration contained
+ * in the specified file. The file is not verified to exist
+ * or contain a launch configuration.
+ *
+ * @param file launch configuration file
+ * @return a handle to the launch configuration contained
+ * in the specified file
+ * @since 2.0
+ */
+ public ILaunchConfiguration getLaunchConfiguration(IFile file);
+
+ /**
+ * Returns a handle to the launch configuration specified by
+ * the given memento. The configuration may not exist.
+ *
+ * @return a handle to the launch configuration specified by
+ * the given memento
+ * @exception CoreException if the given memento is invalid or
+ * an exception occurs parsing the memento
+ * @see ILaunchConfiguration#getMemento()
+ * @since 2.0
+ */
+ public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException;
+
+ /**
+ * Returns all defined launch configuration type extensions
+ *
+ * @return all defined launch configuration type extensions
+ * @since 2.0
+ */
+ public ILaunchConfigurationType[] getLaunchConfigurationTypes();
+
+ /**
+ * Returns the launch configuration type extension with the specified
+ * id, or <code>null</code> if it does not exist.
+ *
+ * @param id unique identifier for a launch configuration type extension
+ * @return the launch configuration type extension with the specified
+ * id, or <code>null</code> if it does not exist
+ * @since 2.0
+ */
+ public ILaunchConfigurationType getLaunchConfigurationType(String id);
+
+ /**
+ * Adds the given launch configuration listener to the list
+ * of listeners notified when a launch configuration is
+ * added, removed, or changed. Has no effect if the given listener
+ * is already registered.
+ *
+ * @param listener launch configuration listener
+ * @since 2.0
+ */
+ public void addLaunchConfigurationListener(ILaunchConfigurationListener listener);
+
+ /**
+ * Removes the given launch configuration listener from the list
+ * of listeners notified when a launch configuration is
+ * added, removed, or changed. Has no effect if the given listener
+ * is not already registered.
+ *
+ * @param listener launch configuration listener
+ * @since 2.0
+ */
+ public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener);
+
+ /**
+ * Return <code>true</code> if there is a launch configuration with the specified name,
+ * <code>false</code> otherwise.
+ *
+ * @param name the name of the launch configuration whose existence is being checked
+ * @exception CoreException if unable to retrieve existing launch configuration names
+ * @since 2.0
+ */
+ public boolean isExistingLaunchConfigurationName(String name) throws CoreException;
+
+ /**
+ * Return a String that can be used as the name of a launch configuration. The name
+ * is guaranteed to be unique (no existing launch configurations will have this name).
+ * The name that is returned uses the <code>namePrefix</code> as a starting point. If
+ * there is no existing launch configuration with this name, then <code>namePrefix</code>
+ * is returned. Otherwise, the value returned consists of the specified prefix plus
+ * some suffix that guarantees uniqueness.
+ *
+ * @param namePrefix the String that the returned name must begin with
+ * @since 2.0
+ */
+ public String generateUniqueLaunchConfigurationNameFrom(String namePrefix);
+
+ /**
+ * Creates and returns a new source locator of the specified
+ * type.
+ *
+ * @param identifier the identifier associated with a
+ * persistable source locator extension
+ * @return a source locator
+ * @exception CoreException if an exception occurs creating
+ * the source locator
+ * @since 2.0
+ */
+ public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException;
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java
index 50be60d37..a2ada5bb9 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java
@@ -1,27 +1,27 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IStreamMonitor;
-
-/**
- * A stream listener is notified of changes
- * to a stream monitor.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IStreamMonitor
- */
-public interface IStreamListener {
- /**
- * Notifies this listener that text has been appended to
- * the given stream monitor.
- *
- * @param text the appended text
- * @param monitor the stream monitor to which text was appended
- */
- public void streamAppended(String text, IStreamMonitor monitor);
-}
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IStreamMonitor;
+
+/**
+ * A stream listener is notified of changes
+ * to a stream monitor.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IStreamMonitor
+ */
+public interface IStreamListener {
+ /**
+ * Notifies this listener that text has been appended to
+ * the given stream monitor.
+ *
+ * @param text the appended text
+ * @param monitor the stream monitor to which text was appended
+ */
+ public void streamAppended(String text, IStreamMonitor monitor);
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
index 3aa4d5661..036596209 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
@@ -1,388 +1,388 @@
-package org.eclipse.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.internal.core.DebugCoreMessages;
-import org.eclipse.debug.internal.core.LaunchManager;
-
-/**
- * A launch is the result of launching a debug session
- * and/or one or more system processes. This class provides
- * a public implementation of <code>ILaunch</code> for client
- * use.
- * <p>
- * Clients may instantiate this class. Clients may subclass this class.
- * Many of the methods in this class that are part of the <code>ILaunch</code> interface
- * are final. Clients that subclass this class are not intended to change the behavior
- * or implementation of the provided methods. Subclassing is only intended
- * to add additional information to a specific launch. For example, a client that
- * implements a launch object representing a Java launch might store a classpath
- * with the launch.
- * </p>
- * @see ILaunch
- * @see ILaunchManager
- */
-
-public class Launch extends PlatformObject implements ILaunch {
-
- /**
- * The debug targets associated with this
- * launch (the primary target is the first one
- * in this collection), or empty if
- * there are no debug targets.
- */
- private List fTargets= new ArrayList();
-
- /**
- * The configuration that was launched, or null.
- */
- private ILaunchConfiguration fConfiguration= null;
-
- /**
- * The system processes associated with
- * this launch, or empty if none.
- */
- private List fProcesses= new ArrayList();
-
- /**
- * The source locator to use in the debug session
- * or <code>null</code> if not supported.
- */
- private ISourceLocator fLocator= null;
-
- /**
- * The mode this launch was launched in.
- */
- private String fMode;
-
- /**
- * Table of client defined attributes
- */
- private HashMap fAttributes;
-
- /**
- * Flag indiating that change notification should
- * be suppressed. <code>true</code> until this
- * launch has been initialzied.
- */
- private boolean fSuppressChange = true;
-
- /**
- * Constructs a launch with the specified attributes.
- *
- * @param launchConfiguration the configuration that was launched
- * @param mode the mode of this launch - run or debug (constants
- * defined by <code>ILaunchManager</code>)
- * @param locator the source locator to use for this debug session, or
- * <code>null</code> if not supported
- */
- public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
- setLaunchConfiguration(launchConfiguration);
- setSourceLocator(locator);
- setLaunchMode(mode);
- fSuppressChange = false;
- }
-
- /**
- * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
- */
- public final boolean canTerminate() {
- return !isTerminated();
- }
-
- /**
- * @see ILaunch#getChildren()
- */
- public final Object[] getChildren() {
- ArrayList children = new ArrayList(getDebugTargets0());
- children.addAll(getProcesses0());
- return children.toArray();
- }
-
- /**
- * @see ILaunch#getDebugTarget()
- */
- public final IDebugTarget getDebugTarget() {
- if (!getDebugTargets0().isEmpty()) {
- return (IDebugTarget)getDebugTargets0().get(0);
- }
- return null;
- }
-
- /**
- * Sets the configuration that was launched
- *
- * @param configuration the configuration that was launched
- */
- private void setLaunchConfiguration(ILaunchConfiguration configuration) {
- fConfiguration = configuration;
- }
-
- /**
- * @see ILaunch#getProcesses()
- */
- public final IProcess[] getProcesses() {
- return (IProcess[])getProcesses0().toArray(new IProcess[getProcesses0().size()]);
- }
-
- /**
- * Returns the processes associated with this
- * launch, in its internal form - a list.
- *
- * @return list of processes
- */
- protected List getProcesses0() {
- return fProcesses;
- }
-
- /**
- * @see ILaunch#getSourceLocator()
- */
- public final ISourceLocator getSourceLocator() {
- return fLocator;
- }
-
- /**
- * @see ILaunch#setSourceLocator(ISourceLocator)
- */
- public final void setSourceLocator(ISourceLocator sourceLocator) {
- fLocator = sourceLocator;
- }
-
- /**
- * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
- */
- public final boolean isTerminated() {
- if (getProcesses0().isEmpty() && getDebugTargets0().isEmpty()) {
- return false;
- }
-
- Iterator processes = getProcesses0().iterator();
- while (processes.hasNext()) {
- IProcess process = (IProcess)processes.next();
- if (!process.isTerminated()) {
- return false;
- }
- }
-
- Iterator targets = getDebugTargets0().iterator();
- while (targets.hasNext()) {
- IDebugTarget target = (IDebugTarget)targets.next();
- if (!(target.isTerminated() || target.isDisconnected())) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.debug.core.model.ITerminate#terminate()
- */
- public final void terminate() throws DebugException {
- MultiStatus status=
- new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugCoreMessages.getString("Launch.terminate_failed"), null); //$NON-NLS-1$
-
- // terminate the system processes
- Iterator processes = getProcesses0().iterator();
- while (processes.hasNext()) {
- IProcess process = (IProcess)processes.next();
- if (process.canTerminate()) {
- try {
- process.terminate();
- } catch (DebugException e) {
- status.merge(e.getStatus());
- }
- }
- }
-
- // terminate or disconnect debug target if it is still alive
- Iterator targets = getDebugTargets0().iterator();
- while (targets.hasNext()) {
- IDebugTarget target= (IDebugTarget)targets.next();
- if (target != null) {
- if (target.canTerminate()) {
- try {
- target.terminate();
- } catch (DebugException e) {
- status.merge(e.getStatus());
- }
- } else {
- if (target.canDisconnect()) {
- try {
- target.disconnect();
- } catch (DebugException de) {
- status.merge(de.getStatus());
- }
- }
- }
- }
- }
- if (status.isOK())
- return;
- IStatus[] children= status.getChildren();
- if (children.length == 1) {
- throw new DebugException(children[0]);
- } else {
- throw new DebugException(status);
- }
- }
-
- /**
- * @see ILaunch#getLaunchMode()
- */
- public final String getLaunchMode() {
- return fMode;
- }
-
- /**
- * Sets the mode in which this launch was
- * launched.
- *
- * @param mode the mode in which this launch
- * was launched - one of the constants defined
- * by <code>ILaunchManager</code>.
- */
- private void setLaunchMode(String mode) {
- fMode = mode;
- }
-
- /**
- * @see ILaunch#getLaunchConfiguration()
- */
- public ILaunchConfiguration getLaunchConfiguration() {
- return fConfiguration;
- }
-
- /**
- * @see ILaunch#setAttribute(String, String)
- */
- public void setAttribute(String key, String value) {
- if (fAttributes == null) {
- fAttributes = new HashMap(5);
- }
- fAttributes.put(key, value);
- }
-
- /**
- * @see ILaunch#getAttribute(String)
- */
- public String getAttribute(String key) {
- if (fAttributes == null) {
- return null;
- }
- return (String)fAttributes.get(key);
- }
-
- /**
- * @see ILaunch#getDebugTargets()
- */
- public IDebugTarget[] getDebugTargets() {
- return (IDebugTarget[])fTargets.toArray(new IDebugTarget[fTargets.size()]);
- }
-
- /**
- * Returns the debug targets associated with this
- * launch, in its internal form - a list
- *
- * @return list of debug targets
- */
- protected List getDebugTargets0() {
- return fTargets;
- }
-
- /**
- * @see ILaunch#addDebugTarget(IDebugTarget)
- */
- public final void addDebugTarget(IDebugTarget target) {
- if (target != null) {
- if (!getDebugTargets0().contains(target)) {
- getDebugTargets0().add(target);
- fireChanged();
- }
- }
- }
-
- /**
- * @see ILaunch#removeDebugTarget(IDebugTarget)
- */
- public final void removeDebugTarget(IDebugTarget target) {
- if (target != null) {
- if (getDebugTargets0().remove(target)) {
- fireChanged();
- }
- }
- }
-
- /**
- * @see ILaunch#addProcess(IProcess)
- */
- public final void addProcess(IProcess process) {
- if (process != null) {
- if (!getProcesses0().contains(process)) {
- getProcesses0().add(process);
- fireChanged();
- }
- }
- }
-
- /**
- * @see ILaunch#removeProcess(IProcess)
- */
- public final void removeProcess(IProcess process) {
- if (process != null) {
- if (getProcesses0().remove(process)) {
- fireChanged();
- }
- }
- }
-
- /**
- * Adds the given processes to this launch.
- *
- * @param processes processes to add
- */
- protected void addProcesses(IProcess[] processes) {
- if (processes != null) {
- for (int i = 0; i < processes.length; i++) {
- addProcess(processes[i]);
- fireChanged();
- }
- }
- }
-
- /**
- * Notifies listeners that this launch has changed.
- * Has no effect of this launch has not yet been
- * properly created/initialized.
- */
- protected void fireChanged() {
- if (!fSuppressChange) {
- ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).fireUpdate(this, LaunchManager.CHANGED);
- }
- }
-
- /**
- * @see ILaunch#hasChildren()
- */
- public boolean hasChildren() {
- return getProcesses0().size() > 0 || (getDebugTargets0().size() > 0);
- }
-
-}
-
-
+package org.eclipse.debug.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.internal.core.DebugCoreMessages;
+import org.eclipse.debug.internal.core.LaunchManager;
+
+/**
+ * A launch is the result of launching a debug session
+ * and/or one or more system processes. This class provides
+ * a public implementation of <code>ILaunch</code> for client
+ * use.
+ * <p>
+ * Clients may instantiate this class. Clients may subclass this class.
+ * Many of the methods in this class that are part of the <code>ILaunch</code> interface
+ * are final. Clients that subclass this class are not intended to change the behavior
+ * or implementation of the provided methods. Subclassing is only intended
+ * to add additional information to a specific launch. For example, a client that
+ * implements a launch object representing a Java launch might store a classpath
+ * with the launch.
+ * </p>
+ * @see ILaunch
+ * @see ILaunchManager
+ */
+
+public class Launch extends PlatformObject implements ILaunch {
+
+ /**
+ * The debug targets associated with this
+ * launch (the primary target is the first one
+ * in this collection), or empty if
+ * there are no debug targets.
+ */
+ private List fTargets= new ArrayList();
+
+ /**
+ * The configuration that was launched, or null.
+ */
+ private ILaunchConfiguration fConfiguration= null;
+
+ /**
+ * The system processes associated with
+ * this launch, or empty if none.
+ */
+ private List fProcesses= new ArrayList();
+
+ /**
+ * The source locator to use in the debug session
+ * or <code>null</code> if not supported.
+ */
+ private ISourceLocator fLocator= null;
+
+ /**
+ * The mode this launch was launched in.
+ */
+ private String fMode;
+
+ /**
+ * Table of client defined attributes
+ */
+ private HashMap fAttributes;
+
+ /**
+ * Flag indiating that change notification should
+ * be suppressed. <code>true</code> until this
+ * launch has been initialzied.
+ */
+ private boolean fSuppressChange = true;
+
+ /**
+ * Constructs a launch with the specified attributes.
+ *
+ * @param launchConfiguration the configuration that was launched
+ * @param mode the mode of this launch - run or debug (constants
+ * defined by <code>ILaunchManager</code>)
+ * @param locator the source locator to use for this debug session, or
+ * <code>null</code> if not supported
+ */
+ public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
+ setLaunchConfiguration(launchConfiguration);
+ setSourceLocator(locator);
+ setLaunchMode(mode);
+ fSuppressChange = false;
+ }
+
+ /**
+ * @see org.eclipse.debug.core.model.ITerminate#canTerminate()
+ */
+ public final boolean canTerminate() {
+ return !isTerminated();
+ }
+
+ /**
+ * @see ILaunch#getChildren()
+ */
+ public final Object[] getChildren() {
+ ArrayList children = new ArrayList(getDebugTargets0());
+ children.addAll(getProcesses0());
+ return children.toArray();
+ }
+
+ /**
+ * @see ILaunch#getDebugTarget()
+ */
+ public final IDebugTarget getDebugTarget() {
+ if (!getDebugTargets0().isEmpty()) {
+ return (IDebugTarget)getDebugTargets0().get(0);
+ }
+ return null;
+ }
+
+ /**
+ * Sets the configuration that was launched
+ *
+ * @param configuration the configuration that was launched
+ */
+ private void setLaunchConfiguration(ILaunchConfiguration configuration) {
+ fConfiguration = configuration;
+ }
+
+ /**
+ * @see ILaunch#getProcesses()
+ */
+ public final IProcess[] getProcesses() {
+ return (IProcess[])getProcesses0().toArray(new IProcess[getProcesses0().size()]);
+ }
+
+ /**
+ * Returns the processes associated with this
+ * launch, in its internal form - a list.
+ *
+ * @return list of processes
+ */
+ protected List getProcesses0() {
+ return fProcesses;
+ }
+
+ /**
+ * @see ILaunch#getSourceLocator()
+ */
+ public final ISourceLocator getSourceLocator() {
+ return fLocator;
+ }
+
+ /**
+ * @see ILaunch#setSourceLocator(ISourceLocator)
+ */
+ public final void setSourceLocator(ISourceLocator sourceLocator) {
+ fLocator = sourceLocator;
+ }
+
+ /**
+ * @see org.eclipse.debug.core.model.ITerminate#isTerminated()
+ */
+ public final boolean isTerminated() {
+ if (getProcesses0().isEmpty() && getDebugTargets0().isEmpty()) {
+ return false;
+ }
+
+ Iterator processes = getProcesses0().iterator();
+ while (processes.hasNext()) {
+ IProcess process = (IProcess)processes.next();
+ if (!process.isTerminated()) {
+ return false;
+ }
+ }
+
+ Iterator targets = getDebugTargets0().iterator();
+ while (targets.hasNext()) {
+ IDebugTarget target = (IDebugTarget)targets.next();
+ if (!(target.isTerminated() || target.isDisconnected())) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.debug.core.model.ITerminate#terminate()
+ */
+ public final void terminate() throws DebugException {
+ MultiStatus status=
+ new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugCoreMessages.getString("Launch.terminate_failed"), null); //$NON-NLS-1$
+
+ // terminate the system processes
+ Iterator processes = getProcesses0().iterator();
+ while (processes.hasNext()) {
+ IProcess process = (IProcess)processes.next();
+ if (process.canTerminate()) {
+ try {
+ process.terminate();
+ } catch (DebugException e) {
+ status.merge(e.getStatus());
+ }
+ }
+ }
+
+ // terminate or disconnect debug target if it is still alive
+ Iterator targets = getDebugTargets0().iterator();
+ while (targets.hasNext()) {
+ IDebugTarget target= (IDebugTarget)targets.next();
+ if (target != null) {
+ if (target.canTerminate()) {
+ try {
+ target.terminate();
+ } catch (DebugException e) {
+ status.merge(e.getStatus());
+ }
+ } else {
+ if (target.canDisconnect()) {
+ try {
+ target.disconnect();
+ } catch (DebugException de) {
+ status.merge(de.getStatus());
+ }
+ }
+ }
+ }
+ }
+ if (status.isOK())
+ return;
+ IStatus[] children= status.getChildren();
+ if (children.length == 1) {
+ throw new DebugException(children[0]);
+ } else {
+ throw new DebugException(status);
+ }
+ }
+
+ /**
+ * @see ILaunch#getLaunchMode()
+ */
+ public final String getLaunchMode() {
+ return fMode;
+ }
+
+ /**
+ * Sets the mode in which this launch was
+ * launched.
+ *
+ * @param mode the mode in which this launch
+ * was launched - one of the constants defined
+ * by <code>ILaunchManager</code>.
+ */
+ private void setLaunchMode(String mode) {
+ fMode = mode;
+ }
+
+ /**
+ * @see ILaunch#getLaunchConfiguration()
+ */
+ public ILaunchConfiguration getLaunchConfiguration() {
+ return fConfiguration;
+ }
+
+ /**
+ * @see ILaunch#setAttribute(String, String)
+ */
+ public void setAttribute(String key, String value) {
+ if (fAttributes == null) {
+ fAttributes = new HashMap(5);
+ }
+ fAttributes.put(key, value);
+ }
+
+ /**
+ * @see ILaunch#getAttribute(String)
+ */
+ public String getAttribute(String key) {
+ if (fAttributes == null) {
+ return null;
+ }
+ return (String)fAttributes.get(key);
+ }
+
+ /**
+ * @see ILaunch#getDebugTargets()
+ */
+ public IDebugTarget[] getDebugTargets() {
+ return (IDebugTarget[])fTargets.toArray(new IDebugTarget[fTargets.size()]);
+ }
+
+ /**
+ * Returns the debug targets associated with this
+ * launch, in its internal form - a list
+ *
+ * @return list of debug targets
+ */
+ protected List getDebugTargets0() {
+ return fTargets;
+ }
+
+ /**
+ * @see ILaunch#addDebugTarget(IDebugTarget)
+ */
+ public final void addDebugTarget(IDebugTarget target) {
+ if (target != null) {
+ if (!getDebugTargets0().contains(target)) {
+ getDebugTargets0().add(target);
+ fireChanged();
+ }
+ }
+ }
+
+ /**
+ * @see ILaunch#removeDebugTarget(IDebugTarget)
+ */
+ public final void removeDebugTarget(IDebugTarget target) {
+ if (target != null) {
+ if (getDebugTargets0().remove(target)) {
+ fireChanged();
+ }
+ }
+ }
+
+ /**
+ * @see ILaunch#addProcess(IProcess)
+ */
+ public final void addProcess(IProcess process) {
+ if (process != null) {
+ if (!getProcesses0().contains(process)) {
+ getProcesses0().add(process);
+ fireChanged();
+ }
+ }
+ }
+
+ /**
+ * @see ILaunch#removeProcess(IProcess)
+ */
+ public final void removeProcess(IProcess process) {
+ if (process != null) {
+ if (getProcesses0().remove(process)) {
+ fireChanged();
+ }
+ }
+ }
+
+ /**
+ * Adds the given processes to this launch.
+ *
+ * @param processes processes to add
+ */
+ protected void addProcesses(IProcess[] processes) {
+ if (processes != null) {
+ for (int i = 0; i < processes.length; i++) {
+ addProcess(processes[i]);
+ fireChanged();
+ }
+ }
+ }
+
+ /**
+ * Notifies listeners that this launch has changed.
+ * Has no effect of this launch has not yet been
+ * properly created/initialized.
+ */
+ protected void fireChanged() {
+ if (!fSuppressChange) {
+ ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).fireUpdate(this, LaunchManager.CHANGED);
+ }
+ }
+
+ /**
+ * @see ILaunch#hasChildren()
+ */
+ public boolean hasChildren() {
+ return getProcesses0().size() > 0 || (getDebugTargets0().size() > 0);
+ }
+
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
index fec369742..b6bab171a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
@@ -1,257 +1,257 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.internal.core.DebugCoreMessages;
-
-/**
- * Abstract implementation of a breakpoint. This class is
- * intended to be subclassed by implementations
- * of breakpoints.
- *
- * @see IBreakpoint
- * @since 2.0
- */
-
-public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
-
- /**
- * Underlying marker.
- */
- private IMarker fMarker= null;
-
- /**
- * @see IBreakpoint#setMarker(IMarker)
- */
- public void setMarker(IMarker marker) throws CoreException {
- fMarker= marker;
- }
-
- /**
- * @see Object#equals(Object)
- */
- public boolean equals(Object item) {
- if (item instanceof IBreakpoint) {
- return getMarker().equals(((IBreakpoint)item).getMarker());
- }
- return false;
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getMarker().hashCode();
- }
-
- /**
- * @see IBreakpoint#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) throws CoreException {
- if (enabled != isEnabled()) {
- setAttribute(ENABLED, enabled);
- }
- }
-
- /**
- * @see IBreakpoint#isEnabled()
- */
- public boolean isEnabled() throws CoreException {
- return getMarker().getAttribute(ENABLED, false);
- }
-
- /**
- * @see IBreakpoint#isRegistered()
- */
- public boolean isRegistered() throws CoreException {
- return getMarker().getAttribute(REGISTERED, true);
- }
-
- /**
- * @see IBreakpoint#setRegistered(boolean)
- */
- public void setRegistered(boolean registered) throws CoreException {
- if (isRegistered() != registered) {
- setAttribute(REGISTERED, registered);
- IBreakpointManager mgr = DebugPlugin.getDefault().getBreakpointManager();
- if (registered) {
- mgr.addBreakpoint(this);
- } else {
- mgr.removeBreakpoint(this, false);
- }
- }
- }
-
- /**
- * @see IBreakpoint#delete()
- */
- public void delete() throws CoreException {
- getMarker().delete();
- }
-
- /**
- * @see IBreakpoint#getMarker()
- */
- public IMarker getMarker() {
- return fMarker;
- }
-
- /**
- * @see IBreakpoint#isPersisted()
- */
- public boolean isPersisted() throws CoreException {
- return getMarker().getAttribute(PERSISTED, true);
- }
-
- /**
- * @see IBreakpoint#setPersisted(boolean)
- */
- public void setPersisted(boolean persisted) throws CoreException {
- if (isPersisted() != persisted) {
- setAttribute(PERSISTED, persisted);
- }
- }
-
- /**
- * Convenience method to set the given boolean attribute of
- * this breakpoint's underlying marker in a workspace
- * runnable. Setting marker attributes in a workspace runnable
- * prevents deadlock.
- *
- * @param attributeName attribute name
- * @param value attribute value
- * @exception CoreException is setting the attribute fails
- * @see IMarker#setAttribute(java.lang.String, boolean)
- */
- protected void setAttribute(final String attributeName, final boolean value) throws CoreException {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ensureMarker().setAttribute(attributeName, value);
- }
- };
-
- workspace.run(runnable, null);
- }
-
- /**
- * Convenience method to set the given integer attribute of
- * this breakpoint's underlying marker in a workspace
- * runnable. Setting marker attributes in a workspace runnable
- * prevents deadlock.
- *
- * @param attributeName attribute name
- * @param value attribute value
- * @exception CoreException is setting the attribute fails
- * @see IMarker#setAttribute(java.lang.String, int)
- */
- protected void setAttribute(final String attributeName, final int value) throws CoreException {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ensureMarker().setAttribute(attributeName, value);
- }
- };
-
- workspace.run(runnable, null);
- }
-
- /**
- * Convenience method to set the given attribute of
- * this breakpoint's underlying marker in a workspace
- * runnable. Setting marker attributes in a workspace runnable
- * prevents deadlock.
- *
- * @param attributeName attribute name
- * @param value attribute value
- * @exception CoreException is setting the attribute fails
- * @see IMarker#setAttribute(java.lang.String, java.lang.Object)
- */
- protected void setAttribute(final String attributeName, final Object value) throws CoreException {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ensureMarker().setAttribute(attributeName, value);
- }
- };
-
- workspace.run(runnable, null);
- }
-
- /**
- * Convenience method to set the given attributes of
- * this breakpoint's underlying marker in a workspace
- * runnable. Setting marker attributes in a workspace runnable
- * prevents deadlock.
- *
- * @param attributeNames attribute names
- * @param values attribute values
- * @exception CoreException is setting the attributes fails
- * @see IMarker#setAttributes(java.lang.String[], java.lang.Object[])
- */
- protected void setAttributes(final String[] attributeNames, final Object[] values) throws CoreException {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ensureMarker().setAttributes(attributeNames, values);
- }
- };
-
- workspace.run(runnable, null);
- }
-
- /**
- * Convenience method to set the attributes of
- * this breakpoint's underlying marker in a workspace
- * runnable. Setting marker attributes in a workspace runnable
- * prevents deadlock.
- *
- * @param attributes attribute map
- * @exception CoreException is setting the attributes fails
- * @see IMarker#setAttributes(java.util.Map)
- */
- protected void setAttributes(final Map attributes) throws CoreException{
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ensureMarker().setAttributes(attributes);
- }
- };
-
- workspace.run(runnable, null);
- }
-
- /**
- * Returns the marker associated with this breakpoint.
- *
- * @return breakpoint marker
- * @exception DebugException if no marker is associated with
- * this breakpoint or the associated marker does not exist
- */
- protected IMarker ensureMarker() throws DebugException {
- IMarker m = getMarker();
- if (m == null || !m.exists()) {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
- DebugCoreMessages.getString("Breakpoint.no_associated_marker"), null)); //$NON-NLS-1$
- }
- return m;
- }
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.internal.core.DebugCoreMessages;
+
+/**
+ * Abstract implementation of a breakpoint. This class is
+ * intended to be subclassed by implementations
+ * of breakpoints.
+ *
+ * @see IBreakpoint
+ * @since 2.0
+ */
+
+public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
+
+ /**
+ * Underlying marker.
+ */
+ private IMarker fMarker= null;
+
+ /**
+ * @see IBreakpoint#setMarker(IMarker)
+ */
+ public void setMarker(IMarker marker) throws CoreException {
+ fMarker= marker;
+ }
+
+ /**
+ * @see Object#equals(Object)
+ */
+ public boolean equals(Object item) {
+ if (item instanceof IBreakpoint) {
+ return getMarker().equals(((IBreakpoint)item).getMarker());
+ }
+ return false;
+ }
+
+ /**
+ * @see Object#hashCode()
+ */
+ public int hashCode() {
+ return getMarker().hashCode();
+ }
+
+ /**
+ * @see IBreakpoint#setEnabled(boolean)
+ */
+ public void setEnabled(boolean enabled) throws CoreException {
+ if (enabled != isEnabled()) {
+ setAttribute(ENABLED, enabled);
+ }
+ }
+
+ /**
+ * @see IBreakpoint#isEnabled()
+ */
+ public boolean isEnabled() throws CoreException {
+ return getMarker().getAttribute(ENABLED, false);
+ }
+
+ /**
+ * @see IBreakpoint#isRegistered()
+ */
+ public boolean isRegistered() throws CoreException {
+ return getMarker().getAttribute(REGISTERED, true);
+ }
+
+ /**
+ * @see IBreakpoint#setRegistered(boolean)
+ */
+ public void setRegistered(boolean registered) throws CoreException {
+ if (isRegistered() != registered) {
+ setAttribute(REGISTERED, registered);
+ IBreakpointManager mgr = DebugPlugin.getDefault().getBreakpointManager();
+ if (registered) {
+ mgr.addBreakpoint(this);
+ } else {
+ mgr.removeBreakpoint(this, false);
+ }
+ }
+ }
+
+ /**
+ * @see IBreakpoint#delete()
+ */
+ public void delete() throws CoreException {
+ getMarker().delete();
+ }
+
+ /**
+ * @see IBreakpoint#getMarker()
+ */
+ public IMarker getMarker() {
+ return fMarker;
+ }
+
+ /**
+ * @see IBreakpoint#isPersisted()
+ */
+ public boolean isPersisted() throws CoreException {
+ return getMarker().getAttribute(PERSISTED, true);
+ }
+
+ /**
+ * @see IBreakpoint#setPersisted(boolean)
+ */
+ public void setPersisted(boolean persisted) throws CoreException {
+ if (isPersisted() != persisted) {
+ setAttribute(PERSISTED, persisted);
+ }
+ }
+
+ /**
+ * Convenience method to set the given boolean attribute of
+ * this breakpoint's underlying marker in a workspace
+ * runnable. Setting marker attributes in a workspace runnable
+ * prevents deadlock.
+ *
+ * @param attributeName attribute name
+ * @param value attribute value
+ * @exception CoreException is setting the attribute fails
+ * @see IMarker#setAttribute(java.lang.String, boolean)
+ */
+ protected void setAttribute(final String attributeName, final boolean value) throws CoreException {
+ IWorkspace workspace= ResourcesPlugin.getWorkspace();
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ensureMarker().setAttribute(attributeName, value);
+ }
+ };
+
+ workspace.run(runnable, null);
+ }
+
+ /**
+ * Convenience method to set the given integer attribute of
+ * this breakpoint's underlying marker in a workspace
+ * runnable. Setting marker attributes in a workspace runnable
+ * prevents deadlock.
+ *
+ * @param attributeName attribute name
+ * @param value attribute value
+ * @exception CoreException is setting the attribute fails
+ * @see IMarker#setAttribute(java.lang.String, int)
+ */
+ protected void setAttribute(final String attributeName, final int value) throws CoreException {
+ IWorkspace workspace= ResourcesPlugin.getWorkspace();
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ensureMarker().setAttribute(attributeName, value);
+ }
+ };
+
+ workspace.run(runnable, null);
+ }
+
+ /**
+ * Convenience method to set the given attribute of
+ * this breakpoint's underlying marker in a workspace
+ * runnable. Setting marker attributes in a workspace runnable
+ * prevents deadlock.
+ *
+ * @param attributeName attribute name
+ * @param value attribute value
+ * @exception CoreException is setting the attribute fails
+ * @see IMarker#setAttribute(java.lang.String, java.lang.Object)
+ */
+ protected void setAttribute(final String attributeName, final Object value) throws CoreException {
+ IWorkspace workspace= ResourcesPlugin.getWorkspace();
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ensureMarker().setAttribute(attributeName, value);
+ }
+ };
+
+ workspace.run(runnable, null);
+ }
+
+ /**
+ * Convenience method to set the given attributes of
+ * this breakpoint's underlying marker in a workspace
+ * runnable. Setting marker attributes in a workspace runnable
+ * prevents deadlock.
+ *
+ * @param attributeNames attribute names
+ * @param values attribute values
+ * @exception CoreException is setting the attributes fails
+ * @see IMarker#setAttributes(java.lang.String[], java.lang.Object[])
+ */
+ protected void setAttributes(final String[] attributeNames, final Object[] values) throws CoreException {
+ IWorkspace workspace= ResourcesPlugin.getWorkspace();
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ensureMarker().setAttributes(attributeNames, values);
+ }
+ };
+
+ workspace.run(runnable, null);
+ }
+
+ /**
+ * Convenience method to set the attributes of
+ * this breakpoint's underlying marker in a workspace
+ * runnable. Setting marker attributes in a workspace runnable
+ * prevents deadlock.
+ *
+ * @param attributes attribute map
+ * @exception CoreException is setting the attributes fails
+ * @see IMarker#setAttributes(java.util.Map)
+ */
+ protected void setAttributes(final Map attributes) throws CoreException{
+ IWorkspace workspace= ResourcesPlugin.getWorkspace();
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ensureMarker().setAttributes(attributes);
+ }
+ };
+
+ workspace.run(runnable, null);
+ }
+
+ /**
+ * Returns the marker associated with this breakpoint.
+ *
+ * @return breakpoint marker
+ * @exception DebugException if no marker is associated with
+ * this breakpoint or the associated marker does not exist
+ */
+ protected IMarker ensureMarker() throws DebugException {
+ IMarker m = getMarker();
+ if (m == null || !m.exists()) {
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
+ DebugCoreMessages.getString("Breakpoint.no_associated_marker"), null)); //$NON-NLS-1$
+ }
+ return m;
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java
index aeac73c34..54ec0139f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java
@@ -1,215 +1,215 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-
-/**
- * A breakpoint is capable of suspending the execution of a
- * program at a specific location when a program is running
- * in debug mode. Each breakpoint has an associated marker which
- * stores and persists all attributes associated with a breakpoint.
- * <p>
- * A breakpoint is defined in two parts:
- * <ol>
- * <li>By an extension of kind <code>"org.eclipse.debug.core.breakpoints"</code></li>
- * <li>By a marker definition that corresponds to the above breakpoint extension</li>
- * </ol>
- * <p>
- * For example, following is a definition of corresponding breakpoint
- * and breakpoint marker definitions. Note that the <code>markerType</code>
- * attribute defined by the breakpoint extension corresponds to the
- * type of the marker definition.
- * <pre>
- * &lt;extension point="org.eclipse.debug.core.breakpoints"&gt;
- * &lt;breakpoint
- * id="com.example.Breakpoint"
- * class="com.example.Breakpoint"
- * markerType="com.example.BreakpointMarker"&gt;
- * &lt;/breakpoint&gt;
- * &lt;/extension&gt;
- * &lt;extension point="org.eclipse.core.resources.markers"&gt;
- * &lt;marker
- * id="com.example.BreakpointMarker"
- * super type="org.eclipse.debug.core.breakpointMarker"
- * attribute name ="exampleAttribute"&gt;
- * &lt;/marker&gt;
- * &lt;/extension&gt;
- * </pre>
- * <p>
- * The breakpoint manager instantiates persisted breakpoints by
- * traversing all markers that are a subtype of
- * <code>"org.eclipse.debug.core.breakpointMarker"</code>, and
- * instantiating the class defined by the <code>class</code> attribute
- * on the associated breakpoint extension. The method <code>setMarker</code>
- * is then called to associate a marker with the breakpoint.
- * </p>
- * <p>
- * Breakpoints may or may not be registered with the breakpoint manager, and
- * are persisted and restored as such. Since marker definitions only allow
- * all or none of a specific marker type to be persisted, breakpoints define
- * a <code>PERSISTED</code> attribute for selective persistence of breakpoints
- * of the same type.
- * </p>
- *
- * @since 2.0
- */
-
-public interface IBreakpoint extends IAdaptable {
-
- /**
- * Root breakpoint marker type
- * (value <code>"org.eclipse.debug.core.breakpoint"</code>).
- */
- public static final String BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".breakpointMarker"; //$NON-NLS-1$
-
- /**
- * Line breakpoint marker type
- * (value <code>"org.eclipse.debug.core.lineBreakpoint"</code>).
- */
- public static final String LINE_BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".lineBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Enabled breakpoint marker attribute (value <code>"org.eclipse.debug.core.enabled"</code>).
- * The attribute is a <code>boolean</code> corresponding to the
- * enabled state of a breakpoint.
- *
- * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
- */
- public static final String ENABLED= "org.eclipse.debug.core.enabled"; //$NON-NLS-1$
-
- /**
- * Debug model identifier breakpoint marker attribute (value <code>"org.eclipse.debug.core.id"</code>).
- * The attribute is a <code>String</code> corresponding to the
- * identifier of the debug model a breakpoint is associated with.
- */
- public static final String ID= "org.eclipse.debug.core.id"; //$NON-NLS-1$
-
- /**
- * Registered breakpoint marker attribute (value <code>"org.eclipse.debug.core.registered"</code>).
- * The attribute is a <code>boolean</code> corresponding to
- * whether a breakpoint has been registered with the breakpoint manager.
- *
- * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
- */
- public static final String REGISTERED= "org.eclipse.debug.core.registered"; //$NON-NLS-1$
-
- /**
- * Persisted breakpoint marker attribute (value <code>"org.eclipse.debug.core.persisted"</code>).
- * The attribute is a <code>boolean</code> corresponding to
- * whether a breakpoint is to be persisted accross workspace
- * invocations.
- *
- * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
- */
- public static final String PERSISTED= "org.eclipse.debug.core.persisted"; //$NON-NLS-1$
-
- /**
- * Deletes this breakpoint's underlying marker, and removes
- * this breakpoint from the breakpoint manager.
- *
- * @exception CoreException if unable to delete this breakpoint's
- * underlying marker
- */
- public void delete() throws CoreException;
-
- /**
- * Returns the marker associated with this breakpoint, or
- * <code>null</code> if no marker is associated with this breakpoint.
- *
- * @return associated marker, or <code>null</code> if there is
- * no associated marker.
- */
- public IMarker getMarker();
- /**
- * Sets the marker associated with this breakpoint. This method is
- * called once at breakpoint creation.
- *
- * @param marker the marker to associate with this breakpoint
- * @exception CoreException if an error occurs accessing the marker
- */
- public void setMarker(IMarker marker) throws CoreException;
- /**
- * Returns the identifier of the debug model this breakpoint is
- * associated with.
- *
- * @return the identifier of the debug model this breakpoint is
- * associated with
- */
- public String getModelIdentifier();
- /**
- * Returns whether this breakpoint is enabled
- *
- * @return whether this breakpoint is enabled
- * @exception CoreException if unable to access the associated
- * attribute from this breakpoint's underlying marker
- */
- public boolean isEnabled() throws CoreException;
- /**
- * Sets the enabled state of this breakpoint. This has no effect
- * if the current enabled state is the same as specified by the
- * enabled parameter.
- *
- * @param enabled whether this breakpoint should be enabled
- * @exception CoreException if unable to set the associated attribute on
- * this breakpoint's underlying marker.
- */
- public void setEnabled(boolean enabled) throws CoreException;
-
- /**
- * Returns whether this breakpoint is currently registered with
- * the breakpoint manager.
- *
- * @return whether this breakpoint is currently registered with
- * the breakpoint manager
- * @exception CoreException if unable to access the associated
- * attribute on this breakpoint's underlying marker
- */
- public boolean isRegistered() throws CoreException;
-
- /**
- * Sets whether this breakpoint is currently registered with the
- * breakpoint manager.
- *
- * @param registered whether this breakpoint is registered with the
- * breakpoint manager
- * @exception CoreException if unable to set the associated attribute
- * on this breakpoint's underlying marker.
- */
- public void setRegistered(boolean registered) throws CoreException;
-
- /**
- * Returns whether this breakpoint is to be persisted across
- * workspace invocations, or when a project is closed and re-opened.
- * Since marker definitions only allow all/none of a specific type
- * of marker to be persisted (rather than selected markers of a
- * specific type), breakpoints define this functionality.
- *
- * @return whether this breakpoint is to be persisted
- * @exception CoreException if unable to access the associated attribute
- * on this breakpoint's underlying marker
- */
- public boolean isPersisted() throws CoreException;
-
- /**
- * Sets whether this breakpoint is to be persisted across
- * workspace invocations, or when a project is closed and re-opened.
- * Since marker definitions only allow all/none of a specific type of
- * marker to be persisted (rather than selected markers of a specific
- * type), breakpoints define this functionality. Has no effect if this
- * breakpoint's marker definition is defined as not persisted.
- *
- * @param persist whether this breakpoint is to be persisted
- * @exception CoreException if unable to set the associated attribute on
- * this breakpoint's underlying marker.
- */
- public void setPersisted(boolean registered) throws CoreException;
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+
+/**
+ * A breakpoint is capable of suspending the execution of a
+ * program at a specific location when a program is running
+ * in debug mode. Each breakpoint has an associated marker which
+ * stores and persists all attributes associated with a breakpoint.
+ * <p>
+ * A breakpoint is defined in two parts:
+ * <ol>
+ * <li>By an extension of kind <code>"org.eclipse.debug.core.breakpoints"</code></li>
+ * <li>By a marker definition that corresponds to the above breakpoint extension</li>
+ * </ol>
+ * <p>
+ * For example, following is a definition of corresponding breakpoint
+ * and breakpoint marker definitions. Note that the <code>markerType</code>
+ * attribute defined by the breakpoint extension corresponds to the
+ * type of the marker definition.
+ * <pre>
+ * &lt;extension point="org.eclipse.debug.core.breakpoints"&gt;
+ * &lt;breakpoint
+ * id="com.example.Breakpoint"
+ * class="com.example.Breakpoint"
+ * markerType="com.example.BreakpointMarker"&gt;
+ * &lt;/breakpoint&gt;
+ * &lt;/extension&gt;
+ * &lt;extension point="org.eclipse.core.resources.markers"&gt;
+ * &lt;marker
+ * id="com.example.BreakpointMarker"
+ * super type="org.eclipse.debug.core.breakpointMarker"
+ * attribute name ="exampleAttribute"&gt;
+ * &lt;/marker&gt;
+ * &lt;/extension&gt;
+ * </pre>
+ * <p>
+ * The breakpoint manager instantiates persisted breakpoints by
+ * traversing all markers that are a subtype of
+ * <code>"org.eclipse.debug.core.breakpointMarker"</code>, and
+ * instantiating the class defined by the <code>class</code> attribute
+ * on the associated breakpoint extension. The method <code>setMarker</code>
+ * is then called to associate a marker with the breakpoint.
+ * </p>
+ * <p>
+ * Breakpoints may or may not be registered with the breakpoint manager, and
+ * are persisted and restored as such. Since marker definitions only allow
+ * all or none of a specific marker type to be persisted, breakpoints define
+ * a <code>PERSISTED</code> attribute for selective persistence of breakpoints
+ * of the same type.
+ * </p>
+ *
+ * @since 2.0
+ */
+
+public interface IBreakpoint extends IAdaptable {
+
+ /**
+ * Root breakpoint marker type
+ * (value <code>"org.eclipse.debug.core.breakpoint"</code>).
+ */
+ public static final String BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".breakpointMarker"; //$NON-NLS-1$
+
+ /**
+ * Line breakpoint marker type
+ * (value <code>"org.eclipse.debug.core.lineBreakpoint"</code>).
+ */
+ public static final String LINE_BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".lineBreakpointMarker"; //$NON-NLS-1$
+
+ /**
+ * Enabled breakpoint marker attribute (value <code>"org.eclipse.debug.core.enabled"</code>).
+ * The attribute is a <code>boolean</code> corresponding to the
+ * enabled state of a breakpoint.
+ *
+ * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
+ */
+ public static final String ENABLED= "org.eclipse.debug.core.enabled"; //$NON-NLS-1$
+
+ /**
+ * Debug model identifier breakpoint marker attribute (value <code>"org.eclipse.debug.core.id"</code>).
+ * The attribute is a <code>String</code> corresponding to the
+ * identifier of the debug model a breakpoint is associated with.
+ */
+ public static final String ID= "org.eclipse.debug.core.id"; //$NON-NLS-1$
+
+ /**
+ * Registered breakpoint marker attribute (value <code>"org.eclipse.debug.core.registered"</code>).
+ * The attribute is a <code>boolean</code> corresponding to
+ * whether a breakpoint has been registered with the breakpoint manager.
+ *
+ * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
+ */
+ public static final String REGISTERED= "org.eclipse.debug.core.registered"; //$NON-NLS-1$
+
+ /**
+ * Persisted breakpoint marker attribute (value <code>"org.eclipse.debug.core.persisted"</code>).
+ * The attribute is a <code>boolean</code> corresponding to
+ * whether a breakpoint is to be persisted accross workspace
+ * invocations.
+ *
+ * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
+ */
+ public static final String PERSISTED= "org.eclipse.debug.core.persisted"; //$NON-NLS-1$
+
+ /**
+ * Deletes this breakpoint's underlying marker, and removes
+ * this breakpoint from the breakpoint manager.
+ *
+ * @exception CoreException if unable to delete this breakpoint's
+ * underlying marker
+ */
+ public void delete() throws CoreException;
+
+ /**
+ * Returns the marker associated with this breakpoint, or
+ * <code>null</code> if no marker is associated with this breakpoint.
+ *
+ * @return associated marker, or <code>null</code> if there is
+ * no associated marker.
+ */
+ public IMarker getMarker();
+ /**
+ * Sets the marker associated with this breakpoint. This method is
+ * called once at breakpoint creation.
+ *
+ * @param marker the marker to associate with this breakpoint
+ * @exception CoreException if an error occurs accessing the marker
+ */
+ public void setMarker(IMarker marker) throws CoreException;
+ /**
+ * Returns the identifier of the debug model this breakpoint is
+ * associated with.
+ *
+ * @return the identifier of the debug model this breakpoint is
+ * associated with
+ */
+ public String getModelIdentifier();
+ /**
+ * Returns whether this breakpoint is enabled
+ *
+ * @return whether this breakpoint is enabled
+ * @exception CoreException if unable to access the associated
+ * attribute from this breakpoint's underlying marker
+ */
+ public boolean isEnabled() throws CoreException;
+ /**
+ * Sets the enabled state of this breakpoint. This has no effect
+ * if the current enabled state is the same as specified by the
+ * enabled parameter.
+ *
+ * @param enabled whether this breakpoint should be enabled
+ * @exception CoreException if unable to set the associated attribute on
+ * this breakpoint's underlying marker.
+ */
+ public void setEnabled(boolean enabled) throws CoreException;
+
+ /**
+ * Returns whether this breakpoint is currently registered with
+ * the breakpoint manager.
+ *
+ * @return whether this breakpoint is currently registered with
+ * the breakpoint manager
+ * @exception CoreException if unable to access the associated
+ * attribute on this breakpoint's underlying marker
+ */
+ public boolean isRegistered() throws CoreException;
+
+ /**
+ * Sets whether this breakpoint is currently registered with the
+ * breakpoint manager.
+ *
+ * @param registered whether this breakpoint is registered with the
+ * breakpoint manager
+ * @exception CoreException if unable to set the associated attribute
+ * on this breakpoint's underlying marker.
+ */
+ public void setRegistered(boolean registered) throws CoreException;
+
+ /**
+ * Returns whether this breakpoint is to be persisted across
+ * workspace invocations, or when a project is closed and re-opened.
+ * Since marker definitions only allow all/none of a specific type
+ * of marker to be persisted (rather than selected markers of a
+ * specific type), breakpoints define this functionality.
+ *
+ * @return whether this breakpoint is to be persisted
+ * @exception CoreException if unable to access the associated attribute
+ * on this breakpoint's underlying marker
+ */
+ public boolean isPersisted() throws CoreException;
+
+ /**
+ * Sets whether this breakpoint is to be persisted across
+ * workspace invocations, or when a project is closed and re-opened.
+ * Since marker definitions only allow all/none of a specific type of
+ * marker to be persisted (rather than selected markers of a specific
+ * type), breakpoints define this functionality. Has no effect if this
+ * breakpoint's marker definition is defined as not persisted.
+ *
+ * @param persist whether this breakpoint is to be persisted
+ * @exception CoreException if unable to set the associated attribute on
+ * this breakpoint's underlying marker.
+ */
+ public void setPersisted(boolean registered) throws CoreException;
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java
index 7c65af84d..64836c3c2 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java
@@ -1,57 +1,57 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-
-/**
- * A debug element represents an artifact in a program being
- * debugged.
- * <p>
- * Some methods on debug elements require communication
- * with the target program. Such methods may throw a <code>DebugException</code>
- * with a status code of <code>TARGET_REQUEST_FAILED</code>
- * when unable to complete a request due to a failure on the target.
- * Methods that require communication with the target program or require
- * the target to be in a specific state (for example, suspended), are declared
- * as such.
- * </p>
- * <p>
- * Debug elements are language independent. However, language specific
- * features can be made available via the adapter mechanism provided by
- * <code>IAdaptable</code>, or by extending the debug element interfaces.
- * A debug model is responsible for declaring any special adapters
- * its debug elements implement.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- */
-public interface IDebugElement extends IAdaptable {
-
- /**
- * Returns the unique identifier of the plug-in
- * this debug element originated from.
- *
- * @return the plug-in identifier
- */
- public String getModelIdentifier();
- /**
- * Returns the debug target this element is contained in.
- *
- * @return the debug target this element is contained in
- */
- public IDebugTarget getDebugTarget();
- /**
- * Returns the launch this element is contained in.
- *
- * @return the launch this element is contained in
- */
- public ILaunch getLaunch();
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.ILaunch;
+
+/**
+ * A debug element represents an artifact in a program being
+ * debugged.
+ * <p>
+ * Some methods on debug elements require communication
+ * with the target program. Such methods may throw a <code>DebugException</code>
+ * with a status code of <code>TARGET_REQUEST_FAILED</code>
+ * when unable to complete a request due to a failure on the target.
+ * Methods that require communication with the target program or require
+ * the target to be in a specific state (for example, suspended), are declared
+ * as such.
+ * </p>
+ * <p>
+ * Debug elements are language independent. However, language specific
+ * features can be made available via the adapter mechanism provided by
+ * <code>IAdaptable</code>, or by extending the debug element interfaces.
+ * A debug model is responsible for declaring any special adapters
+ * its debug elements implement.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ */
+public interface IDebugElement extends IAdaptable {
+
+ /**
+ * Returns the unique identifier of the plug-in
+ * this debug element originated from.
+ *
+ * @return the plug-in identifier
+ */
+ public String getModelIdentifier();
+ /**
+ * Returns the debug target this element is contained in.
+ *
+ * @return the debug target this element is contained in
+ */
+ public IDebugTarget getDebugTarget();
+ /**
+ * Returns the launch this element is contained in.
+ *
+ * @return the launch this element is contained in
+ */
+ public ILaunch getLaunch();
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java
index d3389534d..222a6f19a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java
@@ -1,92 +1,92 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.IBreakpointListener;
-
-/**
- * A debug target is a debuggable execution context. For example, a debug target
- * may represent a debuggable process or a virtual machine. A debug target is the root
- * of the debug element hierarchy. A debug target contains threads. Minimally, a debug
- * target supports the following:
- * <ul>
- * <li>terminate
- * <li>suspend/resume
- * <li>breakpoints
- * <li>disconnect
- * </ul>
- * <p>
- * Generally, launching a debug session results in the creation of a
- * debug target. Launching is a client responsibility, as is debug target
- * creation.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see ITerminate
- * @see ISuspendResume
- * @see IBreakpointListener
- * @see IDisconnect
- * @see IMemoryBlockRetrieval
- * @see org.eclipse.debug.core.ILaunch
- */
-public interface IDebugTarget extends IDebugElement, ITerminate, ISuspendResume, IBreakpointListener, IDisconnect, IMemoryBlockRetrieval {
- /**
- * Returns the system process associated with this debug target.
- *
- * @return the system process associated with this debug target
- */
- public IProcess getProcess();
- /**
- * Returns the threads contained in this debug target. An
- * empty collection is returned if this debug target contains
- * no threads.
- *
- * @return a collection of threads
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
- * @since 2.0
- */
- public IThread[] getThreads() throws DebugException;
-
- /**
- * Returns whether this debug target currently contains any threads.
- *
- * @return whether this debug target currently contains any threads
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
- * @since 2.0
- */
- public boolean hasThreads() throws DebugException;
-
- /**
- * Returns the name of this debug target. Name format is debug model
- * specific, and should be specified by a debug model.
- *
- * @return this target's name
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
- */
- public String getName() throws DebugException;
-
- /**
- * Returns whether the given breakpoint is supported by this
- * target - i.e. whether the given breakpoint could be installed
- * in this target.
- *
- * @return whether the given breakpoint is supported by this
- * target
- */
- public boolean supportsBreakpoint(IBreakpoint breakpoint);
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.IBreakpointListener;
+
+/**
+ * A debug target is a debuggable execution context. For example, a debug target
+ * may represent a debuggable process or a virtual machine. A debug target is the root
+ * of the debug element hierarchy. A debug target contains threads. Minimally, a debug
+ * target supports the following:
+ * <ul>
+ * <li>terminate
+ * <li>suspend/resume
+ * <li>breakpoints
+ * <li>disconnect
+ * </ul>
+ * <p>
+ * Generally, launching a debug session results in the creation of a
+ * debug target. Launching is a client responsibility, as is debug target
+ * creation.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see ITerminate
+ * @see ISuspendResume
+ * @see IBreakpointListener
+ * @see IDisconnect
+ * @see IMemoryBlockRetrieval
+ * @see org.eclipse.debug.core.ILaunch
+ */
+public interface IDebugTarget extends IDebugElement, ITerminate, ISuspendResume, IBreakpointListener, IDisconnect, IMemoryBlockRetrieval {
+ /**
+ * Returns the system process associated with this debug target.
+ *
+ * @return the system process associated with this debug target
+ */
+ public IProcess getProcess();
+ /**
+ * Returns the threads contained in this debug target. An
+ * empty collection is returned if this debug target contains
+ * no threads.
+ *
+ * @return a collection of threads
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li></ul>
+ * @since 2.0
+ */
+ public IThread[] getThreads() throws DebugException;
+
+ /**
+ * Returns whether this debug target currently contains any threads.
+ *
+ * @return whether this debug target currently contains any threads
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li></ul>
+ * @since 2.0
+ */
+ public boolean hasThreads() throws DebugException;
+
+ /**
+ * Returns the name of this debug target. Name format is debug model
+ * specific, and should be specified by a debug model.
+ *
+ * @return this target's name
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li></ul>
+ */
+ public String getName() throws DebugException;
+
+ /**
+ * Returns whether the given breakpoint is supported by this
+ * target - i.e. whether the given breakpoint could be installed
+ * in this target.
+ *
+ * @return whether the given breakpoint is supported by this
+ * target
+ */
+ public boolean supportsBreakpoint(IBreakpoint breakpoint);
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java
index 7e06b6c4a..2b28297c8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java
@@ -1,44 +1,44 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * The ability to end a debug session with a target program
- * and allow the target to continue running.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IDebugTarget
- */
-public interface IDisconnect {
- /**
- * Returns whether this element can currently disconnect.
- *
- * @return whether this element can currently disconnect
- */
- public boolean canDisconnect();
- /**
- * Disconnects this element from its target. Generally, disconnecting
- * ends a debug session with a debug target, but allows the target
- * program to continue running.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public void disconnect() throws DebugException;
- /**
- * Returns whether this element is disconnected.
- *
- * @return whether this element is disconnected
- */
- public boolean isDisconnected();
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * The ability to end a debug session with a target program
+ * and allow the target to continue running.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IDebugTarget
+ */
+public interface IDisconnect {
+ /**
+ * Returns whether this element can currently disconnect.
+ *
+ * @return whether this element can currently disconnect
+ */
+ public boolean canDisconnect();
+ /**
+ * Disconnects this element from its target. Generally, disconnecting
+ * ends a debug session with a debug target, but allows the target
+ * program to continue running.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public void disconnect() throws DebugException;
+ /**
+ * Returns whether this element is disconnected.
+ *
+ * @return whether this element is disconnected
+ */
+ public boolean isDisconnected();
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java
index ee92662f9..bee5e9360 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java
@@ -1,61 +1,61 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * An expression is a snippet of code that can be evaluated
- * to produce a value. When and how an experssion is evaluated
- * is implementation specific. The context/binding required to
- * evaluate an expression varies by debug model, and by
- * user intent. Furthermore, an expression may need to be evaluated
- * at a specific location in a program (for example, at a
- * breakpoint/line where certain variables referenced in the
- * expression are visible/allocated). A user may want to
- * evaluate an expression once to produce a value that can
- * be inspected iteratively, or they may wish to evaluate an
- * expression iteratively producing new values each time
- * (i.e. as in a watch list).
- * <p>
- * Clients are intended to implement this interface.
- * </p>
- * @since 2.0
- */
-public interface IExpression extends IDebugElement {
-
- /**
- * Returns this expression's snippet of code.
- *
- * @return the expression
- */
- public abstract String getExpressionText();
-
- /**
- * Returns the current value of this expression or
- * <code>null</code> if this expression does not
- * currently have a value.
- *
- * @return value or <code>null</code>
- */
- public abstract IValue getValue();
-
- /**
- * Returns the debug target this expression is associated
- * with, or <code>null</code> if this expression is not
- * associated with a debug target.
- *
- * @return debug target or <code>null</code>
- * @see IDebugElement#getDebugTarget()
- */
- public abstract IDebugTarget getDebugTarget();
-
- /**
- * Notifies this expression that it has been removed
- * from the expression manager. Any required clean up
- * is be performed such that this expression can be
- * garbage collected.
- */
- public abstract void dispose();
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * An expression is a snippet of code that can be evaluated
+ * to produce a value. When and how an experssion is evaluated
+ * is implementation specific. The context/binding required to
+ * evaluate an expression varies by debug model, and by
+ * user intent. Furthermore, an expression may need to be evaluated
+ * at a specific location in a program (for example, at a
+ * breakpoint/line where certain variables referenced in the
+ * expression are visible/allocated). A user may want to
+ * evaluate an expression once to produce a value that can
+ * be inspected iteratively, or they may wish to evaluate an
+ * expression iteratively producing new values each time
+ * (i.e. as in a watch list).
+ * <p>
+ * Clients are intended to implement this interface.
+ * </p>
+ * @since 2.0
+ */
+public interface IExpression extends IDebugElement {
+
+ /**
+ * Returns this expression's snippet of code.
+ *
+ * @return the expression
+ */
+ public abstract String getExpressionText();
+
+ /**
+ * Returns the current value of this expression or
+ * <code>null</code> if this expression does not
+ * currently have a value.
+ *
+ * @return value or <code>null</code>
+ */
+ public abstract IValue getValue();
+
+ /**
+ * Returns the debug target this expression is associated
+ * with, or <code>null</code> if this expression is not
+ * associated with a debug target.
+ *
+ * @return debug target or <code>null</code>
+ * @see IDebugElement#getDebugTarget()
+ */
+ public abstract IDebugTarget getDebugTarget();
+
+ /**
+ * Notifies this expression that it has been removed
+ * from the expression manager. Any required clean up
+ * is be performed such that this expression can be
+ * garbage collected.
+ */
+ public abstract void dispose();
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java
index 61aa6aca3..9a72f3017 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java
@@ -1,43 +1,43 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-
-/**
- * A launch configuration delegate performs launching for a
- * specific type of launch configuration. A launch configuration
- * delegate is defined by the <code>delegate</code> attribute
- * of a <code>launchConfigurationType</code> extension.
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see ILaunchConfiguration
- * @since 2.0
- */
-public interface ILaunchConfigurationDelegate {
-
- /**
- * Launches the given configuration in the specified mode, contributing
- * debug targets and/or processes to the given launch object. The
- * launch object has already been registered with the launch manager.
- *
- * @param configuration the configuration to launch
- * @param mode the mode in which to launch, one of the mode constants
- * defined by <code>ILaunchManager</code> -
- * <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
- * @param monitor progress monitor, or <code>null</code>
- * @param launch the launch object to contribute processes and debug
- * targets to
- * @exception CoreException if launching fails
- */
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/**
+ * A launch configuration delegate performs launching for a
+ * specific type of launch configuration. A launch configuration
+ * delegate is defined by the <code>delegate</code> attribute
+ * of a <code>launchConfigurationType</code> extension.
+ * <p>
+ * This interface is intended to be implemented by clients.
+ * </p>
+ * @see org.eclipse.debug.core.ILaunchConfigurationType
+ * @see ILaunchConfiguration
+ * @since 2.0
+ */
+public interface ILaunchConfigurationDelegate {
+
+ /**
+ * Launches the given configuration in the specified mode, contributing
+ * debug targets and/or processes to the given launch object. The
+ * launch object has already been registered with the launch manager.
+ *
+ * @param configuration the configuration to launch
+ * @param mode the mode in which to launch, one of the mode constants
+ * defined by <code>ILaunchManager</code> -
+ * <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
+ * @param monitor progress monitor, or <code>null</code>
+ * @param launch the launch object to contribute processes and debug
+ * targets to
+ * @exception CoreException if launching fails
+ */
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java
index e5173f7d0..55a7da471 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java
@@ -1,44 +1,44 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * A breakpoint that can be located at a specific line of source code.
- */
-public interface ILineBreakpoint extends IBreakpoint {
-
-/**
- * Returns the line number in the original source that corresponds
- * to the location of this breakpoint, or -1 if the attribute is not
- * present.
- *
- * @return this breakpoint's line number, or -1 if unknown
- * @exception CoreException if a <code>CoreException</code> is thrown
- * while accessing the underlying <code>IMarker.LINE_NUMBER</code> marker attribute
- */
-public int getLineNumber() throws CoreException;
-/**
- * Returns starting source index in the original source that corresponds
- * to the location of this breakpoint, or -1 if the attribute is not present.
- *
- * @return this breakpoint's char start value, or -1 if unknown
- * @exception CoreException if a <code>CoreException</code> is thrown
- * while accessing the underlying <code>IMarker.CHAR_START</code> marker attribute
- */
-public int getCharStart() throws CoreException;
-/**
- * Returns ending source index in the original source that corresponds
- * to the location of this breakpoint, or -1 if the attribute is not present.
- *
- * @return this breakpoint's char end value, or -1 if unknown
- * @exception CoreException if a <code>CoreException</code> is thrown
- * while accessing the underlying <code>IMarker.CHAR_END</code> marker attribute
- */
-public int getCharEnd() throws CoreException;
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * A breakpoint that can be located at a specific line of source code.
+ */
+public interface ILineBreakpoint extends IBreakpoint {
+
+/**
+ * Returns the line number in the original source that corresponds
+ * to the location of this breakpoint, or -1 if the attribute is not
+ * present.
+ *
+ * @return this breakpoint's line number, or -1 if unknown
+ * @exception CoreException if a <code>CoreException</code> is thrown
+ * while accessing the underlying <code>IMarker.LINE_NUMBER</code> marker attribute
+ */
+public int getLineNumber() throws CoreException;
+/**
+ * Returns starting source index in the original source that corresponds
+ * to the location of this breakpoint, or -1 if the attribute is not present.
+ *
+ * @return this breakpoint's char start value, or -1 if unknown
+ * @exception CoreException if a <code>CoreException</code> is thrown
+ * while accessing the underlying <code>IMarker.CHAR_START</code> marker attribute
+ */
+public int getCharStart() throws CoreException;
+/**
+ * Returns ending source index in the original source that corresponds
+ * to the location of this breakpoint, or -1 if the attribute is not present.
+ *
+ * @return this breakpoint's char end value, or -1 if unknown
+ * @exception CoreException if a <code>CoreException</code> is thrown
+ * while accessing the underlying <code>IMarker.CHAR_END</code> marker attribute
+ */
+public int getCharEnd() throws CoreException;
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java
index ec2bfcad9..249d4e0e8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java
@@ -1,76 +1,76 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A contiguous segment of memory in an execution context.
- * A memory block is represented by a starting memory address
- * and a length. Not all debug architectures support the retrieval
- * of memory blocks.
- *
- * @see IMemoryBlockRetrieval
- * @since 2.0
- */
-public interface IMemoryBlock extends IDebugElement {
-
- /**
- * Returns the start address of this memory block.
- *
- * @return the start address of this memory block
- */
- public long getStartAddress();
-
- /**
- * Returns the length of this memory block in bytes.
- *
- * @return the length of this memory block in bytes
- */
- public long getLength();
-
- /**
- * Returns the values of the bytes currently contained
- * in this this memory block.
- *
- * @return the values of the bytes currently contained
- * in this this memory block
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- public byte[] getBytes() throws DebugException;
-
- /**
- * Returns whether this memory block supports value modification
- *
- * @return whether this memory block supports value modification
- */
- public boolean supportsValueModification();
-
- /**
- * Sets the value of the bytes in this memory block at the specified
- * offset within this memory block to the spcified bytes.
- * The offset is zero based.
- *
- * @param offset the offset at which to set the new values
- * @param bytes the new values
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This memory block does not support value modification</li>
- * <li>The specified offset is greater than or equal to the length
- * of this memory block, or the number of bytes specified goes
- * beyond the end of this memory block (index of out of range)</li>
- * </ul>
- */
- public void setValue(long offset, byte[] bytes) throws DebugException;
-
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A contiguous segment of memory in an execution context.
+ * A memory block is represented by a starting memory address
+ * and a length. Not all debug architectures support the retrieval
+ * of memory blocks.
+ *
+ * @see IMemoryBlockRetrieval
+ * @since 2.0
+ */
+public interface IMemoryBlock extends IDebugElement {
+
+ /**
+ * Returns the start address of this memory block.
+ *
+ * @return the start address of this memory block
+ */
+ public long getStartAddress();
+
+ /**
+ * Returns the length of this memory block in bytes.
+ *
+ * @return the length of this memory block in bytes
+ */
+ public long getLength();
+
+ /**
+ * Returns the values of the bytes currently contained
+ * in this this memory block.
+ *
+ * @return the values of the bytes currently contained
+ * in this this memory block
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ */
+ public byte[] getBytes() throws DebugException;
+
+ /**
+ * Returns whether this memory block supports value modification
+ *
+ * @return whether this memory block supports value modification
+ */
+ public boolean supportsValueModification();
+
+ /**
+ * Sets the value of the bytes in this memory block at the specified
+ * offset within this memory block to the spcified bytes.
+ * The offset is zero based.
+ *
+ * @param offset the offset at which to set the new values
+ * @param bytes the new values
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * <li>This memory block does not support value modification</li>
+ * <li>The specified offset is greater than or equal to the length
+ * of this memory block, or the number of bytes specified goes
+ * beyond the end of this memory block (index of out of range)</li>
+ * </ul>
+ */
+ public void setValue(long offset, byte[] bytes) throws DebugException;
+
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java
index d9ab94b34..e4f3924cd 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java
@@ -1,46 +1,46 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * Supports the retrieval of arbitrary blocks of memory.
- *
- * @see IMemoryBlock
- * @since 2.0
- */
-public interface IMemoryBlockRetrieval {
-
- /**
- * Returns whether this debug target supports the retrieval
- * of memory blocks.
- *
- * @return whether this debug target supports the retrieval
- * of memory blocks
- */
- public boolean supportsStorageRetrieval();
-
- /**
- * Returns a memory block that starts at the specified
- * memory address, with the specified length.
- *
- * @param startAddress starting address
- * @param length length of the memory block in bytes
- * @return a memory block that starts at the specified
- * memory address, with the specified length
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This debug target does not support memory block retrieval</li>
- * <li>The specified address and length are not within valid
- * ranges</li>
- * </ul>
- */
- public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException;
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Supports the retrieval of arbitrary blocks of memory.
+ *
+ * @see IMemoryBlock
+ * @since 2.0
+ */
+public interface IMemoryBlockRetrieval {
+
+ /**
+ * Returns whether this debug target supports the retrieval
+ * of memory blocks.
+ *
+ * @return whether this debug target supports the retrieval
+ * of memory blocks
+ */
+ public boolean supportsStorageRetrieval();
+
+ /**
+ * Returns a memory block that starts at the specified
+ * memory address, with the specified length.
+ *
+ * @param startAddress starting address
+ * @param length length of the memory block in bytes
+ * @return a memory block that starts at the specified
+ * memory address, with the specified length
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * <li>This debug target does not support memory block retrieval</li>
+ * <li>The specified address and length are not within valid
+ * ranges</li>
+ * </ul>
+ */
+ public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException;
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
index ed623bd4a..154b3ee67 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
@@ -1,71 +1,71 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunch;
-
-/**
- * A process represents a program running in normal (non-debug) mode.
- * Processes support setting and getting of client defined attributes.
- * This way, clients can annotate a process with any extra information
- * important to them. For example, classpath annotations, or command
- * line arguments used to launch the process may be important to a client.
- * <p>
- * Clients may implement this interface, however, the debug plug-in
- * provides an implementation of this interface for a
- * <code>java.lang.Process</code>.
- * </p>
- * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String)
- */
-public interface IProcess extends IAdaptable, ITerminate {
-
- /**
- * Returns a human-readable label for this process.
- *
- * @return a label for this process
- */
- public String getLabel();
- /**
- * Returns the launch this element originated from.
- *
- * @return the launch this process is contained in
- */
- public ILaunch getLaunch();
- /**
- * Returns a proxy to the standard input, output, and error streams
- * for this process, or <code>null</code> if not supported.
- *
- * @return a streams proxy, or <code>null</code> if not supported
- */
- public IStreamsProxy getStreamsProxy();
-
- /**
- * Sets the value of a client defined attribute.
- *
- * @param key the attribute key
- * @param value the attribute value
- */
- public void setAttribute(String key, String value);
-
- /**
- * Returns the value of a client defined attribute.
- *
- * @param key the attribute key
- * @return value the String attribute value, or <code>null</code> if undefined
- */
- public String getAttribute(String key);
-
- /**
- * Returns the exit value of this process. Conventionally, 0 indicates
- * normal termination.
- *
- * @return the exit value of this process
- * @exception DebugException if this process has not yet terminated
- */
- public int getExitValue() throws DebugException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+
+/**
+ * A process represents a program running in normal (non-debug) mode.
+ * Processes support setting and getting of client defined attributes.
+ * This way, clients can annotate a process with any extra information
+ * important to them. For example, classpath annotations, or command
+ * line arguments used to launch the process may be important to a client.
+ * <p>
+ * Clients may implement this interface, however, the debug plug-in
+ * provides an implementation of this interface for a
+ * <code>java.lang.Process</code>.
+ * </p>
+ * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String)
+ */
+public interface IProcess extends IAdaptable, ITerminate {
+
+ /**
+ * Returns a human-readable label for this process.
+ *
+ * @return a label for this process
+ */
+ public String getLabel();
+ /**
+ * Returns the launch this element originated from.
+ *
+ * @return the launch this process is contained in
+ */
+ public ILaunch getLaunch();
+ /**
+ * Returns a proxy to the standard input, output, and error streams
+ * for this process, or <code>null</code> if not supported.
+ *
+ * @return a streams proxy, or <code>null</code> if not supported
+ */
+ public IStreamsProxy getStreamsProxy();
+
+ /**
+ * Sets the value of a client defined attribute.
+ *
+ * @param key the attribute key
+ * @param value the attribute value
+ */
+ public void setAttribute(String key, String value);
+
+ /**
+ * Returns the value of a client defined attribute.
+ *
+ * @param key the attribute key
+ * @return value the String attribute value, or <code>null</code> if undefined
+ */
+ public String getAttribute(String key);
+
+ /**
+ * Returns the exit value of this process. Conventionally, 0 indicates
+ * normal termination.
+ *
+ * @return the exit value of this process
+ * @exception DebugException if this process has not yet terminated
+ */
+ public int getExitValue() throws DebugException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java
index 6fecca6ee..5e5de25fc 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java
@@ -1,31 +1,31 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A register is a special kind of variable that is contained
- * in a register group. Each register has a name and a value.
- * Not all debug architectures provide access to registers.
- *
- * @since 2.0
- */
-public interface IRegister extends IVariable {
-
- /**
- * Returns the register group this register is contained in.
- *
- * @return the register group this register is contained in
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public IRegisterGroup getRegisterGroup() throws DebugException;
-
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A register is a special kind of variable that is contained
+ * in a register group. Each register has a name and a value.
+ * Not all debug architectures provide access to registers.
+ *
+ * @since 2.0
+ */
+public interface IRegister extends IVariable {
+
+ /**
+ * Returns the register group this register is contained in.
+ *
+ * @return the register group this register is contained in
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public IRegisterGroup getRegisterGroup() throws DebugException;
+
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java
index 4a330f1b9..426dc5e56 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java
@@ -1,56 +1,56 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A register group is a group of registers that are
- * assigned to a stack frame. Some debug architectures
- * provide access to registers, and registers are often
- * grouped logically. For example, a floating point
- * register group.
- *
- * @since 2.0
- */
-public interface IRegisterGroup extends IDebugElement {
-
-
- /**
- * Returns the name of this register group.
- *
- * @return this register group's name
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getName() throws DebugException;
-
- /**
- * Returns the registers in this register group.
- *
- * @return the registers in this register group
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public IRegister[] getRegisters() throws DebugException;
-
- /**
- * Returns whether this register group currently contains any registers.
- *
- * @return whether this register group currently contains any registers
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public boolean hasRegisters() throws DebugException;
-
-}
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A register group is a group of registers that are
+ * assigned to a stack frame. Some debug architectures
+ * provide access to registers, and registers are often
+ * grouped logically. For example, a floating point
+ * register group.
+ *
+ * @since 2.0
+ */
+public interface IRegisterGroup extends IDebugElement {
+
+
+ /**
+ * Returns the name of this register group.
+ *
+ * @return this register group's name
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getName() throws DebugException;
+
+ /**
+ * Returns the registers in this register group.
+ *
+ * @return the registers in this register group
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public IRegister[] getRegisters() throws DebugException;
+
+ /**
+ * Returns whether this register group currently contains any registers.
+ *
+ * @return whether this register group currently contains any registers
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public boolean hasRegisters() throws DebugException;
+
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java
index 181b83dd2..22a9b12eb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java
@@ -1,62 +1,62 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IStackFrame;
-
-/**
- * A source locator locates source elements for stack frames. A launch (optionally)
- * specifies a source locator which is
- * used to locate source for that debug session. If a launch does not
- * provide a source locator, source cannot be displayed.
- * Abstraction of source lookup allows clients to hide implementation
- * details of source location and representation.
- * <p>
- * Generally, an implementor of a debug model will also implement launch configuration types,
- * delegates, and source locators that work together as a whole. That is, the implementation
- * of a source locator will have knowledge of how to locate a source element
- * for a stack frame. For example, a Java stack frame could define API which
- * specifies a source file name. A Java source locator would use this information
- * to locate the associated file in the workspace.
- * </p>
- * <p>
- * Source is displayed by the debug UI plug-in. The debug UI uses a source locator
- * to resolve an object representing the source for a stack frame, and then uses
- * a debug model presentation to determine the editor and editor input to use to
- * display the actual source in an editor.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.core.ILaunch
- * @see org.eclipse.debug.core.model.IStackFrame
- * @see org.eclipse.debug.ui.IDebugModelPresentation
- * @see org.eclipse.debug.core.model.IPersistableSourceLocator
- */
-public interface ISourceLocator {
-
- /**
- * Returns a source element that corresponds to the given stack frame, or
- * <code>null</code> if a source element could not be located. The object returned
- * by this method will be used by the debug UI plug-in to display source.
- * The debug UI uses the debug model presentation associated
- * with the given stack frame's debug model to translate a source object into an
- * {editor input, editor id} pair in which to display source.
- * <p>
- * For example, a java source locator could return an object representing a
- * compilation unit or class file. The java debug model presentation would
- * then be responsible for providing an editor input and editor id for each
- * compilation unit and class file such that the debug UI could display source.
- * </p>
- *
- * @param stackFrame the stack frame for which to locate source
- * @return an object representing a source element.
- */
- public Object getSourceElement(IStackFrame stackFrame);
-
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IStackFrame;
+
+/**
+ * A source locator locates source elements for stack frames. A launch (optionally)
+ * specifies a source locator which is
+ * used to locate source for that debug session. If a launch does not
+ * provide a source locator, source cannot be displayed.
+ * Abstraction of source lookup allows clients to hide implementation
+ * details of source location and representation.
+ * <p>
+ * Generally, an implementor of a debug model will also implement launch configuration types,
+ * delegates, and source locators that work together as a whole. That is, the implementation
+ * of a source locator will have knowledge of how to locate a source element
+ * for a stack frame. For example, a Java stack frame could define API which
+ * specifies a source file name. A Java source locator would use this information
+ * to locate the associated file in the workspace.
+ * </p>
+ * <p>
+ * Source is displayed by the debug UI plug-in. The debug UI uses a source locator
+ * to resolve an object representing the source for a stack frame, and then uses
+ * a debug model presentation to determine the editor and editor input to use to
+ * display the actual source in an editor.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see org.eclipse.debug.core.ILaunch
+ * @see org.eclipse.debug.core.model.IStackFrame
+ * @see org.eclipse.debug.ui.IDebugModelPresentation
+ * @see org.eclipse.debug.core.model.IPersistableSourceLocator
+ */
+public interface ISourceLocator {
+
+ /**
+ * Returns a source element that corresponds to the given stack frame, or
+ * <code>null</code> if a source element could not be located. The object returned
+ * by this method will be used by the debug UI plug-in to display source.
+ * The debug UI uses the debug model presentation associated
+ * with the given stack frame's debug model to translate a source object into an
+ * {editor input, editor id} pair in which to display source.
+ * <p>
+ * For example, a java source locator could return an object representing a
+ * compilation unit or class file. The java debug model presentation would
+ * then be responsible for providing an editor input and editor id for each
+ * compilation unit and class file such that the debug UI could display source.
+ * </p>
+ *
+ * @param stackFrame the stack frame for which to locate source
+ * @return an object representing a source element.
+ */
+ public Object getSourceElement(IStackFrame stackFrame);
+
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java
index bf9d787d7..500256f9a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java
@@ -1,176 +1,176 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A stack frame represents an execution context in a suspended thread.
- * A stack frame contains variables representing visible locals and arguments at
- * the current execution location. Minimally, a stack frame supports
- * the following:
- * <ul>
- * <li>suspend/resume (convenience to resume this stack frame's thread)
- * <li>stepping
- * <li>termination (convenience to terminate this stack frame's thread or debug target)
- * </ul>
- * <p>
- * A debug model implementation may choose to re-use or discard
- * stack frames on iterative thread suspensions. Clients
- * cannot assume that stack frames are identical or equal across
- * iterative thread suspensions and must check for equality on iterative
- * suspensions if they wish to re-use the objects.
- * </p>
- * <p>
- * A debug model implementation that preserves equality
- * across iterative suspensions may display more desirable behavior in
- * some clients. For example, if stack frames are preserved
- * while stepping, a UI client would be able to update the UI incrementally,
- * rather than collapse and redraw the entire list.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IStep
- * @see ISuspendResume
- * @see ITerminate
- */
-public interface IStackFrame extends IDebugElement, IStep, ISuspendResume, ITerminate {
- /**
- * Returns the thread this stack frame is contained in.
- *
- * @return thread
- * @since 2.0
- */
- public IThread getThread();
- /**
- * Returns the visible variables in this stack frame. An empty
- * collection is returned if there are no visible variables.
- *
- * @return collection of visible variables
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public IVariable[] getVariables() throws DebugException;
-
- /**
- * Returns whether this stack frame currently contains any visible variables.
- *
- * @return whether this stack frame currently contains any visible variables
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public boolean hasVariables() throws DebugException;
-
- /**
- * Returns the line number of the instruction pointer in
- * this stack frame that corresponds to a line in an associated source
- * element, or <code>-1</code> if line number information
- * is unavailable.
- *
- * @return line number of instruction pointer in this stack frame, or
- * <code>-1</code> if line number information is unavailable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- public int getLineNumber() throws DebugException;
-
- /**
- * Returns the index of the first character in the associated source
- * element that corresponds to the current location of the instruction pointer
- * in this stack frame, or <code>-1</code> if the information is unavailable.
- * <p>
- * If a debug model supports expression level stepping, the start/end
- * character ranges are used to highlight the expression within a line
- * that is being executed.
- * </p>
- * @return index of the first character in the associated source
- * element that corresponds to the current location of the instruction pointer
- * in this stack frame, or <code>-1</code> if the information is unavailable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public int getCharStart() throws DebugException;
-
- /**
- * Returns the index of the last character in the associated source
- * element that corresponds to the current location of the instruction pointer
- * in this stack frame, or <code>-1</code> if the information is unavailable.
- * <p>
- * If a debug model supports expression level stepping, the start/end
- * character ranges are used to highlight the expression within a line
- * that is being executed.
- * </p>
- * @return index of the last character in the associated source
- * element that corresponds to the current location of the instruction pointer
- * in this stack frame, or <code>-1</code> if the information is unavailable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public int getCharEnd() throws DebugException;
-
- /**
- * Returns the name of this stack frame. Name format is debug model
- * specific, and should be specified by a debug model.
- *
- * @return this frame's name
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- public String getName() throws DebugException;
-
- /**
- * Returns the register groups assigned to this stack frame,
- * or an empty collection if no register groups are assigned
- * to this stack frame.
- *
- * @return the register groups assigned to this stack frame
- * or an empty collection if no register groups are assigned
- * to this stack frame
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public IRegisterGroup[] getRegisterGroups() throws DebugException;
-
- /**
- * Returns whether this stack frame contains any register groups.
- *
- * @return whether this stack frame contains any visible register groups
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public boolean hasRegisterGroups() throws DebugException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A stack frame represents an execution context in a suspended thread.
+ * A stack frame contains variables representing visible locals and arguments at
+ * the current execution location. Minimally, a stack frame supports
+ * the following:
+ * <ul>
+ * <li>suspend/resume (convenience to resume this stack frame's thread)
+ * <li>stepping
+ * <li>termination (convenience to terminate this stack frame's thread or debug target)
+ * </ul>
+ * <p>
+ * A debug model implementation may choose to re-use or discard
+ * stack frames on iterative thread suspensions. Clients
+ * cannot assume that stack frames are identical or equal across
+ * iterative thread suspensions and must check for equality on iterative
+ * suspensions if they wish to re-use the objects.
+ * </p>
+ * <p>
+ * A debug model implementation that preserves equality
+ * across iterative suspensions may display more desirable behavior in
+ * some clients. For example, if stack frames are preserved
+ * while stepping, a UI client would be able to update the UI incrementally,
+ * rather than collapse and redraw the entire list.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IStep
+ * @see ISuspendResume
+ * @see ITerminate
+ */
+public interface IStackFrame extends IDebugElement, IStep, ISuspendResume, ITerminate {
+ /**
+ * Returns the thread this stack frame is contained in.
+ *
+ * @return thread
+ * @since 2.0
+ */
+ public IThread getThread();
+ /**
+ * Returns the visible variables in this stack frame. An empty
+ * collection is returned if there are no visible variables.
+ *
+ * @return collection of visible variables
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public IVariable[] getVariables() throws DebugException;
+
+ /**
+ * Returns whether this stack frame currently contains any visible variables.
+ *
+ * @return whether this stack frame currently contains any visible variables
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public boolean hasVariables() throws DebugException;
+
+ /**
+ * Returns the line number of the instruction pointer in
+ * this stack frame that corresponds to a line in an associated source
+ * element, or <code>-1</code> if line number information
+ * is unavailable.
+ *
+ * @return line number of instruction pointer in this stack frame, or
+ * <code>-1</code> if line number information is unavailable
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ */
+ public int getLineNumber() throws DebugException;
+
+ /**
+ * Returns the index of the first character in the associated source
+ * element that corresponds to the current location of the instruction pointer
+ * in this stack frame, or <code>-1</code> if the information is unavailable.
+ * <p>
+ * If a debug model supports expression level stepping, the start/end
+ * character ranges are used to highlight the expression within a line
+ * that is being executed.
+ * </p>
+ * @return index of the first character in the associated source
+ * element that corresponds to the current location of the instruction pointer
+ * in this stack frame, or <code>-1</code> if the information is unavailable
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public int getCharStart() throws DebugException;
+
+ /**
+ * Returns the index of the last character in the associated source
+ * element that corresponds to the current location of the instruction pointer
+ * in this stack frame, or <code>-1</code> if the information is unavailable.
+ * <p>
+ * If a debug model supports expression level stepping, the start/end
+ * character ranges are used to highlight the expression within a line
+ * that is being executed.
+ * </p>
+ * @return index of the last character in the associated source
+ * element that corresponds to the current location of the instruction pointer
+ * in this stack frame, or <code>-1</code> if the information is unavailable
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public int getCharEnd() throws DebugException;
+
+ /**
+ * Returns the name of this stack frame. Name format is debug model
+ * specific, and should be specified by a debug model.
+ *
+ * @return this frame's name
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ */
+ public String getName() throws DebugException;
+
+ /**
+ * Returns the register groups assigned to this stack frame,
+ * or an empty collection if no register groups are assigned
+ * to this stack frame.
+ *
+ * @return the register groups assigned to this stack frame
+ * or an empty collection if no register groups are assigned
+ * to this stack frame
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public IRegisterGroup[] getRegisterGroups() throws DebugException;
+
+ /**
+ * Returns whether this stack frame contains any register groups.
+ *
+ * @return whether this stack frame contains any visible register groups
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public boolean hasRegisterGroups() throws DebugException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java
index b27ce940b..65c326f3f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java
@@ -1,85 +1,85 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * Provides the ability to step into, over, and return
- * from the current execution location. Implementations
- * must be non-blocking.
- * <p>
- * Clients may implement this interface.
- * </p>
- */
-public interface IStep {
- /**
- * Returns whether this element can currently perform a step into.
- *
- * @return whether this element can currently perform a step into
- */
- public boolean canStepInto();
- /**
- * Returns whether this element can currently perform a step over.
- *
- * @return whether this element can currently perform a step over
- */
- public boolean canStepOver();
- /**
- * Returns whether this element can currently perform a step return.
- *
- * @return whether this element can currently perform a step return
- */
- public boolean canStepReturn();
- /**
- * Returns whether this element is currently stepping.
- * <p>
- * For example, a thread is considered to be stepping
- * after the <code>stepOver</code> call until the step over is completed,
- * a breakpoint is reached, an exception is thrown, or the thread or debug target is
- * terminated.
- * </p>
- *
- * @return whether this element is currently stepping
- */
- public boolean isStepping();
- /**
- * Steps into the current statement, generating <code>RESUME</code>
- * and <code>SUSPEND</code> events for the associated thread. Can only be called
- * when the associated thread is suspended. Implementations must implement
- * stepping as non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
- * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
- * </ul>
- */
- public void stepInto() throws DebugException;
- /**
- * Steps over the current statement, generating <code>RESUME</code>
- * and <code>SUSPEND</code> events for the associated thread. Can only be called
- * when the associated thread is suspended. Implementations must implement
- * stepping as non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
- * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
- * </ul>
- */
- public void stepOver() throws DebugException;
- /**
- * Steps to the next return statement in the current scope,
- * generating <code>RESUME</code> and <code>SUSPEND</code> events for
- * the associated thread. Can only be called when the associated thread is suspended.
- * Implementations must implement stepping as non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
- * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
- * </ul>
- */
- public void stepReturn() throws DebugException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to step into, over, and return
+ * from the current execution location. Implementations
+ * must be non-blocking.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ */
+public interface IStep {
+ /**
+ * Returns whether this element can currently perform a step into.
+ *
+ * @return whether this element can currently perform a step into
+ */
+ public boolean canStepInto();
+ /**
+ * Returns whether this element can currently perform a step over.
+ *
+ * @return whether this element can currently perform a step over
+ */
+ public boolean canStepOver();
+ /**
+ * Returns whether this element can currently perform a step return.
+ *
+ * @return whether this element can currently perform a step return
+ */
+ public boolean canStepReturn();
+ /**
+ * Returns whether this element is currently stepping.
+ * <p>
+ * For example, a thread is considered to be stepping
+ * after the <code>stepOver</code> call until the step over is completed,
+ * a breakpoint is reached, an exception is thrown, or the thread or debug target is
+ * terminated.
+ * </p>
+ *
+ * @return whether this element is currently stepping
+ */
+ public boolean isStepping();
+ /**
+ * Steps into the current statement, generating <code>RESUME</code>
+ * and <code>SUSPEND</code> events for the associated thread. Can only be called
+ * when the associated thread is suspended. Implementations must implement
+ * stepping as non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
+ * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
+ * </ul>
+ */
+ public void stepInto() throws DebugException;
+ /**
+ * Steps over the current statement, generating <code>RESUME</code>
+ * and <code>SUSPEND</code> events for the associated thread. Can only be called
+ * when the associated thread is suspended. Implementations must implement
+ * stepping as non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
+ * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
+ * </ul>
+ */
+ public void stepOver() throws DebugException;
+ /**
+ * Steps to the next return statement in the current scope,
+ * generating <code>RESUME</code> and <code>SUSPEND</code> events for
+ * the associated thread. Can only be called when the associated thread is suspended.
+ * Implementations must implement stepping as non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
+ * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
+ * </ul>
+ */
+ public void stepReturn() throws DebugException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java
index 0c8e4a807..895c7b777 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java
@@ -1,43 +1,43 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.IStreamListener;
-
-/**
- * A stream monitor manages the contents of the stream a process
- * is writing to, and notifies registered listeners of changes in
- * the stream.
- * <p>
- * Clients may implement this interface. Generally, a client that
- * provides an implementation of the <code>IStreamsProxy</code>
- * interface must also provide an implementation of this interface.
- * </p>
- * @see IStreamsProxy
- */
-public interface IStreamMonitor {
- /**
- * Adds the given listener to this stream monitor's registered listeners.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the listener to add
- */
- public void addListener(IStreamListener listener);
- /**
- * Returns the entire current contents of the stream. An empty
- * String is returned if the stream is empty.
- *
- * @return the stream contents as a <code>String</code>
- */
- public String getContents();
- /**
- * Removes the given listener from this stream monitor's registered listeners.
- * Has no effect if the listener is not already registered.
- *
- * @param listener the listener to remove
- */
- public void removeListener(IStreamListener listener);
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.IStreamListener;
+
+/**
+ * A stream monitor manages the contents of the stream a process
+ * is writing to, and notifies registered listeners of changes in
+ * the stream.
+ * <p>
+ * Clients may implement this interface. Generally, a client that
+ * provides an implementation of the <code>IStreamsProxy</code>
+ * interface must also provide an implementation of this interface.
+ * </p>
+ * @see IStreamsProxy
+ */
+public interface IStreamMonitor {
+ /**
+ * Adds the given listener to this stream monitor's registered listeners.
+ * Has no effect if an identical listener is already registered.
+ *
+ * @param listener the listener to add
+ */
+ public void addListener(IStreamListener listener);
+ /**
+ * Returns the entire current contents of the stream. An empty
+ * String is returned if the stream is empty.
+ *
+ * @return the stream contents as a <code>String</code>
+ */
+ public String getContents();
+ /**
+ * Removes the given listener from this stream monitor's registered listeners.
+ * Has no effect if the listener is not already registered.
+ *
+ * @param listener the listener to remove
+ */
+ public void removeListener(IStreamListener listener);
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java
index 01c9741d8..8838512fe 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java
@@ -1,51 +1,51 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.IOException;
-
-/**
- * A streams proxy acts as proxy between the streams of a
- * process and interested clients. This abstraction allows
- * implementations of <code>IProcess</code> to handle I/O related
- * to the standard input, output, and error streams associated
- * with a process.
- * <p>
- * Clients implementing the <code>IProcess</code> interface must also
- * provide an implementation of this interface.
- * </p>
- * @see IProcess
- */
-public interface IStreamsProxy {
- /**
- * Returns a monitor for the error stream of this proxy's process,
- * or <code>null</code> if not supported.
- * The monitor is connected to the error stream of the
- * associated process.
- *
- * @return an error stream monitor, or <code>null</code> if none
- */
- public IStreamMonitor getErrorStreamMonitor();
- /**
- * Returns a monitor for the output stream of this proxy's process,
- * or <code>null</code> if not supported.
- * The monitor is connected to the output stream of the
- * associated process.
- *
- * @return an output stream monitor, or <code>null</code> if none
- */
- public IStreamMonitor getOutputStreamMonitor();
- /**
- * Writes the given text to the output stream connected to the
- * standard input stream of this proxy's process.
- *
- * @param input the text to be written
- * @exception IOException when an error occurs writing to the
- * underlying <code>OutputStream</code>.
- *
- */
- public void write(String input) throws IOException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.IOException;
+
+/**
+ * A streams proxy acts as proxy between the streams of a
+ * process and interested clients. This abstraction allows
+ * implementations of <code>IProcess</code> to handle I/O related
+ * to the standard input, output, and error streams associated
+ * with a process.
+ * <p>
+ * Clients implementing the <code>IProcess</code> interface must also
+ * provide an implementation of this interface.
+ * </p>
+ * @see IProcess
+ */
+public interface IStreamsProxy {
+ /**
+ * Returns a monitor for the error stream of this proxy's process,
+ * or <code>null</code> if not supported.
+ * The monitor is connected to the error stream of the
+ * associated process.
+ *
+ * @return an error stream monitor, or <code>null</code> if none
+ */
+ public IStreamMonitor getErrorStreamMonitor();
+ /**
+ * Returns a monitor for the output stream of this proxy's process,
+ * or <code>null</code> if not supported.
+ * The monitor is connected to the output stream of the
+ * associated process.
+ *
+ * @return an output stream monitor, or <code>null</code> if none
+ */
+ public IStreamMonitor getOutputStreamMonitor();
+ /**
+ * Writes the given text to the output stream connected to the
+ * standard input stream of this proxy's process.
+ *
+ * @param input the text to be written
+ * @exception IOException when an error occurs writing to the
+ * underlying <code>OutputStream</code>.
+ *
+ */
+ public void write(String input) throws IOException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java
index d1d08f1cb..d87f36b45 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java
@@ -1,57 +1,57 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * Provides the ability to suspend and resume a thread
- * or debug target.
- * <p>
- * Clients may implement this interface.
- * </p>
- */
-public interface ISuspendResume {
- /**
- * Returns whether this element can currently be resumed.
- *
- * @return whether this element can currently be resumed
- */
- public boolean canResume();
- /**
- * Returns whether this element can currently be suspended.
- *
- * @return whether this element can currently be suspended
- */
- public boolean canSuspend();
- /**
- * Returns whether this element is currently suspended.
- *
- * @return whether this element is currently suspended
- */
- public boolean isSuspended();
- /**
- * Causes this element to resume its execution, generating a <code>RESUME</code> event.
- * Has no effect on an element that is not suspended. This call is non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public void resume() throws DebugException;
- /**
- * Causes this element to suspend its execution, generating a <code>SUSPEND</code> event.
- * Has no effect on an already suspended element.
- * Implementations may be blocking or non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public void suspend() throws DebugException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to suspend and resume a thread
+ * or debug target.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ */
+public interface ISuspendResume {
+ /**
+ * Returns whether this element can currently be resumed.
+ *
+ * @return whether this element can currently be resumed
+ */
+ public boolean canResume();
+ /**
+ * Returns whether this element can currently be suspended.
+ *
+ * @return whether this element can currently be suspended
+ */
+ public boolean canSuspend();
+ /**
+ * Returns whether this element is currently suspended.
+ *
+ * @return whether this element is currently suspended
+ */
+ public boolean isSuspended();
+ /**
+ * Causes this element to resume its execution, generating a <code>RESUME</code> event.
+ * Has no effect on an element that is not suspended. This call is non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public void resume() throws DebugException;
+ /**
+ * Causes this element to suspend its execution, generating a <code>SUSPEND</code> event.
+ * Has no effect on an already suspended element.
+ * Implementations may be blocking or non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public void suspend() throws DebugException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java
index 3848ffa97..9a60cddb9 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java
@@ -1,40 +1,40 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * Provides the ability to terminate an execution
- * context - for example, a thread, debug target or process.
- * <p>
- * Clients may implement this interface.
- * </p>
- */
-public interface ITerminate {
- /**
- * Returns whether this element can be terminated.
- *
- * @return whether this element can be terminated
- */
- public boolean canTerminate();
- /**
- * Returns whether this element is terminated.
- *
- * @return whether this element is terminated
- */
- public boolean isTerminated();
- /**
- * Causes this element to terminate, generating a <code>TERMINATE</code> event.
- * Implementations may be blocking or non-blocking.
- *
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public void terminate() throws DebugException;
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to terminate an execution
+ * context - for example, a thread, debug target or process.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ */
+public interface ITerminate {
+ /**
+ * Returns whether this element can be terminated.
+ *
+ * @return whether this element can be terminated
+ */
+ public boolean canTerminate();
+ /**
+ * Returns whether this element is terminated.
+ *
+ * @return whether this element is terminated
+ */
+ public boolean isTerminated();
+ /**
+ * Causes this element to terminate, generating a <code>TERMINATE</code> event.
+ * Implementations may be blocking or non-blocking.
+ *
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public void terminate() throws DebugException;
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java
index 615156eb1..e9b0787aa 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java
@@ -1,105 +1,105 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A thread is a sequential flow of execution in a debug target.
- * A thread contains stack frames. Stack frames are only available when the
- * thread is suspended, and are returned in top-down order.
- * Minimally, a thread supports the following:
- * <ul>
- * <li>suspend/resume
- * <li>stepping
- * <li>terminate
- * </ul>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see ISuspendResume
- * @see IStep
- * @see ITerminate
- * @see IStackFrame
- */
-
-public interface IThread extends IDebugElement, ISuspendResume, IStep, ITerminate {
- /**
- * Returns the stack frames contained in this thread. An
- * empty collection is returned if this thread contains
- * no stack frames, or is not currently suspended. Stack frames
- * are returned in top down order.
- *
- * @return a collection of stack frames
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public IStackFrame[] getStackFrames() throws DebugException;
-
- /**
- * Returns whether this thread currently contains any stack
- * frames.
- *
- * @return whether this thread currently contains any stack frames
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public boolean hasStackFrames() throws DebugException;
-
- /**
- * Returns the priority of this thread. The meaning of this
- * number is operating-system dependent.
- *
- * @return thread priority
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public int getPriority() throws DebugException;
- /**
- * Returns the top stack frame or <code>null</code> if there is
- * currently no top stack frame.
- *
- * @return the top stack frame, or <code>null</code> if none
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public IStackFrame getTopStackFrame() throws DebugException;
- /**
- * Returns the name of this thread. Name format is debug model
- * specific, and should be specified by a debug model.
- *
- * @return this thread's name
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getName() throws DebugException;
-
- /**
- * Returns the breakpoints that caused this thread to suspend,
- * or an empty collection if this thread is not suspended or
- * was not suspended by a breakpoint. Usually a single breakpoint
- * will be returned, but this collection can contain more than
- * one breakpoint if two breakpoints are at the same location in
- * a program.
- *
- * @return the collection of breakpoints that caused this thread to suspend
- */
- public IBreakpoint[] getBreakpoints();
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A thread is a sequential flow of execution in a debug target.
+ * A thread contains stack frames. Stack frames are only available when the
+ * thread is suspended, and are returned in top-down order.
+ * Minimally, a thread supports the following:
+ * <ul>
+ * <li>suspend/resume
+ * <li>stepping
+ * <li>terminate
+ * </ul>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see ISuspendResume
+ * @see IStep
+ * @see ITerminate
+ * @see IStackFrame
+ */
+
+public interface IThread extends IDebugElement, ISuspendResume, IStep, ITerminate {
+ /**
+ * Returns the stack frames contained in this thread. An
+ * empty collection is returned if this thread contains
+ * no stack frames, or is not currently suspended. Stack frames
+ * are returned in top down order.
+ *
+ * @return a collection of stack frames
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public IStackFrame[] getStackFrames() throws DebugException;
+
+ /**
+ * Returns whether this thread currently contains any stack
+ * frames.
+ *
+ * @return whether this thread currently contains any stack frames
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public boolean hasStackFrames() throws DebugException;
+
+ /**
+ * Returns the priority of this thread. The meaning of this
+ * number is operating-system dependent.
+ *
+ * @return thread priority
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public int getPriority() throws DebugException;
+ /**
+ * Returns the top stack frame or <code>null</code> if there is
+ * currently no top stack frame.
+ *
+ * @return the top stack frame, or <code>null</code> if none
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public IStackFrame getTopStackFrame() throws DebugException;
+ /**
+ * Returns the name of this thread. Name format is debug model
+ * specific, and should be specified by a debug model.
+ *
+ * @return this thread's name
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getName() throws DebugException;
+
+ /**
+ * Returns the breakpoints that caused this thread to suspend,
+ * or an empty collection if this thread is not suspended or
+ * was not suspended by a breakpoint. Usually a single breakpoint
+ * will be returned, but this collection can contain more than
+ * one breakpoint if two breakpoints are at the same location in
+ * a program.
+ *
+ * @return the collection of breakpoints that caused this thread to suspend
+ */
+ public IBreakpoint[] getBreakpoints();
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java
index a78a48b90..323144614 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java
@@ -1,98 +1,98 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A value represents the value of a variable.
- * A value representing a complex data structure contains variables.
- * <p>
- * An implementation may choose to re-use or discard
- * values on iterative thread suspensions. Clients
- * cannot assume that values are identical or equal across
- * iterative thread suspensions and must check for equality on iterative
- * suspensions if they wish to re-use the objects.
- * </p>
- * <p>
- * An implementation that preserves equality
- * across iterative suspensions may display more desirable behavior in
- * some clients. For example, if variables are preserved
- * while stepping, a UI client would be able to update the UI incrementally,
- * rather than collapse and redraw the entire list or tree.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IVariable
- */
-
-
-public interface IValue extends IDebugElement {
-
- /**
- * Returns a description of the type of data this value contains
- * or references.
- *
- * @return the name of this value's reference type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getReferenceTypeName() throws DebugException;
-
- /**
- * Returns this value as a <code>String</code>.
- *
- * @return a String representation of this value
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getValueString() throws DebugException;
-
- /**
- * Returns whether this value is currently allocated.
- * <p>
- * For example, if this value represents
- * an object that has been garbage collected, <code>false</code> is returned.
- * </p>
- * @return whether this value is currently allocated
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public boolean isAllocated() throws DebugException;
- /**
- * Returns the visible variables in this value. An empty
- * collection is returned if there are no visible variables.
- *
- * @return an array of visible variables
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public IVariable[] getVariables() throws DebugException;
-
- /**
- * Returns whether this value currently contains any visible variables.
- *
- * @return whether this value currently contains any visible variables
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 2.0
- */
- public boolean hasVariables() throws DebugException;
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A value represents the value of a variable.
+ * A value representing a complex data structure contains variables.
+ * <p>
+ * An implementation may choose to re-use or discard
+ * values on iterative thread suspensions. Clients
+ * cannot assume that values are identical or equal across
+ * iterative thread suspensions and must check for equality on iterative
+ * suspensions if they wish to re-use the objects.
+ * </p>
+ * <p>
+ * An implementation that preserves equality
+ * across iterative suspensions may display more desirable behavior in
+ * some clients. For example, if variables are preserved
+ * while stepping, a UI client would be able to update the UI incrementally,
+ * rather than collapse and redraw the entire list or tree.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IVariable
+ */
+
+
+public interface IValue extends IDebugElement {
+
+ /**
+ * Returns a description of the type of data this value contains
+ * or references.
+ *
+ * @return the name of this value's reference type
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getReferenceTypeName() throws DebugException;
+
+ /**
+ * Returns this value as a <code>String</code>.
+ *
+ * @return a String representation of this value
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getValueString() throws DebugException;
+
+ /**
+ * Returns whether this value is currently allocated.
+ * <p>
+ * For example, if this value represents
+ * an object that has been garbage collected, <code>false</code> is returned.
+ * </p>
+ * @return whether this value is currently allocated
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public boolean isAllocated() throws DebugException;
+ /**
+ * Returns the visible variables in this value. An empty
+ * collection is returned if there are no visible variables.
+ *
+ * @return an array of visible variables
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public IVariable[] getVariables() throws DebugException;
+
+ /**
+ * Returns whether this value currently contains any visible variables.
+ *
+ * @return whether this value currently contains any visible variables
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the debug target. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
+ * @since 2.0
+ */
+ public boolean hasVariables() throws DebugException;
} \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java
index bd08b4e0c..df4d93da6 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java
@@ -1,79 +1,79 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * Provides the ability to modify the value of a variable in
- * a target.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IVariable
- */
-public interface IValueModification {
-
- /**
- * Attempts to set the value of this variable to the
- * value of the given expression.
- *
- * @param expression an expression to generate a new value
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public void setValue(String expression) throws DebugException;
-
- /**
- * Sets the value of this variable to the given value.
- *
- * @param value a new value
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- * @since 2.0
- */
- public void setValue(IValue value) throws DebugException;
-
- /**
- * Returns whether this variable supports value modification.
- *
- * @return whether this variable supports value modification
- */
- public boolean supportsValueModification();
-
- /**
- * Returns whether the given expression is valid to be used in
- * setting a new value for this variable.
- *
- * @param expression an expression to generate a new value
- * @return whether the expression is valid
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- */
- public boolean verifyValue(String expression) throws DebugException;
-
- /**
- * Returns whether the given value can be used as
- * a new value for this variable.
- *
- * @param value a new value
- * @return whether the value is valid
- * @exception DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target
- * <li>NOT_SUPPORTED - The capability is not supported by the target
- * </ul>
- * @since 2.0
- */
- public boolean verifyValue(IValue value) throws DebugException;
-}
-
-
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to modify the value of a variable in
+ * a target.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IVariable
+ */
+public interface IValueModification {
+
+ /**
+ * Attempts to set the value of this variable to the
+ * value of the given expression.
+ *
+ * @param expression an expression to generate a new value
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public void setValue(String expression) throws DebugException;
+
+ /**
+ * Sets the value of this variable to the given value.
+ *
+ * @param value a new value
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ * @since 2.0
+ */
+ public void setValue(IValue value) throws DebugException;
+
+ /**
+ * Returns whether this variable supports value modification.
+ *
+ * @return whether this variable supports value modification
+ */
+ public boolean supportsValueModification();
+
+ /**
+ * Returns whether the given expression is valid to be used in
+ * setting a new value for this variable.
+ *
+ * @param expression an expression to generate a new value
+ * @return whether the expression is valid
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ */
+ public boolean verifyValue(String expression) throws DebugException;
+
+ /**
+ * Returns whether the given value can be used as
+ * a new value for this variable.
+ *
+ * @param value a new value
+ * @return whether the value is valid
+ * @exception DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target
+ * <li>NOT_SUPPORTED - The capability is not supported by the target
+ * </ul>
+ * @since 2.0
+ */
+ public boolean verifyValue(IValue value) throws DebugException;
+}
+
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
index 59a3dd607..eec3069e1 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
@@ -1,89 +1,89 @@
-package org.eclipse.debug.core.model;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A variable represents a visible data structure in a stack frame
- * or value.
- * Each variable has a value which may in turn contain more variables.
- * A variable may support value modification.
- * <p>
- * An implementation may choose to re-use or discard
- * variables on iterative thread suspensions. Clients
- * cannot assume that variables are identical or equal across
- * iterative thread suspensions and must check for equality on iterative
- * suspensions if they wish to re-use the objects.
- * </p>
- * <p>
- * An implementation that preserves equality
- * across iterative suspensions may display more desirable behavior in
- * some clients. For example, if variables are preserved
- * while stepping, a UI client would be able to update the UI incrementally,
- * rather than collapse and redraw the entire list or tree.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IValue
- * @see IStackFrame
- * @see IValueModification
- */
-public interface IVariable extends IDebugElement, IValueModification {
- /**
- * Returns the value of this variable.
- *
- * @return this variable's value
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public IValue getValue() throws DebugException;
- /**
- * Returns the name of this variable. Name format is debug model
- * specific, and should be specified by a debug model.
- *
- * @return this variable's name
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getName() throws DebugException;
- /**
- * Returns a description of the type of data this variable is
- * declared to reference. Note that the declared type of a
- * variable and the concrete type of its value are not neccessarily
- * the same.
- *
- * @return the declared type of this variable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- */
- public String getReferenceTypeName() throws DebugException;
-
- /**
- * Returns whether this variable's value has changed since the last suspend event.
- * Implementations may choose whether the last suspend event is the last suspend
- * event in this variable's debug target, or within the thread(s) in which this variable
- * is visible.
- * <p>
- * Implementations that choose not to implement this function should always
- * return <code>false</code>.
- * </p>
- *
- * @return whether this variable's value has changed since the last suspend event
- * @exception DebugException if an exception occurs determining if this variable's
- * value has changed since the last suspend event
- */
- public boolean hasValueChanged() throws DebugException;
-
-
-}
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A variable represents a visible data structure in a stack frame
+ * or value.
+ * Each variable has a value which may in turn contain more variables.
+ * A variable may support value modification.
+ * <p>
+ * An implementation may choose to re-use or discard
+ * variables on iterative thread suspensions. Clients
+ * cannot assume that variables are identical or equal across
+ * iterative thread suspensions and must check for equality on iterative
+ * suspensions if they wish to re-use the objects.
+ * </p>
+ * <p>
+ * An implementation that preserves equality
+ * across iterative suspensions may display more desirable behavior in
+ * some clients. For example, if variables are preserved
+ * while stepping, a UI client would be able to update the UI incrementally,
+ * rather than collapse and redraw the entire list or tree.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see IValue
+ * @see IStackFrame
+ * @see IValueModification
+ */
+public interface IVariable extends IDebugElement, IValueModification {
+ /**
+ * Returns the value of this variable.
+ *
+ * @return this variable's value
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public IValue getValue() throws DebugException;
+ /**
+ * Returns the name of this variable. Name format is debug model
+ * specific, and should be specified by a debug model.
+ *
+ * @return this variable's name
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getName() throws DebugException;
+ /**
+ * Returns a description of the type of data this variable is
+ * declared to reference. Note that the declared type of a
+ * variable and the concrete type of its value are not neccessarily
+ * the same.
+ *
+ * @return the declared type of this variable
+ * @exception DebugException if this method fails. Reasons include:
+ * <ul><li>Failure communicating with the VM. The DebugException's
+ * status code contains the underlying exception responsible for
+ * the failure.</li>
+ */
+ public String getReferenceTypeName() throws DebugException;
+
+ /**
+ * Returns whether this variable's value has changed since the last suspend event.
+ * Implementations may choose whether the last suspend event is the last suspend
+ * event in this variable's debug target, or within the thread(s) in which this variable
+ * is visible.
+ * <p>
+ * Implementations that choose not to implement this function should always
+ * return <code>false</code>.
+ * </p>
+ *
+ * @return whether this variable's value has changed since the last suspend event
+ * @exception DebugException if an exception occurs determining if this variable's
+ * value has changed since the last suspend event
+ */
+ public boolean hasValueChanged() throws DebugException;
+
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java
index 88122c0e5..76f365ede 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java
@@ -1,56 +1,56 @@
-package org.eclipse.debug.core.model;
+package org.eclipse.debug.core.model;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+
+
+/**
+ * Abstract implementation of a line breakpoint. This class is
+ * intended to be subclassed by debug model specific implementations
+ * of line breakpoints.
+ *
+ * @see ILineBreakpoint
+ */
+
+public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoint {
+
+
+ /**
+ * @see ILineBreakpoint#getLineNumber()
+ */
+ public int getLineNumber() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.LINE_NUMBER, -1);
+ }
+ return -1;
+ }
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
+ /**
+ * @see ILineBreakpoint#getCharStart()
+ */
+ public int getCharStart() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.CHAR_START, -1);
+ }
+ return -1;
+ }
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-
-
-/**
- * Abstract implementation of a line breakpoint. This class is
- * intended to be subclassed by debug model specific implementations
- * of line breakpoints.
- *
- * @see ILineBreakpoint
- */
-
-public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoint {
-
-
- /**
- * @see ILineBreakpoint#getLineNumber()
- */
- public int getLineNumber() throws CoreException {
- IMarker m = getMarker();
- if (m != null) {
- return m.getAttribute(IMarker.LINE_NUMBER, -1);
- }
- return -1;
- }
-
- /**
- * @see ILineBreakpoint#getCharStart()
- */
- public int getCharStart() throws CoreException {
- IMarker m = getMarker();
- if (m != null) {
- return m.getAttribute(IMarker.CHAR_START, -1);
- }
- return -1;
+ /**
+ * @see ILineBreakpoint#getCharEnd()
+ */
+ public int getCharEnd() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.CHAR_END, -1);
+ }
+ return -1;
}
-
- /**
- * @see ILineBreakpoint#getCharEnd()
- */
- public int getCharEnd() throws CoreException {
- IMarker m = getMarker();
- if (m != null) {
- return m.getAttribute(IMarker.CHAR_END, -1);
- }
- return -1;
- }
-}
-
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html
index 9bd3a0ae8..8cf4a5b5b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html
@@ -1,97 +1,97 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Platform [org.eclipse.debug.core.model]</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Defines interfaces for a debug model elements, source lookup, and launching.</p>
-
-<h2>Package Specification</h2>
-
-<p>This package defines classes and interfaces known as the &quot;debug model&quot; which support
-an extensible set of debug architectures and languages. The debug model is a set of interfaces
-representing common artifacts in debuggable programs. The debug plug-in itself does not provide
-any implementations of a debug model. It is intended that third parties providing an integrated
-set of development tools for a specific language will also implement a debug model for that language,
-using an underlying debug architecture of their choice. For example, Java Tooling provides an
-implementation of a debug model based on the standard Java Platform Debug Architecture (JPDA).</p>
-
-<h4>The Debug Model</h4>
-
-<p>A client implements a debug model by
-providing an implementation of the interfaces defined in this package. (There is no explicit
-extension point that represents a debug model). Each debug model provides one or more
-launch configuration types capable of initiating a debug session.</p>
-
-<p>The common elements defined by the debug model are:
-
-<ul>
- <li>Debug Target - A debug target represents a debuggable program - for example, a virtual
- machine or a process.</li>
- <li>Thread - A debug target may contain one or more threads.</li>
- <li>Stack Frame - A suspended thread may contain one or more stack frames.</li>
- <li>Variable - A stack frame may contain variables.</li>
- <li>Value - Each variable has an associated value, and a value may contain more variables (to
- represent complex data structures and objects).</li>
- <li>Register Group - A stack frame may (optionally) be associated with one or more register
- groups.</li>
- <li>Register - A register group contains one or more registers.</li>
- <li>Memory Blocks - A debug target may (optionally) support the retrieval of
- arbitrary contiguous segments of memory.</li>
- <li>Breakpoint - Breakpoints suspend the execution of a program.</li>
- <li>Expression - An expression is a snippet of code that can be evaluated to
- produce a value.</li>
-</ul>
-
-<p>A debug model implementation is responsible for firing debug events. A debug event
-corresponds to an event in a program being debugged - for example the creation or
-termination of a thread.</p>
-
-<h4>Breakpoints</h4>
-
-<p>Breakpoints are used to suspend the execution of a program being debugged. There are
-many kinds of breakpoints - line breakpoints, conditional line breakpoints, hit count
-breakpoints, exception breakpoints, etc. The kinds of breakpoints supported by each debug
-architecture, and the information required to create those breakpoints
-is dictated by each debug architecture. The debug platform supports an extensible
-set of breakpoint via the breakpoints extension point.</p>
-
-<p>The debug platform provides a breakpoint manager that maintains the collection of all
-registered breakpoints. Clients add and remove breakpoints via this manager. Breakpoints are
-implemented by instances of IBreakpoint. Each breakpoint object has an associated marker,
-which provides persistence and presentation in editors. The debug platform defines a generic
-breakpoint and line breakpoint, as well as their corresponding marker definitions. Breakpoint
-creation is a client responsibility - that is, defining the attributes of a breakpoint and
-the resource to associate a breakpoint marker with.</p>
-
-<p>Also, the location in which a breakpoint may
-be placed, and the attributes that a debug target requires to install a breakpoint are
-specific to each debug architecture, and thus a client responsibility.</p>
-
-<h5>Persistence</h5>
-
-<p>Breakpoints are persisted via their underlying marker. Breakpoint markers defined
-with the <b>persisted</b> attribute as <b>false</b> will not be persisted. Breakpoints
-are restored at workspace startup time by the breakpoint manager - that is, breakpoint objects
-are created for all persisted markers which are a subtype of the root breakpoint marker
-and are added to the breakpoint manager. To allow for selective persistence
-of breakpoints (of the same kind), the IBreakpoint interface and root breakpoint
-implementation define a &quot;persisted&quot; attribute. If this value is set to false,
-the breakpoint will not be persisted across workspace invocations.</p>
-
-<h5>Change Notification</h5>
-
-<p>As breakpoint markers are modified (created, removed, and changed), resource deltas
-are created by the platform. The breakpoint manager translates pertinent resource deltas
-into breakpoint change notifications (breakpoint added/removed/changed messages). Interested
-listeners may register with the breakpoint manager. The breakpoint manager only fires change
-notifications for registered breakpoints. This simplifies breakpoint processing for clients,
-as resource delta traversal and analysis is not required. Debug targets that support breakpoints
-should register for breakpoint change notifications.</p>
-
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Eclipse Debug Platform [org.eclipse.debug.core.model]</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+
+<p>Defines interfaces for a debug model elements, source lookup, and launching.</p>
+
+<h2>Package Specification</h2>
+
+<p>This package defines classes and interfaces known as the &quot;debug model&quot; which support
+an extensible set of debug architectures and languages. The debug model is a set of interfaces
+representing common artifacts in debuggable programs. The debug plug-in itself does not provide
+any implementations of a debug model. It is intended that third parties providing an integrated
+set of development tools for a specific language will also implement a debug model for that language,
+using an underlying debug architecture of their choice. For example, Java Tooling provides an
+implementation of a debug model based on the standard Java Platform Debug Architecture (JPDA).</p>
+
+<h4>The Debug Model</h4>
+
+<p>A client implements a debug model by
+providing an implementation of the interfaces defined in this package. (There is no explicit
+extension point that represents a debug model). Each debug model provides one or more
+launch configuration types capable of initiating a debug session.</p>
+
+<p>The common elements defined by the debug model are:
+
+<ul>
+ <li>Debug Target - A debug target represents a debuggable program - for example, a virtual
+ machine or a process.</li>
+ <li>Thread - A debug target may contain one or more threads.</li>
+ <li>Stack Frame - A suspended thread may contain one or more stack frames.</li>
+ <li>Variable - A stack frame may contain variables.</li>
+ <li>Value - Each variable has an associated value, and a value may contain more variables (to
+ represent complex data structures and objects).</li>
+ <li>Register Group - A stack frame may (optionally) be associated with one or more register
+ groups.</li>
+ <li>Register - A register group contains one or more registers.</li>
+ <li>Memory Blocks - A debug target may (optionally) support the retrieval of
+ arbitrary contiguous segments of memory.</li>
+ <li>Breakpoint - Breakpoints suspend the execution of a program.</li>
+ <li>Expression - An expression is a snippet of code that can be evaluated to
+ produce a value.</li>
+</ul>
+
+<p>A debug model implementation is responsible for firing debug events. A debug event
+corresponds to an event in a program being debugged - for example the creation or
+termination of a thread.</p>
+
+<h4>Breakpoints</h4>
+
+<p>Breakpoints are used to suspend the execution of a program being debugged. There are
+many kinds of breakpoints - line breakpoints, conditional line breakpoints, hit count
+breakpoints, exception breakpoints, etc. The kinds of breakpoints supported by each debug
+architecture, and the information required to create those breakpoints
+is dictated by each debug architecture. The debug platform supports an extensible
+set of breakpoint via the breakpoints extension point.</p>
+
+<p>The debug platform provides a breakpoint manager that maintains the collection of all
+registered breakpoints. Clients add and remove breakpoints via this manager. Breakpoints are
+implemented by instances of IBreakpoint. Each breakpoint object has an associated marker,
+which provides persistence and presentation in editors. The debug platform defines a generic
+breakpoint and line breakpoint, as well as their corresponding marker definitions. Breakpoint
+creation is a client responsibility - that is, defining the attributes of a breakpoint and
+the resource to associate a breakpoint marker with.</p>
+
+<p>Also, the location in which a breakpoint may
+be placed, and the attributes that a debug target requires to install a breakpoint are
+specific to each debug architecture, and thus a client responsibility.</p>
+
+<h5>Persistence</h5>
+
+<p>Breakpoints are persisted via their underlying marker. Breakpoint markers defined
+with the <b>persisted</b> attribute as <b>false</b> will not be persisted. Breakpoints
+are restored at workspace startup time by the breakpoint manager - that is, breakpoint objects
+are created for all persisted markers which are a subtype of the root breakpoint marker
+and are added to the breakpoint manager. To allow for selective persistence
+of breakpoints (of the same kind), the IBreakpoint interface and root breakpoint
+implementation define a &quot;persisted&quot; attribute. If this value is set to false,
+the breakpoint will not be persisted across workspace invocations.</p>
+
+<h5>Change Notification</h5>
+
+<p>As breakpoint markers are modified (created, removed, and changed), resource deltas
+are created by the platform. The breakpoint manager translates pertinent resource deltas
+into breakpoint change notifications (breakpoint added/removed/changed messages). Interested
+listeners may register with the breakpoint manager. The breakpoint manager only fires change
+notifications for registered breakpoints. This simplifies breakpoint processing for clients,
+as resource delta traversal and analysis is not required. Debug targets that support breakpoints
+should register for breakpoint change notifications.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html
index c8e7d76ca..de9276e03 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html
@@ -1,64 +1,64 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Platform</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides support for launching programs, breakpoint management, expression management,
-and debug events.</p>
-
-<h2>Package Specification</h2>
-
-<p>This package provides classes and interfaces to support facilities common
-among many debug architectures: launching programs, breakpoint management,
-expression management, and debug events. An extensible
-set of debug architectures and languages are supported by the definition of a &quot;debug
-model&quot; - a set of interfaces representing common artifacts in debuggable programs, which
-are defined in <b>org.eclipse.debug.core.model</b>.
-The debug plug-in itself does not provide any implementations of a debug model. It is
-intended that third parties providing an integrated set of development tools for a
-specific language will also implement a debug model for that language, using an underlying
-debug architecture of their choice. For example, Java Tooling provides an implementation
-of a debug model based on the standard Java Platform Debug Architecture (JPDA).</p>
-
-<h4>The Managers</h4>
-
-<p>The debug platform defines and provides an implementation of the following managers:
-<ul>
- <li>Launch Manager - The launch manager maintains the set of registered launches - that is,
- a collection of programs that have been launched in debuggable or non-debuggable (run) mode.
- Each launch maintains its associated debug targets and system processes. A launch that
- represents a debuggable program may specify an associated source locator used to locate
- source elements associated with stack frames for a particular debug session. Clients must
- provide implementations of source locators, which are generally tied to the manner in which
- a program is launched.</li>
- <li>Breakpoint Manager - The breakpoint manager maintains, persists, and restores the collection
- of all registered breakpoints in the workspace. As well, it provides change notification for
- breakpoints.</li>
- <li>Expression Manager - The expression manager maintains a collection of registered expressions.
- Expressions are not automatically persisted, but a client could persist its own expressions
- if required.</li>
-</ul>
-</p>
-
-<h4>Launch Configurations</h4>
-
-<p>A launch configuration is a persistable description of how to launch an application.
- Each launch configuration is an instance of a type of launch configuration - for example,
- a Java Application. The debug plug-in defines a launch configuration type extension point
- such that clients may define launch configurations specific to their debug architecture.
- A launch configuration is simply a set of attributes describing how to launch a program.
- The actual launching of an application is performed
- by an associated implementation of a launch configuration delegate, which is specifed by each launch configuration
- type extension.</p>
-<p>A launch configuration may be stored as a file in the worksapce (and shared in a repository via
- standard team mechanisms), or may be stored locally, essentially making the launch configuration
- private for a single user.</p>
-
-
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Eclipse Debug Platform</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+
+<p>Provides support for launching programs, breakpoint management, expression management,
+and debug events.</p>
+
+<h2>Package Specification</h2>
+
+<p>This package provides classes and interfaces to support facilities common
+among many debug architectures: launching programs, breakpoint management,
+expression management, and debug events. An extensible
+set of debug architectures and languages are supported by the definition of a &quot;debug
+model&quot; - a set of interfaces representing common artifacts in debuggable programs, which
+are defined in <b>org.eclipse.debug.core.model</b>.
+The debug plug-in itself does not provide any implementations of a debug model. It is
+intended that third parties providing an integrated set of development tools for a
+specific language will also implement a debug model for that language, using an underlying
+debug architecture of their choice. For example, Java Tooling provides an implementation
+of a debug model based on the standard Java Platform Debug Architecture (JPDA).</p>
+
+<h4>The Managers</h4>
+
+<p>The debug platform defines and provides an implementation of the following managers:
+<ul>
+ <li>Launch Manager - The launch manager maintains the set of registered launches - that is,
+ a collection of programs that have been launched in debuggable or non-debuggable (run) mode.
+ Each launch maintains its associated debug targets and system processes. A launch that
+ represents a debuggable program may specify an associated source locator used to locate
+ source elements associated with stack frames for a particular debug session. Clients must
+ provide implementations of source locators, which are generally tied to the manner in which
+ a program is launched.</li>
+ <li>Breakpoint Manager - The breakpoint manager maintains, persists, and restores the collection
+ of all registered breakpoints in the workspace. As well, it provides change notification for
+ breakpoints.</li>
+ <li>Expression Manager - The expression manager maintains a collection of registered expressions.
+ Expressions are not automatically persisted, but a client could persist its own expressions
+ if required.</li>
+</ul>
+</p>
+
+<h4>Launch Configurations</h4>
+
+<p>A launch configuration is a persistable description of how to launch an application.
+ Each launch configuration is an instance of a type of launch configuration - for example,
+ a Java Application. The debug plug-in defines a launch configuration type extension point
+ such that clients may define launch configurations specific to their debug architecture.
+ A launch configuration is simply a set of attributes describing how to launch a program.
+ The actual launching of an application is performed
+ by an associated implementation of a launch configuration delegate, which is specifed by each launch configuration
+ type extension.</p>
+<p>A launch configuration may be stored as a file in the worksapce (and shared in a repository via
+ standard team mechanisms), or may be stored locally, essentially making the launch configuration
+ private for a single user.</p>
+
+
+</body>
+</html>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
index b5b7a4dfc..951ba2536 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
@@ -1,582 +1,582 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointListener;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * The breakpoint manager manages all registered breakpoints
- * for the debug plugin. It is instantiated by the debug plugin at startup.
- *
- * @see IBreakpointManager
- */
-public class BreakpointManager implements IBreakpointManager, IResourceChangeListener {
-
- /**
- * Constants for breakpoint add/remove/change updates
- */
- private final static int ADDED = 0;
- private final static int REMOVED = 1;
- private final static int CHANGED = 2;
-
- /**
- * String constants corresponding to XML extension keys
- */
- private final static String CLASS = "class"; //$NON-NLS-1$
-
- /**
- * Attribute name for the <code>"markerType"</code> attribute of
- * a breakpoint extension.
- */
- private static final String MARKER_TYPE= "markerType"; //$NON-NLS-1$
-
- /**
- * A collection of breakpoints registered with this manager.
- */
- private Vector fBreakpoints= null;
-
- /**
- * A table of breakpoint extension points, keyed by
- * marker type
- * key: a marker type
- * value: the breakpoint extension which corresponds to that marker type
- */
- private HashMap fBreakpointExtensions;
-
- /**
- * Collection of markers that associates markers to breakpoints
- * key: a marker
- * value: the breakpoint which contains that marker
- */
- private HashMap fMarkersToBreakpoints;
-
- /**
- * Collection of breakpoint listeners.
- */
- private ListenerList fBreakpointListeners= new ListenerList(6);
-
- /**
- * Singleton resource delta visitor which handles marker
- * additions, changes, and removals.
- */
- private static BreakpointManagerVisitor fgVisitor;
-
- /**
- * Constructs a new breakpoint manager.
- */
- public BreakpointManager() {
- fMarkersToBreakpoints= new HashMap(10);
- fBreakpointExtensions = new HashMap(15);
- }
-
- /**
- * Registers this manager as a resource change listener and
- * initializes the collection of defined breakpoint extensions.
- *
- * This method should only be called on initial startup of
- * the debug plugin.
- */
- public void startup() throws CoreException {
- getWorkspace().addResourceChangeListener(this);
- }
-
- /**
- * Loads all the breakpoints on the given resource.
- *
- * @param resource the resource which contains the breakpoints
- */
- private void loadBreakpoints(IResource resource) throws CoreException {
- initBreakpointExtensions();
- IMarker[] markers= getPersistedMarkers(resource);
- for (int i = 0; i < markers.length; i++) {
- IMarker marker= markers[i];
- try {
- createBreakpoint(marker);
- } catch (DebugException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Returns the persisted markers associated with the given resource.
- *
- * Delete any non-persisted/invalid breakpoint markers. This is done
- * at startup rather than shutdown, since the changes made at
- * shutdown are not persisted as the workspace state has already
- * been saved. See bug 7683.
- */
- protected IMarker[] getPersistedMarkers(IResource resource) throws CoreException {
- IMarker[] markers= resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE);
- final List delete = new ArrayList();
- List persisted= new ArrayList();
- for (int i = 0; i < markers.length; i++) {
- IMarker marker= markers[i];
- // ensure the marker has a valid model identifier attribute
- // and delete the breakpoint if not
- String modelId = marker.getAttribute(IBreakpoint.ID, null);
- if (modelId == null) {
- // marker with old/invalid format - delete
- delete.add(marker);
- } else if (!marker.getAttribute(IBreakpoint.PERSISTED, true)) {
- // the breakpoint is marked as not to be persisted,
- // schedule for deletion
- delete.add(marker);
- } else {
- persisted.add(marker);
- }
- }
- // delete any markers that are not to be restored
- if (!delete.isEmpty()) {
- IWorkspaceRunnable wr = new IWorkspaceRunnable() {
- public void run(IProgressMonitor pm) throws CoreException {
- ResourcesPlugin.getWorkspace().deleteMarkers((IMarker[])delete.toArray(new IMarker[delete.size()]));
- }
- };
- fork(wr);
- }
- return (IMarker[])persisted.toArray(new IMarker[persisted.size()]);
- }
-
- /**
- * Removes this manager as a resource change listener
- * and removes all breakpoint listeners.
- */
- public void shutdown() {
- getWorkspace().removeResourceChangeListener(this);
- fBreakpointListeners.removeAll();
- }
-
- /**
- * Find the defined breakpoint extensions and cache them for use in recreating
- * breakpoints from markers.
- */
- private void initBreakpointExtensions() {
- IExtensionPoint ep= DebugPlugin.getDefault().getDescriptor().getExtensionPoint(DebugPlugin.EXTENSION_POINT_BREAKPOINTS);
- IConfigurationElement[] elements = ep.getConfigurationElements();
- for (int i= 0; i < elements.length; i++) {
- fBreakpointExtensions.put(elements[i].getAttribute(MARKER_TYPE), elements[i]);
- }
-
- }
-
- /**
- * Convenience method to get the workspace
- */
- private IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * @see IBreakpointManager#getBreakpoint(IMarker)
- */
- public IBreakpoint getBreakpoint(IMarker marker) {
- // ensure that breakpoints are initialized
- getBreakpoints0();
- return (IBreakpoint)fMarkersToBreakpoints.get(marker);
- }
-
- /**
- * @see IBreakpointManager#getBreakpoints()
- */
- public IBreakpoint[] getBreakpoints() {
- Vector breakpoints= getBreakpoints0();
- IBreakpoint[] temp= new IBreakpoint[breakpoints.size()];
- breakpoints.copyInto(temp);
- return temp;
- }
-
- /**
- * The BreakpointManager waits to load the breakpoints
- * of the workspace until a request is made to retrieve the
- * breakpoints.
- */
- private Vector getBreakpoints0() {
- if (fBreakpoints == null) {
- initializeBreakpoints();
- }
- return fBreakpoints;
- }
-
- /**
- * @see IBreakpointManager#getBreakpoints(String)
- */
- public IBreakpoint[] getBreakpoints(String modelIdentifier) {
- Vector allBreakpoints= getBreakpoints0();
- ArrayList temp= new ArrayList(allBreakpoints.size());
- Iterator breakpoints= allBreakpoints.iterator();
- while (breakpoints.hasNext()) {
- IBreakpoint breakpoint= (IBreakpoint) breakpoints.next();
- String id= breakpoint.getModelIdentifier();
- if (id != null && id.equals(modelIdentifier)) {
- temp.add(breakpoint);
- }
- }
- return (IBreakpoint[]) temp.toArray(new IBreakpoint[temp.size()]);
- }
-
- /**
- * Loads the list of breakpoints from the breakpoint markers in the
- * workspace.
- */
- private void initializeBreakpoints() {
- setBreakpoints(new Vector(10));
- try {
- loadBreakpoints(getWorkspace().getRoot());
- } catch (CoreException ce) {
- DebugPlugin.log(ce);
- setBreakpoints(new Vector(0));
- }
- }
-
- /**
- * @see IBreakpointManager#isRegistered(IBreakpoint)
- */
- public boolean isRegistered(IBreakpoint breakpoint) {
- return getBreakpoints0().contains(breakpoint);
- }
-
-
- /**
- * @see IBreakpointManager#removeBreakpoint(IBreakpoint, boolean)
- */
- public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException {
- if (getBreakpoints0().remove(breakpoint)) {
- fMarkersToBreakpoints.remove(breakpoint.getMarker());
- fireUpdate(breakpoint, null, REMOVED);
- if (delete) {
- breakpoint.delete();
- } else {
- // if the breakpoint is being removed from the manager
- // because the project is closing, the breakpoint should
- // remain as registered, otherwise, the breakpoint should
- // be marked as deregistered
- IMarker marker = breakpoint.getMarker();
- if (marker.exists()) {
- IProject project = breakpoint.getMarker().getResource().getProject();
- if (project == null || project.isOpen()) {
- breakpoint.setRegistered(false);
- }
- }
- }
- }
- }
-
- /**
- * Create a breakpoint for the given marker. The created breakpoint
- * is of the type specified in the breakpoint extension associated
- * with the given marker type.
- *
- * @return a breakpoint on this marker
- * @exception DebugException if breakpoint creation fails. Reasons for
- * failure include:
- * <ol>
- * <li>The breakpoint manager cannot determine what kind of breakpoint
- * to instantiate for the given marker type</li>
- * <li>A lower level exception occurred while accessing the given marker</li>
- * </ol>
- */
- private IBreakpoint createBreakpoint(IMarker marker) throws DebugException {
- IBreakpoint breakpoint= (IBreakpoint) fMarkersToBreakpoints.get(marker);
- if (breakpoint != null) {
- return breakpoint;
- }
- try {
- IConfigurationElement config = (IConfigurationElement)fBreakpointExtensions.get(marker.getType());
- if (config == null) {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.CONFIGURATION_INVALID, MessageFormat.format(DebugCoreMessages.getString("BreakpointManager.Missing_breakpoint_definition"), new String[] {marker.getType()}), null)); //$NON-NLS-1$
- }
- breakpoint = (IBreakpoint)config.createExecutableExtension(CLASS);
- breakpoint.setMarker(marker);
- if (breakpoint.isRegistered()) {
- addBreakpoint(breakpoint);
- }
- return breakpoint;
- } catch (CoreException e) {
- throw new DebugException(e.getStatus());
- }
- }
-
- /**
- * @see IBreakpointManager#addBreakpoint(IBreakpoint)
- */
- public void addBreakpoint(IBreakpoint breakpoint) throws CoreException {
- if (!getBreakpoints0().contains(breakpoint)) {
- verifyBreakpoint(breakpoint);
- // set the registered property before adding to the collection
- // such that a change notification is not fired
- breakpoint.setRegistered(true);
- getBreakpoints0().add(breakpoint);
- fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint);
- fireUpdate(breakpoint, null, ADDED);
- }
- }
-
- /**
- * @see IBreakpointManager#fireBreakpointChanged(IBreakpoint)
- */
- public void fireBreakpointChanged(IBreakpoint breakpoint) {
- if (getBreakpoints0().contains(breakpoint)) {
- fireUpdate(breakpoint, null, CHANGED);
- }
- }
-
- /**
- * Verifies that the breakpoint marker has the minimal required attributes,
- * and throws a debug exception if not.
- */
- private void verifyBreakpoint(IBreakpoint breakpoint) throws DebugException {
- try {
- String id= breakpoint.getModelIdentifier();
- if (id == null) {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.CONFIGURATION_INVALID, DebugCoreMessages.getString("BreakpointManager.Missing_model_identifier"), null)); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- throw new DebugException(e.getStatus());
- }
- }
-
- /**
- * A resource has changed. Traverses the delta for breakpoint changes.
- */
- public void resourceChanged(IResourceChangeEvent event) {
- if (!isRestored()) {
- // if breakpoints have not been restored, deltas
- // should not be processed (we are unable to restore
- // breakpoints in a resource callback, as that might
- // cause the resource tree to be modififed, which is
- // not allowed during notification).
- // @see bug 9327
- return;
- }
- IResourceDelta delta= event.getDelta();
- if (delta != null) {
- try {
- if (fgVisitor == null) {
- fgVisitor= new BreakpointManagerVisitor();
- }
- delta.accept(fgVisitor);
- } catch (CoreException ce) {
- DebugPlugin.log(ce);
- }
- }
- }
-
- /**
- * Returns whether breakpoints have been restored
- * since the workbench was started.
- *
- * @return whether breakpoints have been restored
- * since the workbench was started
- */
- protected boolean isRestored() {
- return fBreakpoints != null;
- }
-
- /**
- * A project has been opened or closed. Updates the breakpoints for
- * that project
- */
- private void handleProjectResourceOpenStateChange(IResource project) {
- if (!project.isAccessible()) {
- //closed
- Enumeration breakpoints= ((Vector)getBreakpoints0().clone()).elements();
- while (breakpoints.hasMoreElements()) {
- IBreakpoint breakpoint= (IBreakpoint) breakpoints.nextElement();
- IResource markerResource= breakpoint.getMarker().getResource();
- if (project.getFullPath().isPrefixOf(markerResource.getFullPath())) {
- try {
- removeBreakpoint(breakpoint, false);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
- return;
- } else {
- try {
- loadBreakpoints(project);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Visitor for handling resource deltas
- */
- class BreakpointManagerVisitor implements IResourceDeltaVisitor {
- /**
- * @see IResourceDeltaVisitor#visit(IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- if (delta == null) {
- return false;
- }
- if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
- handleProjectResourceOpenStateChange(delta.getResource());
- return false;
- }
- IMarkerDelta[] markerDeltas= delta.getMarkerDeltas();
- for (int i= 0; i < markerDeltas.length; i++) {
- IMarkerDelta markerDelta= markerDeltas[i];
- if (markerDelta.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
- switch (markerDelta.getKind()) {
- case IResourceDelta.ADDED :
- handleAddBreakpoint(delta, markerDelta.getMarker(), markerDelta);
- break;
- case IResourceDelta.REMOVED :
- handleRemoveBreakpoint(markerDelta.getMarker(), markerDelta);
- break;
- case IResourceDelta.CHANGED :
- handleChangeBreakpoint(markerDelta.getMarker(), markerDelta);
- break;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Wrapper for handling adds
- */
- protected void handleAddBreakpoint(IResourceDelta rDelta, final IMarker marker, IMarkerDelta mDelta) {
- if (0 != (rDelta.getFlags() & IResourceDelta.MOVED_FROM)) {
- // This breakpoint has actually been moved - already removed
- // from the Breakpoint manager during the remove callback
- // Delete the marker associated with the new resource
- IWorkspaceRunnable wRunnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- try {
- marker.delete();
- } catch (CoreException ce) {
- DebugPlugin.log(ce);
- }
- }
- };
- fork(wRunnable);
- } else {
- // do nothing - we do not add until explicitly added
- }
- }
-
- /**
- * Wrapper for handling removes
- */
- protected void handleRemoveBreakpoint(IMarker marker, IMarkerDelta delta) {
- IBreakpoint breakpoint= getBreakpoint(marker);
- if (breakpoint != null) {
- try {
- removeBreakpoint(breakpoint, false);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Wrapper for handling changes
- */
- protected void handleChangeBreakpoint(IMarker marker, IMarkerDelta delta) {
- final IBreakpoint breakpoint= getBreakpoint(marker);
- if (breakpoint != null && isRegistered(breakpoint)) {
- fireUpdate(breakpoint, delta, CHANGED);
- }
- }
- }
-
- /**
- * @see IBreakpointManager#addBreakpointListener(IBreakpointListener)
- */
- public void addBreakpointListener(IBreakpointListener listener) {
- fBreakpointListeners.add(listener);
- }
-
- /**
- * @see IBreakpointManager#removeBreakpointListener(IBreakpointListener)
- */
- public void removeBreakpointListener(IBreakpointListener listener) {
- fBreakpointListeners.remove(listener);
- }
-
- /**
- * Notifies listeners of the add/remove/change
- */
- private void fireUpdate(IBreakpoint breakpoint, IMarkerDelta delta, int update) {
- Object[] copiedListeners= fBreakpointListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- IBreakpointListener listener = (IBreakpointListener)copiedListeners[i];
- switch (update) {
- case ADDED:
- listener.breakpointAdded(breakpoint);
- break;
- case REMOVED:
- listener.breakpointRemoved(breakpoint, delta);
- break;
- case CHANGED:
- listener.breakpointChanged(breakpoint, delta);
- break;
- }
- }
- }
-
- protected void setBreakpoints(Vector breakpoints) {
- fBreakpoints = breakpoints;
- }
-
- protected void fork(final IWorkspaceRunnable wRunnable) {
- Runnable runnable= new Runnable() {
- public void run() {
- try {
- getWorkspace().run(wRunnable, null);
- } catch (CoreException ce) {
- DebugPlugin.log(ce);
- }
- }
- };
- new Thread(runnable).start();
- }
-
- /**
- * @see IBreakpointManager#hasBreakpoints()
- */
- public boolean hasBreakpoints() {
- return !getBreakpoints0().isEmpty();
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointListener;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ * The breakpoint manager manages all registered breakpoints
+ * for the debug plugin. It is instantiated by the debug plugin at startup.
+ *
+ * @see IBreakpointManager
+ */
+public class BreakpointManager implements IBreakpointManager, IResourceChangeListener {
+
+ /**
+ * Constants for breakpoint add/remove/change updates
+ */
+ private final static int ADDED = 0;
+ private final static int REMOVED = 1;
+ private final static int CHANGED = 2;
+
+ /**
+ * String constants corresponding to XML extension keys
+ */
+ private final static String CLASS = "class"; //$NON-NLS-1$
+
+ /**
+ * Attribute name for the <code>"markerType"</code> attribute of
+ * a breakpoint extension.
+ */
+ private static final String MARKER_TYPE= "markerType"; //$NON-NLS-1$
+
+ /**
+ * A collection of breakpoints registered with this manager.
+ */
+ private Vector fBreakpoints= null;
+
+ /**
+ * A table of breakpoint extension points, keyed by
+ * marker type
+ * key: a marker type
+ * value: the breakpoint extension which corresponds to that marker type
+ */
+ private HashMap fBreakpointExtensions;
+
+ /**
+ * Collection of markers that associates markers to breakpoints
+ * key: a marker
+ * value: the breakpoint which contains that marker
+ */
+ private HashMap fMarkersToBreakpoints;
+
+ /**
+ * Collection of breakpoint listeners.
+ */
+ private ListenerList fBreakpointListeners= new ListenerList(6);
+
+ /**
+ * Singleton resource delta visitor which handles marker
+ * additions, changes, and removals.
+ */
+ private static BreakpointManagerVisitor fgVisitor;
+
+ /**
+ * Constructs a new breakpoint manager.
+ */
+ public BreakpointManager() {
+ fMarkersToBreakpoints= new HashMap(10);
+ fBreakpointExtensions = new HashMap(15);
+ }
+
+ /**
+ * Registers this manager as a resource change listener and
+ * initializes the collection of defined breakpoint extensions.
+ *
+ * This method should only be called on initial startup of
+ * the debug plugin.
+ */
+ public void startup() throws CoreException {
+ getWorkspace().addResourceChangeListener(this);
+ }
+
+ /**
+ * Loads all the breakpoints on the given resource.
+ *
+ * @param resource the resource which contains the breakpoints
+ */
+ private void loadBreakpoints(IResource resource) throws CoreException {
+ initBreakpointExtensions();
+ IMarker[] markers= getPersistedMarkers(resource);
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker= markers[i];
+ try {
+ createBreakpoint(marker);
+ } catch (DebugException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Returns the persisted markers associated with the given resource.
+ *
+ * Delete any non-persisted/invalid breakpoint markers. This is done
+ * at startup rather than shutdown, since the changes made at
+ * shutdown are not persisted as the workspace state has already
+ * been saved. See bug 7683.
+ */
+ protected IMarker[] getPersistedMarkers(IResource resource) throws CoreException {
+ IMarker[] markers= resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE);
+ final List delete = new ArrayList();
+ List persisted= new ArrayList();
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker= markers[i];
+ // ensure the marker has a valid model identifier attribute
+ // and delete the breakpoint if not
+ String modelId = marker.getAttribute(IBreakpoint.ID, null);
+ if (modelId == null) {
+ // marker with old/invalid format - delete
+ delete.add(marker);
+ } else if (!marker.getAttribute(IBreakpoint.PERSISTED, true)) {
+ // the breakpoint is marked as not to be persisted,
+ // schedule for deletion
+ delete.add(marker);
+ } else {
+ persisted.add(marker);
+ }
+ }
+ // delete any markers that are not to be restored
+ if (!delete.isEmpty()) {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor pm) throws CoreException {
+ ResourcesPlugin.getWorkspace().deleteMarkers((IMarker[])delete.toArray(new IMarker[delete.size()]));
+ }
+ };
+ fork(wr);
+ }
+ return (IMarker[])persisted.toArray(new IMarker[persisted.size()]);
+ }
+
+ /**
+ * Removes this manager as a resource change listener
+ * and removes all breakpoint listeners.
+ */
+ public void shutdown() {
+ getWorkspace().removeResourceChangeListener(this);
+ fBreakpointListeners.removeAll();
+ }
+
+ /**
+ * Find the defined breakpoint extensions and cache them for use in recreating
+ * breakpoints from markers.
+ */
+ private void initBreakpointExtensions() {
+ IExtensionPoint ep= DebugPlugin.getDefault().getDescriptor().getExtensionPoint(DebugPlugin.EXTENSION_POINT_BREAKPOINTS);
+ IConfigurationElement[] elements = ep.getConfigurationElements();
+ for (int i= 0; i < elements.length; i++) {
+ fBreakpointExtensions.put(elements[i].getAttribute(MARKER_TYPE), elements[i]);
+ }
+
+ }
+
+ /**
+ * Convenience method to get the workspace
+ */
+ private IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * @see IBreakpointManager#getBreakpoint(IMarker)
+ */
+ public IBreakpoint getBreakpoint(IMarker marker) {
+ // ensure that breakpoints are initialized
+ getBreakpoints0();
+ return (IBreakpoint)fMarkersToBreakpoints.get(marker);
+ }
+
+ /**
+ * @see IBreakpointManager#getBreakpoints()
+ */
+ public IBreakpoint[] getBreakpoints() {
+ Vector breakpoints= getBreakpoints0();
+ IBreakpoint[] temp= new IBreakpoint[breakpoints.size()];
+ breakpoints.copyInto(temp);
+ return temp;
+ }
+
+ /**
+ * The BreakpointManager waits to load the breakpoints
+ * of the workspace until a request is made to retrieve the
+ * breakpoints.
+ */
+ private Vector getBreakpoints0() {
+ if (fBreakpoints == null) {
+ initializeBreakpoints();
+ }
+ return fBreakpoints;
+ }
+
+ /**
+ * @see IBreakpointManager#getBreakpoints(String)
+ */
+ public IBreakpoint[] getBreakpoints(String modelIdentifier) {
+ Vector allBreakpoints= getBreakpoints0();
+ ArrayList temp= new ArrayList(allBreakpoints.size());
+ Iterator breakpoints= allBreakpoints.iterator();
+ while (breakpoints.hasNext()) {
+ IBreakpoint breakpoint= (IBreakpoint) breakpoints.next();
+ String id= breakpoint.getModelIdentifier();
+ if (id != null && id.equals(modelIdentifier)) {
+ temp.add(breakpoint);
+ }
+ }
+ return (IBreakpoint[]) temp.toArray(new IBreakpoint[temp.size()]);
+ }
+
+ /**
+ * Loads the list of breakpoints from the breakpoint markers in the
+ * workspace.
+ */
+ private void initializeBreakpoints() {
+ setBreakpoints(new Vector(10));
+ try {
+ loadBreakpoints(getWorkspace().getRoot());
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
+ setBreakpoints(new Vector(0));
+ }
+ }
+
+ /**
+ * @see IBreakpointManager#isRegistered(IBreakpoint)
+ */
+ public boolean isRegistered(IBreakpoint breakpoint) {
+ return getBreakpoints0().contains(breakpoint);
+ }
+
+
+ /**
+ * @see IBreakpointManager#removeBreakpoint(IBreakpoint, boolean)
+ */
+ public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException {
+ if (getBreakpoints0().remove(breakpoint)) {
+ fMarkersToBreakpoints.remove(breakpoint.getMarker());
+ fireUpdate(breakpoint, null, REMOVED);
+ if (delete) {
+ breakpoint.delete();
+ } else {
+ // if the breakpoint is being removed from the manager
+ // because the project is closing, the breakpoint should
+ // remain as registered, otherwise, the breakpoint should
+ // be marked as deregistered
+ IMarker marker = breakpoint.getMarker();
+ if (marker.exists()) {
+ IProject project = breakpoint.getMarker().getResource().getProject();
+ if (project == null || project.isOpen()) {
+ breakpoint.setRegistered(false);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Create a breakpoint for the given marker. The created breakpoint
+ * is of the type specified in the breakpoint extension associated
+ * with the given marker type.
+ *
+ * @return a breakpoint on this marker
+ * @exception DebugException if breakpoint creation fails. Reasons for
+ * failure include:
+ * <ol>
+ * <li>The breakpoint manager cannot determine what kind of breakpoint
+ * to instantiate for the given marker type</li>
+ * <li>A lower level exception occurred while accessing the given marker</li>
+ * </ol>
+ */
+ private IBreakpoint createBreakpoint(IMarker marker) throws DebugException {
+ IBreakpoint breakpoint= (IBreakpoint) fMarkersToBreakpoints.get(marker);
+ if (breakpoint != null) {
+ return breakpoint;
+ }
+ try {
+ IConfigurationElement config = (IConfigurationElement)fBreakpointExtensions.get(marker.getType());
+ if (config == null) {
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.CONFIGURATION_INVALID, MessageFormat.format(DebugCoreMessages.getString("BreakpointManager.Missing_breakpoint_definition"), new String[] {marker.getType()}), null)); //$NON-NLS-1$
+ }
+ breakpoint = (IBreakpoint)config.createExecutableExtension(CLASS);
+ breakpoint.setMarker(marker);
+ if (breakpoint.isRegistered()) {
+ addBreakpoint(breakpoint);
+ }
+ return breakpoint;
+ } catch (CoreException e) {
+ throw new DebugException(e.getStatus());
+ }
+ }
+
+ /**
+ * @see IBreakpointManager#addBreakpoint(IBreakpoint)
+ */
+ public void addBreakpoint(IBreakpoint breakpoint) throws CoreException {
+ if (!getBreakpoints0().contains(breakpoint)) {
+ verifyBreakpoint(breakpoint);
+ // set the registered property before adding to the collection
+ // such that a change notification is not fired
+ breakpoint.setRegistered(true);
+ getBreakpoints0().add(breakpoint);
+ fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint);
+ fireUpdate(breakpoint, null, ADDED);
+ }
+ }
+
+ /**
+ * @see IBreakpointManager#fireBreakpointChanged(IBreakpoint)
+ */
+ public void fireBreakpointChanged(IBreakpoint breakpoint) {
+ if (getBreakpoints0().contains(breakpoint)) {
+ fireUpdate(breakpoint, null, CHANGED);
+ }
+ }
+
+ /**
+ * Verifies that the breakpoint marker has the minimal required attributes,
+ * and throws a debug exception if not.
+ */
+ private void verifyBreakpoint(IBreakpoint breakpoint) throws DebugException {
+ try {
+ String id= breakpoint.getModelIdentifier();
+ if (id == null) {
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.CONFIGURATION_INVALID, DebugCoreMessages.getString("BreakpointManager.Missing_model_identifier"), null)); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ throw new DebugException(e.getStatus());
+ }
+ }
+
+ /**
+ * A resource has changed. Traverses the delta for breakpoint changes.
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ if (!isRestored()) {
+ // if breakpoints have not been restored, deltas
+ // should not be processed (we are unable to restore
+ // breakpoints in a resource callback, as that might
+ // cause the resource tree to be modififed, which is
+ // not allowed during notification).
+ // @see bug 9327
+ return;
+ }
+ IResourceDelta delta= event.getDelta();
+ if (delta != null) {
+ try {
+ if (fgVisitor == null) {
+ fgVisitor= new BreakpointManagerVisitor();
+ }
+ delta.accept(fgVisitor);
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
+ }
+ }
+ }
+
+ /**
+ * Returns whether breakpoints have been restored
+ * since the workbench was started.
+ *
+ * @return whether breakpoints have been restored
+ * since the workbench was started
+ */
+ protected boolean isRestored() {
+ return fBreakpoints != null;
+ }
+
+ /**
+ * A project has been opened or closed. Updates the breakpoints for
+ * that project
+ */
+ private void handleProjectResourceOpenStateChange(IResource project) {
+ if (!project.isAccessible()) {
+ //closed
+ Enumeration breakpoints= ((Vector)getBreakpoints0().clone()).elements();
+ while (breakpoints.hasMoreElements()) {
+ IBreakpoint breakpoint= (IBreakpoint) breakpoints.nextElement();
+ IResource markerResource= breakpoint.getMarker().getResource();
+ if (project.getFullPath().isPrefixOf(markerResource.getFullPath())) {
+ try {
+ removeBreakpoint(breakpoint, false);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+ return;
+ } else {
+ try {
+ loadBreakpoints(project);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Visitor for handling resource deltas
+ */
+ class BreakpointManagerVisitor implements IResourceDeltaVisitor {
+ /**
+ * @see IResourceDeltaVisitor#visit(IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) {
+ if (delta == null) {
+ return false;
+ }
+ if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
+ handleProjectResourceOpenStateChange(delta.getResource());
+ return false;
+ }
+ IMarkerDelta[] markerDeltas= delta.getMarkerDeltas();
+ for (int i= 0; i < markerDeltas.length; i++) {
+ IMarkerDelta markerDelta= markerDeltas[i];
+ if (markerDelta.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
+ switch (markerDelta.getKind()) {
+ case IResourceDelta.ADDED :
+ handleAddBreakpoint(delta, markerDelta.getMarker(), markerDelta);
+ break;
+ case IResourceDelta.REMOVED :
+ handleRemoveBreakpoint(markerDelta.getMarker(), markerDelta);
+ break;
+ case IResourceDelta.CHANGED :
+ handleChangeBreakpoint(markerDelta.getMarker(), markerDelta);
+ break;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Wrapper for handling adds
+ */
+ protected void handleAddBreakpoint(IResourceDelta rDelta, final IMarker marker, IMarkerDelta mDelta) {
+ if (0 != (rDelta.getFlags() & IResourceDelta.MOVED_FROM)) {
+ // This breakpoint has actually been moved - already removed
+ // from the Breakpoint manager during the remove callback
+ // Delete the marker associated with the new resource
+ IWorkspaceRunnable wRunnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) {
+ try {
+ marker.delete();
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
+ }
+ }
+ };
+ fork(wRunnable);
+ } else {
+ // do nothing - we do not add until explicitly added
+ }
+ }
+
+ /**
+ * Wrapper for handling removes
+ */
+ protected void handleRemoveBreakpoint(IMarker marker, IMarkerDelta delta) {
+ IBreakpoint breakpoint= getBreakpoint(marker);
+ if (breakpoint != null) {
+ try {
+ removeBreakpoint(breakpoint, false);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Wrapper for handling changes
+ */
+ protected void handleChangeBreakpoint(IMarker marker, IMarkerDelta delta) {
+ final IBreakpoint breakpoint= getBreakpoint(marker);
+ if (breakpoint != null && isRegistered(breakpoint)) {
+ fireUpdate(breakpoint, delta, CHANGED);
+ }
+ }
+ }
+
+ /**
+ * @see IBreakpointManager#addBreakpointListener(IBreakpointListener)
+ */
+ public void addBreakpointListener(IBreakpointListener listener) {
+ fBreakpointListeners.add(listener);
+ }
+
+ /**
+ * @see IBreakpointManager#removeBreakpointListener(IBreakpointListener)
+ */
+ public void removeBreakpointListener(IBreakpointListener listener) {
+ fBreakpointListeners.remove(listener);
+ }
+
+ /**
+ * Notifies listeners of the add/remove/change
+ */
+ private void fireUpdate(IBreakpoint breakpoint, IMarkerDelta delta, int update) {
+ Object[] copiedListeners= fBreakpointListeners.getListeners();
+ for (int i= 0; i < copiedListeners.length; i++) {
+ IBreakpointListener listener = (IBreakpointListener)copiedListeners[i];
+ switch (update) {
+ case ADDED:
+ listener.breakpointAdded(breakpoint);
+ break;
+ case REMOVED:
+ listener.breakpointRemoved(breakpoint, delta);
+ break;
+ case CHANGED:
+ listener.breakpointChanged(breakpoint, delta);
+ break;
+ }
+ }
+ }
+
+ protected void setBreakpoints(Vector breakpoints) {
+ fBreakpoints = breakpoints;
+ }
+
+ protected void fork(final IWorkspaceRunnable wRunnable) {
+ Runnable runnable= new Runnable() {
+ public void run() {
+ try {
+ getWorkspace().run(wRunnable, null);
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
+ }
+ }
+ };
+ new Thread(runnable).start();
+ }
+
+ /**
+ * @see IBreakpointManager#hasBreakpoints()
+ */
+ public boolean hasBreakpoints() {
+ return !getBreakpoints0().isEmpty();
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
index 4953856fc..e9885ccd0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
@@ -1,26 +1,26 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.debug.internal.core;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class DebugCoreMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.core.DebugCoreMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private DebugCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+package org.eclipse.debug.internal.core;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class DebugCoreMessages {
+
+ private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.core.DebugCoreMessages";//$NON-NLS-1$
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private DebugCoreMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
index 4e8a8d959..a315f3860 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
@@ -1,56 +1,56 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-Breakpoint.no_associated_marker=Breakpoint does not have an associated marker.
-
-BreakpointManager.Missing_breakpoint_definition=Missing breakpoint definition for marker type {0}
-BreakpointManager.Missing_model_identifier=Breakpoint missing debug model identifier
-
-DebugEvent.illegal_detail=detail is not one of the allowed constants, see IDebugEventConstants
-DebugEvent.illegal_kind=kind is not one of the allowed constants, see IDebugEventConstants
-
-DebugPlugin.Invalid_status_handler_extension__{0}_2=Invalid status handler extension: {0}
-
-InputStreamMonitor.label=Input Stream Monitor
-
-Launch.terminate_failed=Terminate failed
-
-LaunchConfiguration.Exception_occurred_creating_launch_configuration_memento_9=Exception occurred creating launch configuration memento
-LaunchConfiguration.Exception_occurred_parsing_memento_5=Exception occurred parsing memento
-LaunchConfiguration.Failed_to_delete_launch_configuration._1=Failed to delete launch configuration.
-LaunchConfiguration.Invalid_launch_configuration_memento__missing_path_attribute_3=Invalid launch configuration memento: missing path attribute
-LaunchConfiguration.Invalid_launch_configuration_memento__missing_local_attribute_4=Invalid launch configuration memento: missing local attribute
-
-LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_boolean._3=Attribute {0} is not of type boolean.
-LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_int._2=Attribute {0} is not of type int.
-LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.lang.String._1=Attribute {0} is not of type java.lang.String.
-LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.List._1=Attribute {0} is not of type java.util.List.
-LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.Map._1=Attribute {0} is not of type java.util.Map.
-LaunchConfigurationInfo.Invalid_launch_configuration_XML._10=Invalid launch configuration XML.
-LaunchConfigurationInfo.Launch_configuration_type_id___{0}___does_not_exist._nPossible_causes__n_tMissing_specification_of_a_launch_type_(missing_plugin)_n_tIncorrect_launch_configuration_XML_1=Launch configuration type id \"{0}\" does not exist.\nPossible causes:\n\tMissing specification of a launch type (missing plugin)\n\tIncorrect launch configuration XML
-
-LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1={0} occurred generating launch configuration XML.
-LaunchConfigurationWorkingCopy.Specified_container_for_launch_configuration_does_not_exist_2=Specified container for launch configuration does not exist
-
-LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1=Exception occurred while reading launch configuration file: {0}.
-LaunchManager.Invalid_launch_configuration_index._18=Invalid launch configuration index.
-LaunchManager.Invalid_source_locator_extentsion_defined_by_plug-in___{0}______id___not_specified_12=Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified
-LaunchManager.Launch_configuration_does_not_exist._6=Launch configuration does not exist.
-LaunchManager.Source_locator_does_not_exist__{0}_13=Source locator does not exist: {0}
-LaunchManager.Unable_to_restore_invalid_launch_configuration=Unable to restore invalid launch configuration {0}
-LaunchManager.Invalid_launch_configuration_comparator_extension_defined_by_plug-in_{0}_-_attribute_not_specified_1=Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified
-
-OutputStreamMonitor.label=Output Stream Monitor
-
-ProcessMonitor.label=Process Monitor
-
-RuntimeProcess.terminate_failed=Terminate failed
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+Breakpoint.no_associated_marker=Breakpoint does not have an associated marker.
+
+BreakpointManager.Missing_breakpoint_definition=Missing breakpoint definition for marker type {0}
+BreakpointManager.Missing_model_identifier=Breakpoint missing debug model identifier
+
+DebugEvent.illegal_detail=detail is not one of the allowed constants, see IDebugEventConstants
+DebugEvent.illegal_kind=kind is not one of the allowed constants, see IDebugEventConstants
+
+DebugPlugin.Invalid_status_handler_extension__{0}_2=Invalid status handler extension: {0}
+
+InputStreamMonitor.label=Input Stream Monitor
+
+Launch.terminate_failed=Terminate failed
+
+LaunchConfiguration.Exception_occurred_creating_launch_configuration_memento_9=Exception occurred creating launch configuration memento
+LaunchConfiguration.Exception_occurred_parsing_memento_5=Exception occurred parsing memento
+LaunchConfiguration.Failed_to_delete_launch_configuration._1=Failed to delete launch configuration.
+LaunchConfiguration.Invalid_launch_configuration_memento__missing_path_attribute_3=Invalid launch configuration memento: missing path attribute
+LaunchConfiguration.Invalid_launch_configuration_memento__missing_local_attribute_4=Invalid launch configuration memento: missing local attribute
+
+LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_boolean._3=Attribute {0} is not of type boolean.
+LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_int._2=Attribute {0} is not of type int.
+LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.lang.String._1=Attribute {0} is not of type java.lang.String.
+LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.List._1=Attribute {0} is not of type java.util.List.
+LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.Map._1=Attribute {0} is not of type java.util.Map.
+LaunchConfigurationInfo.Invalid_launch_configuration_XML._10=Invalid launch configuration XML.
+LaunchConfigurationInfo.Launch_configuration_type_id___{0}___does_not_exist._nPossible_causes__n_tMissing_specification_of_a_launch_type_(missing_plugin)_n_tIncorrect_launch_configuration_XML_1=Launch configuration type id \"{0}\" does not exist.\nPossible causes:\n\tMissing specification of a launch type (missing plugin)\n\tIncorrect launch configuration XML
+
+LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1={0} occurred generating launch configuration XML.
+LaunchConfigurationWorkingCopy.Specified_container_for_launch_configuration_does_not_exist_2=Specified container for launch configuration does not exist
+
+LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1=Exception occurred while reading launch configuration file: {0}.
+LaunchManager.Invalid_launch_configuration_index._18=Invalid launch configuration index.
+LaunchManager.Invalid_source_locator_extentsion_defined_by_plug-in___{0}______id___not_specified_12=Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified
+LaunchManager.Launch_configuration_does_not_exist._6=Launch configuration does not exist.
+LaunchManager.Source_locator_does_not_exist__{0}_13=Source locator does not exist: {0}
+LaunchManager.Unable_to_restore_invalid_launch_configuration=Unable to restore invalid launch configuration {0}
+LaunchManager.Invalid_launch_configuration_comparator_extension_defined_by_plug-in_{0}_-_attribute_not_specified_1=Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified
+
+OutputStreamMonitor.label=Output Stream Monitor
+
+ProcessMonitor.label=Process Monitor
+
+RuntimeProcess.terminate_failed=Terminate failed
RuntimeProcess.Exit_value_not_available_until_process_terminates._1=Exit value not available until process terminates. \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
index 3ffadb7d7..711d65dde 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
@@ -1,189 +1,189 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.IExpressionListener;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-
-/**
- * The expression manager manages all registered expressions
- * for the debug plugin. It is instantiated by the debug plugin
- * at startup.
- *
- * [XXX: expression persistence not yet implemented]
- *
- * @see IExpressionManager
- */
-public class ExpressionManager implements IExpressionManager, IDebugEventSetListener {
-
- /**
- * Collection of registered expressions.
- */
- private Vector fExpressions = new Vector(10);
-
- /**
- * List of expression listeners
- */
- private ListenerList fListeners = new ListenerList(2);
-
- /**
- * @see IExpressionManager#addExpression(IExpression, String)
- */
- public void addExpression(IExpression expression) {
- if (getExpressions0().indexOf(expression) == -1) {
- getExpressions0().add(expression);
- fireExpressionAdded(expression);
- }
- }
-
- /**
- * @see IExpressionManager#getExpressions()
- */
- public IExpression[] getExpressions() {
- Vector expressions = getExpressions0();
- IExpression[] temp= new IExpression[expressions.size()];
- expressions.copyInto(temp);
- return temp;
- }
-
- /**
- * @see IExpressionManager#getExpressions(String)
- */
- public IExpression[] getExpressions(String modelIdentifier) {
- Vector expressions = getExpressions0();
- ArrayList temp= new ArrayList(expressions.size());
- Iterator iter= expressions.iterator();
- while (iter.hasNext()) {
- IExpression expression= (IExpression) iter.next();
- String id= expression.getModelIdentifier();
- if (id != null && id.equals(modelIdentifier)) {
- temp.add(expression);
- }
- }
- return (IExpression[]) temp.toArray(new IExpression[temp.size()]);
- }
-
- /**
- * @see IExpressionManager#removeExpression(IExpression)
- */
- public void removeExpression(IExpression expression) {
- if (getExpressions0().indexOf(expression) >= 0) {
- getExpressions0().remove(expression);
- expression.dispose();
- fireExpressionRemoved(expression);
- }
- }
-
- /**
- * @see IExpressionManager#addExpressionListener(IExpressionListener)
- */
- public void addExpressionListener(IExpressionListener listener) {
- fListeners.add(listener);
- }
-
- /**
- * @see IExpressionManager#removeExpressionListener(IExpressionListener)
- */
- public void removeExpressionListener(IExpressionListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Called be the debug plug-in when starting up.
- */
- public void startup() {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /**
- * Called by the debug plug-in when shutting down.
- */
- public void shutdown() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /**
- * Returns the list of registered expressions as
- * a vector.
- *
- * @return vector of registered expressions
- */
- protected Vector getExpressions0() {
- return fExpressions;
- }
-
- /**
- * @see IDebugEventSetListener#handleDebugEvent(DebugEvent)
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource() instanceof IExpression) {
- switch (event.getKind()) {
- case DebugEvent.CHANGE:
- fireExpressionChanged((IExpression)event.getSource());
- break;
- default:
- break;
- }
- }
- }
- }
-
- /**
- * Notifies listeners that the given expression has been
- * added.
- *
- * @param expression the newly added expression
- */
- protected void fireExpressionAdded(IExpression expression) {
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IExpressionListener)listeners[i]).expressionAdded(expression);
- }
- }
-
- /**
- * Notifies listeners that the given expression has been
- * removed.
- *
- * @param expression the removed expression
- */
- protected void fireExpressionRemoved(IExpression expression) {
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IExpressionListener)listeners[i]).expressionRemoved(expression);
- }
- }
-
- /**
- * Notifies listeners that the given expression has changed.
- *
- * @param expression the changed expression
- */
- protected void fireExpressionChanged(IExpression expression) {
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IExpressionListener)listeners[i]).expressionChanged(expression);
- }
- }
-
- /**
- * @see IExpressionManager#hasExpressions()
- */
- public boolean hasExpressions() {
- return !getExpressions0().isEmpty();
- }
-
-}
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.IExpressionListener;
+import org.eclipse.debug.core.IExpressionManager;
+import org.eclipse.debug.core.model.IExpression;
+
+/**
+ * The expression manager manages all registered expressions
+ * for the debug plugin. It is instantiated by the debug plugin
+ * at startup.
+ *
+ * [XXX: expression persistence not yet implemented]
+ *
+ * @see IExpressionManager
+ */
+public class ExpressionManager implements IExpressionManager, IDebugEventSetListener {
+
+ /**
+ * Collection of registered expressions.
+ */
+ private Vector fExpressions = new Vector(10);
+
+ /**
+ * List of expression listeners
+ */
+ private ListenerList fListeners = new ListenerList(2);
+
+ /**
+ * @see IExpressionManager#addExpression(IExpression, String)
+ */
+ public void addExpression(IExpression expression) {
+ if (getExpressions0().indexOf(expression) == -1) {
+ getExpressions0().add(expression);
+ fireExpressionAdded(expression);
+ }
+ }
+
+ /**
+ * @see IExpressionManager#getExpressions()
+ */
+ public IExpression[] getExpressions() {
+ Vector expressions = getExpressions0();
+ IExpression[] temp= new IExpression[expressions.size()];
+ expressions.copyInto(temp);
+ return temp;
+ }
+
+ /**
+ * @see IExpressionManager#getExpressions(String)
+ */
+ public IExpression[] getExpressions(String modelIdentifier) {
+ Vector expressions = getExpressions0();
+ ArrayList temp= new ArrayList(expressions.size());
+ Iterator iter= expressions.iterator();
+ while (iter.hasNext()) {
+ IExpression expression= (IExpression) iter.next();
+ String id= expression.getModelIdentifier();
+ if (id != null && id.equals(modelIdentifier)) {
+ temp.add(expression);
+ }
+ }
+ return (IExpression[]) temp.toArray(new IExpression[temp.size()]);
+ }
+
+ /**
+ * @see IExpressionManager#removeExpression(IExpression)
+ */
+ public void removeExpression(IExpression expression) {
+ if (getExpressions0().indexOf(expression) >= 0) {
+ getExpressions0().remove(expression);
+ expression.dispose();
+ fireExpressionRemoved(expression);
+ }
+ }
+
+ /**
+ * @see IExpressionManager#addExpressionListener(IExpressionListener)
+ */
+ public void addExpressionListener(IExpressionListener listener) {
+ fListeners.add(listener);
+ }
+
+ /**
+ * @see IExpressionManager#removeExpressionListener(IExpressionListener)
+ */
+ public void removeExpressionListener(IExpressionListener listener) {
+ fListeners.remove(listener);
+ }
+
+ /**
+ * Called be the debug plug-in when starting up.
+ */
+ public void startup() {
+ DebugPlugin.getDefault().addDebugEventListener(this);
+ }
+
+ /**
+ * Called by the debug plug-in when shutting down.
+ */
+ public void shutdown() {
+ DebugPlugin.getDefault().removeDebugEventListener(this);
+ }
+
+ /**
+ * Returns the list of registered expressions as
+ * a vector.
+ *
+ * @return vector of registered expressions
+ */
+ protected Vector getExpressions0() {
+ return fExpressions;
+ }
+
+ /**
+ * @see IDebugEventSetListener#handleDebugEvent(DebugEvent)
+ */
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getSource() instanceof IExpression) {
+ switch (event.getKind()) {
+ case DebugEvent.CHANGE:
+ fireExpressionChanged((IExpression)event.getSource());
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Notifies listeners that the given expression has been
+ * added.
+ *
+ * @param expression the newly added expression
+ */
+ protected void fireExpressionAdded(IExpression expression) {
+ Object[] listeners = fListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ((IExpressionListener)listeners[i]).expressionAdded(expression);
+ }
+ }
+
+ /**
+ * Notifies listeners that the given expression has been
+ * removed.
+ *
+ * @param expression the removed expression
+ */
+ protected void fireExpressionRemoved(IExpression expression) {
+ Object[] listeners = fListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ((IExpressionListener)listeners[i]).expressionRemoved(expression);
+ }
+ }
+
+ /**
+ * Notifies listeners that the given expression has changed.
+ *
+ * @param expression the changed expression
+ */
+ protected void fireExpressionChanged(IExpression expression) {
+ Object[] listeners = fListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ((IExpressionListener)listeners[i]).expressionChanged(expression);
+ }
+ }
+
+ /**
+ * @see IExpressionManager#hasExpressions()
+ */
+ public boolean hasExpressions() {
+ return !getExpressions0().isEmpty();
+ }
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
index a3b2be67f..fc0e2f0f8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
@@ -1,124 +1,124 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.eclipse.debug.core.DebugPlugin;
-
-/**
- * Writes to the input stream of a system process,
- * queueing output if the stream is blocked.
- *
- * The input stream monitor writes to system in via
- * an output stream.
- */
-public class InputStreamMonitor {
-
- /**
- * The stream which is being written to (connected to system in).
- */
- private OutputStream fStream;
- /**
- * The queue of output.
- */
- private Vector fQueue;
- /**
- * The thread which writes to the stream.
- */
- private Thread fThread;
- /**
- * A lock for ensuring that writes to the queue are contiguous
- */
- private Object fLock;
-
- /**
- * Creates an input stream monitor which writes
- * to system in via the given output stream.
- */
- public InputStreamMonitor(OutputStream stream) {
- fStream= stream;
- fQueue= new Vector();
- fLock= new Object();
- }
-
- /**
- * Appends the given text to the stream, or
- * queues the text to be written at a later time
- * if the stream is blocked.
- */
- public void write(String text) {
- synchronized(fLock) {
- fQueue.add(text);
- fLock.notifyAll();
- }
- }
-
- /**
- * Starts a thread which writes the stream.
- */
- public void startMonitoring() {
- if (fThread == null) {
- fThread= new Thread(new Runnable() {
- public void run() {
- write();
- }
- }, DebugCoreMessages.getString("InputStreamMonitor.label")); //$NON-NLS-1$
- fThread.start();
- }
- }
-
- /**
- * Close all communications between this
- * monitor and the underlying stream.
- */
- public void close() {
- if (fThread != null) {
- Thread thread= fThread;
- fThread= null;
- thread.interrupt();
- }
- }
-
- /**
- * Continuously writes to the stream.
- */
- protected void write() {
- while (fThread != null) {
- writeNext();
- }
- try {
- fStream.close();
- } catch (IOException e) {
- DebugPlugin.log(e);
- }
- }
-
- /**
- * Write the text in the queue to the stream.
- */
- protected void writeNext() {
- while (!fQueue.isEmpty()) {
- String text = (String)fQueue.firstElement();
- fQueue.removeElementAt(0);
- try {
- fStream.write(text.getBytes());
- fStream.flush();
- } catch (IOException e) {
- DebugPlugin.log(e);
- }
- }
- try {
- synchronized(fLock) {
- fLock.wait();
- }
- } catch (InterruptedException e) {
- }
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Vector;
+
+import org.eclipse.debug.core.DebugPlugin;
+
+/**
+ * Writes to the input stream of a system process,
+ * queueing output if the stream is blocked.
+ *
+ * The input stream monitor writes to system in via
+ * an output stream.
+ */
+public class InputStreamMonitor {
+
+ /**
+ * The stream which is being written to (connected to system in).
+ */
+ private OutputStream fStream;
+ /**
+ * The queue of output.
+ */
+ private Vector fQueue;
+ /**
+ * The thread which writes to the stream.
+ */
+ private Thread fThread;
+ /**
+ * A lock for ensuring that writes to the queue are contiguous
+ */
+ private Object fLock;
+
+ /**
+ * Creates an input stream monitor which writes
+ * to system in via the given output stream.
+ */
+ public InputStreamMonitor(OutputStream stream) {
+ fStream= stream;
+ fQueue= new Vector();
+ fLock= new Object();
+ }
+
+ /**
+ * Appends the given text to the stream, or
+ * queues the text to be written at a later time
+ * if the stream is blocked.
+ */
+ public void write(String text) {
+ synchronized(fLock) {
+ fQueue.add(text);
+ fLock.notifyAll();
+ }
+ }
+
+ /**
+ * Starts a thread which writes the stream.
+ */
+ public void startMonitoring() {
+ if (fThread == null) {
+ fThread= new Thread(new Runnable() {
+ public void run() {
+ write();
+ }
+ }, DebugCoreMessages.getString("InputStreamMonitor.label")); //$NON-NLS-1$
+ fThread.start();
+ }
+ }
+
+ /**
+ * Close all communications between this
+ * monitor and the underlying stream.
+ */
+ public void close() {
+ if (fThread != null) {
+ Thread thread= fThread;
+ fThread= null;
+ thread.interrupt();
+ }
+ }
+
+ /**
+ * Continuously writes to the stream.
+ */
+ protected void write() {
+ while (fThread != null) {
+ writeNext();
+ }
+ try {
+ fStream.close();
+ } catch (IOException e) {
+ DebugPlugin.log(e);
+ }
+ }
+
+ /**
+ * Write the text in the queue to the stream.
+ */
+ protected void writeNext() {
+ while (!fQueue.isEmpty()) {
+ String text = (String)fQueue.firstElement();
+ fQueue.removeElementAt(0);
+ try {
+ fStream.write(text.getBytes());
+ fStream.flush();
+ } catch (IOException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ try {
+ synchronized(fLock) {
+ fLock.wait();
+ }
+ } catch (InterruptedException e) {
+ }
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index c04282dc8..ab0a15a4c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -1,462 +1,462 @@
-package org.eclipse.debug.internal.core;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.xerces.dom.DocumentImpl;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.Launch;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-import org.eclipse.debug.core.model.IPersistableSourceLocator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Launch configuration handle.
- *
- * @see ILaunchConfiguration
- */
-public class LaunchConfiguration extends PlatformObject implements ILaunchConfiguration {
-
- /**
- * Location this configuration is stored in. This
- * is the key for a launch configuration handle.
- */
- private IPath fLocation;
-
- /**
- * Constructs a launch configuration in the given location.
- *
- * @param location path to where this launch configuration's
- * underlying file is located
- */
- protected LaunchConfiguration(IPath location) {
- setLocation(location);
- }
-
- /**
- * Constructs a launch configuration from the given
- * memento.
- *
- * @param memento launch configuration memento
- * @exception CoreException if the memento is invalid or
- * an exception occurrs reading the memento
- */
- protected LaunchConfiguration(String memento) throws CoreException {
- Exception ex = null;
- try {
- Element root = null;
- DocumentBuilder parser =
- DocumentBuilderFactory.newInstance().newDocumentBuilder();
- StringReader reader = new StringReader(memento);
- InputSource source = new InputSource(reader);
- root = parser.parse(source).getDocumentElement();
-
- String localString = root.getAttribute("local"); //$NON-NLS-1$
- String path = root.getAttribute("path"); //$NON-NLS-1$
-
- String message = null;
- if (path == null) {
- message = DebugCoreMessages.getString("LaunchConfiguration.Invalid_launch_configuration_memento__missing_path_attribute_3"); //$NON-NLS-1$
- } else if (localString == null) {
- message = DebugCoreMessages.getString("LaunchConfiguration.Invalid_launch_configuration_memento__missing_local_attribute_4"); //$NON-NLS-1$
- }
- if (message != null) {
- IStatus s = newStatus(message, DebugException.INTERNAL_ERROR, null);
- throw new CoreException(s);
- }
-
- IPath location = null;
- boolean local = (Boolean.valueOf(localString)).booleanValue();
- if (local) {
- location = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.append(path);
- } else {
- location = new Path(path);
- }
- setLocation(location);
- return;
- } catch (ParserConfigurationException e) {
- ex = e;
- } catch (SAXException e) {
- ex = e;
- } catch (IOException e) {
- ex = e;
- }
- IStatus s = newStatus(DebugCoreMessages.getString("LaunchConfiguration.Exception_occurred_parsing_memento_5"), DebugException.INTERNAL_ERROR, ex); //$NON-NLS-1$
- throw new CoreException(s);
- }
-
- /**
- * Creates and returns a new error status based on
- * the given mesasge, code, and exception.
- *
- * @param message error message
- * @param code error code
- * @param e exception or <code>null</code>
- * @return status
- */
- protected IStatus newStatus(String message, int code, Throwable e) {
- return new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), code, message, e);
- }
-
- /**
- * @see ILaunchConfiguration#launch(String, IProgressMonitor)
- */
- public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException {
- ILaunch launch = new Launch(this, mode, null);
- getLaunchManager().addLaunch(launch);
- try {
- getDelegate().launch(this, mode, launch, monitor);
- } catch (CoreException e) {
- // if there was an exception, and the launch is empty, remove it
- if (!launch.hasChildren()) {
- getLaunchManager().removeLaunch(launch);
- }
- throw e;
- }
- if (monitor != null && monitor.isCanceled()) {
- getLaunchManager().removeLaunch(launch);
- } else {
- initializeSourceLocator(launch);
- }
- return launch;
- }
-
- /**
- * Set the source locator to use with the launch, if specified
- * by this configuration.
- *
- * @param launch the launch on which to set the source locator
- */
- protected void initializeSourceLocator(ILaunch launch) throws CoreException {
- if (launch.getSourceLocator() == null) {
- String type = getAttribute(ATTR_SOURCE_LOCATOR_ID, (String)null);
- if (type != null) {
- IPersistableSourceLocator locator = getLaunchManager().newSourceLocator(type);
- String memento = getAttribute(ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
- if (memento == null) {
- locator.initializeDefaults(this);
- } else {
- locator.initializeFromMemento(memento);
- }
- launch.setSourceLocator(locator);
- }
- }
- }
-
- /**
- * @see ILaunchConfiguration#supportsMode(String)
- */
- public boolean supportsMode(String mode) throws CoreException {
- return getType().supportsMode(mode);
- }
-
- /**
- * A configuration's name is that of the last segment
- * in it's location (subtract the ".launch" extension).
- *
- * @see ILaunchConfiguration#getName()
- */
- public String getName() {
- return getLastLocationSegment();
- }
-
- private String getLastLocationSegment() {
- String name = getLocation().lastSegment();
- name = name.substring(0, name.length() - (LAUNCH_CONFIGURATION_FILE_EXTENSION.length() + 1));
- return name;
- }
-
- /**
- * @see ILaunchConfiguration#getLocation()
- */
- public IPath getLocation() {
- return fLocation;
- }
-
- /**
- * Sets the location of this configuration's underlying
- * file.
- *
- * @param location the location of this configuration's underlying
- * file
- */
- private void setLocation(IPath location) {
- fLocation = location;
- }
-
- /**
- * @see ILaunchConfiguration#exists()
- */
- public boolean exists() {
- return getLocation().toFile().exists();
- }
-
- /**
- * @see ILaunchConfiguration#getAttribute(String, int)
- */
- public int getAttribute(String attributeName, int defaultValue) throws CoreException {
- return getInfo().getIntAttribute(attributeName, defaultValue);
- }
-
- /**
- * @see ILaunchConfiguration#getAttribute(String, String)
- */
- public String getAttribute(String attributeName, String defaultValue) throws CoreException {
- return getInfo().getStringAttribute(attributeName, defaultValue);
- }
-
- /**
- * @see ILaunchConfiguration#getAttribute(String, boolean)
- */
- public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException {
- return getInfo().getBooleanAttribute(attributeName, defaultValue);
- }
-
- /**
- * @see ILaunchConfiguration#getAttribute(String, List)
- */
- public List getAttribute(String attributeName, List defaultValue) throws CoreException {
- return getInfo().getListAttribute(attributeName, defaultValue);
- }
-
- /**
- * @see ILaunchConfiguration#getAttribute(String, Map)
- */
- public Map getAttribute(String attributeName, Map defaultValue) throws CoreException {
- return getInfo().getMapAttribute(attributeName, defaultValue);
- }
-
- /**
- * @see ILaunchConfiguration#getType()
- */
- public ILaunchConfigurationType getType() throws CoreException {
- return getInfo().getType();
- }
-
- /**
- * @see ILaunchConfiguration#isLocal()
- */
- public boolean isLocal() {
- IPath localPath = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
- return localPath.isPrefixOf(getLocation());
- }
-
- /**
- * @see ILaunchConfiguration#getWorkingCopy()
- */
- public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException {
- return new LaunchConfigurationWorkingCopy(this);
- }
-
- /**
- * @see ILaunchConfiguration#copy(String name)
- */
- public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException {
- ILaunchConfigurationWorkingCopy copy = new LaunchConfigurationWorkingCopy(this, name);
- return copy;
- }
-
- /**
- * @see ILaunchConfiguration#isWorkingCopy()
- */
- public boolean isWorkingCopy() {
- return false;
- }
-
- /**
- * @see ILaunchConfiguration#delete()
- */
- public void delete() throws CoreException {
- if (exists()) {
- if (isLocal()) {
- if (!(getLocation().toFile().delete())) {
- throw new DebugException(
- new Status(Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfiguration.Failed_to_delete_launch_configuration._1"), null) //$NON-NLS-1$
- );
- }
- // manually update the launch manager cache since there
- // will be no resource delta
- getLaunchManager().launchConfigurationDeleted(this);
- } else {
- // delete the resource using IFile API such that
- // resource deltas are fired.
- IResource file = getFile();
- if (file != null) {
- file.delete(true, null);
- } else {
- // Error - the exists test passed, but could not locate file
- }
- }
- }
- }
-
- /**
- * Returns the info object containing the attributes
- * of this configuration
- *
- * @return info for this handle
- * @exception CoreException if unable to retrieve the
- * info object
- */
- protected LaunchConfigurationInfo getInfo() throws CoreException {
- return getLaunchManager().getInfo(this);
- }
-
- /**
- * Returns the launch configuration delegate for this
- * launch configuration.
- *
- * @return launch configuration delegate
- * @exception CoreException if the delegate was unable
- * to be created
- */
- protected ILaunchConfigurationDelegate getDelegate() throws CoreException {
- return ((LaunchConfigurationType)getType()).getDelegate();
- }
-
- /**
- * Returns the launch manager
- *
- * @return launch manager
- */
- protected LaunchManager getLaunchManager() {
- return (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * @see ILaunchConfiguration#getMemento()
- */
- public String getMemento() throws CoreException {
- IPath relativePath = null;
- if (isLocal()) {
- IPath rootPath = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
- IPath configPath = getLocation();
- relativePath = configPath.removeFirstSegments(rootPath.segmentCount());
- relativePath = relativePath.setDevice(null);
- } else {
- relativePath = getLocation();
- }
-
- Document doc = new DocumentImpl();
- Element node = doc.createElement("launchConfiguration"); //$NON-NLS-1$
- doc.appendChild(node);
- node.setAttribute("local", (new Boolean(isLocal())).toString()); //$NON-NLS-1$
- node.setAttribute("path", relativePath.toString()); //$NON-NLS-1$
-
- try {
- return LaunchManager.serializeDocument(doc);
- } catch (IOException e) {
- IStatus status = newStatus(DebugCoreMessages.getString("LaunchConfiguration.Exception_occurred_creating_launch_configuration_memento_9"), DebugException.INTERNAL_ERROR, e); //$NON-NLS-1$
- throw new CoreException(status);
- }
- }
-
- /**
- * @see ILaunchConfiguration#getFile()
- */
- public IFile getFile() {
- if (isLocal()) {
- return null;
- }
- return ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(getLocation());
- }
-
- /**
- * @see ILaunchConfiguration#contentsEqual(ILaunchConfiguration)
- */
- public boolean contentsEqual(ILaunchConfiguration object) {
- try {
- if (object instanceof LaunchConfiguration) {
- LaunchConfiguration otherConfig = (LaunchConfiguration) object;
- return getName().equals(otherConfig.getName())
- && getType().equals(otherConfig.getType())
- && getLocation().equals(otherConfig.getLocation())
- && getInfo().equals(otherConfig.getInfo());
- }
- return false;
- } catch (CoreException ce) {
- return false;
- }
- }
-
- /**
- * Returns whether this configuration is equal to the
- * given configuration. Two configurations are equal if
- * they are stored in the same location (and neither one
- * is a working copy).
- *
- * @return whether this configuration is equal to the
- * given configuration
- * @see Object#equals(Object)
- */
- public boolean equals(Object object) {
- if (object instanceof ILaunchConfiguration) {
- if (isWorkingCopy()) {
- return this == object;
- }
- ILaunchConfiguration config = (ILaunchConfiguration) object;
- if (!config.isWorkingCopy()) {
- return config.getLocation().equals(getLocation());
- }
- }
- return false;
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getLocation().hashCode();
- }
-
- /**
- * Returns the container this launch configuration is
- * stored in, or <code>null</code> if this launch configuration
- * is stored locally.
- *
- * @return the container this launch configuration is
- * stored in, or <code>null</code> if this launch configuration
- * is stored locally
- */
- protected IContainer getContainer() {
- IFile file = getFile();
- if (file != null) {
- return file.getParent();
- }
- return null;
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.xerces.dom.DocumentImpl;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.Launch;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Launch configuration handle.
+ *
+ * @see ILaunchConfiguration
+ */
+public class LaunchConfiguration extends PlatformObject implements ILaunchConfiguration {
+
+ /**
+ * Location this configuration is stored in. This
+ * is the key for a launch configuration handle.
+ */
+ private IPath fLocation;
+
+ /**
+ * Constructs a launch configuration in the given location.
+ *
+ * @param location path to where this launch configuration's
+ * underlying file is located
+ */
+ protected LaunchConfiguration(IPath location) {
+ setLocation(location);
+ }
+
+ /**
+ * Constructs a launch configuration from the given
+ * memento.
+ *
+ * @param memento launch configuration memento
+ * @exception CoreException if the memento is invalid or
+ * an exception occurrs reading the memento
+ */
+ protected LaunchConfiguration(String memento) throws CoreException {
+ Exception ex = null;
+ try {
+ Element root = null;
+ DocumentBuilder parser =
+ DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ StringReader reader = new StringReader(memento);
+ InputSource source = new InputSource(reader);
+ root = parser.parse(source).getDocumentElement();
+
+ String localString = root.getAttribute("local"); //$NON-NLS-1$
+ String path = root.getAttribute("path"); //$NON-NLS-1$
+
+ String message = null;
+ if (path == null) {
+ message = DebugCoreMessages.getString("LaunchConfiguration.Invalid_launch_configuration_memento__missing_path_attribute_3"); //$NON-NLS-1$
+ } else if (localString == null) {
+ message = DebugCoreMessages.getString("LaunchConfiguration.Invalid_launch_configuration_memento__missing_local_attribute_4"); //$NON-NLS-1$
+ }
+ if (message != null) {
+ IStatus s = newStatus(message, DebugException.INTERNAL_ERROR, null);
+ throw new CoreException(s);
+ }
+
+ IPath location = null;
+ boolean local = (Boolean.valueOf(localString)).booleanValue();
+ if (local) {
+ location = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.append(path);
+ } else {
+ location = new Path(path);
+ }
+ setLocation(location);
+ return;
+ } catch (ParserConfigurationException e) {
+ ex = e;
+ } catch (SAXException e) {
+ ex = e;
+ } catch (IOException e) {
+ ex = e;
+ }
+ IStatus s = newStatus(DebugCoreMessages.getString("LaunchConfiguration.Exception_occurred_parsing_memento_5"), DebugException.INTERNAL_ERROR, ex); //$NON-NLS-1$
+ throw new CoreException(s);
+ }
+
+ /**
+ * Creates and returns a new error status based on
+ * the given mesasge, code, and exception.
+ *
+ * @param message error message
+ * @param code error code
+ * @param e exception or <code>null</code>
+ * @return status
+ */
+ protected IStatus newStatus(String message, int code, Throwable e) {
+ return new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), code, message, e);
+ }
+
+ /**
+ * @see ILaunchConfiguration#launch(String, IProgressMonitor)
+ */
+ public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException {
+ ILaunch launch = new Launch(this, mode, null);
+ getLaunchManager().addLaunch(launch);
+ try {
+ getDelegate().launch(this, mode, launch, monitor);
+ } catch (CoreException e) {
+ // if there was an exception, and the launch is empty, remove it
+ if (!launch.hasChildren()) {
+ getLaunchManager().removeLaunch(launch);
+ }
+ throw e;
+ }
+ if (monitor != null && monitor.isCanceled()) {
+ getLaunchManager().removeLaunch(launch);
+ } else {
+ initializeSourceLocator(launch);
+ }
+ return launch;
+ }
+
+ /**
+ * Set the source locator to use with the launch, if specified
+ * by this configuration.
+ *
+ * @param launch the launch on which to set the source locator
+ */
+ protected void initializeSourceLocator(ILaunch launch) throws CoreException {
+ if (launch.getSourceLocator() == null) {
+ String type = getAttribute(ATTR_SOURCE_LOCATOR_ID, (String)null);
+ if (type != null) {
+ IPersistableSourceLocator locator = getLaunchManager().newSourceLocator(type);
+ String memento = getAttribute(ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
+ if (memento == null) {
+ locator.initializeDefaults(this);
+ } else {
+ locator.initializeFromMemento(memento);
+ }
+ launch.setSourceLocator(locator);
+ }
+ }
+ }
+
+ /**
+ * @see ILaunchConfiguration#supportsMode(String)
+ */
+ public boolean supportsMode(String mode) throws CoreException {
+ return getType().supportsMode(mode);
+ }
+
+ /**
+ * A configuration's name is that of the last segment
+ * in it's location (subtract the ".launch" extension).
+ *
+ * @see ILaunchConfiguration#getName()
+ */
+ public String getName() {
+ return getLastLocationSegment();
+ }
+
+ private String getLastLocationSegment() {
+ String name = getLocation().lastSegment();
+ name = name.substring(0, name.length() - (LAUNCH_CONFIGURATION_FILE_EXTENSION.length() + 1));
+ return name;
+ }
+
+ /**
+ * @see ILaunchConfiguration#getLocation()
+ */
+ public IPath getLocation() {
+ return fLocation;
+ }
+
+ /**
+ * Sets the location of this configuration's underlying
+ * file.
+ *
+ * @param location the location of this configuration's underlying
+ * file
+ */
+ private void setLocation(IPath location) {
+ fLocation = location;
+ }
+
+ /**
+ * @see ILaunchConfiguration#exists()
+ */
+ public boolean exists() {
+ return getLocation().toFile().exists();
+ }
+
+ /**
+ * @see ILaunchConfiguration#getAttribute(String, int)
+ */
+ public int getAttribute(String attributeName, int defaultValue) throws CoreException {
+ return getInfo().getIntAttribute(attributeName, defaultValue);
+ }
+
+ /**
+ * @see ILaunchConfiguration#getAttribute(String, String)
+ */
+ public String getAttribute(String attributeName, String defaultValue) throws CoreException {
+ return getInfo().getStringAttribute(attributeName, defaultValue);
+ }
+
+ /**
+ * @see ILaunchConfiguration#getAttribute(String, boolean)
+ */
+ public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException {
+ return getInfo().getBooleanAttribute(attributeName, defaultValue);
+ }
+
+ /**
+ * @see ILaunchConfiguration#getAttribute(String, List)
+ */
+ public List getAttribute(String attributeName, List defaultValue) throws CoreException {
+ return getInfo().getListAttribute(attributeName, defaultValue);
+ }
+
+ /**
+ * @see ILaunchConfiguration#getAttribute(String, Map)
+ */
+ public Map getAttribute(String attributeName, Map defaultValue) throws CoreException {
+ return getInfo().getMapAttribute(attributeName, defaultValue);
+ }
+
+ /**
+ * @see ILaunchConfiguration#getType()
+ */
+ public ILaunchConfigurationType getType() throws CoreException {
+ return getInfo().getType();
+ }
+
+ /**
+ * @see ILaunchConfiguration#isLocal()
+ */
+ public boolean isLocal() {
+ IPath localPath = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
+ return localPath.isPrefixOf(getLocation());
+ }
+
+ /**
+ * @see ILaunchConfiguration#getWorkingCopy()
+ */
+ public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException {
+ return new LaunchConfigurationWorkingCopy(this);
+ }
+
+ /**
+ * @see ILaunchConfiguration#copy(String name)
+ */
+ public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException {
+ ILaunchConfigurationWorkingCopy copy = new LaunchConfigurationWorkingCopy(this, name);
+ return copy;
+ }
+
+ /**
+ * @see ILaunchConfiguration#isWorkingCopy()
+ */
+ public boolean isWorkingCopy() {
+ return false;
+ }
+
+ /**
+ * @see ILaunchConfiguration#delete()
+ */
+ public void delete() throws CoreException {
+ if (exists()) {
+ if (isLocal()) {
+ if (!(getLocation().toFile().delete())) {
+ throw new DebugException(
+ new Status(Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfiguration.Failed_to_delete_launch_configuration._1"), null) //$NON-NLS-1$
+ );
+ }
+ // manually update the launch manager cache since there
+ // will be no resource delta
+ getLaunchManager().launchConfigurationDeleted(this);
+ } else {
+ // delete the resource using IFile API such that
+ // resource deltas are fired.
+ IResource file = getFile();
+ if (file != null) {
+ file.delete(true, null);
+ } else {
+ // Error - the exists test passed, but could not locate file
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the info object containing the attributes
+ * of this configuration
+ *
+ * @return info for this handle
+ * @exception CoreException if unable to retrieve the
+ * info object
+ */
+ protected LaunchConfigurationInfo getInfo() throws CoreException {
+ return getLaunchManager().getInfo(this);
+ }
+
+ /**
+ * Returns the launch configuration delegate for this
+ * launch configuration.
+ *
+ * @return launch configuration delegate
+ * @exception CoreException if the delegate was unable
+ * to be created
+ */
+ protected ILaunchConfigurationDelegate getDelegate() throws CoreException {
+ return ((LaunchConfigurationType)getType()).getDelegate();
+ }
+
+ /**
+ * Returns the launch manager
+ *
+ * @return launch manager
+ */
+ protected LaunchManager getLaunchManager() {
+ return (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ /**
+ * @see ILaunchConfiguration#getMemento()
+ */
+ public String getMemento() throws CoreException {
+ IPath relativePath = null;
+ if (isLocal()) {
+ IPath rootPath = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
+ IPath configPath = getLocation();
+ relativePath = configPath.removeFirstSegments(rootPath.segmentCount());
+ relativePath = relativePath.setDevice(null);
+ } else {
+ relativePath = getLocation();
+ }
+
+ Document doc = new DocumentImpl();
+ Element node = doc.createElement("launchConfiguration"); //$NON-NLS-1$
+ doc.appendChild(node);
+ node.setAttribute("local", (new Boolean(isLocal())).toString()); //$NON-NLS-1$
+ node.setAttribute("path", relativePath.toString()); //$NON-NLS-1$
+
+ try {
+ return LaunchManager.serializeDocument(doc);
+ } catch (IOException e) {
+ IStatus status = newStatus(DebugCoreMessages.getString("LaunchConfiguration.Exception_occurred_creating_launch_configuration_memento_9"), DebugException.INTERNAL_ERROR, e); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ }
+
+ /**
+ * @see ILaunchConfiguration#getFile()
+ */
+ public IFile getFile() {
+ if (isLocal()) {
+ return null;
+ }
+ return ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(getLocation());
+ }
+
+ /**
+ * @see ILaunchConfiguration#contentsEqual(ILaunchConfiguration)
+ */
+ public boolean contentsEqual(ILaunchConfiguration object) {
+ try {
+ if (object instanceof LaunchConfiguration) {
+ LaunchConfiguration otherConfig = (LaunchConfiguration) object;
+ return getName().equals(otherConfig.getName())
+ && getType().equals(otherConfig.getType())
+ && getLocation().equals(otherConfig.getLocation())
+ && getInfo().equals(otherConfig.getInfo());
+ }
+ return false;
+ } catch (CoreException ce) {
+ return false;
+ }
+ }
+
+ /**
+ * Returns whether this configuration is equal to the
+ * given configuration. Two configurations are equal if
+ * they are stored in the same location (and neither one
+ * is a working copy).
+ *
+ * @return whether this configuration is equal to the
+ * given configuration
+ * @see Object#equals(Object)
+ */
+ public boolean equals(Object object) {
+ if (object instanceof ILaunchConfiguration) {
+ if (isWorkingCopy()) {
+ return this == object;
+ }
+ ILaunchConfiguration config = (ILaunchConfiguration) object;
+ if (!config.isWorkingCopy()) {
+ return config.getLocation().equals(getLocation());
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see Object#hashCode()
+ */
+ public int hashCode() {
+ return getLocation().hashCode();
+ }
+
+ /**
+ * Returns the container this launch configuration is
+ * stored in, or <code>null</code> if this launch configuration
+ * is stored locally.
+ *
+ * @return the container this launch configuration is
+ * stored in, or <code>null</code> if this launch configuration
+ * is stored locally
+ */
+ protected IContainer getContainer() {
+ IFile file = getFile();
+ if (file != null) {
+ return file.getParent();
+ }
+ return null;
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
index db8071fd0..90f0a7b78 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
@@ -1,521 +1,521 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.xerces.dom.DocumentImpl;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * The information associated with a launch configuration
- * handle.
- */
-public class LaunchConfigurationInfo {
-
- /**
- * This configurations attribute table.
- * Keys are <code>String</code>s and values
- * are one of <code>String</code>, <code>Integer</code>,
- * or <code>Boolean</code>.
- */
- private HashMap fAttributes;
-
- /**
- * This launch configuration's type
- */
- private ILaunchConfigurationType fType;
-
- /**
- * Constructs a new empty info
- */
- protected LaunchConfigurationInfo() {
- setAttributeTable(new HashMap(10));
- }
-
- /**
- * Returns this configuration's attribute table.
- *
- * @return attribute table
- */
- private HashMap getAttributeTable() {
- return fAttributes;
- }
-
- /**
- * Sets this configuration's attribute table.
- *
- * @param table attribute table
- */
- private void setAttributeTable(HashMap table) {
- fAttributes = table;
- }
-
- /**
- * Returns the <code>String</code> attribute with the
- * given key or the given default value if undefined.
- *
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @exception if the attribute with the given key exists
- * but is not a <code>String</code>
- */
- protected String getStringAttribute(String key, String defaultValue) throws CoreException {
- Object attr = getAttributeTable().get(key);
- if (attr != null) {
- if (attr instanceof String) {
- return (String)attr;
- } else {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.lang.String._1"), new String[] {key}), null //$NON-NLS-1$
- )
- );
- }
- }
- return defaultValue;
- }
-
- /**
- * Returns the <code>int</code> attribute with the
- * given key or the given default value if undefined.
- *
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @exception if the attribute with the given key exists
- * but is not an <code>int</code>
- */
- protected int getIntAttribute(String key, int defaultValue) throws CoreException {
- Object attr = getAttributeTable().get(key);
- if (attr != null) {
- if (attr instanceof Integer) {
- return ((Integer)attr).intValue();
- } else {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_int._2"), new String[] {key}), null //$NON-NLS-1$
- )
- );
- }
- }
- return defaultValue;
- }
-
- /**
- * Returns the <code>boolean</code> attribute with the
- * given key or the given default value if undefined.
- *
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @exception if the attribute with the given key exists
- * but is not a <code>boolean</code>
- */
- protected boolean getBooleanAttribute(String key, boolean defaultValue) throws CoreException {
- Object attr = getAttributeTable().get(key);
- if (attr != null) {
- if (attr instanceof Boolean) {
- return ((Boolean)attr).booleanValue();
- } else {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_boolean._3"), new String[] {key}), null //$NON-NLS-1$
- )
- );
- }
- }
- return defaultValue;
- }
-
- /**
- * Returns the <code>java.util.List</code> attribute with the
- * given key or the given default value if undefined.
- *
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @exception if the attribute with the given key exists
- * but is not a <code>java.util.List</code>
- */
- protected List getListAttribute(String key, List defaultValue) throws CoreException {
- Object attr = getAttributeTable().get(key);
- if (attr != null) {
- if (attr instanceof List) {
- return (List)attr;
- } else {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.List._1"), new String[] {key}), null //$NON-NLS-1$
- )
- );
- }
- }
- return defaultValue;
- }
-
- /**
- * Returns the <code>java.util.Map</code> attribute with the
- * given key or the given default value if undefined.
- *
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @exception if the attribute with the given key exists
- * but is not a <code>java.util.Map</code>
- */
- protected Map getMapAttribute(String key, Map defaultValue) throws CoreException {
- Object attr = getAttributeTable().get(key);
- if (attr != null) {
- if (attr instanceof Map) {
- return (Map)attr;
- } else {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.Map._1"), new String[] {key}), null //$NON-NLS-1$
- )
- );
- }
- }
- return defaultValue;
- }
-
- /**
- * Sets this configuration's type.
- *
- * @param type launch configuration type
- */
- protected void setType(ILaunchConfigurationType type) {
- fType = type;
- }
-
- /**
- * Returns this configuration's type.
- *
- * @return launch configuration type
- */
- protected ILaunchConfigurationType getType() {
- return fType;
- }
-
-
- /**
- * Returns a copy of this info object
- *
- * @return copy of this info
- */
- protected LaunchConfigurationInfo getCopy() {
- LaunchConfigurationInfo copy = new LaunchConfigurationInfo();
- copy.setType(getType());
- copy.setAttributeTable((HashMap)getAttributeTable().clone());
- return copy;
- }
-
- /**
- * Sets the given attribute to the given value. Only
- * working copy's should use this API.
- *
- * @param key attribute key
- * @param value attribuet value
- */
- protected void setAttribute(String key, Object value) {
- if (value == null) {
- getAttributeTable().remove(key);
- } else {
- getAttributeTable().put(key, value);
- }
- }
-
- /**
- * Returns the content of this info as XML
- *
- * @return the content of this info as XML
- * @exception IOException if an exception occurs creating the XML
- */
- protected String getAsXML() throws IOException {
-
- Document doc = new DocumentImpl();
- Element configRootElement = doc.createElement("launchConfiguration"); //$NON-NLS-1$
- doc.appendChild(configRootElement);
-
- configRootElement.setAttribute("type", getType().getIdentifier()); //$NON-NLS-1$
-
- Iterator keys = getAttributeTable().keySet().iterator();
- while (keys.hasNext()) {
- String key = (String)keys.next();
- Object value = getAttributeTable().get(key);
- if (value == null) {
- continue;
- }
- Element element = null;
- String valueString = null;
- if (value instanceof String) {
- valueString = (String)value;
- element = createKeyValueElement(doc, "stringAttribute", key, valueString); //$NON-NLS-1$
- } else if (value instanceof Integer) {
- valueString = ((Integer)value).toString();
- element = createKeyValueElement(doc, "intAttribute", key, valueString); //$NON-NLS-1$
- } else if (value instanceof Boolean) {
- valueString = ((Boolean)value).toString();
- element = createKeyValueElement(doc, "booleanAttribute", key, valueString); //$NON-NLS-1$
- } else if (value instanceof List) {
- element = createListElement(doc, "listAttribute", key, (List)value); //$NON-NLS-1$
- } else if (value instanceof Map) {
- element = createMapElement(doc, "mapAttribute", key, (Map)value); //$NON-NLS-1$
- }
- configRootElement.appendChild(element);
- }
-
- return LaunchManager.serializeDocument(doc);
- }
-
- /**
- * Helper method that creates a 'key value' element of the specified type with the
- * specified attribute values.
- */
- protected Element createKeyValueElement(Document doc, String elementType, String key, String value) {
- Element element = doc.createElement(elementType);
- element.setAttribute("key", key); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
- return element;
- }
-
- protected Element createListElement(Document doc, String elementType, String listKey, List list) {
- Element listElement = doc.createElement(elementType);
- listElement.setAttribute("key", listKey); //$NON-NLS-1$
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- String value = (String) iterator.next();
- Element element = doc.createElement("listEntry"); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
- listElement.appendChild(element);
- }
- return listElement;
- }
-
- protected Element createMapElement(Document doc, String elementType, String mapKey, Map map) {
- Element mapElement = doc.createElement(elementType);
- mapElement.setAttribute("key", mapKey); //$NON-NLS-1$
- Iterator iterator = map.keySet().iterator();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- String value = (String) map.get(key);
- Element element = doc.createElement("mapEntry"); //$NON-NLS-1$
- element.setAttribute("key", key); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
- mapElement.appendChild(element);
- }
- return mapElement;
- }
-
- protected void initializeFromXML(Element root) throws CoreException {
- if (!root.getNodeName().equalsIgnoreCase("launchConfiguration")) { //$NON-NLS-1$
- throw getInvalidFormatDebugException();
- }
-
- // read type
- String id = root.getAttribute("type"); //$NON-NLS-1$
- if (id == null) {
- throw getInvalidFormatDebugException();
- } else {
- ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(id);
- if (type == null) {
- String message= MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Launch_configuration_type_id___{0}___does_not_exist._nPossible_causes__n_tMissing_specification_of_a_launch_type_(missing_plugin)_n_tIncorrect_launch_configuration_XML_1"), new Object[]{id}); //$NON-NLS-1$
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, message, null)
- );
- }
- setType(type);
- }
-
- NodeList list = root.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- String nodeName = element.getNodeName();
-
- if (nodeName.equalsIgnoreCase("stringAttribute")) { //$NON-NLS-1$
- setStringAttribute(element);
- } else if (nodeName.equalsIgnoreCase("intAttribute")) { //$NON-NLS-1$
- setIntegerAttribute(element);
- } else if (nodeName.equalsIgnoreCase("booleanAttribute")) { //$NON-NLS-1$
- setBooleanAttribute(element);
- } else if (nodeName.equalsIgnoreCase("listAttribute")) { //$NON-NLS-1$
- setListAttribute(element);
- } else if (nodeName.equalsIgnoreCase("mapAttribute")) { //$NON-NLS-1$
- setMapAttribute(element);
- }
- }
- }
- }
-
- protected void setStringAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, value);
- }
-
- protected void setIntegerAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, new Integer(value));
- }
-
- protected void setBooleanAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, new Boolean(value));
- }
-
- protected void setListAttribute(Element element) throws CoreException {
- String listKey = element.getAttribute("key"); //$NON-NLS-1$
- NodeList nodeList = element.getChildNodes();
- int entryCount = nodeList.getLength();
- List list = new ArrayList(entryCount);
- for (int i = 0; i < entryCount; i++) {
- Node node = nodeList.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element subElement = (Element) node;
- String nodeName = subElement.getNodeName();
- if (!nodeName.equalsIgnoreCase("listEntry")) { //$NON-NLS-1$
- throw getInvalidFormatDebugException();
- }
- String value = getValueAttribute(subElement);
- list.add(value);
- }
- }
- setAttribute(listKey, list);
- }
-
- protected void setMapAttribute(Element element) throws CoreException {
- String mapKey = element.getAttribute("key"); //$NON-NLS-1$
- NodeList nodeList = element.getChildNodes();
- int entryCount = nodeList.getLength();
- Map map = new HashMap(entryCount);
- for (int i = 0; i < entryCount; i++) {
- Node node = nodeList.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element subElement = (Element) node;
- String nodeName = subElement.getNodeName();
- if (!nodeName.equalsIgnoreCase("mapEntry")) { //$NON-NLS-1$
- throw getInvalidFormatDebugException();
- }
- String key = getKeyAttribute(subElement);
- String value = getValueAttribute(subElement);
- map.put(key, value);
- }
- }
- setAttribute(mapKey, map);
- }
-
- protected String getKeyAttribute(Element element) throws CoreException {
- String key = element.getAttribute("key"); //$NON-NLS-1$
- if (key == null) {
- throw getInvalidFormatDebugException();
- }
- return key;
- }
-
- protected String getValueAttribute(Element element) throws CoreException {
- String value = element.getAttribute("value"); //$NON-NLS-1$
- if (value == null) {
- throw getInvalidFormatDebugException();
- }
- return value;
- }
-
- protected DebugException getInvalidFormatDebugException() {
- return
- new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfigurationInfo.Invalid_launch_configuration_XML._10"), null //$NON-NLS-1$
- )
- );
- }
-
- /**
- * Two <code>LaunchConfigurationInfo</code> objects are equal if and only if they have the
- * same type and they have the same set of attributes with the same values.
- *
- * @see Object#equals(Object)
- */
- public boolean equals(Object obj) {
-
- // Make sure it's a LaunchConfigurationInfo object
- if (!(obj instanceof LaunchConfigurationInfo)) {
- return false;
- }
-
- // Make sure the types are the same
- LaunchConfigurationInfo other = (LaunchConfigurationInfo) obj;
- if (!fType.getIdentifier().equals(other.getType().getIdentifier())) {
- return false;
- }
-
- // Make sure the attributes are the same
- return compareAttributes(fAttributes, other.getAttributeTable());
- }
-
- /**
- * Returns whether the two attribute maps are equal, consulting
- * registered comparator extensions.
- *
- * @param map1 attribute map
- * @param map2 attribute map
- * @return whether the two attribute maps are equal
- */
- protected boolean compareAttributes(HashMap map1, HashMap map2) {
- LaunchManager manager = (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
- if (map1.size() == map2.size()) {
- Iterator attributes = map1.keySet().iterator();
- while (attributes.hasNext()) {
- String key = (String)attributes.next();
- Object attr1 = map1.get(key);
- Object attr2 = map2.get(key);
- if (attr2 == null) {
- return false;
- }
- Comparator comp = manager.getComparator(key);
- if (comp == null) {
- if (!attr1.equals(attr2)) {
- return false;
- }
- } else {
- if (comp.compare(attr1, attr2) != 0) {
- return false;
- }
- }
- }
- return true;
- }
- return false;
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.xerces.dom.DocumentImpl;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * The information associated with a launch configuration
+ * handle.
+ */
+public class LaunchConfigurationInfo {
+
+ /**
+ * This configurations attribute table.
+ * Keys are <code>String</code>s and values
+ * are one of <code>String</code>, <code>Integer</code>,
+ * or <code>Boolean</code>.
+ */
+ private HashMap fAttributes;
+
+ /**
+ * This launch configuration's type
+ */
+ private ILaunchConfigurationType fType;
+
+ /**
+ * Constructs a new empty info
+ */
+ protected LaunchConfigurationInfo() {
+ setAttributeTable(new HashMap(10));
+ }
+
+ /**
+ * Returns this configuration's attribute table.
+ *
+ * @return attribute table
+ */
+ private HashMap getAttributeTable() {
+ return fAttributes;
+ }
+
+ /**
+ * Sets this configuration's attribute table.
+ *
+ * @param table attribute table
+ */
+ private void setAttributeTable(HashMap table) {
+ fAttributes = table;
+ }
+
+ /**
+ * Returns the <code>String</code> attribute with the
+ * given key or the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue
+ * if undefined
+ * @exception if the attribute with the given key exists
+ * but is not a <code>String</code>
+ */
+ protected String getStringAttribute(String key, String defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof String) {
+ return (String)attr;
+ } else {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.lang.String._1"), new String[] {key}), null //$NON-NLS-1$
+ )
+ );
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Returns the <code>int</code> attribute with the
+ * given key or the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue
+ * if undefined
+ * @exception if the attribute with the given key exists
+ * but is not an <code>int</code>
+ */
+ protected int getIntAttribute(String key, int defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof Integer) {
+ return ((Integer)attr).intValue();
+ } else {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_int._2"), new String[] {key}), null //$NON-NLS-1$
+ )
+ );
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Returns the <code>boolean</code> attribute with the
+ * given key or the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue
+ * if undefined
+ * @exception if the attribute with the given key exists
+ * but is not a <code>boolean</code>
+ */
+ protected boolean getBooleanAttribute(String key, boolean defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof Boolean) {
+ return ((Boolean)attr).booleanValue();
+ } else {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_boolean._3"), new String[] {key}), null //$NON-NLS-1$
+ )
+ );
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Returns the <code>java.util.List</code> attribute with the
+ * given key or the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue
+ * if undefined
+ * @exception if the attribute with the given key exists
+ * but is not a <code>java.util.List</code>
+ */
+ protected List getListAttribute(String key, List defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof List) {
+ return (List)attr;
+ } else {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.List._1"), new String[] {key}), null //$NON-NLS-1$
+ )
+ );
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Returns the <code>java.util.Map</code> attribute with the
+ * given key or the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue
+ * if undefined
+ * @exception if the attribute with the given key exists
+ * but is not a <code>java.util.Map</code>
+ */
+ protected Map getMapAttribute(String key, Map defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof Map) {
+ return (Map)attr;
+ } else {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Attribute_{0}_is_not_of_type_java.util.Map._1"), new String[] {key}), null //$NON-NLS-1$
+ )
+ );
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Sets this configuration's type.
+ *
+ * @param type launch configuration type
+ */
+ protected void setType(ILaunchConfigurationType type) {
+ fType = type;
+ }
+
+ /**
+ * Returns this configuration's type.
+ *
+ * @return launch configuration type
+ */
+ protected ILaunchConfigurationType getType() {
+ return fType;
+ }
+
+
+ /**
+ * Returns a copy of this info object
+ *
+ * @return copy of this info
+ */
+ protected LaunchConfigurationInfo getCopy() {
+ LaunchConfigurationInfo copy = new LaunchConfigurationInfo();
+ copy.setType(getType());
+ copy.setAttributeTable((HashMap)getAttributeTable().clone());
+ return copy;
+ }
+
+ /**
+ * Sets the given attribute to the given value. Only
+ * working copy's should use this API.
+ *
+ * @param key attribute key
+ * @param value attribuet value
+ */
+ protected void setAttribute(String key, Object value) {
+ if (value == null) {
+ getAttributeTable().remove(key);
+ } else {
+ getAttributeTable().put(key, value);
+ }
+ }
+
+ /**
+ * Returns the content of this info as XML
+ *
+ * @return the content of this info as XML
+ * @exception IOException if an exception occurs creating the XML
+ */
+ protected String getAsXML() throws IOException {
+
+ Document doc = new DocumentImpl();
+ Element configRootElement = doc.createElement("launchConfiguration"); //$NON-NLS-1$
+ doc.appendChild(configRootElement);
+
+ configRootElement.setAttribute("type", getType().getIdentifier()); //$NON-NLS-1$
+
+ Iterator keys = getAttributeTable().keySet().iterator();
+ while (keys.hasNext()) {
+ String key = (String)keys.next();
+ Object value = getAttributeTable().get(key);
+ if (value == null) {
+ continue;
+ }
+ Element element = null;
+ String valueString = null;
+ if (value instanceof String) {
+ valueString = (String)value;
+ element = createKeyValueElement(doc, "stringAttribute", key, valueString); //$NON-NLS-1$
+ } else if (value instanceof Integer) {
+ valueString = ((Integer)value).toString();
+ element = createKeyValueElement(doc, "intAttribute", key, valueString); //$NON-NLS-1$
+ } else if (value instanceof Boolean) {
+ valueString = ((Boolean)value).toString();
+ element = createKeyValueElement(doc, "booleanAttribute", key, valueString); //$NON-NLS-1$
+ } else if (value instanceof List) {
+ element = createListElement(doc, "listAttribute", key, (List)value); //$NON-NLS-1$
+ } else if (value instanceof Map) {
+ element = createMapElement(doc, "mapAttribute", key, (Map)value); //$NON-NLS-1$
+ }
+ configRootElement.appendChild(element);
+ }
+
+ return LaunchManager.serializeDocument(doc);
+ }
+
+ /**
+ * Helper method that creates a 'key value' element of the specified type with the
+ * specified attribute values.
+ */
+ protected Element createKeyValueElement(Document doc, String elementType, String key, String value) {
+ Element element = doc.createElement(elementType);
+ element.setAttribute("key", key); //$NON-NLS-1$
+ element.setAttribute("value", value); //$NON-NLS-1$
+ return element;
+ }
+
+ protected Element createListElement(Document doc, String elementType, String listKey, List list) {
+ Element listElement = doc.createElement(elementType);
+ listElement.setAttribute("key", listKey); //$NON-NLS-1$
+ Iterator iterator = list.iterator();
+ while (iterator.hasNext()) {
+ String value = (String) iterator.next();
+ Element element = doc.createElement("listEntry"); //$NON-NLS-1$
+ element.setAttribute("value", value); //$NON-NLS-1$
+ listElement.appendChild(element);
+ }
+ return listElement;
+ }
+
+ protected Element createMapElement(Document doc, String elementType, String mapKey, Map map) {
+ Element mapElement = doc.createElement(elementType);
+ mapElement.setAttribute("key", mapKey); //$NON-NLS-1$
+ Iterator iterator = map.keySet().iterator();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+ String value = (String) map.get(key);
+ Element element = doc.createElement("mapEntry"); //$NON-NLS-1$
+ element.setAttribute("key", key); //$NON-NLS-1$
+ element.setAttribute("value", value); //$NON-NLS-1$
+ mapElement.appendChild(element);
+ }
+ return mapElement;
+ }
+
+ protected void initializeFromXML(Element root) throws CoreException {
+ if (!root.getNodeName().equalsIgnoreCase("launchConfiguration")) { //$NON-NLS-1$
+ throw getInvalidFormatDebugException();
+ }
+
+ // read type
+ String id = root.getAttribute("type"); //$NON-NLS-1$
+ if (id == null) {
+ throw getInvalidFormatDebugException();
+ } else {
+ ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(id);
+ if (type == null) {
+ String message= MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationInfo.Launch_configuration_type_id___{0}___does_not_exist._nPossible_causes__n_tMissing_specification_of_a_launch_type_(missing_plugin)_n_tIncorrect_launch_configuration_XML_1"), new Object[]{id}); //$NON-NLS-1$
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, message, null)
+ );
+ }
+ setType(type);
+ }
+
+ NodeList list = root.getChildNodes();
+ int length = list.getLength();
+ for (int i = 0; i < length; ++i) {
+ Node node = list.item(i);
+ short type = node.getNodeType();
+ if (type == Node.ELEMENT_NODE) {
+ Element element = (Element) node;
+ String nodeName = element.getNodeName();
+
+ if (nodeName.equalsIgnoreCase("stringAttribute")) { //$NON-NLS-1$
+ setStringAttribute(element);
+ } else if (nodeName.equalsIgnoreCase("intAttribute")) { //$NON-NLS-1$
+ setIntegerAttribute(element);
+ } else if (nodeName.equalsIgnoreCase("booleanAttribute")) { //$NON-NLS-1$
+ setBooleanAttribute(element);
+ } else if (nodeName.equalsIgnoreCase("listAttribute")) { //$NON-NLS-1$
+ setListAttribute(element);
+ } else if (nodeName.equalsIgnoreCase("mapAttribute")) { //$NON-NLS-1$
+ setMapAttribute(element);
+ }
+ }
+ }
+ }
+
+ protected void setStringAttribute(Element element) throws CoreException {
+ String key = getKeyAttribute(element);
+ String value = getValueAttribute(element);
+ setAttribute(key, value);
+ }
+
+ protected void setIntegerAttribute(Element element) throws CoreException {
+ String key = getKeyAttribute(element);
+ String value = getValueAttribute(element);
+ setAttribute(key, new Integer(value));
+ }
+
+ protected void setBooleanAttribute(Element element) throws CoreException {
+ String key = getKeyAttribute(element);
+ String value = getValueAttribute(element);
+ setAttribute(key, new Boolean(value));
+ }
+
+ protected void setListAttribute(Element element) throws CoreException {
+ String listKey = element.getAttribute("key"); //$NON-NLS-1$
+ NodeList nodeList = element.getChildNodes();
+ int entryCount = nodeList.getLength();
+ List list = new ArrayList(entryCount);
+ for (int i = 0; i < entryCount; i++) {
+ Node node = nodeList.item(i);
+ short type = node.getNodeType();
+ if (type == Node.ELEMENT_NODE) {
+ Element subElement = (Element) node;
+ String nodeName = subElement.getNodeName();
+ if (!nodeName.equalsIgnoreCase("listEntry")) { //$NON-NLS-1$
+ throw getInvalidFormatDebugException();
+ }
+ String value = getValueAttribute(subElement);
+ list.add(value);
+ }
+ }
+ setAttribute(listKey, list);
+ }
+
+ protected void setMapAttribute(Element element) throws CoreException {
+ String mapKey = element.getAttribute("key"); //$NON-NLS-1$
+ NodeList nodeList = element.getChildNodes();
+ int entryCount = nodeList.getLength();
+ Map map = new HashMap(entryCount);
+ for (int i = 0; i < entryCount; i++) {
+ Node node = nodeList.item(i);
+ short type = node.getNodeType();
+ if (type == Node.ELEMENT_NODE) {
+ Element subElement = (Element) node;
+ String nodeName = subElement.getNodeName();
+ if (!nodeName.equalsIgnoreCase("mapEntry")) { //$NON-NLS-1$
+ throw getInvalidFormatDebugException();
+ }
+ String key = getKeyAttribute(subElement);
+ String value = getValueAttribute(subElement);
+ map.put(key, value);
+ }
+ }
+ setAttribute(mapKey, map);
+ }
+
+ protected String getKeyAttribute(Element element) throws CoreException {
+ String key = element.getAttribute("key"); //$NON-NLS-1$
+ if (key == null) {
+ throw getInvalidFormatDebugException();
+ }
+ return key;
+ }
+
+ protected String getValueAttribute(Element element) throws CoreException {
+ String value = element.getAttribute("value"); //$NON-NLS-1$
+ if (value == null) {
+ throw getInvalidFormatDebugException();
+ }
+ return value;
+ }
+
+ protected DebugException getInvalidFormatDebugException() {
+ return
+ new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfigurationInfo.Invalid_launch_configuration_XML._10"), null //$NON-NLS-1$
+ )
+ );
+ }
+
+ /**
+ * Two <code>LaunchConfigurationInfo</code> objects are equal if and only if they have the
+ * same type and they have the same set of attributes with the same values.
+ *
+ * @see Object#equals(Object)
+ */
+ public boolean equals(Object obj) {
+
+ // Make sure it's a LaunchConfigurationInfo object
+ if (!(obj instanceof LaunchConfigurationInfo)) {
+ return false;
+ }
+
+ // Make sure the types are the same
+ LaunchConfigurationInfo other = (LaunchConfigurationInfo) obj;
+ if (!fType.getIdentifier().equals(other.getType().getIdentifier())) {
+ return false;
+ }
+
+ // Make sure the attributes are the same
+ return compareAttributes(fAttributes, other.getAttributeTable());
+ }
+
+ /**
+ * Returns whether the two attribute maps are equal, consulting
+ * registered comparator extensions.
+ *
+ * @param map1 attribute map
+ * @param map2 attribute map
+ * @return whether the two attribute maps are equal
+ */
+ protected boolean compareAttributes(HashMap map1, HashMap map2) {
+ LaunchManager manager = (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
+ if (map1.size() == map2.size()) {
+ Iterator attributes = map1.keySet().iterator();
+ while (attributes.hasNext()) {
+ String key = (String)attributes.next();
+ Object attr1 = map1.get(key);
+ Object attr2 = map2.get(key);
+ if (attr2 == null) {
+ return false;
+ }
+ Comparator comp = manager.getComparator(key);
+ if (comp == null) {
+ if (!attr1.equals(attr2)) {
+ return false;
+ }
+ } else {
+ if (comp.compare(attr1, attr2) != 0) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
index 0fcafdefe..9a42b050a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
@@ -1,152 +1,152 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-
-/**
- * A launch configuration type wrappers a configuration
- * element for a <code>launchConfigurationType</code>
- * extension.
- */
-public class LaunchConfigurationType implements ILaunchConfigurationType {
-
- /**
- * The configuration element of the extension.
- */
- private IConfigurationElement fElement;
-
- /**
- * Modes this type supports.
- */
- private Set fModes;
-
- /**
- * The delegate for launch configurations of this type.
- * Delegates are instantiated lazily as required.
- */
- private ILaunchConfigurationDelegate fDelegate;
-
- /**
- * Constructs a new launch configuration type on the
- * given configuration element.
- *
- * @param element configuration element
- */
- protected LaunchConfigurationType(IConfigurationElement element) {
- setConfigurationElement(element);
- }
-
- /**
- * Sets this type's configuration element.
- *
- * @param element this type's configuration element
- */
- private void setConfigurationElement(IConfigurationElement element) {
- fElement = element;
- }
-
- /**
- * Returns this type's configuration element.
- *
- * @return this type's configuration element
- */
- protected IConfigurationElement getConfigurationElement() {
- return fElement;
- }
-
-
- /**
- * @see ILaunchConfigurationType#supportsMode(String)
- */
- public boolean supportsMode(String mode) {
- return getModes().contains(mode);
- }
-
- /**
- * Returns the set of modes specified in the configuration data.
- *
- * @return the set of modes specified in the configuration data
- */
- protected Set getModes() {
- if (fModes == null) {
- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
- if (modes == null) {
- return new HashSet(0);
- }
- StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
- fModes = new HashSet(tokenizer.countTokens());
- while (tokenizer.hasMoreTokens()) {
- fModes.add(tokenizer.nextToken().trim());
- }
- }
- return fModes;
- }
-
- /**
- * @see ILaunchConfigurationType#getName()
- */
- public String getName() {
- return getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
- }
-
- /**
- * @see ILaunchConfigurationType#getIdentifier()
- */
- public String getIdentifier() {
- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * @see ILaunchConfigurationType#isPublic()
- */
- public boolean isPublic() {
- String publicString = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
- if (publicString != null) {
- if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
- return false;
- }
- }
- return true;
- }
-
- /**
- * @see ILaunchConfigurationType#newInstance(IContainer, String)
- */
- public ILaunchConfigurationWorkingCopy newInstance(
- IContainer container,
- String name)
- throws CoreException {
- return new LaunchConfigurationWorkingCopy(container, name, this);
- }
-
- /**
- * Returns the launch configuration delegate for launch
- * configurations of this type. The first time this method
- * is called, the delegate is instantiated.
- *
- * @return launch configuration delegate
- * @exception CoreException if unable to instantiate the
- * delegate
- */
- public ILaunchConfigurationDelegate getDelegate() throws CoreException {
- if (fDelegate == null) {
- fDelegate = (ILaunchConfigurationDelegate)getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
- }
- return fDelegate;
- }
-
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+
+/**
+ * A launch configuration type wrappers a configuration
+ * element for a <code>launchConfigurationType</code>
+ * extension.
+ */
+public class LaunchConfigurationType implements ILaunchConfigurationType {
+
+ /**
+ * The configuration element of the extension.
+ */
+ private IConfigurationElement fElement;
+
+ /**
+ * Modes this type supports.
+ */
+ private Set fModes;
+
+ /**
+ * The delegate for launch configurations of this type.
+ * Delegates are instantiated lazily as required.
+ */
+ private ILaunchConfigurationDelegate fDelegate;
+
+ /**
+ * Constructs a new launch configuration type on the
+ * given configuration element.
+ *
+ * @param element configuration element
+ */
+ protected LaunchConfigurationType(IConfigurationElement element) {
+ setConfigurationElement(element);
+ }
+
+ /**
+ * Sets this type's configuration element.
+ *
+ * @param element this type's configuration element
+ */
+ private void setConfigurationElement(IConfigurationElement element) {
+ fElement = element;
+ }
+
+ /**
+ * Returns this type's configuration element.
+ *
+ * @return this type's configuration element
+ */
+ protected IConfigurationElement getConfigurationElement() {
+ return fElement;
+ }
+
+
+ /**
+ * @see ILaunchConfigurationType#supportsMode(String)
+ */
+ public boolean supportsMode(String mode) {
+ return getModes().contains(mode);
+ }
+
+ /**
+ * Returns the set of modes specified in the configuration data.
+ *
+ * @return the set of modes specified in the configuration data
+ */
+ protected Set getModes() {
+ if (fModes == null) {
+ String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
+ if (modes == null) {
+ return new HashSet(0);
+ }
+ StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
+ fModes = new HashSet(tokenizer.countTokens());
+ while (tokenizer.hasMoreTokens()) {
+ fModes.add(tokenizer.nextToken().trim());
+ }
+ }
+ return fModes;
+ }
+
+ /**
+ * @see ILaunchConfigurationType#getName()
+ */
+ public String getName() {
+ return getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ILaunchConfigurationType#getIdentifier()
+ */
+ public String getIdentifier() {
+ return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ILaunchConfigurationType#isPublic()
+ */
+ public boolean isPublic() {
+ String publicString = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
+ if (publicString != null) {
+ if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @see ILaunchConfigurationType#newInstance(IContainer, String)
+ */
+ public ILaunchConfigurationWorkingCopy newInstance(
+ IContainer container,
+ String name)
+ throws CoreException {
+ return new LaunchConfigurationWorkingCopy(container, name, this);
+ }
+
+ /**
+ * Returns the launch configuration delegate for launch
+ * configurations of this type. The first time this method
+ * is called, the delegate is instantiated.
+ *
+ * @return launch configuration delegate
+ * @exception CoreException if unable to instantiate the
+ * delegate
+ */
+ public ILaunchConfigurationDelegate getDelegate() throws CoreException {
+ if (fDelegate == null) {
+ fDelegate = (ILaunchConfigurationDelegate)getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
+ }
+ return fDelegate;
+ }
+
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
index b2b560bca..1dddac236 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
@@ -1,489 +1,489 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * A working copy launch configuration
- */
-public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implements ILaunchConfigurationWorkingCopy {
-
- /**
- * Handle of original launch configuration this
- * working copy is based on
- */
- private LaunchConfiguration fOriginal;
-
- /**
- * Working copy of attributes.
- */
- private LaunchConfigurationInfo fInfo;
-
- /**
- * Whether this working copy has been modified since
- * it was created
- */
- private boolean fDirty = false;
-
- /**
- * The name for this configuration.
- */
- private String fName;
-
- /**
- * Indicates whether this working copy has been explicitly renamed.
- */
- private boolean fRenamed = false;
-
- /**
- * Suppress change notification until created
- */
- private boolean fSuppressChange = true;
-
- /**
- * The container this working copy will be
- * stored in when saved.
- */
- private IContainer fContainer;
-
- /**
- * Constructs a working copy of the specified launch
- * configuration.
- *
- * @param original launch configuration to make
- * a working copy of
- * @exception CoreException if unable to initialize this
- * working copy's attributes based on the original configuration
- */
- protected LaunchConfigurationWorkingCopy(LaunchConfiguration original) throws CoreException {
- super(original.getLocation());
- setName(original.getName());
- copyFrom(original);
- setOriginal(original);
- fSuppressChange = false;
- }
-
- /**
- * Constructs a copy of the specified launch
- * configuration, with the given (new) name.
- *
- * @param original launch configuration to make
- * a working copy of
- * @param name the new name for the copy of the launch
- * configuration
- * @exception CoreException if unable to initialize this
- * working copy's attributes based on the original configuration
- */
- protected LaunchConfigurationWorkingCopy(LaunchConfiguration original, String name) throws CoreException {
- super(original.getLocation());
- copyFrom(original);
- setName(name);
- fSuppressChange = false;
- }
-
- /**
- * Constructs a new working copy to be created in the specified
- * location.
- *
- * @param container the container that the configuration will be created in
- * or <code>null</code> if to be local
- * @param name the name of the new launch configuration
- * @param type the type of this working copy
- */
- protected LaunchConfigurationWorkingCopy(IContainer container, String name, ILaunchConfigurationType type) {
- super((IPath)null);
- setName(name);
- setInfo(new LaunchConfigurationInfo());
- getInfo().setType(type);
- setContainer(container);
- fSuppressChange = false;
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#isDirty()
- */
- public boolean isDirty() {
- return fDirty;
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#doSave()
- */
- public ILaunchConfiguration doSave() throws CoreException {
- if (isDirty()) {
- IWorkspaceRunnable wr = new IWorkspaceRunnable() {
- public void run(IProgressMonitor pm) throws CoreException {
- // write the new file
- LaunchConfigurationWorkingCopy.this.writeNewFile();
- // delete the old file if this is not a new configuration
- // or the file was renamed/moved
- if (!LaunchConfigurationWorkingCopy.this.isNew()) {
- if (LaunchConfigurationWorkingCopy.this.isMoved()) {
- LaunchConfigurationWorkingCopy.this.getOriginal().delete();
- }
- }
- resetDirty();
- }
- };
-
- ResourcesPlugin.getWorkspace().run(wr, null);
- }
-
- return new LaunchConfiguration(getLocation());
- }
-
- /**
- * Writes the new configuration information to a file.
- *
- * @exception CoreException if writing the file fails
- */
- protected void writeNewFile() throws CoreException {
- String xml = null;
- try {
- xml = getInfo().getAsXML();
- } catch (IOException e) {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1"), new String[]{e.toString()}), null //$NON-NLS-1$
- )
- );
- }
-
- if (isLocal()) {
- // use java.io to update configuration file
- try {
- boolean added = false;
- File file = getLocation().toFile();
- File dir = getLocation().removeLastSegments(1).toFile();
- dir.mkdirs();
- if (!file.exists()) {
- added = true;
- file.createNewFile();
- }
- FileOutputStream stream = new FileOutputStream(file);
- stream.write(xml.getBytes("UTF8")); //$NON-NLS-1$
- stream.close();
- if (added) {
- getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getLocation()));
- } else {
- getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getLocation()));
- }
- } catch (IOException e) {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1"), new String[]{e.toString()}), null //$NON-NLS-1$
- )
- );
- }
- } else {
- // use resource API to update configuration file
- IFile file = getFile();
- IContainer dir = file.getParent();
- if (!dir.exists()) {
- throw new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.Specified_container_for_launch_configuration_does_not_exist_2"), null //$NON-NLS-1$
- )
- );
- }
- ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
- if (!file.exists()) {
- file.create(stream, false, null);
- //getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getLocation()));
- } else {
- file.setContents(stream, false, false, null);
- //getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getLocation()));
- }
- }
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setAttribute(String, int)
- */
- public void setAttribute(String attributeName, int value) {
- getInfo().setAttribute(attributeName, new Integer(value));
- setDirty();
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setAttribute(String, String)
- */
- public void setAttribute(String attributeName, String value) {
- getInfo().setAttribute(attributeName, value);
- setDirty();
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setAttribute(String, boolean)
- */
- public void setAttribute(String attributeName, boolean value) {
- getInfo().setAttribute(attributeName, new Boolean(value));
- setDirty();
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setAttribute(String, List)
- */
- public void setAttribute(String attributeName, List value) {
- getInfo().setAttribute(attributeName, value);
- setDirty();
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setAttribute(String, Map)
- */
- public void setAttribute(String attributeName, Map value) {
- getInfo().setAttribute(attributeName, value);
- setDirty();
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#getOriginal()
- */
- public ILaunchConfiguration getOriginal() {
- return fOriginal;
- }
-
- /**
- * Sets the launch configuration this working copy
- * is based on. Initializes the attributes of this
- * working copy to the current values of the given
- * configuration.
- *
- * @param originl the launch configuration this working
- * copy is based on.
- * @exception CoreException if unable to initialize this
- * working copy based on the original's current attribute
- * set
- */
- private void copyFrom(LaunchConfiguration original) throws CoreException {
- LaunchConfigurationInfo info = original.getInfo();
- setInfo(info.getCopy());
- setContainer(original.getContainer());
- resetDirty();
- }
-
- /**
- * Sets the launch configuration this working copy
- * is based on.
- *
- * @param originl the launch configuration this working
- * copy is based on.
- */
- private void setOriginal(LaunchConfiguration original) {
- fOriginal = original;
- }
-
- /**
- * Sets the working copy info object for this working copy.
- *
- * @param info a copy of attributes from this working copy's
- * original launch configuration
- */
- protected void setInfo(LaunchConfigurationInfo info) {
- fInfo = info;
- }
-
- /**
- * @see ILaunchConfiguration#isWorkingCopy()
- */
- public boolean isWorkingCopy() {
- return true;
- }
-
- /**
- * A working copy keeps a local info object that is not
- * cached with the launch manager.
- *
- * @see LaunchConfiguration#getInfo()
- */
- protected LaunchConfigurationInfo getInfo() {
- return fInfo;
- }
-
- /**
- * Sets this working copy's state to dirty.
- * Notifies listeners that this working copy has
- * changed.
- */
- private void setDirty() {
- fDirty = true;
- if (!suppressChangeNotification()) {
- getLaunchManager().notifyChanged(this);
- }
- }
-
- /**
- * Sets this working copy's state to not dirty.
- */
- private void resetDirty() {
- fDirty = false;
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#rename(String)
- */
- public void rename(String name) {
- if (!getName().equals(name)) {
- setName(name);
- fRenamed = isNew() || !(getOriginal().getName().equals(name));
- }
- }
-
- /**
- * Sets the new name for this configuration.
- *
- * @param name the new name for this configuration
- */
- private void setName(String name) {
- fName = name;
- setDirty();
- }
-
- /**
- * @see ILaunchConfiguration#getName()
- */
- public String getName() {
- return fName;
- }
-
- /**
- * @see ILaunchConfiguration#isLocal()
- */
- public boolean isLocal() {
- return getContainer() == null;
- }
-
- /**
- * Returns the location this launch configuration will reside at
- * when saved.
- *
- * @see ILaunchConfiguration#getLocation()
- */
- public IPath getLocation() {
- if (isMoved()) {
- IPath path = null;
- if (isLocal()) {
- path = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
- } else {
- path = getContainer().getLocation();
- }
- path = path.append(getName() + "." + LAUNCH_CONFIGURATION_FILE_EXTENSION); //$NON-NLS-1$
- return path;
- } else {
- return getOriginal().getLocation();
- }
- }
-
- /**
- * Returns whether this working copy is new, or is a
- * working copy of another launch configuration.
- *
- * @return whether this working copy is new, or is a
- * working copy of another launch configuration
- */
- protected boolean isNew() {
- return getOriginal() == null;
- }
-
- /**
- * Returns whether this working copy is new or if its
- * location has changed from that of its original.
- *
- * @return whether this working copy is new or if its
- * location has changed from that of its original
- */
- protected boolean isMoved() {
- if (isNew() || fRenamed) {
- return true;
- }
- IContainer newContainer = getContainer();
- IContainer originalContainer = ((LaunchConfiguration)getOriginal()).getContainer();
- if (newContainer == originalContainer) {
- return false;
- }
- if (newContainer == null) {
- return !originalContainer.equals(newContainer);
- } else {
- return !newContainer.equals(originalContainer);
- }
- }
-
- /**
- * A working copy cannot generate a memento.
- *
- * @see ILaunchConfiguration#getMemento()
- */
- public String getMemento() {
- return null;
- }
-
- /**
- * Returns whether change notification should be
- * suppressed
- */
- protected boolean suppressChangeNotification() {
- return fSuppressChange;
- }
-
- /**
- * @see ILaunchConfigurationWorkingCopy#setContainer(IContainer)
- */
- public void setContainer(IContainer container) {
- if (container == fContainer) {
- return;
- }
- if (container != null) {
- if (container.equals(fContainer)) {
- return;
- }
- } else {
- if (fContainer.equals(container)) {
- return;
- }
- }
- fContainer = container;
- setDirty();
- }
-
- /**
- * Returns the container this working copy will be
- * stored in when saved, or <code>null</code> if
- * this working copy is local.
- *
- * @return the container this working copy will be
- * stored in when saved, or <code>null</code> if
- * this working copy is local
- */
- protected IContainer getContainer() {
- return fContainer;
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+
+/**
+ * A working copy launch configuration
+ */
+public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implements ILaunchConfigurationWorkingCopy {
+
+ /**
+ * Handle of original launch configuration this
+ * working copy is based on
+ */
+ private LaunchConfiguration fOriginal;
+
+ /**
+ * Working copy of attributes.
+ */
+ private LaunchConfigurationInfo fInfo;
+
+ /**
+ * Whether this working copy has been modified since
+ * it was created
+ */
+ private boolean fDirty = false;
+
+ /**
+ * The name for this configuration.
+ */
+ private String fName;
+
+ /**
+ * Indicates whether this working copy has been explicitly renamed.
+ */
+ private boolean fRenamed = false;
+
+ /**
+ * Suppress change notification until created
+ */
+ private boolean fSuppressChange = true;
+
+ /**
+ * The container this working copy will be
+ * stored in when saved.
+ */
+ private IContainer fContainer;
+
+ /**
+ * Constructs a working copy of the specified launch
+ * configuration.
+ *
+ * @param original launch configuration to make
+ * a working copy of
+ * @exception CoreException if unable to initialize this
+ * working copy's attributes based on the original configuration
+ */
+ protected LaunchConfigurationWorkingCopy(LaunchConfiguration original) throws CoreException {
+ super(original.getLocation());
+ setName(original.getName());
+ copyFrom(original);
+ setOriginal(original);
+ fSuppressChange = false;
+ }
+
+ /**
+ * Constructs a copy of the specified launch
+ * configuration, with the given (new) name.
+ *
+ * @param original launch configuration to make
+ * a working copy of
+ * @param name the new name for the copy of the launch
+ * configuration
+ * @exception CoreException if unable to initialize this
+ * working copy's attributes based on the original configuration
+ */
+ protected LaunchConfigurationWorkingCopy(LaunchConfiguration original, String name) throws CoreException {
+ super(original.getLocation());
+ copyFrom(original);
+ setName(name);
+ fSuppressChange = false;
+ }
+
+ /**
+ * Constructs a new working copy to be created in the specified
+ * location.
+ *
+ * @param container the container that the configuration will be created in
+ * or <code>null</code> if to be local
+ * @param name the name of the new launch configuration
+ * @param type the type of this working copy
+ */
+ protected LaunchConfigurationWorkingCopy(IContainer container, String name, ILaunchConfigurationType type) {
+ super((IPath)null);
+ setName(name);
+ setInfo(new LaunchConfigurationInfo());
+ getInfo().setType(type);
+ setContainer(container);
+ fSuppressChange = false;
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#isDirty()
+ */
+ public boolean isDirty() {
+ return fDirty;
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#doSave()
+ */
+ public ILaunchConfiguration doSave() throws CoreException {
+ if (isDirty()) {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor pm) throws CoreException {
+ // write the new file
+ LaunchConfigurationWorkingCopy.this.writeNewFile();
+ // delete the old file if this is not a new configuration
+ // or the file was renamed/moved
+ if (!LaunchConfigurationWorkingCopy.this.isNew()) {
+ if (LaunchConfigurationWorkingCopy.this.isMoved()) {
+ LaunchConfigurationWorkingCopy.this.getOriginal().delete();
+ }
+ }
+ resetDirty();
+ }
+ };
+
+ ResourcesPlugin.getWorkspace().run(wr, null);
+ }
+
+ return new LaunchConfiguration(getLocation());
+ }
+
+ /**
+ * Writes the new configuration information to a file.
+ *
+ * @exception CoreException if writing the file fails
+ */
+ protected void writeNewFile() throws CoreException {
+ String xml = null;
+ try {
+ xml = getInfo().getAsXML();
+ } catch (IOException e) {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1"), new String[]{e.toString()}), null //$NON-NLS-1$
+ )
+ );
+ }
+
+ if (isLocal()) {
+ // use java.io to update configuration file
+ try {
+ boolean added = false;
+ File file = getLocation().toFile();
+ File dir = getLocation().removeLastSegments(1).toFile();
+ dir.mkdirs();
+ if (!file.exists()) {
+ added = true;
+ file.createNewFile();
+ }
+ FileOutputStream stream = new FileOutputStream(file);
+ stream.write(xml.getBytes("UTF8")); //$NON-NLS-1$
+ stream.close();
+ if (added) {
+ getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getLocation()));
+ } else {
+ getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getLocation()));
+ }
+ } catch (IOException e) {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.{0}_occurred_generating_launch_configuration_XML._1"), new String[]{e.toString()}), null //$NON-NLS-1$
+ )
+ );
+ }
+ } else {
+ // use resource API to update configuration file
+ IFile file = getFile();
+ IContainer dir = file.getParent();
+ if (!dir.exists()) {
+ throw new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchConfigurationWorkingCopy.Specified_container_for_launch_configuration_does_not_exist_2"), null //$NON-NLS-1$
+ )
+ );
+ }
+ ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
+ if (!file.exists()) {
+ file.create(stream, false, null);
+ //getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getLocation()));
+ } else {
+ file.setContents(stream, false, false, null);
+ //getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getLocation()));
+ }
+ }
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setAttribute(String, int)
+ */
+ public void setAttribute(String attributeName, int value) {
+ getInfo().setAttribute(attributeName, new Integer(value));
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setAttribute(String, String)
+ */
+ public void setAttribute(String attributeName, String value) {
+ getInfo().setAttribute(attributeName, value);
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setAttribute(String, boolean)
+ */
+ public void setAttribute(String attributeName, boolean value) {
+ getInfo().setAttribute(attributeName, new Boolean(value));
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setAttribute(String, List)
+ */
+ public void setAttribute(String attributeName, List value) {
+ getInfo().setAttribute(attributeName, value);
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setAttribute(String, Map)
+ */
+ public void setAttribute(String attributeName, Map value) {
+ getInfo().setAttribute(attributeName, value);
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#getOriginal()
+ */
+ public ILaunchConfiguration getOriginal() {
+ return fOriginal;
+ }
+
+ /**
+ * Sets the launch configuration this working copy
+ * is based on. Initializes the attributes of this
+ * working copy to the current values of the given
+ * configuration.
+ *
+ * @param originl the launch configuration this working
+ * copy is based on.
+ * @exception CoreException if unable to initialize this
+ * working copy based on the original's current attribute
+ * set
+ */
+ private void copyFrom(LaunchConfiguration original) throws CoreException {
+ LaunchConfigurationInfo info = original.getInfo();
+ setInfo(info.getCopy());
+ setContainer(original.getContainer());
+ resetDirty();
+ }
+
+ /**
+ * Sets the launch configuration this working copy
+ * is based on.
+ *
+ * @param originl the launch configuration this working
+ * copy is based on.
+ */
+ private void setOriginal(LaunchConfiguration original) {
+ fOriginal = original;
+ }
+
+ /**
+ * Sets the working copy info object for this working copy.
+ *
+ * @param info a copy of attributes from this working copy's
+ * original launch configuration
+ */
+ protected void setInfo(LaunchConfigurationInfo info) {
+ fInfo = info;
+ }
+
+ /**
+ * @see ILaunchConfiguration#isWorkingCopy()
+ */
+ public boolean isWorkingCopy() {
+ return true;
+ }
+
+ /**
+ * A working copy keeps a local info object that is not
+ * cached with the launch manager.
+ *
+ * @see LaunchConfiguration#getInfo()
+ */
+ protected LaunchConfigurationInfo getInfo() {
+ return fInfo;
+ }
+
+ /**
+ * Sets this working copy's state to dirty.
+ * Notifies listeners that this working copy has
+ * changed.
+ */
+ private void setDirty() {
+ fDirty = true;
+ if (!suppressChangeNotification()) {
+ getLaunchManager().notifyChanged(this);
+ }
+ }
+
+ /**
+ * Sets this working copy's state to not dirty.
+ */
+ private void resetDirty() {
+ fDirty = false;
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#rename(String)
+ */
+ public void rename(String name) {
+ if (!getName().equals(name)) {
+ setName(name);
+ fRenamed = isNew() || !(getOriginal().getName().equals(name));
+ }
+ }
+
+ /**
+ * Sets the new name for this configuration.
+ *
+ * @param name the new name for this configuration
+ */
+ private void setName(String name) {
+ fName = name;
+ setDirty();
+ }
+
+ /**
+ * @see ILaunchConfiguration#getName()
+ */
+ public String getName() {
+ return fName;
+ }
+
+ /**
+ * @see ILaunchConfiguration#isLocal()
+ */
+ public boolean isLocal() {
+ return getContainer() == null;
+ }
+
+ /**
+ * Returns the location this launch configuration will reside at
+ * when saved.
+ *
+ * @see ILaunchConfiguration#getLocation()
+ */
+ public IPath getLocation() {
+ if (isMoved()) {
+ IPath path = null;
+ if (isLocal()) {
+ path = LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
+ } else {
+ path = getContainer().getLocation();
+ }
+ path = path.append(getName() + "." + LAUNCH_CONFIGURATION_FILE_EXTENSION); //$NON-NLS-1$
+ return path;
+ } else {
+ return getOriginal().getLocation();
+ }
+ }
+
+ /**
+ * Returns whether this working copy is new, or is a
+ * working copy of another launch configuration.
+ *
+ * @return whether this working copy is new, or is a
+ * working copy of another launch configuration
+ */
+ protected boolean isNew() {
+ return getOriginal() == null;
+ }
+
+ /**
+ * Returns whether this working copy is new or if its
+ * location has changed from that of its original.
+ *
+ * @return whether this working copy is new or if its
+ * location has changed from that of its original
+ */
+ protected boolean isMoved() {
+ if (isNew() || fRenamed) {
+ return true;
+ }
+ IContainer newContainer = getContainer();
+ IContainer originalContainer = ((LaunchConfiguration)getOriginal()).getContainer();
+ if (newContainer == originalContainer) {
+ return false;
+ }
+ if (newContainer == null) {
+ return !originalContainer.equals(newContainer);
+ } else {
+ return !newContainer.equals(originalContainer);
+ }
+ }
+
+ /**
+ * A working copy cannot generate a memento.
+ *
+ * @see ILaunchConfiguration#getMemento()
+ */
+ public String getMemento() {
+ return null;
+ }
+
+ /**
+ * Returns whether change notification should be
+ * suppressed
+ */
+ protected boolean suppressChangeNotification() {
+ return fSuppressChange;
+ }
+
+ /**
+ * @see ILaunchConfigurationWorkingCopy#setContainer(IContainer)
+ */
+ public void setContainer(IContainer container) {
+ if (container == fContainer) {
+ return;
+ }
+ if (container != null) {
+ if (container.equals(fContainer)) {
+ return;
+ }
+ } else {
+ if (fContainer.equals(container)) {
+ return;
+ }
+ }
+ fContainer = container;
+ setDirty();
+ }
+
+ /**
+ * Returns the container this working copy will be
+ * stored in when saved, or <code>null</code> if
+ * this working copy is local.
+ *
+ * @return the container this working copy will be
+ * stored in when saved, or <code>null</code> if
+ * this working copy is local
+ */
+ protected IContainer getContainer() {
+ return fContainer;
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 74ffab9a7..25204e826 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -1,1111 +1,1111 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.Serializer;
-import org.apache.xml.serialize.SerializerFactory;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IPersistableSourceLocator;
-import org.eclipse.debug.core.model.IProcess;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Manages launch configurations, launch configuration types, and registered launches.
- *
- * @see ILaunchManager
- */
-public class LaunchManager implements ILaunchManager, IResourceChangeListener {
-
- /**
- * Collection of defined launch configuration type
- * extensions.
- */
- private List fLaunchConfigurationTypes = null;
-
- /**
- * Launch configuration cache. Keys are <code>LaunchConfiguration</code>,
- * values are <code>LaunchConfigurationInfo</code>.
- */
- private HashMap fLaunchConfigurations = new HashMap(10);
-
- /**
- * A cache of launch configuration names currently in the workspace.
- */
- private String[] fSortedConfigNames = null;
-
- /**
- * Collection of all launch configurations in the workspace.
- * <code>List</code> of <code>ILaunchConfiguration</code>.
- */
- private List fLaunchConfigurationIndex = null;
-
- /**
- * Launch configuration comparator extensions,
- * keyed by attribute name.
- */
- private HashMap fComparators = null;
-
- /**
- * Constant for use as local name part of <code>QualifiedName</code>
- * for persisting the default launch configuration type.
- */
- private static final String DEFAULT_CONFIG_TYPE = "defaultLaunchConfigurationType"; //$NON-NLS-1$
-
- /**
- * Types of notifications
- */
- public static final int ADDED = 0;
- public static final int REMOVED= 1;
- public static final int CHANGED= 2;
-
- /**
- * Collection of launches
- */
- private Vector fLaunches= new Vector(10);
-
- /**
- * Collection of listeners
- */
- private ListenerList fListeners= new ListenerList(5);
-
- /**
- * Visitor used to process resource deltas,
- * to update launch configuration index.
- */
- private IResourceDeltaVisitor fgVisitor;
-
- /**
- * Launch configuration listeners
- */
- private ListenerList fLaunchConfigurationListeners = new ListenerList(5);
-
- /**
- * Table of source locator extensions. Keys
- * are identifiers, and values are associated
- * configuration elements.
- */
- private Map fSourceLocators = null;
-
- /**
- * Path to the local directory where local launch configurations
- * are stored with the workspace.
- */
- protected static final IPath LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH =
- DebugPlugin.getDefault().getStateLocation().append(".launches"); //$NON-NLS-1$
-
- /**
- * Serializes a XML document into a string - encoded in UTF8 format,
- * with platform line separators.
- *
- * @param doc document to serialize
- * @return the document as a string
- */
- public static String serializeDocument(Document doc) throws IOException {
- ByteArrayOutputStream s= new ByteArrayOutputStream();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
-
- Serializer serializer =
- SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(
- new OutputStreamWriter(s, "UTF8"), //$NON-NLS-1$
- format);
- serializer.asDOMSerializer().serialize(doc);
- return s.toString("UTF8"); //$NON-NLS-1$
- }
-
- /**
- * @see ILaunchManager#addLaunchListener(ILaunchListener)
- */
- public void addLaunchListener(ILaunchListener listener) {
- fListeners.add(listener);
- }
-
- /**
- * Returns a collection of all launch configuration handles in
- * the workspace. This collection is initialized lazily.
- *
- * @return all launch configuration handles
- */
- private List getAllLaunchConfigurations() throws CoreException {
- if (fLaunchConfigurationIndex == null) {
- fLaunchConfigurationIndex = new ArrayList(20);
- List configs = findLocalLaunchConfigurations();
- verifyConfigurations(configs, fLaunchConfigurationIndex);
- configs = findLaunchConfigurations(getWorkspaceRoot());
- verifyConfigurations(configs, fLaunchConfigurationIndex);
- }
- return fLaunchConfigurationIndex;
- }
-
- /**
- * Verify basic integrity of launch configurations in the given list,
- * adding valid configs to the collection of all launch configurations.
- * Excpetions are logged for invalid configs.
- *
- * @param verify the list of configs to verify
- * @param valid the list to place valid configrations in
- */
- protected void verifyConfigurations(List verify, List valid) {
- Iterator configs = verify.iterator();
- while (configs.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)configs.next();
- if (isValid(config)) {
- valid.add(config);
- }
- }
- }
-
- /**
- * Returns whether the given launch configuration passes a basic
- * integritiy test by retrieving its type.
- *
- * @param config the configuration to verify
- * @return whether the config meets basic integrity constraints
- */
- protected boolean isValid(ILaunchConfiguration config) {
- try {
- config.getType();
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
- MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Unable_to_restore_invalid_launch_configuration"),new String[] {config.getLocation().toOSString()} ), e); //$NON-NLS-1$
- DebugPlugin.log(status);
- return false;
- }
- return true;
- }
-
- /**
- * Clears all launch configurations (if any have been accessed)
- */
- private void clearAllLaunchConfigurations() {
- if (fLaunchConfigurationTypes != null) {
- fLaunchConfigurationTypes.clear();
- }
- if (fLaunchConfigurationIndex != null) {
- fLaunchConfigurationIndex.clear();
- }
- }
-
- /**
- * @see ILaunchManager#removeLaunch(ILaunch)
- */
- public void removeLaunch(ILaunch launch) {
- if (launch == null) {
- return;
- }
- if (fLaunches.remove(launch)) {
- fireUpdate(launch, REMOVED);
- }
- }
-
- /**
- * Fires notification to the listeners that a launch has been (de)registered.
- */
- public void fireUpdate(ILaunch launch, int update) {
- Object[] copiedListeners= fListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- ILaunchListener listener = (ILaunchListener)copiedListeners[i];
- switch (update) {
- case ADDED:
- listener.launchAdded(launch);
- break;
- case REMOVED:
- listener.launchRemoved(launch);
- break;
- case CHANGED:
- if (isRegistered(launch)) {
- listener.launchChanged(launch);
- }
- break;
- }
- }
- }
-
- /**
- * Returns whether the given launch is currently registered.
- *
- * @param launch a launch
- * @return whether the given launch is currently registered
- */
- protected boolean isRegistered(ILaunch launch) {
- return fLaunches.contains(launch);
- }
-
- /**
- * @see ILaunchManager#getDebugTargets()
- */
- public IDebugTarget[] getDebugTargets() {
- List allTargets= new ArrayList(fLaunches.size());
- if (fLaunches.size() > 0) {
- Iterator e= fLaunches.iterator();
- while (e.hasNext()) {
- IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets();
- for (int i = 0; i < targets.length; i++) {
- allTargets.add(targets[i]);
- }
- }
- }
- return (IDebugTarget[])allTargets.toArray(new IDebugTarget[allTargets.size()]);
- }
-
- /**
- * @see ILaunchManager#getLaunches()
- */
- public ILaunch[] getLaunches() {
- return (ILaunch[])fLaunches.toArray(new ILaunch[fLaunches.size()]);
- }
-
- /**
- * @see ILaunchManager#getProcesses()
- */
- public IProcess[] getProcesses() {
- List allProcesses= new ArrayList(fLaunches.size());
- Iterator e= fLaunches.iterator();
- while (e.hasNext()) {
- IProcess[] processes= ((ILaunch) e.next()).getProcesses();
- for (int i= 0; i < processes.length; i++) {
- allProcesses.add(processes[i]);
- }
- }
- return (IProcess[])allProcesses.toArray(new IProcess[allProcesses.size()]);
- }
-
- /**
- * @see ILaunchManager#addLaunch(ILaunch)
- */
- public void addLaunch(ILaunch launch) {
- if (fLaunches.contains(launch)) {
- return;
- }
-
- fLaunches.add(launch);
- fireUpdate(launch, ADDED);
- }
-
- /**
- * @see ILaunchManager#removeLaunchListener(ILaunchListener)
- */
- public void removeLaunchListener(ILaunchListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Return a LaunchConfigurationInfo object initialized from XML contained in
- * the specified stream. Simply pass out any exceptions encountered so that
- * caller can deal with them. This is important since caller may need access to the
- * actual exception.
- */
- protected LaunchConfigurationInfo createInfoFromXML(InputStream stream) throws CoreException,
- ParserConfigurationException,
- IOException,
- SAXException {
- Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- root = parser.parse(new InputSource(stream)).getDocumentElement();
- LaunchConfigurationInfo info = new LaunchConfigurationInfo();
- info.initializeFromXML(root);
- return info;
- }
-
- /**
- * Terminates/Disconnects any active debug targets/processes.
- * Clears launch configuration types.
- */
- public void shutdown() throws CoreException {
- fListeners.removeAll();
- ILaunch[] launches = getLaunches();
- for (int i= 0; i < launches.length; i++) {
- ILaunch launch= launches[i];
- try {
- launch.terminate();
- } catch (DebugException e) {
- DebugPlugin.log(e);
- }
- }
-
- clearAllLaunchConfigurations();
-
- getWorkspace().removeResourceChangeListener(this);
- }
-
- /**
- * Creates launch configuration types for each defined extension.
- *
- * @exception CoreException if an exception occurs processing
- * the extensions
- */
- public void startup() throws CoreException {
- getWorkspace().addResourceChangeListener(this);
- }
-
- /**
- * Returns the info object for the specified launch configuration.
- * If the configuration exists, but is not yet in the cache,
- * an info object is built and added to the cache.
- *
- * @exception CoreException if an exception occurs building
- * the info object
- * @exception DebugException if the config does not exist
- */
- protected LaunchConfigurationInfo getInfo(ILaunchConfiguration config) throws CoreException {
- LaunchConfigurationInfo info = (LaunchConfigurationInfo)fLaunchConfigurations.get(config);
- if (info == null) {
- if (config.exists()) {
- InputStream stream = null;
- try {
- if (config.isLocal()) {
- IPath path = config.getLocation();
- File file = path.toFile();
- stream = new FileInputStream(file);
- } else {
- IFile file = ((LaunchConfiguration) config).getFile();
- stream = file.getContents();
- }
- info = createInfoFromXML(stream);
- fLaunchConfigurations.put(config, info);
- } catch (FileNotFoundException e) {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
- } catch (SAXException e) {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
- } catch (ParserConfigurationException e) {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
- } catch (IOException e) {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
- } finally {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
- }
- }
- }
-
- } else {
- throw createDebugException(DebugCoreMessages.getString("LaunchManager.Launch_configuration_does_not_exist._6"), null); //$NON-NLS-1$
- }
- }
- return info;
- }
-
- /**
- * Return an instance of DebugException containing the specified message and Throwable.
- */
- protected DebugException createDebugException(String message, Throwable throwable) {
- return new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, message, throwable
- )
- );
- }
-
- /**
- * Removes the given launch configuration from the cache of configurations.
- * When a local configuration is deleted, this method is called, as there will
- * be no resource delta generated to auto-update the cache.
- *
- * @param configuration the configuration to remove
- */
- private void removeInfo(ILaunchConfiguration configuration) {
- fLaunchConfigurations.remove(configuration);
- }
-
- /**
- * @see ILaunchManager#getLaunchConfigurations()
- */
- public ILaunchConfiguration[] getLaunchConfigurations() throws CoreException {
- List allConfigs = getAllLaunchConfigurations();
- return (ILaunchConfiguration[])allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]);
- }
-
- /**
- * @see ILaunchManager#getLaunchConfigurations(ILaunchConfigurationType)
- */
- public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
- Iterator iter = getAllLaunchConfigurations().iterator();
- List configs = new ArrayList();
- while (iter.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
- if (config.getType().equals(type)) {
- configs.add(config);
- }
- }
- return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
- }
-
- /**
- * Returns all launch configurations that are stored as resources
- * in the given project.
- *
- * @param project a project
- * @return collection of launch configurations that are stored as resources
- * in the given project
- */
- protected List getLaunchConfigurations(IProject project) throws CoreException {
- Iterator iter = getAllLaunchConfigurations().iterator();
- List configs = new ArrayList();
- while (iter.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
- IFile file = config.getFile();
- if (file != null && file.getProject().equals(project)) {
- configs.add(config);
- }
- }
- return configs;
- }
-
- /**
- * Returns all launch configurations that are stored locally.
- *
- * @return collection of launch configurations stored lcoally
- */
- protected List getLocalLaunchConfigurations() throws CoreException {
- Iterator iter = getAllLaunchConfigurations().iterator();
- List configs = new ArrayList();
- while (iter.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
- if (config.isLocal()) {
- configs.add(config);
- }
- }
- return configs;
- }
-
- /**
- * @see ILaunchManager#getLaunchConfiguration(IFile)
- */
- public ILaunchConfiguration getLaunchConfiguration(IFile file) {
- return new LaunchConfiguration(file.getLocation());
- }
-
- /**
- * @see ILaunchManager#getLaunchConfiguration(String)
- */
- public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException {
- return new LaunchConfiguration(memento);
- }
-
- /**
- * @see ILaunchManager#getLaunchConfigurationTypes()
- */
- public ILaunchConfigurationType[] getLaunchConfigurationTypes() {
- List types= getLaunchConfigurationTypeList();
- return (ILaunchConfigurationType[])types.toArray(new ILaunchConfigurationType[types.size()]);
- }
-
- /**
- * @see ILaunchManager#getLaunchConfigurationType(String)
- */
- public ILaunchConfigurationType getLaunchConfigurationType(String id) {
- Iterator iter = getLaunchConfigurationTypeList().iterator();
- while (iter.hasNext()) {
- ILaunchConfigurationType type = (ILaunchConfigurationType)iter.next();
- if (type.getIdentifier().equals(id)) {
- return type;
- }
- }
- return null;
- }
-
- private List getLaunchConfigurationTypeList() {
- if (fLaunchConfigurationTypes == null) {
- initializeLaunchConfigurationTypes();
- }
- return fLaunchConfigurationTypes;
- }
-
- private void initializeLaunchConfigurationTypes() {
- IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fLaunchConfigurationTypes= new ArrayList(infos.length);
- for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement);
- fLaunchConfigurationTypes.add(configType);
- }
- }
-
- /**
- * Notifies the launch manager that a launch configuration
- * has been deleted. The configuration is removed from the
- * cache of info's and from the index of configurations by
- * project, and listeners are notified.
- *
- * @param config the launch configuration that was deleted
- */
- protected void launchConfigurationDeleted(ILaunchConfiguration config) throws CoreException {
- removeInfo(config);
- getAllLaunchConfigurations().remove(config);
- if (fLaunchConfigurationListeners.size() > 0) {
- Object[] listeners = fLaunchConfigurationListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
- listener.launchConfigurationRemoved(config);
- }
- }
- clearConfigNameCache();
- }
-
- /**
- * Notifies the launch manager that a launch configuration
- * has been added. The configuration is added to the index of
- * configurations by project, and listeners are notified.
- *
- * @param config the launch configuration that was added
- */
- protected void launchConfigurationAdded(ILaunchConfiguration config) throws CoreException {
- if (isValid(config)) {
- List allConfigs = getAllLaunchConfigurations();
- if (!allConfigs.contains(config)) {
- allConfigs.add(config);
- }
- if (fLaunchConfigurationListeners.size() > 0) {
- Object[] listeners = fLaunchConfigurationListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
- listener.launchConfigurationAdded(config);
- }
- }
- clearConfigNameCache();
- } else {
- launchConfigurationDeleted(config);
- }
- }
-
- /**
- * Notifies the launch manager that a launch configuration
- * has been changed. The configuration is removed from the
- * cache of info objects such that the new attributes will
- * be updated on the next access. Listeners are notified of
- * the change.
- *
- * @param config the launch configuration that was changed
- */
- protected void launchConfigurationChanged(ILaunchConfiguration config) {
- removeInfo(config);
- clearConfigNameCache();
- if (isValid(config)) {
- notifyChanged(config);
- } else {
- try {
- launchConfigurationDeleted(config);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Notifies listeners that the given launch configuration
- * has changed.
- *
- * @param configuration the changed launch configuration
- */
- protected void notifyChanged(ILaunchConfiguration configuration) {
- if (fLaunchConfigurationListeners.size() > 0) {
- Object[] listeners = fLaunchConfigurationListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
- listener.launchConfigurationChanged(configuration);
- }
- }
- }
-
- /**
- * @see ILaunchManager#isExistingLaunchConfigurationName(String)
- */
- public boolean isExistingLaunchConfigurationName(String name) throws CoreException {
- String[] sortedConfigNames = getAllSortedConfigNames();
- int index = Arrays.binarySearch(sortedConfigNames, name);
- if (index < 0) {
- return false;
- }
- return true;
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchManager#generateUniqueLaunchConfigurationNameFrom(String)
- */
- public String generateUniqueLaunchConfigurationNameFrom(String baseName) {
- int index = 1;
- int length= baseName.length();
- int copyIndex = baseName.lastIndexOf(" ("); //$NON-NLS-1$
- if (copyIndex > -1 && length > copyIndex + 2 && baseName.charAt(length - 1) == ')') {
- String trailer = baseName.substring(copyIndex + 2, length -1);
- if (isNumber(trailer)) {
- try {
- index = Integer.parseInt(trailer);
- baseName = baseName.substring(0, copyIndex);
- } catch (NumberFormatException nfe) {
- }
- }
- }
- String newName = baseName;
- try {
- StringBuffer buffer= null;
- while (isExistingLaunchConfigurationName(newName)) {
- buffer = new StringBuffer(baseName);
- buffer.append(" ("); //$NON-NLS-1$
- buffer.append(String.valueOf(index));
- index++;
- buffer.append(')');
- newName = buffer.toString();
- }
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- return newName;
- }
-
- /**
- * Returns whether the given String is composed solely of digits
- */
- private boolean isNumber(String string) {
- int numChars= string.length();
- if (numChars == 0) {
- return false;
- }
- for (int i= 0; i < numChars; i++) {
- if (!Character.isDigit(string.charAt(i))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return a sorted array of the names of all <code>ILaunchConfiguration</code>s in
- * the workspace. These are cached, and cache is cleared when a new config is added,
- * deleted or changed.
- */
- protected String[] getAllSortedConfigNames() throws CoreException {
- if (fSortedConfigNames == null) {
- ILaunchConfiguration[] configs = getLaunchConfigurations();
- fSortedConfigNames = new String[configs.length];
- for (int i = 0; i < configs.length; i++) {
- fSortedConfigNames[i] = configs[i].getName();
- }
- Arrays.sort(fSortedConfigNames);
- }
- return fSortedConfigNames;
- }
-
- /**
- * The launch config name cache is cleared when a config is added, deleted or changed.
- */
- protected void clearConfigNameCache() {
- fSortedConfigNames = null;
- }
-
- /**
- * Finds and returns all local launch configurations.
- *
- * @return all local launch configurations
- * @exception CoreException if there is a lower level
- * IO exception
- */
- protected List findLocalLaunchConfigurations() throws CoreException {
- IPath containerPath = LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
- List configs = new ArrayList(10);
- final File directory = containerPath.toFile();
- if (directory.isDirectory()) {
- FilenameFilter filter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return dir.equals(directory) &&
- name.endsWith(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION);
- }
- };
- String[] files = directory.list(filter);
- for (int i = 0; i < files.length; i++) {
- LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i]));
- configs.add(config);
- }
- }
- return configs;
- }
-
- /**
- * Finds and returns all launch configurations in the given
- * container (and subcontainers)
- *
- * @param container the container to search
- * @exception CoreException an exception occurs traversing
- * the container.
- * @return all launch configurations in the given container
- */
- protected List findLaunchConfigurations(IContainer container) throws CoreException {
- List list = new ArrayList(10);
- if (container instanceof IProject && !((IProject)container).isOpen()) {
- return list;
- }
- searchForFiles(container, ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION, list);
- Iterator iter = list.iterator();
- List configs = new ArrayList(list.size());
- while (iter.hasNext()) {
- IFile file = (IFile)iter.next();
- configs.add(getLaunchConfiguration(file));
- }
- return configs;
- }
-
- /**
- * Recursively searches the given container for files with the given
- * extension.
- *
- * @param container the container to search in
- * @param extension the file extension being searched for
- * @param list the list to add the matching files to
- * @exception CoreException if an exception occurs traversing
- * the container
- */
- protected void searchForFiles(IContainer container, String extension, List list) throws CoreException {
- IResource[] members = container.members();
- for (int i = 0; i < members.length; i++) {
- if (members[i] instanceof IContainer) {
- if (members[i] instanceof IProject && !((IProject)members[i]) .isOpen()) {
- continue;
- }
- searchForFiles((IContainer)members[i], extension, list);
- } else if (members[i] instanceof IFile) {
- IFile file = (IFile)members[i];
- if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equalsIgnoreCase(file.getFileExtension())) {
- list.add(file);
- }
- }
- }
- }
-
- /**
- * Traverses the delta looking for added/removed/changed launch
- * configuration files.
- *
- * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta= event.getDelta();
- if (delta != null) {
- try {
- if (fgVisitor == null) {
- fgVisitor= new LaunchManagerVisitor();
- }
- delta.accept(fgVisitor);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Returns the launch configurations specified by the given
- * XML document.
- *
- * @param root XML document
- * @return list of launch configurations
- * @exception IOException if an exception occurs reading the XML
- */
- protected List getConfigsFromXML(Element root) throws CoreException {
- DebugException invalidFormat =
- new DebugException(
- new Status(
- Status.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchManager.Invalid_launch_configuration_index._18"), null //$NON-NLS-1$
- )
- );
-
- if (!root.getNodeName().equalsIgnoreCase("launchConfigurations")) { //$NON-NLS-1$
- throw invalidFormat;
- }
-
- // read each launch configuration
- List configs = new ArrayList(4);
- NodeList list = root.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element entry = (Element) node;
- String nodeName = entry.getNodeName();
- if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$
- throw invalidFormat;
- }
- String memento = entry.getAttribute("memento"); //$NON-NLS-1$
- if (memento == null) {
- throw invalidFormat;
- }
- configs.add(getLaunchConfiguration(memento));
- }
- }
- return configs;
- }
-
- /**
- * The specified project has just opened - add all launch
- * configs in the project to the index of all configs.
- *
- * @param project the project that has been opened
- * @exception CoreException if reading the index fails
- */
- protected void projectOpened(IProject project) throws CoreException {
- List configs = findLaunchConfigurations(project);
- if (!configs.isEmpty()) {
- List allList = getAllLaunchConfigurations();
- Iterator iterator = configs.iterator();
- while (iterator.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
- if (!allList.contains(config)) {
- allList.add(config);
- }
- }
- }
- }
-
- /**
- * The specified project has just closed - remove its
- * launch configurations from the cached index.
- *
- * @param project the project that has been closed
- * @exception CoreException if writing the index fails
- */
- protected void projectClosed(IProject project) throws CoreException {
- List configs = getLaunchConfigurations(project);
- if (!configs.isEmpty()) {
- getAllLaunchConfigurations().removeAll(configs);
- }
- }
-
- /**
- * Visitor for handling resource deltas.
- */
- class LaunchManagerVisitor implements IResourceDeltaVisitor {
- /**
- * @see IResourceDeltaVisitor#visit(IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- if (delta == null) {
- return false;
- }
- if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
- if (delta.getResource() instanceof IProject) {
- IProject project = (IProject)delta.getResource();
- try {
- if (project.isOpen()) {
- LaunchManager.this.projectOpened(project);
- } else {
- LaunchManager.this.projectClosed(project);
- }
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- return false;
- }
- IResource resource = delta.getResource();
- if (resource instanceof IFile) {
- IFile file = (IFile)resource;
- if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) {
- IPath configPath = file.getLocation();
- // If the file has already been deleted, reconstruct the full
- // filesystem path
- if (configPath == null) {
- IPath workspaceRelativePath = delta.getFullPath();
- configPath = getWorkspaceRoot().getLocation().append(workspaceRelativePath);
- }
- ILaunchConfiguration handle = new LaunchConfiguration(configPath);
- try {
- switch (delta.getKind()) {
- case IResourceDelta.ADDED :
- LaunchManager.this.launchConfigurationAdded(handle);
- break;
- case IResourceDelta.REMOVED :
- LaunchManager.this.launchConfigurationDeleted(handle);
- break;
- case IResourceDelta.CHANGED :
- LaunchManager.this.launchConfigurationChanged(handle);
- break;
- }
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- return false;
- } else if (resource instanceof IContainer) {
- return true;
- }
- return true;
- }
- }
-
- /**
- * @see ILaunchManager#addLaunchConfigurationListener(ILaunchConfigurationListener)
- */
- public void addLaunchConfigurationListener(ILaunchConfigurationListener listener) {
- fLaunchConfigurationListeners.add(listener);
- }
-
- /**
- * @see ILaunchManager#removeLaunchConfigurationListener(ILaunchConfigurationListener)
- */
- public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener) {
- fLaunchConfigurationListeners.remove(listener);
- }
-
- /**
- * Register source locators.
- *
- * @exception CoreException if an exception occurrs reading
- * the extensions
- */
- private void initializeSourceLocators() throws CoreException {
- IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fSourceLocators= new HashMap(infos.length);
- for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- String id = configurationElement.getAttribute("id"); //$NON-NLS-1$
- if (id != null) {
- fSourceLocators.put(id,configurationElement);
- } else {
- // invalid status handler
- IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
- MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Invalid_source_locator_extentsion_defined_by_plug-in___{0}______id___not_specified_12"), new String[] {configurationElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier()} ), null); //$NON-NLS-1$
- DebugPlugin.getDefault().log(s);
- }
- }
- }
-
-
- /**
- * Load comparator extensions.
- *
- * @exception CoreException if an exception occurrs reading
- * the extensions
- */
- private void initializeComparators() {
- IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fComparators = new HashMap(infos.length);
- for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$
- if (attr != null) {
- fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
- } else {
- // invalid status handler
- IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
- MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Invalid_launch_configuration_comparator_extension_defined_by_plug-in_{0}_-_attribute_not_specified_1"), new String[] {configurationElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier()}), null); //$NON-NLS-1$
- DebugPlugin.getDefault().log(s);
- }
- }
- }
-
- /**
- * @see ILaunchManager#newSourceLocator(String)
- */
- public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException {
- if (fSourceLocators == null) {
- initializeSourceLocators();
- }
- IConfigurationElement config = (IConfigurationElement)fSourceLocators.get(identifier);
- if (config == null) {
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
- MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Source_locator_does_not_exist__{0}_13"), new String[] {identifier} ), null)); //$NON-NLS-1$
- } else {
- return (IPersistableSourceLocator)config.createExecutableExtension("class"); //$NON-NLS-1$
- }
-
- }
-
- /**
- * Returns the comparator registered for the given attribute, or
- * <code>null</code> if none.
- *
- * @param attributeName attribute for which a comparator is required
- * @return comparator, or <code>null</code> if none
- */
- protected Comparator getComparator(String attributeName) {
- HashMap map = getComparators();
- return (Comparator)map.get(attributeName);
- }
-
- /**
- * Returns comparators, loading if required
- */
- protected HashMap getComparators() {
- if (fComparators == null) {
- initializeComparators();
- }
- return fComparators;
- }
-
- private IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- private IWorkspaceRoot getWorkspaceRoot() {
- return getWorkspace().getRoot();
- }
-
-}
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.apache.xml.serialize.Method;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.Serializer;
+import org.apache.xml.serialize.SerializerFactory;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.eclipse.debug.core.model.IProcess;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Manages launch configurations, launch configuration types, and registered launches.
+ *
+ * @see ILaunchManager
+ */
+public class LaunchManager implements ILaunchManager, IResourceChangeListener {
+
+ /**
+ * Collection of defined launch configuration type
+ * extensions.
+ */
+ private List fLaunchConfigurationTypes = null;
+
+ /**
+ * Launch configuration cache. Keys are <code>LaunchConfiguration</code>,
+ * values are <code>LaunchConfigurationInfo</code>.
+ */
+ private HashMap fLaunchConfigurations = new HashMap(10);
+
+ /**
+ * A cache of launch configuration names currently in the workspace.
+ */
+ private String[] fSortedConfigNames = null;
+
+ /**
+ * Collection of all launch configurations in the workspace.
+ * <code>List</code> of <code>ILaunchConfiguration</code>.
+ */
+ private List fLaunchConfigurationIndex = null;
+
+ /**
+ * Launch configuration comparator extensions,
+ * keyed by attribute name.
+ */
+ private HashMap fComparators = null;
+
+ /**
+ * Constant for use as local name part of <code>QualifiedName</code>
+ * for persisting the default launch configuration type.
+ */
+ private static final String DEFAULT_CONFIG_TYPE = "defaultLaunchConfigurationType"; //$NON-NLS-1$
+
+ /**
+ * Types of notifications
+ */
+ public static final int ADDED = 0;
+ public static final int REMOVED= 1;
+ public static final int CHANGED= 2;
+
+ /**
+ * Collection of launches
+ */
+ private Vector fLaunches= new Vector(10);
+
+ /**
+ * Collection of listeners
+ */
+ private ListenerList fListeners= new ListenerList(5);
+
+ /**
+ * Visitor used to process resource deltas,
+ * to update launch configuration index.
+ */
+ private IResourceDeltaVisitor fgVisitor;
+
+ /**
+ * Launch configuration listeners
+ */
+ private ListenerList fLaunchConfigurationListeners = new ListenerList(5);
+
+ /**
+ * Table of source locator extensions. Keys
+ * are identifiers, and values are associated
+ * configuration elements.
+ */
+ private Map fSourceLocators = null;
+
+ /**
+ * Path to the local directory where local launch configurations
+ * are stored with the workspace.
+ */
+ protected static final IPath LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH =
+ DebugPlugin.getDefault().getStateLocation().append(".launches"); //$NON-NLS-1$
+
+ /**
+ * Serializes a XML document into a string - encoded in UTF8 format,
+ * with platform line separators.
+ *
+ * @param doc document to serialize
+ * @return the document as a string
+ */
+ public static String serializeDocument(Document doc) throws IOException {
+ ByteArrayOutputStream s= new ByteArrayOutputStream();
+ OutputFormat format = new OutputFormat();
+ format.setIndenting(true);
+ format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
+
+ Serializer serializer =
+ SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(
+ new OutputStreamWriter(s, "UTF8"), //$NON-NLS-1$
+ format);
+ serializer.asDOMSerializer().serialize(doc);
+ return s.toString("UTF8"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ILaunchManager#addLaunchListener(ILaunchListener)
+ */
+ public void addLaunchListener(ILaunchListener listener) {
+ fListeners.add(listener);
+ }
+
+ /**
+ * Returns a collection of all launch configuration handles in
+ * the workspace. This collection is initialized lazily.
+ *
+ * @return all launch configuration handles
+ */
+ private List getAllLaunchConfigurations() throws CoreException {
+ if (fLaunchConfigurationIndex == null) {
+ fLaunchConfigurationIndex = new ArrayList(20);
+ List configs = findLocalLaunchConfigurations();
+ verifyConfigurations(configs, fLaunchConfigurationIndex);
+ configs = findLaunchConfigurations(getWorkspaceRoot());
+ verifyConfigurations(configs, fLaunchConfigurationIndex);
+ }
+ return fLaunchConfigurationIndex;
+ }
+
+ /**
+ * Verify basic integrity of launch configurations in the given list,
+ * adding valid configs to the collection of all launch configurations.
+ * Excpetions are logged for invalid configs.
+ *
+ * @param verify the list of configs to verify
+ * @param valid the list to place valid configrations in
+ */
+ protected void verifyConfigurations(List verify, List valid) {
+ Iterator configs = verify.iterator();
+ while (configs.hasNext()) {
+ ILaunchConfiguration config = (ILaunchConfiguration)configs.next();
+ if (isValid(config)) {
+ valid.add(config);
+ }
+ }
+ }
+
+ /**
+ * Returns whether the given launch configuration passes a basic
+ * integritiy test by retrieving its type.
+ *
+ * @param config the configuration to verify
+ * @return whether the config meets basic integrity constraints
+ */
+ protected boolean isValid(ILaunchConfiguration config) {
+ try {
+ config.getType();
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
+ MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Unable_to_restore_invalid_launch_configuration"),new String[] {config.getLocation().toOSString()} ), e); //$NON-NLS-1$
+ DebugPlugin.log(status);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Clears all launch configurations (if any have been accessed)
+ */
+ private void clearAllLaunchConfigurations() {
+ if (fLaunchConfigurationTypes != null) {
+ fLaunchConfigurationTypes.clear();
+ }
+ if (fLaunchConfigurationIndex != null) {
+ fLaunchConfigurationIndex.clear();
+ }
+ }
+
+ /**
+ * @see ILaunchManager#removeLaunch(ILaunch)
+ */
+ public void removeLaunch(ILaunch launch) {
+ if (launch == null) {
+ return;
+ }
+ if (fLaunches.remove(launch)) {
+ fireUpdate(launch, REMOVED);
+ }
+ }
+
+ /**
+ * Fires notification to the listeners that a launch has been (de)registered.
+ */
+ public void fireUpdate(ILaunch launch, int update) {
+ Object[] copiedListeners= fListeners.getListeners();
+ for (int i= 0; i < copiedListeners.length; i++) {
+ ILaunchListener listener = (ILaunchListener)copiedListeners[i];
+ switch (update) {
+ case ADDED:
+ listener.launchAdded(launch);
+ break;
+ case REMOVED:
+ listener.launchRemoved(launch);
+ break;
+ case CHANGED:
+ if (isRegistered(launch)) {
+ listener.launchChanged(launch);
+ }
+ break;
+ }
+ }
+ }
+
+ /**
+ * Returns whether the given launch is currently registered.
+ *
+ * @param launch a launch
+ * @return whether the given launch is currently registered
+ */
+ protected boolean isRegistered(ILaunch launch) {
+ return fLaunches.contains(launch);
+ }
+
+ /**
+ * @see ILaunchManager#getDebugTargets()
+ */
+ public IDebugTarget[] getDebugTargets() {
+ List allTargets= new ArrayList(fLaunches.size());
+ if (fLaunches.size() > 0) {
+ Iterator e= fLaunches.iterator();
+ while (e.hasNext()) {
+ IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets();
+ for (int i = 0; i < targets.length; i++) {
+ allTargets.add(targets[i]);
+ }
+ }
+ }
+ return (IDebugTarget[])allTargets.toArray(new IDebugTarget[allTargets.size()]);
+ }
+
+ /**
+ * @see ILaunchManager#getLaunches()
+ */
+ public ILaunch[] getLaunches() {
+ return (ILaunch[])fLaunches.toArray(new ILaunch[fLaunches.size()]);
+ }
+
+ /**
+ * @see ILaunchManager#getProcesses()
+ */
+ public IProcess[] getProcesses() {
+ List allProcesses= new ArrayList(fLaunches.size());
+ Iterator e= fLaunches.iterator();
+ while (e.hasNext()) {
+ IProcess[] processes= ((ILaunch) e.next()).getProcesses();
+ for (int i= 0; i < processes.length; i++) {
+ allProcesses.add(processes[i]);
+ }
+ }
+ return (IProcess[])allProcesses.toArray(new IProcess[allProcesses.size()]);
+ }
+
+ /**
+ * @see ILaunchManager#addLaunch(ILaunch)
+ */
+ public void addLaunch(ILaunch launch) {
+ if (fLaunches.contains(launch)) {
+ return;
+ }
+
+ fLaunches.add(launch);
+ fireUpdate(launch, ADDED);
+ }
+
+ /**
+ * @see ILaunchManager#removeLaunchListener(ILaunchListener)
+ */
+ public void removeLaunchListener(ILaunchListener listener) {
+ fListeners.remove(listener);
+ }
+
+ /**
+ * Return a LaunchConfigurationInfo object initialized from XML contained in
+ * the specified stream. Simply pass out any exceptions encountered so that
+ * caller can deal with them. This is important since caller may need access to the
+ * actual exception.
+ */
+ protected LaunchConfigurationInfo createInfoFromXML(InputStream stream) throws CoreException,
+ ParserConfigurationException,
+ IOException,
+ SAXException {
+ Element root = null;
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ root = parser.parse(new InputSource(stream)).getDocumentElement();
+ LaunchConfigurationInfo info = new LaunchConfigurationInfo();
+ info.initializeFromXML(root);
+ return info;
+ }
+
+ /**
+ * Terminates/Disconnects any active debug targets/processes.
+ * Clears launch configuration types.
+ */
+ public void shutdown() throws CoreException {
+ fListeners.removeAll();
+ ILaunch[] launches = getLaunches();
+ for (int i= 0; i < launches.length; i++) {
+ ILaunch launch= launches[i];
+ try {
+ launch.terminate();
+ } catch (DebugException e) {
+ DebugPlugin.log(e);
+ }
+ }
+
+ clearAllLaunchConfigurations();
+
+ getWorkspace().removeResourceChangeListener(this);
+ }
+
+ /**
+ * Creates launch configuration types for each defined extension.
+ *
+ * @exception CoreException if an exception occurs processing
+ * the extensions
+ */
+ public void startup() throws CoreException {
+ getWorkspace().addResourceChangeListener(this);
+ }
+
+ /**
+ * Returns the info object for the specified launch configuration.
+ * If the configuration exists, but is not yet in the cache,
+ * an info object is built and added to the cache.
+ *
+ * @exception CoreException if an exception occurs building
+ * the info object
+ * @exception DebugException if the config does not exist
+ */
+ protected LaunchConfigurationInfo getInfo(ILaunchConfiguration config) throws CoreException {
+ LaunchConfigurationInfo info = (LaunchConfigurationInfo)fLaunchConfigurations.get(config);
+ if (info == null) {
+ if (config.exists()) {
+ InputStream stream = null;
+ try {
+ if (config.isLocal()) {
+ IPath path = config.getLocation();
+ File file = path.toFile();
+ stream = new FileInputStream(file);
+ } else {
+ IFile file = ((LaunchConfiguration) config).getFile();
+ stream = file.getContents();
+ }
+ info = createInfoFromXML(stream);
+ fLaunchConfigurations.put(config, info);
+ } catch (FileNotFoundException e) {
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
+ } catch (SAXException e) {
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
+ } catch (ParserConfigurationException e) {
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
+ } catch (IOException e) {
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
+ } finally {
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.getString("LaunchManager.{0}_occurred_while_reading_launch_configuration_file._1"), new String[]{e.toString()}), e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ } else {
+ throw createDebugException(DebugCoreMessages.getString("LaunchManager.Launch_configuration_does_not_exist._6"), null); //$NON-NLS-1$
+ }
+ }
+ return info;
+ }
+
+ /**
+ * Return an instance of DebugException containing the specified message and Throwable.
+ */
+ protected DebugException createDebugException(String message, Throwable throwable) {
+ return new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, message, throwable
+ )
+ );
+ }
+
+ /**
+ * Removes the given launch configuration from the cache of configurations.
+ * When a local configuration is deleted, this method is called, as there will
+ * be no resource delta generated to auto-update the cache.
+ *
+ * @param configuration the configuration to remove
+ */
+ private void removeInfo(ILaunchConfiguration configuration) {
+ fLaunchConfigurations.remove(configuration);
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfigurations()
+ */
+ public ILaunchConfiguration[] getLaunchConfigurations() throws CoreException {
+ List allConfigs = getAllLaunchConfigurations();
+ return (ILaunchConfiguration[])allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]);
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfigurations(ILaunchConfigurationType)
+ */
+ public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
+ Iterator iter = getAllLaunchConfigurations().iterator();
+ List configs = new ArrayList();
+ while (iter.hasNext()) {
+ ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
+ if (config.getType().equals(type)) {
+ configs.add(config);
+ }
+ }
+ return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
+ }
+
+ /**
+ * Returns all launch configurations that are stored as resources
+ * in the given project.
+ *
+ * @param project a project
+ * @return collection of launch configurations that are stored as resources
+ * in the given project
+ */
+ protected List getLaunchConfigurations(IProject project) throws CoreException {
+ Iterator iter = getAllLaunchConfigurations().iterator();
+ List configs = new ArrayList();
+ while (iter.hasNext()) {
+ ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
+ IFile file = config.getFile();
+ if (file != null && file.getProject().equals(project)) {
+ configs.add(config);
+ }
+ }
+ return configs;
+ }
+
+ /**
+ * Returns all launch configurations that are stored locally.
+ *
+ * @return collection of launch configurations stored lcoally
+ */
+ protected List getLocalLaunchConfigurations() throws CoreException {
+ Iterator iter = getAllLaunchConfigurations().iterator();
+ List configs = new ArrayList();
+ while (iter.hasNext()) {
+ ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
+ if (config.isLocal()) {
+ configs.add(config);
+ }
+ }
+ return configs;
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfiguration(IFile)
+ */
+ public ILaunchConfiguration getLaunchConfiguration(IFile file) {
+ return new LaunchConfiguration(file.getLocation());
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfiguration(String)
+ */
+ public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException {
+ return new LaunchConfiguration(memento);
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfigurationTypes()
+ */
+ public ILaunchConfigurationType[] getLaunchConfigurationTypes() {
+ List types= getLaunchConfigurationTypeList();
+ return (ILaunchConfigurationType[])types.toArray(new ILaunchConfigurationType[types.size()]);
+ }
+
+ /**
+ * @see ILaunchManager#getLaunchConfigurationType(String)
+ */
+ public ILaunchConfigurationType getLaunchConfigurationType(String id) {
+ Iterator iter = getLaunchConfigurationTypeList().iterator();
+ while (iter.hasNext()) {
+ ILaunchConfigurationType type = (ILaunchConfigurationType)iter.next();
+ if (type.getIdentifier().equals(id)) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+ private List getLaunchConfigurationTypeList() {
+ if (fLaunchConfigurationTypes == null) {
+ initializeLaunchConfigurationTypes();
+ }
+ return fLaunchConfigurationTypes;
+ }
+
+ private void initializeLaunchConfigurationTypes() {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fLaunchConfigurationTypes= new ArrayList(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement);
+ fLaunchConfigurationTypes.add(configType);
+ }
+ }
+
+ /**
+ * Notifies the launch manager that a launch configuration
+ * has been deleted. The configuration is removed from the
+ * cache of info's and from the index of configurations by
+ * project, and listeners are notified.
+ *
+ * @param config the launch configuration that was deleted
+ */
+ protected void launchConfigurationDeleted(ILaunchConfiguration config) throws CoreException {
+ removeInfo(config);
+ getAllLaunchConfigurations().remove(config);
+ if (fLaunchConfigurationListeners.size() > 0) {
+ Object[] listeners = fLaunchConfigurationListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
+ listener.launchConfigurationRemoved(config);
+ }
+ }
+ clearConfigNameCache();
+ }
+
+ /**
+ * Notifies the launch manager that a launch configuration
+ * has been added. The configuration is added to the index of
+ * configurations by project, and listeners are notified.
+ *
+ * @param config the launch configuration that was added
+ */
+ protected void launchConfigurationAdded(ILaunchConfiguration config) throws CoreException {
+ if (isValid(config)) {
+ List allConfigs = getAllLaunchConfigurations();
+ if (!allConfigs.contains(config)) {
+ allConfigs.add(config);
+ }
+ if (fLaunchConfigurationListeners.size() > 0) {
+ Object[] listeners = fLaunchConfigurationListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
+ listener.launchConfigurationAdded(config);
+ }
+ }
+ clearConfigNameCache();
+ } else {
+ launchConfigurationDeleted(config);
+ }
+ }
+
+ /**
+ * Notifies the launch manager that a launch configuration
+ * has been changed. The configuration is removed from the
+ * cache of info objects such that the new attributes will
+ * be updated on the next access. Listeners are notified of
+ * the change.
+ *
+ * @param config the launch configuration that was changed
+ */
+ protected void launchConfigurationChanged(ILaunchConfiguration config) {
+ removeInfo(config);
+ clearConfigNameCache();
+ if (isValid(config)) {
+ notifyChanged(config);
+ } else {
+ try {
+ launchConfigurationDeleted(config);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Notifies listeners that the given launch configuration
+ * has changed.
+ *
+ * @param configuration the changed launch configuration
+ */
+ protected void notifyChanged(ILaunchConfiguration configuration) {
+ if (fLaunchConfigurationListeners.size() > 0) {
+ Object[] listeners = fLaunchConfigurationListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ILaunchConfigurationListener listener = (ILaunchConfigurationListener)listeners[i];
+ listener.launchConfigurationChanged(configuration);
+ }
+ }
+ }
+
+ /**
+ * @see ILaunchManager#isExistingLaunchConfigurationName(String)
+ */
+ public boolean isExistingLaunchConfigurationName(String name) throws CoreException {
+ String[] sortedConfigNames = getAllSortedConfigNames();
+ int index = Arrays.binarySearch(sortedConfigNames, name);
+ if (index < 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchManager#generateUniqueLaunchConfigurationNameFrom(String)
+ */
+ public String generateUniqueLaunchConfigurationNameFrom(String baseName) {
+ int index = 1;
+ int length= baseName.length();
+ int copyIndex = baseName.lastIndexOf(" ("); //$NON-NLS-1$
+ if (copyIndex > -1 && length > copyIndex + 2 && baseName.charAt(length - 1) == ')') {
+ String trailer = baseName.substring(copyIndex + 2, length -1);
+ if (isNumber(trailer)) {
+ try {
+ index = Integer.parseInt(trailer);
+ baseName = baseName.substring(0, copyIndex);
+ } catch (NumberFormatException nfe) {
+ }
+ }
+ }
+ String newName = baseName;
+ try {
+ StringBuffer buffer= null;
+ while (isExistingLaunchConfigurationName(newName)) {
+ buffer = new StringBuffer(baseName);
+ buffer.append(" ("); //$NON-NLS-1$
+ buffer.append(String.valueOf(index));
+ index++;
+ buffer.append(')');
+ newName = buffer.toString();
+ }
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ return newName;
+ }
+
+ /**
+ * Returns whether the given String is composed solely of digits
+ */
+ private boolean isNumber(String string) {
+ int numChars= string.length();
+ if (numChars == 0) {
+ return false;
+ }
+ for (int i= 0; i < numChars; i++) {
+ if (!Character.isDigit(string.charAt(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return a sorted array of the names of all <code>ILaunchConfiguration</code>s in
+ * the workspace. These are cached, and cache is cleared when a new config is added,
+ * deleted or changed.
+ */
+ protected String[] getAllSortedConfigNames() throws CoreException {
+ if (fSortedConfigNames == null) {
+ ILaunchConfiguration[] configs = getLaunchConfigurations();
+ fSortedConfigNames = new String[configs.length];
+ for (int i = 0; i < configs.length; i++) {
+ fSortedConfigNames[i] = configs[i].getName();
+ }
+ Arrays.sort(fSortedConfigNames);
+ }
+ return fSortedConfigNames;
+ }
+
+ /**
+ * The launch config name cache is cleared when a config is added, deleted or changed.
+ */
+ protected void clearConfigNameCache() {
+ fSortedConfigNames = null;
+ }
+
+ /**
+ * Finds and returns all local launch configurations.
+ *
+ * @return all local launch configurations
+ * @exception CoreException if there is a lower level
+ * IO exception
+ */
+ protected List findLocalLaunchConfigurations() throws CoreException {
+ IPath containerPath = LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH;
+ List configs = new ArrayList(10);
+ final File directory = containerPath.toFile();
+ if (directory.isDirectory()) {
+ FilenameFilter filter = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return dir.equals(directory) &&
+ name.endsWith(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION);
+ }
+ };
+ String[] files = directory.list(filter);
+ for (int i = 0; i < files.length; i++) {
+ LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i]));
+ configs.add(config);
+ }
+ }
+ return configs;
+ }
+
+ /**
+ * Finds and returns all launch configurations in the given
+ * container (and subcontainers)
+ *
+ * @param container the container to search
+ * @exception CoreException an exception occurs traversing
+ * the container.
+ * @return all launch configurations in the given container
+ */
+ protected List findLaunchConfigurations(IContainer container) throws CoreException {
+ List list = new ArrayList(10);
+ if (container instanceof IProject && !((IProject)container).isOpen()) {
+ return list;
+ }
+ searchForFiles(container, ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION, list);
+ Iterator iter = list.iterator();
+ List configs = new ArrayList(list.size());
+ while (iter.hasNext()) {
+ IFile file = (IFile)iter.next();
+ configs.add(getLaunchConfiguration(file));
+ }
+ return configs;
+ }
+
+ /**
+ * Recursively searches the given container for files with the given
+ * extension.
+ *
+ * @param container the container to search in
+ * @param extension the file extension being searched for
+ * @param list the list to add the matching files to
+ * @exception CoreException if an exception occurs traversing
+ * the container
+ */
+ protected void searchForFiles(IContainer container, String extension, List list) throws CoreException {
+ IResource[] members = container.members();
+ for (int i = 0; i < members.length; i++) {
+ if (members[i] instanceof IContainer) {
+ if (members[i] instanceof IProject && !((IProject)members[i]) .isOpen()) {
+ continue;
+ }
+ searchForFiles((IContainer)members[i], extension, list);
+ } else if (members[i] instanceof IFile) {
+ IFile file = (IFile)members[i];
+ if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equalsIgnoreCase(file.getFileExtension())) {
+ list.add(file);
+ }
+ }
+ }
+ }
+
+ /**
+ * Traverses the delta looking for added/removed/changed launch
+ * configuration files.
+ *
+ * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta= event.getDelta();
+ if (delta != null) {
+ try {
+ if (fgVisitor == null) {
+ fgVisitor= new LaunchManagerVisitor();
+ }
+ delta.accept(fgVisitor);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Returns the launch configurations specified by the given
+ * XML document.
+ *
+ * @param root XML document
+ * @return list of launch configurations
+ * @exception IOException if an exception occurs reading the XML
+ */
+ protected List getConfigsFromXML(Element root) throws CoreException {
+ DebugException invalidFormat =
+ new DebugException(
+ new Status(
+ Status.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, DebugCoreMessages.getString("LaunchManager.Invalid_launch_configuration_index._18"), null //$NON-NLS-1$
+ )
+ );
+
+ if (!root.getNodeName().equalsIgnoreCase("launchConfigurations")) { //$NON-NLS-1$
+ throw invalidFormat;
+ }
+
+ // read each launch configuration
+ List configs = new ArrayList(4);
+ NodeList list = root.getChildNodes();
+ int length = list.getLength();
+ for (int i = 0; i < length; ++i) {
+ Node node = list.item(i);
+ short type = node.getNodeType();
+ if (type == Node.ELEMENT_NODE) {
+ Element entry = (Element) node;
+ String nodeName = entry.getNodeName();
+ if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$
+ throw invalidFormat;
+ }
+ String memento = entry.getAttribute("memento"); //$NON-NLS-1$
+ if (memento == null) {
+ throw invalidFormat;
+ }
+ configs.add(getLaunchConfiguration(memento));
+ }
+ }
+ return configs;
+ }
+
+ /**
+ * The specified project has just opened - add all launch
+ * configs in the project to the index of all configs.
+ *
+ * @param project the project that has been opened
+ * @exception CoreException if reading the index fails
+ */
+ protected void projectOpened(IProject project) throws CoreException {
+ List configs = findLaunchConfigurations(project);
+ if (!configs.isEmpty()) {
+ List allList = getAllLaunchConfigurations();
+ Iterator iterator = configs.iterator();
+ while (iterator.hasNext()) {
+ ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
+ if (!allList.contains(config)) {
+ allList.add(config);
+ }
+ }
+ }
+ }
+
+ /**
+ * The specified project has just closed - remove its
+ * launch configurations from the cached index.
+ *
+ * @param project the project that has been closed
+ * @exception CoreException if writing the index fails
+ */
+ protected void projectClosed(IProject project) throws CoreException {
+ List configs = getLaunchConfigurations(project);
+ if (!configs.isEmpty()) {
+ getAllLaunchConfigurations().removeAll(configs);
+ }
+ }
+
+ /**
+ * Visitor for handling resource deltas.
+ */
+ class LaunchManagerVisitor implements IResourceDeltaVisitor {
+ /**
+ * @see IResourceDeltaVisitor#visit(IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) {
+ if (delta == null) {
+ return false;
+ }
+ if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
+ if (delta.getResource() instanceof IProject) {
+ IProject project = (IProject)delta.getResource();
+ try {
+ if (project.isOpen()) {
+ LaunchManager.this.projectOpened(project);
+ } else {
+ LaunchManager.this.projectClosed(project);
+ }
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ return false;
+ }
+ IResource resource = delta.getResource();
+ if (resource instanceof IFile) {
+ IFile file = (IFile)resource;
+ if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) {
+ IPath configPath = file.getLocation();
+ // If the file has already been deleted, reconstruct the full
+ // filesystem path
+ if (configPath == null) {
+ IPath workspaceRelativePath = delta.getFullPath();
+ configPath = getWorkspaceRoot().getLocation().append(workspaceRelativePath);
+ }
+ ILaunchConfiguration handle = new LaunchConfiguration(configPath);
+ try {
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED :
+ LaunchManager.this.launchConfigurationAdded(handle);
+ break;
+ case IResourceDelta.REMOVED :
+ LaunchManager.this.launchConfigurationDeleted(handle);
+ break;
+ case IResourceDelta.CHANGED :
+ LaunchManager.this.launchConfigurationChanged(handle);
+ break;
+ }
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+ return false;
+ } else if (resource instanceof IContainer) {
+ return true;
+ }
+ return true;
+ }
+ }
+
+ /**
+ * @see ILaunchManager#addLaunchConfigurationListener(ILaunchConfigurationListener)
+ */
+ public void addLaunchConfigurationListener(ILaunchConfigurationListener listener) {
+ fLaunchConfigurationListeners.add(listener);
+ }
+
+ /**
+ * @see ILaunchManager#removeLaunchConfigurationListener(ILaunchConfigurationListener)
+ */
+ public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener) {
+ fLaunchConfigurationListeners.remove(listener);
+ }
+
+ /**
+ * Register source locators.
+ *
+ * @exception CoreException if an exception occurrs reading
+ * the extensions
+ */
+ private void initializeSourceLocators() throws CoreException {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fSourceLocators= new HashMap(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ String id = configurationElement.getAttribute("id"); //$NON-NLS-1$
+ if (id != null) {
+ fSourceLocators.put(id,configurationElement);
+ } else {
+ // invalid status handler
+ IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
+ MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Invalid_source_locator_extentsion_defined_by_plug-in___{0}______id___not_specified_12"), new String[] {configurationElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier()} ), null); //$NON-NLS-1$
+ DebugPlugin.getDefault().log(s);
+ }
+ }
+ }
+
+
+ /**
+ * Load comparator extensions.
+ *
+ * @exception CoreException if an exception occurrs reading
+ * the extensions
+ */
+ private void initializeComparators() {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fComparators = new HashMap(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$
+ if (attr != null) {
+ fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
+ } else {
+ // invalid status handler
+ IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
+ MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Invalid_launch_configuration_comparator_extension_defined_by_plug-in_{0}_-_attribute_not_specified_1"), new String[] {configurationElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier()}), null); //$NON-NLS-1$
+ DebugPlugin.getDefault().log(s);
+ }
+ }
+ }
+
+ /**
+ * @see ILaunchManager#newSourceLocator(String)
+ */
+ public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException {
+ if (fSourceLocators == null) {
+ initializeSourceLocators();
+ }
+ IConfigurationElement config = (IConfigurationElement)fSourceLocators.get(identifier);
+ if (config == null) {
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
+ MessageFormat.format(DebugCoreMessages.getString("LaunchManager.Source_locator_does_not_exist__{0}_13"), new String[] {identifier} ), null)); //$NON-NLS-1$
+ } else {
+ return (IPersistableSourceLocator)config.createExecutableExtension("class"); //$NON-NLS-1$
+ }
+
+ }
+
+ /**
+ * Returns the comparator registered for the given attribute, or
+ * <code>null</code> if none.
+ *
+ * @param attributeName attribute for which a comparator is required
+ * @return comparator, or <code>null</code> if none
+ */
+ protected Comparator getComparator(String attributeName) {
+ HashMap map = getComparators();
+ return (Comparator)map.get(attributeName);
+ }
+
+ /**
+ * Returns comparators, loading if required
+ */
+ protected HashMap getComparators() {
+ if (fComparators == null) {
+ initializeComparators();
+ }
+ return fComparators;
+ }
+
+ private IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ private IWorkspaceRoot getWorkspaceRoot() {
+ return getWorkspace().getRoot();
+ }
+
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java
index f664e02f1..9ad6e752d 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ListenerList.java
@@ -1,131 +1,131 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Local version of org.eclipse.jface.util.ListenerList (modified)s
- */
-public class ListenerList {
- /**
- * The current number of listeners.
- * Maintains invariant: 0 <= fSize <= listeners.length.
- */
- private int fSize;
-
- /**
- * The list of listeners. Initially <code>null</code> but initialized
- * to an array of size capacity the first time a listener is added.
- * Maintains invariant: listeners != null if and only if fSize != 0
- */
- private Object[] fListeners= null;
-
- /**
- * The empty array singleton instance, returned by getListeners()
- * when size == 0.
- */
- private static final Object[] EmptyArray= new Object[0];
-
- /**
- * Creates a listener list with the given initial capacity.
- *
- * @param capacity the number of listeners which this list can initially accept
- * without growing its internal representation; must be at least 1
- */
- public ListenerList(int capacity) {
- if (capacity < 1) {
- throw new IllegalArgumentException();
- }
- fListeners= new Object[capacity];
- fSize= 0;
- }
-
- /**
- * Adds a listener to the list.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a listener
- */
- public synchronized void add(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- // check for duplicates using identity
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- return;
- }
- }
- // grow array if necessary
- if (fSize == fListeners.length) {
- Object[] temp= new Object[(fSize * 2) + 1];
- System.arraycopy(fListeners, 0, temp, 0, fSize);
- fListeners= temp;
- }
- fListeners[fSize++]= listener;
- }
-
- /**
- * Returns an array containing all the registered listeners.
- * The resulting array is unaffected by subsequent adds or removes.
- * If there are no listeners registered, the result is an empty array
- * singleton instance (no garbage is created).
- * Use this method when notifying listeners, so that any modifications
- * to the listener list during the notification will have no effect on the
- * notification itself.
- */
- public synchronized Object[] getListeners() {
- if (fSize == 0) {
- return EmptyArray;
- }
- Object[] result= new Object[fSize];
- System.arraycopy(fListeners, 0, result, 0, fSize);
- return result;
- }
-
- /**
- * Removes a listener from the list.
- * Has no effect if an identical listener was not already registered.
- *
- * @param listener a listener
- */
- public synchronized void remove(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
-
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- if (--fSize == 0) {
- fListeners= new Object[1];
- } else {
- if (i < fSize) {
- fListeners[i]= fListeners[fSize];
- }
- fListeners[fSize]= null;
- }
- return;
- }
- }
- }
-
- /**
- * Removes all the listeners from the list.
- */
- public void removeAll() {
- fListeners= new Object[0];
- fSize= 0;
- }
-
- /**
- * Returns the number of registered listeners
- *
- * @return the number of registered listeners
- */
- public int size() {
- return fSize;
- }
-}
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * Local version of org.eclipse.jface.util.ListenerList (modified)s
+ */
+public class ListenerList {
+ /**
+ * The current number of listeners.
+ * Maintains invariant: 0 <= fSize <= listeners.length.
+ */
+ private int fSize;
+
+ /**
+ * The list of listeners. Initially <code>null</code> but initialized
+ * to an array of size capacity the first time a listener is added.
+ * Maintains invariant: listeners != null if and only if fSize != 0
+ */
+ private Object[] fListeners= null;
+
+ /**
+ * The empty array singleton instance, returned by getListeners()
+ * when size == 0.
+ */
+ private static final Object[] EmptyArray= new Object[0];
+
+ /**
+ * Creates a listener list with the given initial capacity.
+ *
+ * @param capacity the number of listeners which this list can initially accept
+ * without growing its internal representation; must be at least 1
+ */
+ public ListenerList(int capacity) {
+ if (capacity < 1) {
+ throw new IllegalArgumentException();
+ }
+ fListeners= new Object[capacity];
+ fSize= 0;
+ }
+
+ /**
+ * Adds a listener to the list.
+ * Has no effect if an identical listener is already registered.
+ *
+ * @param listener a listener
+ */
+ public synchronized void add(Object listener) {
+ if (listener == null) {
+ throw new IllegalArgumentException();
+ }
+ // check for duplicates using identity
+ for (int i= 0; i < fSize; ++i) {
+ if (fListeners[i] == listener) {
+ return;
+ }
+ }
+ // grow array if necessary
+ if (fSize == fListeners.length) {
+ Object[] temp= new Object[(fSize * 2) + 1];
+ System.arraycopy(fListeners, 0, temp, 0, fSize);
+ fListeners= temp;
+ }
+ fListeners[fSize++]= listener;
+ }
+
+ /**
+ * Returns an array containing all the registered listeners.
+ * The resulting array is unaffected by subsequent adds or removes.
+ * If there are no listeners registered, the result is an empty array
+ * singleton instance (no garbage is created).
+ * Use this method when notifying listeners, so that any modifications
+ * to the listener list during the notification will have no effect on the
+ * notification itself.
+ */
+ public synchronized Object[] getListeners() {
+ if (fSize == 0) {
+ return EmptyArray;
+ }
+ Object[] result= new Object[fSize];
+ System.arraycopy(fListeners, 0, result, 0, fSize);
+ return result;
+ }
+
+ /**
+ * Removes a listener from the list.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener a listener
+ */
+ public synchronized void remove(Object listener) {
+ if (listener == null) {
+ throw new IllegalArgumentException();
+ }
+
+ for (int i= 0; i < fSize; ++i) {
+ if (fListeners[i] == listener) {
+ if (--fSize == 0) {
+ fListeners= new Object[1];
+ } else {
+ if (i < fSize) {
+ fListeners[i]= fListeners[fSize];
+ }
+ fListeners[fSize]= null;
+ }
+ return;
+ }
+ }
+ }
+
+ /**
+ * Removes all the listeners from the list.
+ */
+ public void removeAll() {
+ fListeners= new Object[0];
+ fSize= 0;
+ }
+
+ /**
+ * Returns the number of registered listeners
+ *
+ * @return the number of registered listeners
+ */
+ public int size() {
+ return fSize;
+ }
+}
+
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
index 6e7ebb1c1..736e40edb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
@@ -1,172 +1,172 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IStreamListener;
-import org.eclipse.debug.core.model.IStreamMonitor;
-
-/**
- * Monitors the output stream of a system process and notifies
- * listeners of additions to the stream.
- *
- * The output stream monitor reads system out (or err) via
- * and input stream.
- */
-public class OutputStreamMonitor implements IStreamMonitor {
- /**
- * The stream being monitored (connected system out or err).
- */
- private InputStream fStream;
-
- /**
- * A collection of listeners
- */
- private ListenerList fListeners= new ListenerList(1);
-
- /**
- * The local copy of the stream contents
- */
- private StringBuffer fContents;
-
- /**
- * The thread which reads from the stream
- */
- private Thread fThread;
-
- /**
- * The size of the read buffer
- */
- private static final int BUFFER_SIZE= 8192;
-
- /**
- * Whether or not this monitor has been killed.
- * When the monitor is killed, it stops reading
- * from the stream immediately.
- */
- private boolean fKilled= false;
- /**
- * Creates an output stream monitor on the
- * given stream (connected to system out or err).
- */
- public OutputStreamMonitor(InputStream stream) {
- fStream= stream;
- fContents= new StringBuffer();
- }
-
- /**
- * @see IStreamMonitor#addListener(IStreamListener)
- */
- public void addListener(IStreamListener listener) {
- fListeners.add(listener);
- }
-
- /**
- * Causes the monitor to close all
- * communications between it and the
- * underlying stream by waiting for the thread to terminate.
- */
- protected void close() {
- if (fThread != null) {
- Thread thread= fThread;
- fThread= null;
- try {
- thread.join();
- } catch (InterruptedException ie) {
- }
- fListeners.removeAll();
- }
- }
-
- /**
- * Notifies the listeners that text has
- * been appended to the stream.
- */
- private void fireStreamAppended(String text) {
- if (text == null)
- return;
- Object[] copiedListeners= fListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- ((IStreamListener) copiedListeners[i]).streamAppended(text, this);
- }
- }
-
- /**
- * @see IStreamMonitor#getContents()
- */
- public String getContents() {
- return fContents.toString();
- }
-
- /**
- * Continually reads from the stream.
- * <p>
- * This method, along with the <code>startReading</code>
- * method is used to allow <code>OutputStreamMonitor</code>
- * to implement <code>Runnable</code> without publicly
- * exposing a <code>run</code> method.
- */
- private void read() {
- byte[] bytes= new byte[BUFFER_SIZE];
- int read = 0;
- while (read >= 0) {
- try {
- if (fKilled) {
- break;
- }
- read= fStream.read(bytes);
- if (read > 0) {
- String text= new String(bytes, 0, read);
- fContents.append(text);
- fireStreamAppended(text);
- }
- } catch (IOException ioe) {
- DebugPlugin.log(ioe);
- return;
- } catch (NullPointerException e) {
- // killing the stream monitor while reading can cause an NPE
- // when reading from the stream
- if (!fKilled || fThread != null) {
- DebugPlugin.log(e);
- }
- return;
- }
- }
- try {
- fStream.close();
- } catch (IOException e) {
- DebugPlugin.log(e);
- }
- }
-
- protected void kill() {
- fKilled= true;
- }
-
- /**
- * @see IStreamMonitor#removeListener(IStreamListener)
- */
- public void removeListener(IStreamListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Starts a thread which reads from the stream
- */
- protected void startMonitoring() {
- if (fThread == null) {
- fThread= new Thread(new Runnable() {
- public void run() {
- read();
- }
- }, DebugCoreMessages.getString("OutputStreamMonitor.label")); //$NON-NLS-1$
- fThread.start();
- }
- }
-}
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IStreamListener;
+import org.eclipse.debug.core.model.IStreamMonitor;
+
+/**
+ * Monitors the output stream of a system process and notifies
+ * listeners of additions to the stream.
+ *
+ * The output stream monitor reads system out (or err) via
+ * and input stream.
+ */
+public class OutputStreamMonitor implements IStreamMonitor {
+ /**
+ * The stream being monitored (connected system out or err).
+ */
+ private InputStream fStream;
+
+ /**
+ * A collection of listeners
+ */
+ private ListenerList fListeners= new ListenerList(1);
+
+ /**
+ * The local copy of the stream contents
+ */
+ private StringBuffer fContents;
+
+ /**
+ * The thread which reads from the stream
+ */
+ private Thread fThread;
+
+ /**
+ * The size of the read buffer
+ */
+ private static final int BUFFER_SIZE= 8192;
+
+ /**
+ * Whether or not this monitor has been killed.
+ * When the monitor is killed, it stops reading
+ * from the stream immediately.
+ */
+ private boolean fKilled= false;
+ /**
+ * Creates an output stream monitor on the
+ * given stream (connected to system out or err).
+ */
+ public OutputStreamMonitor(InputStream stream) {
+ fStream= stream;
+ fContents= new StringBuffer();
+ }
+
+ /**
+ * @see IStreamMonitor#addListener(IStreamListener)
+ */
+ public void addListener(IStreamListener listener) {
+ fListeners.add(listener);
+ }
+
+ /**
+ * Causes the monitor to close all
+ * communications between it and the
+ * underlying stream by waiting for the thread to terminate.
+ */
+ protected void close() {
+ if (fThread != null) {
+ Thread thread= fThread;
+ fThread= null;
+ try {
+ thread.join();
+ } catch (InterruptedException ie) {
+ }
+ fListeners.removeAll();
+ }
+ }
+
+ /**
+ * Notifies the listeners that text has
+ * been appended to the stream.
+ */
+ private void fireStreamAppended(String text) {
+ if (text == null)
+ return;
+ Object[] copiedListeners= fListeners.getListeners();
+ for (int i= 0; i < copiedListeners.length; i++) {
+ ((IStreamListener) copiedListeners[i]).streamAppended(text, this);
+ }
+ }
+
+ /**
+ * @see IStreamMonitor#getContents()
+ */
+ public String getContents() {
+ return fContents.toString();
+ }
+
+ /**
+ * Continually reads from the stream.
+ * <p>
+ * This method, along with the <code>startReading</code>
+ * method is used to allow <code>OutputStreamMonitor</code>
+ * to implement <code>Runnable</code> without publicly
+ * exposing a <code>run</code> method.
+ */
+ private void read() {
+ byte[] bytes= new byte[BUFFER_SIZE];
+ int read = 0;
+ while (read >= 0) {
+ try {
+ if (fKilled) {
+ break;
+ }
+ read= fStream.read(bytes);
+ if (read > 0) {
+ String text= new String(bytes, 0, read);
+ fContents.append(text);
+ fireStreamAppended(text);
+ }
+ } catch (IOException ioe) {
+ DebugPlugin.log(ioe);
+ return;
+ } catch (NullPointerException e) {
+ // killing the stream monitor while reading can cause an NPE
+ // when reading from the stream
+ if (!fKilled || fThread != null) {
+ DebugPlugin.log(e);
+ }
+ return;
+ }
+ }
+ try {
+ fStream.close();
+ } catch (IOException e) {
+ DebugPlugin.log(e);
+ }
+ }
+
+ protected void kill() {
+ fKilled= true;
+ }
+
+ /**
+ * @see IStreamMonitor#removeListener(IStreamListener)
+ */
+ public void removeListener(IStreamListener listener) {
+ fListeners.remove(listener);
+ }
+
+ /**
+ * Starts a thread which reads from the stream
+ */
+ protected void startMonitoring() {
+ if (fThread == null) {
+ fThread= new Thread(new Runnable() {
+ public void run() {
+ read();
+ }
+ }, DebugCoreMessages.getString("OutputStreamMonitor.label")); //$NON-NLS-1$
+ fThread.start();
+ }
+ }
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ProcessMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ProcessMonitor.java
index 81f2f0b22..ad608f373 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ProcessMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ProcessMonitor.java
@@ -1,79 +1,79 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Monitors a system process, wiating for it to terminate, and
- * then notifies the associated runtime process.
- */
-public class ProcessMonitor {
- /**
- * The underlying <code>java.lang.Process</code> being monitored.
- */
- protected Process fOSProcess;
- /**
- * The <code>IProcess</code> which will be informed when this
- * monitor detects that the underlying process has terminated.
- */
- protected RuntimeProcess fProcess;
-
- /**
- * The <code>Thread</code> which is monitoring the underlying process.
- */
- protected Thread fThread;
- /**
- * Creates a new process monitor and starts monitoring the process
- * for termination.
- */
- public ProcessMonitor(RuntimeProcess process) {
- fProcess= process;
- fOSProcess= process.getSystemProcess();
- startMonitoring();
- }
-
- /**
- * Monitors the underlying process for termination. When the underlying
- * process terminates (or if the monitoring thread is interrupted),
- * inform the <code>IProcess</code> that it has terminated.
- */
- private void monitorProcess() {
- while (fOSProcess != null) {
- try {
- fOSProcess.waitFor();
- } catch (InterruptedException ie) {
- } finally {
- fOSProcess = null;
- fProcess.terminated();
- }
- }
- }
-
- /**
- * Starts monitoring the underlying process to determine
- * if it has terminated.
- */
- private void startMonitoring() {
- if (fThread == null) {
- fThread= new Thread(new Runnable() {
- public void run() {
- monitorProcess();
- }
- }, DebugCoreMessages.getString("ProcessMonitor.label")); //$NON-NLS-1$
- fThread.start();
- }
- }
-
- /**
- * Kills the monitoring thread.
- *
- * This method is to be useful for dealing with the error
- * case of an underlying process which has not informed this
- * monitor of its termination.
- */
- protected void killMonitoring() {
- fThread.interrupt();
- }
-}
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * Monitors a system process, wiating for it to terminate, and
+ * then notifies the associated runtime process.
+ */
+public class ProcessMonitor {
+ /**
+ * The underlying <code>java.lang.Process</code> being monitored.
+ */
+ protected Process fOSProcess;
+ /**
+ * The <code>IProcess</code> which will be informed when this
+ * monitor detects that the underlying process has terminated.
+ */
+ protected RuntimeProcess fProcess;
+
+ /**
+ * The <code>Thread</code> which is monitoring the underlying process.
+ */
+ protected Thread fThread;
+ /**
+ * Creates a new process monitor and starts monitoring the process
+ * for termination.
+ */
+ public ProcessMonitor(RuntimeProcess process) {
+ fProcess= process;
+ fOSProcess= process.getSystemProcess();
+ startMonitoring();
+ }
+
+ /**
+ * Monitors the underlying process for termination. When the underlying
+ * process terminates (or if the monitoring thread is interrupted),
+ * inform the <code>IProcess</code> that it has terminated.
+ */
+ private void monitorProcess() {
+ while (fOSProcess != null) {
+ try {
+ fOSProcess.waitFor();
+ } catch (InterruptedException ie) {
+ } finally {
+ fOSProcess = null;
+ fProcess.terminated();
+ }
+ }
+ }
+
+ /**
+ * Starts monitoring the underlying process to determine
+ * if it has terminated.
+ */
+ private void startMonitoring() {
+ if (fThread == null) {
+ fThread= new Thread(new Runnable() {
+ public void run() {
+ monitorProcess();
+ }
+ }, DebugCoreMessages.getString("ProcessMonitor.label")); //$NON-NLS-1$
+ fThread.start();
+ }
+ }
+
+ /**
+ * Kills the monitoring thread.
+ *
+ * This method is to be useful for dealing with the error
+ * case of an underlying process which has not informed this
+ * monitor of its termination.
+ */
+ protected void killMonitoring() {
+ fThread.interrupt();
+ }
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
index 05bb319b1..f7ceb1942 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
@@ -1,291 +1,291 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamsProxy;
-
-
-/**
- * A runtime process is a wrapper for a non-debuggable
- * system process. The process will appear in the debug UI with
- * console and termination support. The process creates a streams
- * proxy for itself, and a process monitor that monitors the
- * underlying system process for terminataion.
- */
-public class RuntimeProcess extends PlatformObject implements IProcess {
-
- private static final int MAX_WAIT_FOR_DEATH_ATTEMPTS = 10;
- private static final int TIME_TO_WAIT_FOR_THREAD_DEATH = 500; // ms
-
- /**
- * The launch this process is contained in
- */
- private ILaunch fLaunch;
-
- /**
- * The system process
- */
- private Process fProcess;
-
- /**
- * The exit value
- */
- private int fExitValue;
-
- /**
- * The monitor which listens for this runtime process' system process
- * to terminate.
- */
- private ProcessMonitor fMonitor;
-
- /**
- * The streams proxy for this process
- */
- private StreamsProxy fStreamsProxy;
-
- /**
- * The name of the process
- */
- private String fName;
-
- /**
- * Whether this process has been terminated
- */
- private boolean fTerminated;
-
- /**
- * Table of client defined attributes
- */
- private HashMap fAttributes;
-
- /**
- * Constructs a RuntimeProcess on the given system process
- * with the given name, adding this process to the given
- * launch.
- */
- public RuntimeProcess(ILaunch launch, Process process, String name) {
- setLaunch(launch);
- fProcess= process;
- fName= name;
- fTerminated= true;
- try {
- process.exitValue();
- } catch (IllegalThreadStateException e) {
- fTerminated= false;
- }
- fStreamsProxy = new StreamsProxy(this);
- fMonitor = new ProcessMonitor(this);
- launch.addProcess(this);
- fireCreationEvent();
- }
-
- /**
- * @see ITerminate#canTerminate()
- */
- public boolean canTerminate() {
- return !fTerminated;
- }
-
- /**
- * Returns the error stream of the underlying system process (connected
- * to the standard error of the process).
- */
- protected InputStream getErrorStream() {
- return fProcess.getErrorStream();
- }
-
- /**
- * Returns the input stream of the underlying system process (connected
- * to the standard out of the process).
- */
- protected InputStream getInputStream() {
- return fProcess.getInputStream();
- }
-
- /**
- * Returns the output stream of the underlying system process (connected
- * to the standard in of the process).
- */
- protected OutputStream getOutputStream() {
- return fProcess.getOutputStream();
- }
-
- /**
- * @see IProcess#getLabel()
- */
- public String getLabel() {
- return fName;
- }
-
- /**
- * Sets the launch this process is contained in
- *
- * @param launch the launch this process is contained in
- */
- private void setLaunch(ILaunch launch) {
- fLaunch = launch;
- }
-
- /**
- * @see IProcess#getLaunch()
- */
- public ILaunch getLaunch() {
- return fLaunch;
- }
-
- /**
- * Returns the underlying system process
- */
- protected Process getSystemProcess() {
- return fProcess;
- }
-
- /**
- * @see ITerminate#isTerminated()
- */
- public boolean isTerminated() {
- return fTerminated;
- }
-
- /**
- * @see ITerminate#terminate()
- */
- public void terminate() throws DebugException {
- if (!isTerminated()) {
- fProcess.destroy();
- fStreamsProxy.kill();
- int attempts = 0;
- while (attempts < MAX_WAIT_FOR_DEATH_ATTEMPTS) {
- try {
- if (fProcess != null) {
- fExitValue = fProcess.exitValue(); // throws exception if process not exited
- }
- return;
- } catch (IllegalThreadStateException ie) {
- }
- try {
- Thread.sleep(TIME_TO_WAIT_FOR_THREAD_DEATH);
- } catch (InterruptedException e) {
- }
- attempts++;
- }
- // clean-up
- fMonitor.killMonitoring();
- IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.getString("RuntimeProcess.terminate_failed"), null); //$NON-NLS-1$
- throw new DebugException(status);
- }
- }
-
- /**
- * Notification that the system process associated with this process
- * has terminated.
- */
- protected void terminated() {
- fStreamsProxy.close();
- fTerminated= true;
- try {
- fExitValue = fProcess.exitValue();
- } catch (IllegalThreadStateException ie) {
- }
- fProcess= null;
- fireTerminateEvent();
- }
-
- /**
- * @see IProcess#getStreamsProxy()
- */
- public IStreamsProxy getStreamsProxy() {
- return fStreamsProxy;
- }
-
- /**
- * Fire a debug event marking the creation of this element.
- */
- private void fireCreationEvent() {
- fireEvent(new DebugEvent(this, DebugEvent.CREATE));
- }
-
- /**
- * Fire a debug event
- */
- private void fireEvent(DebugEvent event) {
- DebugPlugin manager= DebugPlugin.getDefault();
- if (manager != null) {
- manager.fireDebugEventSet(new DebugEvent[]{event});
- }
- }
-
- /**
- * Fire a debug event marking the termination of this process.
- */
- private void fireTerminateEvent() {
- fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
- }
-
- /**
- * @see IProcess#setAttribute(String, String)
- */
- public void setAttribute(String key, String value) {
- if (fAttributes == null) {
- fAttributes = new HashMap(5);
- }
- fAttributes.put(key, value);
- }
-
- /**
- * @see IProcess#getAttribute(String)
- */
- public String getAttribute(String key) {
- if (fAttributes == null) {
- return null;
- }
- return (String)fAttributes.get(key);
- }
-
- /**
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IProcess.class)) {
- return this;
- }
- if (adapter.equals(IDebugTarget.class)) {
- ILaunch launch = getLaunch();
- IDebugTarget[] targets = launch.getDebugTargets();
- for (int i = 0; i < targets.length; i++) {
- if (this.equals(targets[i].getProcess())) {
- return targets[i];
- }
- }
- return null;
- }
- return super.getAdapter(adapter);
- }
- /**
- * @see IProcess#getExitValue()
- */
- public int getExitValue() throws DebugException {
- if (isTerminated()) {
- return fExitValue;
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.getString("RuntimeProcess.Exit_value_not_available_until_process_terminates._1"), null)); //$NON-NLS-1$
- }
- }
-
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IStreamsProxy;
+
+
+/**
+ * A runtime process is a wrapper for a non-debuggable
+ * system process. The process will appear in the debug UI with
+ * console and termination support. The process creates a streams
+ * proxy for itself, and a process monitor that monitors the
+ * underlying system process for terminataion.
+ */
+public class RuntimeProcess extends PlatformObject implements IProcess {
+
+ private static final int MAX_WAIT_FOR_DEATH_ATTEMPTS = 10;
+ private static final int TIME_TO_WAIT_FOR_THREAD_DEATH = 500; // ms
+
+ /**
+ * The launch this process is contained in
+ */
+ private ILaunch fLaunch;
+
+ /**
+ * The system process
+ */
+ private Process fProcess;
+
+ /**
+ * The exit value
+ */
+ private int fExitValue;
+
+ /**
+ * The monitor which listens for this runtime process' system process
+ * to terminate.
+ */
+ private ProcessMonitor fMonitor;
+
+ /**
+ * The streams proxy for this process
+ */
+ private StreamsProxy fStreamsProxy;
+
+ /**
+ * The name of the process
+ */
+ private String fName;
+
+ /**
+ * Whether this process has been terminated
+ */
+ private boolean fTerminated;
+
+ /**
+ * Table of client defined attributes
+ */
+ private HashMap fAttributes;
+
+ /**
+ * Constructs a RuntimeProcess on the given system process
+ * with the given name, adding this process to the given
+ * launch.
+ */
+ public RuntimeProcess(ILaunch launch, Process process, String name) {
+ setLaunch(launch);
+ fProcess= process;
+ fName= name;
+ fTerminated= true;
+ try {
+ process.exitValue();
+ } catch (IllegalThreadStateException e) {
+ fTerminated= false;
+ }
+ fStreamsProxy = new StreamsProxy(this);
+ fMonitor = new ProcessMonitor(this);
+ launch.addProcess(this);
+ fireCreationEvent();
+ }
+
+ /**
+ * @see ITerminate#canTerminate()
+ */
+ public boolean canTerminate() {
+ return !fTerminated;
+ }
+
+ /**
+ * Returns the error stream of the underlying system process (connected
+ * to the standard error of the process).
+ */
+ protected InputStream getErrorStream() {
+ return fProcess.getErrorStream();
+ }
+
+ /**
+ * Returns the input stream of the underlying system process (connected
+ * to the standard out of the process).
+ */
+ protected InputStream getInputStream() {
+ return fProcess.getInputStream();
+ }
+
+ /**
+ * Returns the output stream of the underlying system process (connected
+ * to the standard in of the process).
+ */
+ protected OutputStream getOutputStream() {
+ return fProcess.getOutputStream();
+ }
+
+ /**
+ * @see IProcess#getLabel()
+ */
+ public String getLabel() {
+ return fName;
+ }
+
+ /**
+ * Sets the launch this process is contained in
+ *
+ * @param launch the launch this process is contained in
+ */
+ private void setLaunch(ILaunch launch) {
+ fLaunch = launch;
+ }
+
+ /**
+ * @see IProcess#getLaunch()
+ */
+ public ILaunch getLaunch() {
+ return fLaunch;
+ }
+
+ /**
+ * Returns the underlying system process
+ */
+ protected Process getSystemProcess() {
+ return fProcess;
+ }
+
+ /**
+ * @see ITerminate#isTerminated()
+ */
+ public boolean isTerminated() {
+ return fTerminated;
+ }
+
+ /**
+ * @see ITerminate#terminate()
+ */
+ public void terminate() throws DebugException {
+ if (!isTerminated()) {
+ fProcess.destroy();
+ fStreamsProxy.kill();
+ int attempts = 0;
+ while (attempts < MAX_WAIT_FOR_DEATH_ATTEMPTS) {
+ try {
+ if (fProcess != null) {
+ fExitValue = fProcess.exitValue(); // throws exception if process not exited
+ }
+ return;
+ } catch (IllegalThreadStateException ie) {
+ }
+ try {
+ Thread.sleep(TIME_TO_WAIT_FOR_THREAD_DEATH);
+ } catch (InterruptedException e) {
+ }
+ attempts++;
+ }
+ // clean-up
+ fMonitor.killMonitoring();
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.getString("RuntimeProcess.terminate_failed"), null); //$NON-NLS-1$
+ throw new DebugException(status);
+ }
+ }
+
+ /**
+ * Notification that the system process associated with this process
+ * has terminated.
+ */
+ protected void terminated() {
+ fStreamsProxy.close();
+ fTerminated= true;
+ try {
+ fExitValue = fProcess.exitValue();
+ } catch (IllegalThreadStateException ie) {
+ }
+ fProcess= null;
+ fireTerminateEvent();
+ }
+
+ /**
+ * @see IProcess#getStreamsProxy()
+ */
+ public IStreamsProxy getStreamsProxy() {
+ return fStreamsProxy;
+ }
+
+ /**
+ * Fire a debug event marking the creation of this element.
+ */
+ private void fireCreationEvent() {
+ fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+ }
+
+ /**
+ * Fire a debug event
+ */
+ private void fireEvent(DebugEvent event) {
+ DebugPlugin manager= DebugPlugin.getDefault();
+ if (manager != null) {
+ manager.fireDebugEventSet(new DebugEvent[]{event});
+ }
+ }
+
+ /**
+ * Fire a debug event marking the termination of this process.
+ */
+ private void fireTerminateEvent() {
+ fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+ }
+
+ /**
+ * @see IProcess#setAttribute(String, String)
+ */
+ public void setAttribute(String key, String value) {
+ if (fAttributes == null) {
+ fAttributes = new HashMap(5);
+ }
+ fAttributes.put(key, value);
+ }
+
+ /**
+ * @see IProcess#getAttribute(String)
+ */
+ public String getAttribute(String key) {
+ if (fAttributes == null) {
+ return null;
+ }
+ return (String)fAttributes.get(key);
+ }
+
+ /**
+ * @see IAdaptable#getAdapter(Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter.equals(IProcess.class)) {
+ return this;
+ }
+ if (adapter.equals(IDebugTarget.class)) {
+ ILaunch launch = getLaunch();
+ IDebugTarget[] targets = launch.getDebugTargets();
+ for (int i = 0; i < targets.length; i++) {
+ if (this.equals(targets[i].getProcess())) {
+ return targets[i];
+ }
+ }
+ return null;
+ }
+ return super.getAdapter(adapter);
+ }
+ /**
+ * @see IProcess#getExitValue()
+ */
+ public int getExitValue() throws DebugException {
+ if (isTerminated()) {
+ return fExitValue;
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.getString("RuntimeProcess.Exit_value_not_available_until_process_terminates._1"), null)); //$NON-NLS-1$
+ }
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
index c9720d547..70ebc00eb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
@@ -1,99 +1,99 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import java.io.IOException;
-
-public class StreamsProxy implements IStreamsProxy {
- /**
- * The monitor for the output stream (connected to standard out of the process)
- */
- private OutputStreamMonitor fOutputMonitor;
- /**
- * The monitor for the error stream (connected to standard error of the process)
- */
- private OutputStreamMonitor fErrorMonitor;
- /**
- * The monitor for the input stream (connected to standard in of the process)
- */
- private InputStreamMonitor fInputMonitor;
- /**
- * Records the open/closed state of communications with
- * the underlying streams.
- */
- private boolean fClosed= false;
- /**
- * Creates a <code>StreamsProxy</code> on the streams
- * of the given <code>IProcess</code>.
- */
- public StreamsProxy(RuntimeProcess process) {
- if (process == null) {
- return;
- }
- fOutputMonitor= new OutputStreamMonitor(process.getInputStream());
- fErrorMonitor= new OutputStreamMonitor(process.getErrorStream());
- fInputMonitor= new InputStreamMonitor(process.getOutputStream());
- fOutputMonitor.startMonitoring();
- fErrorMonitor.startMonitoring();
- fInputMonitor.startMonitoring();
- }
-
- /**
- * Causes the proxy to close all
- * communications between it and the
- * underlying streams after all remaining data
- * in the streams is read.
- */
- protected void close() {
- if (!fClosed) {
- fClosed= true;
- fOutputMonitor.close();
- fErrorMonitor.close();
- fInputMonitor.close();
- }
- }
-
- /**
- * Causes the proxy to close all
- * communications between it and the
- * underlying streams immediately.
- * Data remaining in the streams is lost.
- */
- protected void kill() {
- fClosed= true;
- fOutputMonitor.kill();
- fErrorMonitor.kill();
- fInputMonitor.close();
- }
-
- /**
- * @see IStreamsProxy#getErrorStreamMonitor()
- */
- public IStreamMonitor getErrorStreamMonitor() {
- return fErrorMonitor;
- }
-
- /**
- * @see IStreamsProxy#getOutputStreamMonitor()
- */
- public IStreamMonitor getOutputStreamMonitor() {
- return fOutputMonitor;
- }
-
- /**
- * @see IStreamsProxy#write(String)
- */
- public void write(String input) throws IOException {
- if (!fClosed) {
- fInputMonitor.write(input);
- } else {
- throw new IOException();
- }
- }
-
-}
+package org.eclipse.debug.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.debug.core.model.IStreamsProxy;
+import java.io.IOException;
+
+public class StreamsProxy implements IStreamsProxy {
+ /**
+ * The monitor for the output stream (connected to standard out of the process)
+ */
+ private OutputStreamMonitor fOutputMonitor;
+ /**
+ * The monitor for the error stream (connected to standard error of the process)
+ */
+ private OutputStreamMonitor fErrorMonitor;
+ /**
+ * The monitor for the input stream (connected to standard in of the process)
+ */
+ private InputStreamMonitor fInputMonitor;
+ /**
+ * Records the open/closed state of communications with
+ * the underlying streams.
+ */
+ private boolean fClosed= false;
+ /**
+ * Creates a <code>StreamsProxy</code> on the streams
+ * of the given <code>IProcess</code>.
+ */
+ public StreamsProxy(RuntimeProcess process) {
+ if (process == null) {
+ return;
+ }
+ fOutputMonitor= new OutputStreamMonitor(process.getInputStream());
+ fErrorMonitor= new OutputStreamMonitor(process.getErrorStream());
+ fInputMonitor= new InputStreamMonitor(process.getOutputStream());
+ fOutputMonitor.startMonitoring();
+ fErrorMonitor.startMonitoring();
+ fInputMonitor.startMonitoring();
+ }
+
+ /**
+ * Causes the proxy to close all
+ * communications between it and the
+ * underlying streams after all remaining data
+ * in the streams is read.
+ */
+ protected void close() {
+ if (!fClosed) {
+ fClosed= true;
+ fOutputMonitor.close();
+ fErrorMonitor.close();
+ fInputMonitor.close();
+ }
+ }
+
+ /**
+ * Causes the proxy to close all
+ * communications between it and the
+ * underlying streams immediately.
+ * Data remaining in the streams is lost.
+ */
+ protected void kill() {
+ fClosed= true;
+ fOutputMonitor.kill();
+ fErrorMonitor.kill();
+ fInputMonitor.close();
+ }
+
+ /**
+ * @see IStreamsProxy#getErrorStreamMonitor()
+ */
+ public IStreamMonitor getErrorStreamMonitor() {
+ return fErrorMonitor;
+ }
+
+ /**
+ * @see IStreamsProxy#getOutputStreamMonitor()
+ */
+ public IStreamMonitor getOutputStreamMonitor() {
+ return fOutputMonitor;
+ }
+
+ /**
+ * @see IStreamsProxy#write(String)
+ */
+ public void write(String input) throws IOException {
+ if (!fClosed) {
+ fInputMonitor.write(input);
+ } else {
+ throw new IOException();
+ }
+ }
+
+}
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
index 6ac27a319..e131aa980 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
@@ -1,40 +1,40 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Debug User Interface Extension Points</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Eclipse Debug Platform</h1>
-
-<p>The debug platform plug-in, <b>org.eclipse.debug.core</b>,
-defines a model for language independent debugging. A set of common debug artifacts and
-actions are defined by interfaces, for which specific debug architectures may provide
-implementations. For example, some common artifacts are threads, stack frames, and
-variables; some common actions are terminate, suspend, step, and resume. A debug
-architecture, such as the Java Platform Debug Architecture (JPDA), can provide an implementation of the
-artifacts and actions. The debug plug-in also provides facilities to support
-breakpoint management, expression management, and program launching.<br>
-</p>
-
-<hr>
-
-<h1>Extension Points</h1>
-
-<p>The following extension points are used to support and extend the debug infrastructure:
-
-<ul>
- <li><a href="org_eclipse_debug_core_breakpoints.html">org.eclipse.debug.core.breakpoints</a></li>
- <li><a href="org_eclipse_debug_core_launch_configuration_comparators.html">org.eclipse.debug.core.launchConfigurationComparators</a></li>
- <li><a href="org_eclipse_debug_core_launch_configuration_types.html">org.eclipse.debug.core.launchConfigurationTypes</a></li>
- <li><a href="org_eclipse_debug_core_source_locators.html">org.eclipse.debug.core.sourceLocators</a></li>
- <li><a href="org_eclipse_debug_core_status_handlers.html">org.eclipse.debug.core.statusHandlers</a></li>
-</ul>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Debug User Interface Extension Points</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Eclipse Debug Platform</h1>
+
+<p>The debug platform plug-in, <b>org.eclipse.debug.core</b>,
+defines a model for language independent debugging. A set of common debug artifacts and
+actions are defined by interfaces, for which specific debug architectures may provide
+implementations. For example, some common artifacts are threads, stack frames, and
+variables; some common actions are terminate, suspend, step, and resume. A debug
+architecture, such as the Java Platform Debug Architecture (JPDA), can provide an implementation of the
+artifacts and actions. The debug plug-in also provides facilities to support
+breakpoint management, expression management, and program launching.<br>
+</p>
+
+<hr>
+
+<h1>Extension Points</h1>
+
+<p>The following extension points are used to support and extend the debug infrastructure:
+
+<ul>
+ <li><a href="org_eclipse_debug_core_breakpoints.html">org.eclipse.debug.core.breakpoints</a></li>
+ <li><a href="org_eclipse_debug_core_launch_configuration_comparators.html">org.eclipse.debug.core.launchConfigurationComparators</a></li>
+ <li><a href="org_eclipse_debug_core_launch_configuration_types.html">org.eclipse.debug.core.launchConfigurationTypes</a></li>
+ <li><a href="org_eclipse_debug_core_source_locators.html">org.eclipse.debug.core.sourceLocators</a></li>
+ <li><a href="org_eclipse_debug_core_status_handlers.html">org.eclipse.debug.core.statusHandlers</a></li>
+</ul>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_breakpoints.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_breakpoints.html
index 0faf05b3a..2ee96a236 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_breakpoints.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_breakpoints.html
@@ -1,63 +1,63 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Breakpoints Extension Point</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Breakpoints</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.core.breakpoints </p>
-
-<p><b><i>Description: </i></b>This extension point provides a
-mechanism for defining new types of breakpoints.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ATTLIST breakpoint</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; markerType&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> specifies a unique identifier for this breakpoint type.</li>
- <li><code>markerType</code> specifies the fully qualified identifier (id) of
- the corresponding marker definition for breakpoints of this type.</li>
- <li><code>class</code> specifies the fully qualified name of the java class
- that implements <code>IBreakpoint</code>.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a breakpoint extension point: </p>
-
-<pre>
-&lt;extension point="org.eclipse.debug.core.breakpoints"&gt;
- &lt;breakpoint
- id="com.example.ExampleBreakpoint"
- markerType="com.example.ExampleBreakpointMarker"
- class="com.example.ExampleBreakpointImpl"&gt;
- &lt;/breakpoint&gt;
-&lt;/extension&gt;
-</pre>
-
-<p>In the example above, the specified type of breakpoint is implemeted by the
-class "com.example.BreakpointImpl". There is an associated
-marker definition for "com.example.ExampleBreakpointMarker", defining
-the attributes of this breakpoint.
-</p>
-
-<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
-qualified name of a Java class that implements the interface <b>
-org.eclipse.debug.core.model.IBreakpoint</b>.
-</p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Breakpoints Extension Point</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Breakpoints</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.core.breakpoints </p>
+
+<p><b><i>Description: </i></b>This extension point provides a
+mechanism for defining new types of breakpoints.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ATTLIST breakpoint</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; markerType&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> specifies a unique identifier for this breakpoint type.</li>
+ <li><code>markerType</code> specifies the fully qualified identifier (id) of
+ the corresponding marker definition for breakpoints of this type.</li>
+ <li><code>class</code> specifies the fully qualified name of the java class
+ that implements <code>IBreakpoint</code>.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a breakpoint extension point: </p>
+
+<pre>
+&lt;extension point="org.eclipse.debug.core.breakpoints"&gt;
+ &lt;breakpoint
+ id="com.example.ExampleBreakpoint"
+ markerType="com.example.ExampleBreakpointMarker"
+ class="com.example.ExampleBreakpointImpl"&gt;
+ &lt;/breakpoint&gt;
+&lt;/extension&gt;
+</pre>
+
+<p>In the example above, the specified type of breakpoint is implemeted by the
+class "com.example.BreakpointImpl". There is an associated
+marker definition for "com.example.ExampleBreakpointMarker", defining
+the attributes of this breakpoint.
+</p>
+
+<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
+qualified name of a Java class that implements the interface <b>
+org.eclipse.debug.core.model.IBreakpoint</b>.
+</p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_launch_configuration_types.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launch_configuration_types.html
index 2094e9b2b..06089e62d 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_launch_configuration_types.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launch_configuration_types.html
@@ -1,95 +1,95 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Launch Configuration Types Extension Point</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Launch Configuration Types</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.core.launchConfigurationTypes </p>
-
-<p><b><i>Description: </i></b>This extension point provides a configurable
-mechanism for launching applications. Each launch configuration type has a name,
-supports one or more modes (run and or debug), and specifies a delegate
-responsible for the implementation of launching an application.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationType (fileExtension?)</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationType</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delegate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA (true | false) #IMPLIED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> specifies a unique identifier for this launch configuration
- type.</li>
- <li><code>delegate</code> specifies the fully qualified name of the java class
- that implements <code>ILaunchConfigurationDelegate</code>. Launch configuration
- instances of this type will delegate to instances of this class
- to perform launching.</li>
- <li><code>modes</code> specifies a comma separated list of the modes this
- type of launch configuration suports - <code>"run"</code> and/or <code>"debug"</code>.</li>
- <li><code>name</code> specifies a human readable name for this type
- of launch configuration.</li>
- <li><code>public</code> specifies whether this launch configuration type is
- accessible by users. Defaults to true if not specified.</li>
-</ul>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ATTLIST fileExtension</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extension CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default&nbsp;&nbsp; CDATA (true | false) #IMPLIED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>extension</code> specifies a file extension that this launch configuration type
- can be used for.</li>
- <li><code>default</code> specifies whether this launch configuration type should be
- the default launch configuration type for the specified file extension. Defaults
- to false if not specified.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a launch configuration type extension point: </p>
-
-<pre>
-&lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
- &lt;launchConfigurationType
- id="com.example.ExampleIdentifier"
- delegate="com.example.ExampleLaunchConfigurationDelegate"
- modes="run, debug"
- name="Example Application"&gt;
- &lt;fileExtension
- extension="txt"
- default=true&gt;
- &lt;fileExtension
- extension="gif"
- default=false&gt;
- &lt;/launchConfigurationType&gt;
-&lt;/extension&gt;
-</pre>
-
-<p>In the example above, the specified type of launch configuration supports both run and debug modes.
-The launch configuartion is applicable to txt and gif files, and is the default launch configuration
-for txt files.
-</p>
-
-<p><b><i>API Information: </i></b>Value of the attribute <b>delegate</b> must be a fully
-qualified name of a Java class that implements the interface <b>
-org.eclipse.debug.core.model.ILaunchConfigurationDelegate</b>.
-</p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Launch Configuration Types Extension Point</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Launch Configuration Types</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.core.launchConfigurationTypes </p>
+
+<p><b><i>Description: </i></b>This extension point provides a configurable
+mechanism for launching applications. Each launch configuration type has a name,
+supports one or more modes (run and or debug), and specifies a delegate
+responsible for the implementation of launching an application.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationType (fileExtension?)</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationType</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delegate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA (true | false) #IMPLIED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> specifies a unique identifier for this launch configuration
+ type.</li>
+ <li><code>delegate</code> specifies the fully qualified name of the java class
+ that implements <code>ILaunchConfigurationDelegate</code>. Launch configuration
+ instances of this type will delegate to instances of this class
+ to perform launching.</li>
+ <li><code>modes</code> specifies a comma separated list of the modes this
+ type of launch configuration suports - <code>"run"</code> and/or <code>"debug"</code>.</li>
+ <li><code>name</code> specifies a human readable name for this type
+ of launch configuration.</li>
+ <li><code>public</code> specifies whether this launch configuration type is
+ accessible by users. Defaults to true if not specified.</li>
+</ul>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ATTLIST fileExtension</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extension CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default&nbsp;&nbsp; CDATA (true | false) #IMPLIED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>extension</code> specifies a file extension that this launch configuration type
+ can be used for.</li>
+ <li><code>default</code> specifies whether this launch configuration type should be
+ the default launch configuration type for the specified file extension. Defaults
+ to false if not specified.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a launch configuration type extension point: </p>
+
+<pre>
+&lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
+ &lt;launchConfigurationType
+ id="com.example.ExampleIdentifier"
+ delegate="com.example.ExampleLaunchConfigurationDelegate"
+ modes="run, debug"
+ name="Example Application"&gt;
+ &lt;fileExtension
+ extension="txt"
+ default=true&gt;
+ &lt;fileExtension
+ extension="gif"
+ default=false&gt;
+ &lt;/launchConfigurationType&gt;
+&lt;/extension&gt;
+</pre>
+
+<p>In the example above, the specified type of launch configuration supports both run and debug modes.
+The launch configuartion is applicable to txt and gif files, and is the default launch configuration
+for txt files.
+</p>
+
+<p><b><i>API Information: </i></b>Value of the attribute <b>delegate</b> must be a fully
+qualified name of a Java class that implements the interface <b>
+org.eclipse.debug.core.model.ILaunchConfigurationDelegate</b>.
+</p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_source_locators.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_source_locators.html
index 8ab3f56fd..1a931bba1 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_source_locators.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_source_locators.html
@@ -1,59 +1,59 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Source Locators Extension Point</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Source Locators</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.core.sourceLocators</p>
-
-<p><b><i>Description: </i></b>This extension point provides a
- mechanism specifying a source locator to be used with a launch
- configuration.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT sourceLocator</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST sourceLocator</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> specifies a unique identifier for this source locator.</li>
- <li><code>class</code> specifies the fully qualified name of the Java class
- that implements <code>IPersistableSourceLocator</code>.</li>
- <li><code>name</code> a human readable name describing this source locator.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a source locator extension point: </p>
-
-<pre>
- &lt;extension point="org.eclipse.debug.core.sourceLocators"&gt;
- &lt;sourceLocator
- id="com.example.ExampleIdentifier"
- class="com.example.ExampleSourceLocator"
- name="Example Source Locator"&gt;
- &lt;/sourceLocator&gt;
- &lt;/extension&gt;
-</pre>
-
-
-<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
-qualified name of a Java class that implements the interface <b>
-org.eclipse.debug.core.model.IPersistableSourceLocator</b>.
-</p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Source Locators Extension Point</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Source Locators</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.core.sourceLocators</p>
+
+<p><b><i>Description: </i></b>This extension point provides a
+ mechanism specifying a source locator to be used with a launch
+ configuration.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT sourceLocator</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST sourceLocator</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> specifies a unique identifier for this source locator.</li>
+ <li><code>class</code> specifies the fully qualified name of the Java class
+ that implements <code>IPersistableSourceLocator</code>.</li>
+ <li><code>name</code> a human readable name describing this source locator.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a source locator extension point: </p>
+
+<pre>
+ &lt;extension point="org.eclipse.debug.core.sourceLocators"&gt;
+ &lt;sourceLocator
+ id="com.example.ExampleIdentifier"
+ class="com.example.ExampleSourceLocator"
+ name="Example Source Locator"&gt;
+ &lt;/sourceLocator&gt;
+ &lt;/extension&gt;
+</pre>
+
+
+<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
+qualified name of a Java class that implements the interface <b>
+org.eclipse.debug.core.model.IPersistableSourceLocator</b>.
+</p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_status_handlers.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_status_handlers.html
index 9a7c89284..b95d4a324 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_status_handlers.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_status_handlers.html
@@ -1,71 +1,71 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Status Handlers Extension Point</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Status Handlers</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.core.statusHandlers</p>
-
-<p><b><i>Description: </i></b>This extension point provides a generic
- mechanism for separating the generation and resolution of an error.
- The interaction between the source of the error, and the resolution
- is client defined. It is a client reponsibility to lookup and delegate
- to status handlers when an error condition occurrs.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT statusHandlers</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST statusHandlers</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> specifies a unique identifier for this status handler.</li>
- <li><code>class</code> specifies the fully qualified name of the java class
- that implements <code>IStatusHandler</code>.</li>
- <li><code>plugin</code> plug-in identifier that corresponds to the
- plug-in of the status this handler is registered for (i.e.
- <code>IStatus.getPlugin()</code>).</li>
- <li><code>code</code> specifies the status code this handler
- is registered for.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a status handler extension point: </p>
-
-<pre>
- &lt;extension point="org.eclipse.debug.core.statusHandlers"&gt;
- &lt;statusHandler
- id="com.example.ExampleIdentifier"
- class="com.example.ExampleStatusHandler"
- plugin="com.example.ExamplePluginId"
- code="123"&gt;
- &lt;/statusHandler&gt;
- &lt;/extension&gt;
-</pre>
-
-<p>In the example above, the specified status handler will be registered
- to handle status objects with a plug-in identifier of <code>com.example.ExamplePluginId</code>
- and a status code of <code>123</code>.
-</p>
-
-<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
-qualified name of a Java class that implements the interface <b>
-org.eclipse.debug.core.IStatusHandler</b>.
-</p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Status Handlers Extension Point</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Status Handlers</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.core.statusHandlers</p>
+
+<p><b><i>Description: </i></b>This extension point provides a generic
+ mechanism for separating the generation and resolution of an error.
+ The interaction between the source of the error, and the resolution
+ is client defined. It is a client reponsibility to lookup and delegate
+ to status handlers when an error condition occurrs.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT statusHandlers</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST statusHandlers</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> specifies a unique identifier for this status handler.</li>
+ <li><code>class</code> specifies the fully qualified name of the java class
+ that implements <code>IStatusHandler</code>.</li>
+ <li><code>plugin</code> plug-in identifier that corresponds to the
+ plug-in of the status this handler is registered for (i.e.
+ <code>IStatus.getPlugin()</code>).</li>
+ <li><code>code</code> specifies the status code this handler
+ is registered for.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a status handler extension point: </p>
+
+<pre>
+ &lt;extension point="org.eclipse.debug.core.statusHandlers"&gt;
+ &lt;statusHandler
+ id="com.example.ExampleIdentifier"
+ class="com.example.ExampleStatusHandler"
+ plugin="com.example.ExamplePluginId"
+ code="123"&gt;
+ &lt;/statusHandler&gt;
+ &lt;/extension&gt;
+</pre>
+
+<p>In the example above, the specified status handler will be registered
+ to handle status objects with a plug-in identifier of <code>com.example.ExamplePluginId</code>
+ and a status code of <code>123</code>.
+</p>
+
+<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
+qualified name of a Java class that implements the interface <b>
+org.eclipse.debug.core.IStatusHandler</b>.
+</p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.core/plugin.properties b/org.eclipse.debug.core/plugin.properties
index 450b41c69..9d9e6e5eb 100644
--- a/org.eclipse.debug.core/plugin.properties
+++ b/org.eclipse.debug.core/plugin.properties
@@ -1,19 +1,19 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-pluginName=Debug Core
-providerName=Eclipse.org
-launcherExtensionPointName=Launcher
-breakpointExtensionPointName=Breakpoint
-launchConfigurationTypeNameExtensionPointName=Launch Configuration Type
-launchConfigurationComparatorsExtensionPointName=Launch Configuration Comparators
-statusHandlerExtensionPointName=Status Handler
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+pluginName=Debug Core
+providerName=Eclipse.org
+launcherExtensionPointName=Launcher
+breakpointExtensionPointName=Breakpoint
+launchConfigurationTypeNameExtensionPointName=Launch Configuration Type
+launchConfigurationComparatorsExtensionPointName=Launch Configuration Comparators
+statusHandlerExtensionPointName=Status Handler
sourceLocatorsExtensionPointName=Source Locator \ No newline at end of file
diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml
index dddc4d935..b80102e92 100644
--- a/org.eclipse.debug.core/plugin.xml
+++ b/org.eclipse.debug.core/plugin.xml
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.debug.core"
- name="%pluginName"
- version="2.0.0"
- provider-name="%providerName"
- class="org.eclipse.debug.core.DebugPlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.core.resources"/>
-</requires>
-
-<!-- Runtime -->
-<runtime>
- <library name="dtcore.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<!-- Extension points -->
-<extension-point id="launchers" name="%launcherExtensionPointName"/>
-<extension-point id="breakpoints" name="%breakpointExtensionPointName"/>
-<extension-point id="launchConfigurationTypes" name="%launchConfigurationTypeNameExtensionPointName"/>
-<extension-point id="launchConfigurationComparators" name="%launchConfigurationComparatorsExtensionPointName"/>
-<extension-point id="statusHandlers" name="%statusHandlerExtensionPointName"/>
-<extension-point id="sourceLocators" name="%sourceLocatorsExtensionPointName"/>
-
-<!-- Extensions -->
-<extension id="breakpointMarker" point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.core.resources.marker"/>
- <persistent value="true"/>
- <attribute name="org.eclipse.debug.core.modelIdentifier"/>
- <attribute name="org.eclipse.debug.core.enabled"/>
- <attribute name="org.eclipse.debug.core.registered"/>
- <attribute name="org.eclipse.debug.core.persisted"/>
-</extension>
-<extension id="lineBreakpointMarker" point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.debug.core.breakpointMarker"/>
- <super type="org.eclipse.core.resources.textmarker"/>
- <persistent value="true"/>
-</extension>
-
-<extension point="org.eclipse.team.core.fileTypes">
- <fileTypes extension="launch" type="text"/>
-</extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File written by PDE 1.0 -->
+<plugin
+ id="org.eclipse.debug.core"
+ name="%pluginName"
+ version="2.0.0"
+ provider-name="%providerName"
+ class="org.eclipse.debug.core.DebugPlugin">
+<!-- Required plugins -->
+<requires>
+ <import plugin="org.apache.xerces"/>
+ <import plugin="org.eclipse.core.resources"/>
+</requires>
+
+<!-- Runtime -->
+<runtime>
+ <library name="dtcore.jar">
+ <export name="*"/>
+ </library>
+</runtime>
+
+<!-- Extension points -->
+<extension-point id="launchers" name="%launcherExtensionPointName"/>
+<extension-point id="breakpoints" name="%breakpointExtensionPointName"/>
+<extension-point id="launchConfigurationTypes" name="%launchConfigurationTypeNameExtensionPointName"/>
+<extension-point id="launchConfigurationComparators" name="%launchConfigurationComparatorsExtensionPointName"/>
+<extension-point id="statusHandlers" name="%statusHandlerExtensionPointName"/>
+<extension-point id="sourceLocators" name="%sourceLocatorsExtensionPointName"/>
+
+<!-- Extensions -->
+<extension id="breakpointMarker" point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.marker"/>
+ <persistent value="true"/>
+ <attribute name="org.eclipse.debug.core.modelIdentifier"/>
+ <attribute name="org.eclipse.debug.core.enabled"/>
+ <attribute name="org.eclipse.debug.core.registered"/>
+ <attribute name="org.eclipse.debug.core.persisted"/>
+</extension>
+<extension id="lineBreakpointMarker" point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.debug.core.breakpointMarker"/>
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="true"/>
+</extension>
+
+<extension point="org.eclipse.team.core.fileTypes">
+ <fileTypes extension="launch" type="text"/>
+</extension>
+
+</plugin>
diff --git a/org.eclipse.debug.core/scripts/exportplugin.xml b/org.eclipse.debug.core/scripts/exportplugin.xml
index 612e0ec6b..ae3c068f6 100644
--- a/org.eclipse.debug.core/scripts/exportplugin.xml
+++ b/org.eclipse.debug.core/scripts/exportplugin.xml
@@ -1,32 +1,32 @@
-<!-- Export a jar of .class files for the org.eclipse.debug.core Eclipse plugin
- along with other important plugin files to the "plugin-export" subdirectory
- of the target Eclipse installation -->
-<project name="org.eclipse.debug.core" default="export" basedir="..">
-
- <!-- Set the timestamp and important properties -->
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="dest" value="${destdir}/org.eclipse.debug.core_2.0.0" />
- </target>
-
- <!-- Create the jar of .class files, and copy other important files to export dir -->
- <target name="export" depends="init">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/dtcore.jar"
- basedir="bin"
- />
- <!-- Create the source zip -->
- <zip zipfile="${dest}/dtcoresrc.zip">
- <fileset dir="core"/>
- </zip>
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy file=".classpath" todir="${dest}"/>
- <copy file=".options" todir="${dest}"/>
- </target>
-
-</project>
+<!-- Export a jar of .class files for the org.eclipse.debug.core Eclipse plugin
+ along with other important plugin files to the "plugin-export" subdirectory
+ of the target Eclipse installation -->
+<project name="org.eclipse.debug.core" default="export" basedir="..">
+
+ <!-- Set the timestamp and important properties -->
+ <target name="init">
+ <tstamp/>
+ <property name="destdir" value="../../plugin-export" />
+ <property name="dest" value="${destdir}/org.eclipse.debug.core_2.0.0" />
+ </target>
+
+ <!-- Create the jar of .class files, and copy other important files to export dir -->
+ <target name="export" depends="init">
+ <mkdir dir="${destdir}" />
+ <delete dir="${dest}" />
+ <mkdir dir="${dest}" />
+ <jar
+ jarfile="${dest}/dtcore.jar"
+ basedir="bin"
+ />
+ <!-- Create the source zip -->
+ <zip zipfile="${dest}/dtcoresrc.zip">
+ <fileset dir="core"/>
+ </zip>
+ <copy file="plugin.xml" todir="${dest}"/>
+ <copy file="plugin.properties" todir="${dest}"/>
+ <copy file=".classpath" todir="${dest}"/>
+ <copy file=".options" todir="${dest}"/>
+ </target>
+
+</project>
diff --git a/org.eclipse.debug.ui/.project b/org.eclipse.debug.ui/.project
index e9700f1d2..05c20cbbc 100644
--- a/org.eclipse.debug.ui/.project
+++ b/org.eclipse.debug.ui/.project
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.debug.ui</name>
- <comment></comment>
- <projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.debug.core</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.debug.ui</name>
+ <comment></comment>
+ <projects>
+ <project>org.apache.xerces</project>
+ <project>org.eclipse.core.boot</project>
+ <project>org.eclipse.core.resources</project>
+ <project>org.eclipse.core.runtime</project>
+ <project>org.eclipse.debug.core</project>
+ <project>org.eclipse.ui</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.debug.ui/build.properties b/org.eclipse.debug.ui/build.properties
index f3399369c..8a1b9051f 100644
--- a/org.eclipse.debug.ui/build.properties
+++ b/org.eclipse.debug.ui/build.properties
@@ -1,9 +1,9 @@
-bin.includes = icons/,\
- .options,\
- plugin.xml,\
- plugin.properties,\
- *.jar,\
- about.html
-
-source.dtui.jar = ui/
-src.includes=about.html
+bin.includes = icons/,\
+ .options,\
+ plugin.xml,\
+ plugin.properties,\
+ *.jar,\
+ about.html
+
+source.dtui.jar = ui/
+src.includes=about.html
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
index 6085ed2eb..064a39477 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
@@ -1,36 +1,36 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Debug User Interface Extension Points</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Debug Platform User-Interface</h1>
-
-<p>The platform debug UI plug-in, <b>org.eclipse.debug.ui</b>, implements a
-debug user-interface, allowing the user to view and manipulate debug targets, processes,
-threads, stack frames and variables. It provides standard debug actions such as
-stepping, terminating, etc. <br>
-</p>
-
-<hr>
-
-<h1>Extension Points</h1>
-
-<p>The following extension points are used to support and extend the debug UI.:
-
-<ul>
- <li><a href="org_eclipse_debug_ui_debugActionGroups.html">org.eclipse.debug.ui.debugActionGroups</a></li>
- <li><a href="org_eclipse_debug_ui_debugModelPresentations.html">org.eclipse.debug.ui.debugModelPresentations</a></li>
- <li><a href="org_eclipse_debug_ui_launchConfigurationTabGroups.html">org.eclipse.debug.ui.launchConfigurationTabGroups</a></li>
- <li><a href="org_eclipse_debug_ui_launchConfigurationTypeImages.html">org.eclipse.debug.ui.launchConfigurationTypeImages</a></li>
- <li><a href="org_eclipse_debug_ui_launchShortcuts.html">org.eclipse.debug.ui.launchShortcuts</a></li>
-</ul>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Debug User Interface Extension Points</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Debug Platform User-Interface</h1>
+
+<p>The platform debug UI plug-in, <b>org.eclipse.debug.ui</b>, implements a
+debug user-interface, allowing the user to view and manipulate debug targets, processes,
+threads, stack frames and variables. It provides standard debug actions such as
+stepping, terminating, etc. <br>
+</p>
+
+<hr>
+
+<h1>Extension Points</h1>
+
+<p>The following extension points are used to support and extend the debug UI.:
+
+<ul>
+ <li><a href="org_eclipse_debug_ui_debugActionGroups.html">org.eclipse.debug.ui.debugActionGroups</a></li>
+ <li><a href="org_eclipse_debug_ui_debugModelPresentations.html">org.eclipse.debug.ui.debugModelPresentations</a></li>
+ <li><a href="org_eclipse_debug_ui_launchConfigurationTabGroups.html">org.eclipse.debug.ui.launchConfigurationTabGroups</a></li>
+ <li><a href="org_eclipse_debug_ui_launchConfigurationTypeImages.html">org.eclipse.debug.ui.launchConfigurationTypeImages</a></li>
+ <li><a href="org_eclipse_debug_ui_launchShortcuts.html">org.eclipse.debug.ui.launchShortcuts</a></li>
+</ul>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugActionGroups.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugActionGroups.html
index 876b4291d..17670ea0f 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugActionGroups.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugActionGroups.html
@@ -1,65 +1,65 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Debug Action Groups</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Debug Action Groups</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.debugActionGroups </p>
-
-<p><b><i>Description: </i></b>This extension point provides a mechanism to specify the visibility of action
-groups. Any view that returns an instance of IDebugView when queried with #getAdapter(IDebugView.class) will
- have its context menu and toolbar affected by the visibility of the action groups.
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT debugActionGroup (action)*</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST debugActionGroup</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; visible&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> - specifies a unique identifier for this debug action group.</li>
- <li><code>name</code> - a translatable name that will be used for the debug action group label.</li>
- <li><code>visible</code> - an optional attribute indicating the visibility of the group. If omitted the group is set to be visible</li>
-</ul>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT action</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST action</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> - the unique identifier of an action that will be added to the debug action group</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a debug action group extension point. In all
-debug views (views that return an instance of IDebugView when queried with #getAdapter(IDebugView.class)), the actions listed will not be visible in the toolbar or context menu of the view. </p>
-
-<pre>
-&lt;extension point = "org.eclipse.debug.ui.debugActionGroups"&gt;
- &lt;debugActionGroup
- id = "org.eclipse.jdt.debug.ui.javaDebugActionGroup"
- visible="false"
- name="Java Debug"&gt;
- &lt;action id="org.eclipse.jdt.ui.actions.RunToLineToolbar"/&gt;
- &lt;action id="org.eclipse.jdt.ui.breakpointViewActions.ShowQualified"/&gt;
- &lt;/debugActionGroup&gt;
-&lt;/extension&gt;
-</pre>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Debug Action Groups</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Debug Action Groups</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.debugActionGroups </p>
+
+<p><b><i>Description: </i></b>This extension point provides a mechanism to specify the visibility of action
+groups. Any view that returns an instance of IDebugView when queried with #getAdapter(IDebugView.class) will
+ have its context menu and toolbar affected by the visibility of the action groups.
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT debugActionGroup (action)*</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST debugActionGroup</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; visible&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> - specifies a unique identifier for this debug action group.</li>
+ <li><code>name</code> - a translatable name that will be used for the debug action group label.</li>
+ <li><code>visible</code> - an optional attribute indicating the visibility of the group. If omitted the group is set to be visible</li>
+</ul>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT action</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST action</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> - the unique identifier of an action that will be added to the debug action group</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a debug action group extension point. In all
+debug views (views that return an instance of IDebugView when queried with #getAdapter(IDebugView.class)), the actions listed will not be visible in the toolbar or context menu of the view. </p>
+
+<pre>
+&lt;extension point = "org.eclipse.debug.ui.debugActionGroups"&gt;
+ &lt;debugActionGroup
+ id = "org.eclipse.jdt.debug.ui.javaDebugActionGroup"
+ visible="false"
+ name="Java Debug"&gt;
+ &lt;action id="org.eclipse.jdt.ui.actions.RunToLineToolbar"/&gt;
+ &lt;action id="org.eclipse.jdt.ui.breakpointViewActions.ShowQualified"/&gt;
+ &lt;/debugActionGroup&gt;
+&lt;/extension&gt;
+</pre>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugModelPresentations.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugModelPresentations.html
index 8690dbdd4..2d5e86a09 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugModelPresentations.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_debugModelPresentations.html
@@ -1,63 +1,63 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Viewer Label Provider Extension Points</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Debug Model Presentation</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.debugModelPresentations</p>
-
-<p><b><i>Description: </i></b>This extension point allows tools to handle the presentation
-aspects of a debug model. A debug model presentation is responsible for providing labels,
-images and editors for elements in a specific debug model.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<p><tt>&nbsp;&nbsp; &lt;!ATTLIST debugModelPresentation</tt> <br>
-<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp; &nbsp;&nbsp;CDATA #REQUIRED</tt> <tt>
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id &nbsp; &nbsp; &nbsp;&nbsp; CDATA #REQUIRED</tt> <tt>
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; detailsViewerConfiguration &nbsp; &nbsp; &nbsp;&nbsp; CDATA #IMPLIED</tt>&gt;
-<ul>
- <li><b>class</b> - fully qualifed name of a Java class that implements the <b>
- org.eclipse.debug.ui.IDebugModelPresentation</b></li>
- <li><strong>id</strong> - the identifier of the debug model this presentation is
- responsible for</li>
- <li><strong>detailsViewerConfiguration</strong> optionally specifies the fully qualified name of the Java class
- that is an instance of <b>org.eclipse.jface.text.source.SourceViewerConfiguration</b>.
- When specified, the source viewer configuration will be used in the "details" area of the
- variables and expressions view when displaying the details of an element from the
- debug model associated with this debug model presentation. When unspecified,
- a default configuration is used.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a view filter extension point: </p>
-
-<pre><tt>&nbsp;&nbsp; &lt;extension</tt>
-<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point = &quot;org.eclipse.debug.ui.debugModelPresentations&quot;&gt;</tt>
-<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;debugModelPresentation</tt>
-<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class = &quot;com.example.JavaModelPresentation&quot;&gt;</tt>
-<tt> id = &quot;com.example.JavaDebugModel&quot;&gt;
- &lt;/debugModelPresentation&gt;</tt>
-<tt>&nbsp;&nbsp; &lt;/extension&gt;</tt></pre>
-
-<p>In the example above, the class <tt>com.example.JavaModelPresentation</tt> will be used
-to render and present debug elements originating from the debug model identified by <b>
-com.example.JavaDebugModel</b>.</p>
-
-<p><b><i>API Information: </i></b>Value of the action attribute <b>class</b> must be a
-fully qualified class name of a Java class that implements <b>
-org.eclipse.debug.ui.IDebugModelPresentation.</b></p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Viewer Label Provider Extension Points</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Debug Model Presentation</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.debugModelPresentations</p>
+
+<p><b><i>Description: </i></b>This extension point allows tools to handle the presentation
+aspects of a debug model. A debug model presentation is responsible for providing labels,
+images and editors for elements in a specific debug model.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<p><tt>&nbsp;&nbsp; &lt;!ATTLIST debugModelPresentation</tt> <br>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp; &nbsp;&nbsp;CDATA #REQUIRED</tt> <tt>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id &nbsp; &nbsp; &nbsp;&nbsp; CDATA #REQUIRED</tt> <tt>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; detailsViewerConfiguration &nbsp; &nbsp; &nbsp;&nbsp; CDATA #IMPLIED</tt>&gt;
+<ul>
+ <li><b>class</b> - fully qualifed name of a Java class that implements the <b>
+ org.eclipse.debug.ui.IDebugModelPresentation</b></li>
+ <li><strong>id</strong> - the identifier of the debug model this presentation is
+ responsible for</li>
+ <li><strong>detailsViewerConfiguration</strong> optionally specifies the fully qualified name of the Java class
+ that is an instance of <b>org.eclipse.jface.text.source.SourceViewerConfiguration</b>.
+ When specified, the source viewer configuration will be used in the "details" area of the
+ variables and expressions view when displaying the details of an element from the
+ debug model associated with this debug model presentation. When unspecified,
+ a default configuration is used.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a view filter extension point: </p>
+
+<pre><tt>&nbsp;&nbsp; &lt;extension</tt>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point = &quot;org.eclipse.debug.ui.debugModelPresentations&quot;&gt;</tt>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;debugModelPresentation</tt>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class = &quot;com.example.JavaModelPresentation&quot;&gt;</tt>
+<tt> id = &quot;com.example.JavaDebugModel&quot;&gt;
+ &lt;/debugModelPresentation&gt;</tt>
+<tt>&nbsp;&nbsp; &lt;/extension&gt;</tt></pre>
+
+<p>In the example above, the class <tt>com.example.JavaModelPresentation</tt> will be used
+to render and present debug elements originating from the debug model identified by <b>
+com.example.JavaDebugModel</b>.</p>
+
+<p><b><i>API Information: </i></b>Value of the action attribute <b>class</b> must be a
+fully qualified class name of a Java class that implements <b>
+org.eclipse.debug.ui.IDebugModelPresentation.</b></p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
index 720e091db..05c37e2ba 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
@@ -1,64 +1,64 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Launch Configuration Tab Groups Extension Point</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Launch Configuration Tab Groups</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.launchConfigurationTabGroups</p>
-
-<p><b><i>Description: </i></b>This extension point provides a
-mechanism for contributing a group of tabs to the launch configuration dialog
-for a type of launch configuration.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationTabGroup</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationTabGroup</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-</pre>
-
-<ul>
-<li><code>id</code> specifies a unique identifier for this launch configuration
- tab group.</li>
-<li><code>type</code> specifies launch configuration type that this tab
- group is applicable to (corresponds to the id of a launch configuration type
- extension).</li>
-<li><code>class</code> specifies a fully qualified name of a Java class
- that implements <code>ILaunchConfigurationTabGroup</code>.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a launch configuration tab group extension point: </p>
-
-<pre>
-&lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
- &lt;launchConfigurationTabGroup
- id="com.example.ExampleTabGroup"
- type="com.example.ExampleLaunchConfigurationTypeIdentifier"
- class="com.example.ExampleLaunchConfigurationTabGroupClass"&gt;
- &lt;/launchConfigurationTabGroup&gt;
-&lt;/extension&gt;
-</pre>
-<p>In the above example, the contributed tab group will be shown in the launch configuration dialog for the launch configuration type
-with identifier <code>com.example.ExampleLaunchConfigurationTypeIdentifier</code>.
-</p>
-
-<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
-qualified name of a Java class that implements the interface <b>
-org.eclipse.debug.ui.ILaunchConfigurationTabGroup</b>.
-</p>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Launch Configuration Tab Groups Extension Point</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Launch Configuration Tab Groups</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.launchConfigurationTabGroups</p>
+
+<p><b><i>Description: </i></b>This extension point provides a
+mechanism for contributing a group of tabs to the launch configuration dialog
+for a type of launch configuration.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationTabGroup</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationTabGroup</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+</pre>
+
+<ul>
+<li><code>id</code> specifies a unique identifier for this launch configuration
+ tab group.</li>
+<li><code>type</code> specifies launch configuration type that this tab
+ group is applicable to (corresponds to the id of a launch configuration type
+ extension).</li>
+<li><code>class</code> specifies a fully qualified name of a Java class
+ that implements <code>ILaunchConfigurationTabGroup</code>.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a launch configuration tab group extension point: </p>
+
+<pre>
+&lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
+ &lt;launchConfigurationTabGroup
+ id="com.example.ExampleTabGroup"
+ type="com.example.ExampleLaunchConfigurationTypeIdentifier"
+ class="com.example.ExampleLaunchConfigurationTabGroupClass"&gt;
+ &lt;/launchConfigurationTabGroup&gt;
+&lt;/extension&gt;
+</pre>
+<p>In the above example, the contributed tab group will be shown in the launch configuration dialog for the launch configuration type
+with identifier <code>com.example.ExampleLaunchConfigurationTypeIdentifier</code>.
+</p>
+
+<p><b><i>API Information: </i></b>Value of the attribute <b>class</b> must be a fully
+qualified name of a Java class that implements the interface <b>
+org.eclipse.debug.ui.ILaunchConfigurationTabGroup</b>.
+</p>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTypeImages.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTypeImages.html
index ef0166731..036e29ef9 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTypeImages.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTypeImages.html
@@ -1,51 +1,51 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>README Launch Configuration Type Images</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<h1 align="center">Launch Configuration Type Images</h1>
-
-<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.launchConfigurationTypeImages </p>
-
-<p><b><i>Description: </i></b>This extension point provides a way to associate an image with
-a launch configuration type.</p>
-
-<p><b><i>Configuration Markup:</i></b> </p>
-
-<pre>
-<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationTypeImage</tt>&gt;
-<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationTypeImage</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configTypeID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
-</pre>
-
-<ul>
- <li><code>id</code> specifies a unique identifier for this launch configuration type image.</li>
- <li><code>configTypeID</code> specifies the fully qualified ID of a launch configuration type.</li>
- <li><code>icon</code> specifies the plugin-relative path of an image file.</li>
-</ul>
-
-<p><b><i>Examples:</i></b> </p>
-
-<p>The following is an example of a launch configuration type image extension point: </p>
-
-<pre>
-&lt;extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"&gt;
- &lt;launchConfigurationTypeImage
- id="com.example.FirstLaunchConfigurationTypeImage"
- configTypeID="com.example.FirstLaunchConfigurationType"
- icon="icons/FirstLaunchConfigurationType.gif"&gt;
- &lt;/launchConfigurationTypeImage&gt;
-&lt;/extension&gt;
-</pre>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
-border="0" width="195" height="12"></a></p>
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>README Launch Configuration Type Images</title>
+</head>
+
+<body link="#0000FF" vlink="#800080">
+
+<h1 align="center">Launch Configuration Type Images</h1>
+
+<p><b><i>Identifier: </i></b>org.eclipse.debug.ui.launchConfigurationTypeImages </p>
+
+<p><b><i>Description: </i></b>This extension point provides a way to associate an image with
+a launch configuration type.</p>
+
+<p><b><i>Configuration Markup:</i></b> </p>
+
+<pre>
+<tt>&nbsp;&nbsp; &lt;!ELEMENT launchConfigurationTypeImage</tt>&gt;
+<tt>&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationTypeImage</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configTypeID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED</tt>&gt;
+</pre>
+
+<ul>
+ <li><code>id</code> specifies a unique identifier for this launch configuration type image.</li>
+ <li><code>configTypeID</code> specifies the fully qualified ID of a launch configuration type.</li>
+ <li><code>icon</code> specifies the plugin-relative path of an image file.</li>
+</ul>
+
+<p><b><i>Examples:</i></b> </p>
+
+<p>The following is an example of a launch configuration type image extension point: </p>
+
+<pre>
+&lt;extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"&gt;
+ &lt;launchConfigurationTypeImage
+ id="com.example.FirstLaunchConfigurationTypeImage"
+ configTypeID="com.example.FirstLaunchConfigurationType"
+ icon="icons/FirstLaunchConfigurationType.gif"&gt;
+ &lt;/launchConfigurationTypeImage&gt;
+&lt;/extension&gt;
+</pre>
+
+<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
+border="0" width="195" height="12"></a></p>
+</body>
+</html>
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 7381b4302..9668947f9 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -1,82 +1,82 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-pluginName=Debug UI
-
-BreakpointsView.name=Breakpoints
-commonTabName=&Common
-ConsolePreferencePage.name=Console
-ConsoleView.name=Console
-CopyToClipboardAction.label=&Copy Stack
-CopyVariablesToClipboardAction.label=Copy &Variables
-DebugActionGroupsExtensionName= Debug Action Groups
-DebugActionGroupsPreferencePage.name=Debug Action Groups
-DebugActionSet.label=Debug
-DebugConfigurations.label=D&ebug...
-DebugDropDownAction.label=Debug
-DebugHistoryMenuAction.label=Debug &History
-DebugLastAction.label=&Debug Last Launched@F11
-DebugModelPresentationExtensionName=Debug Model Presentation
-DebugPerspective.name=Debug
-DebugPreferencePage.name=Debug
-DebugView.name=Debug
-DebugViewsCategory.name=Debug
-DebugWithConfigurationAction.label=Debug &As
-DisableBreakpointsAction.label=&Disable
-DisconnectAction.label=Disconn&ect
-DisconnectAction.tooltip=Disconnect
-EnableBreakpointsAction.label=&Enable
-ExpressionView.name=Expressions
-LaunchActionSet.label=Launch
-LaunchConfigurationTabGroupExtensionName=Launch Configuration Tab Group
-LaunchShortcutsName=Launch Shortcut
-LaunchConfigurationTypeImageExtensionName=Launch Configuration Type Image
-LaunchConfigurationTypePropertyPage.name=Launch Configuration Type
-LaunchConfigurationTypesPreferencePage.name=Launch Configuration Types
-LauncherPropertyPage.name=Launcher
-LaunchHistoryPreferencePage.name=Launch History
-OpenDebugConfigurations.label=De&bug...
-OpenRunConfigurations.label=Ru&n...
-ProcessesView.name=Processes
-RelaunchAction.label=Re&launch
-RemoveAction.label=Rem&ove
-RemoveAllAction.label=Remove A&ll
-RemoveAllBreakpointsAction.tooltip=Remove All Breakpoints
-RemoveAllExpressionsAction.tooltip=Remove All Expressions
-RemoveAllTerminatedAction.label=Remove &All Terminated
-RemoveAllTerminatedAction.tooltip=Remove All Terminated Launches
-RemoveBreakpointAction.tooltip=Remove Selected Breakpoints
-RemoveExpressionAction.tooltip=Remove Selected Expressions
-ResumeAction.label=Resu&me@F8
-ResumeAction.tooltip=Resume
-RunDropDownAction.label=&Run
-RunMenu.label=&Run
-RunLastAction.label=&Run Last Launched@Ctrl+F11
-RunConfigurations.label=R&un Configurations...
-RunHistoryMenuAction.label=R&un History
-RunWithConfigurationAction.label=Run A&s
-SelectAll.label=Select &All
-StepIntoAction.label=Step &Into@F5
-StepIntoAction.tooltip=Step Into
-StepOverAction.label=Step &Over@F6
-StepOverAction.tooltip=Step Over
-StepReturnAction.label=Step Ret&urn@F7
-StepReturnAction.tooltip=Step Return
-SuspendAction.label=&Suspend
-SuspendAction.tooltip=Suspend
-TerminateAction.label=&Terminate
-TerminateAction.tooltip=Terminate
-TerminateAllAction.label=Termi&nate All
-TerminateAndRemoveAction.label=Terminate and Remo&ve
-VariablesView.name=Variables
-VariableViewsPreferencePage.name=Variable Views
-
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+pluginName=Debug UI
+
+BreakpointsView.name=Breakpoints
+commonTabName=&Common
+ConsolePreferencePage.name=Console
+ConsoleView.name=Console
+CopyToClipboardAction.label=&Copy Stack
+CopyVariablesToClipboardAction.label=Copy &Variables
+DebugActionGroupsExtensionName= Debug Action Groups
+DebugActionGroupsPreferencePage.name=Debug Action Groups
+DebugActionSet.label=Debug
+DebugConfigurations.label=D&ebug...
+DebugDropDownAction.label=Debug
+DebugHistoryMenuAction.label=Debug &History
+DebugLastAction.label=&Debug Last Launched@F11
+DebugModelPresentationExtensionName=Debug Model Presentation
+DebugPerspective.name=Debug
+DebugPreferencePage.name=Debug
+DebugView.name=Debug
+DebugViewsCategory.name=Debug
+DebugWithConfigurationAction.label=Debug &As
+DisableBreakpointsAction.label=&Disable
+DisconnectAction.label=Disconn&ect
+DisconnectAction.tooltip=Disconnect
+EnableBreakpointsAction.label=&Enable
+ExpressionView.name=Expressions
+LaunchActionSet.label=Launch
+LaunchConfigurationTabGroupExtensionName=Launch Configuration Tab Group
+LaunchShortcutsName=Launch Shortcut
+LaunchConfigurationTypeImageExtensionName=Launch Configuration Type Image
+LaunchConfigurationTypePropertyPage.name=Launch Configuration Type
+LaunchConfigurationTypesPreferencePage.name=Launch Configuration Types
+LauncherPropertyPage.name=Launcher
+LaunchHistoryPreferencePage.name=Launch History
+OpenDebugConfigurations.label=De&bug...
+OpenRunConfigurations.label=Ru&n...
+ProcessesView.name=Processes
+RelaunchAction.label=Re&launch
+RemoveAction.label=Rem&ove
+RemoveAllAction.label=Remove A&ll
+RemoveAllBreakpointsAction.tooltip=Remove All Breakpoints
+RemoveAllExpressionsAction.tooltip=Remove All Expressions
+RemoveAllTerminatedAction.label=Remove &All Terminated
+RemoveAllTerminatedAction.tooltip=Remove All Terminated Launches
+RemoveBreakpointAction.tooltip=Remove Selected Breakpoints
+RemoveExpressionAction.tooltip=Remove Selected Expressions
+ResumeAction.label=Resu&me@F8
+ResumeAction.tooltip=Resume
+RunDropDownAction.label=&Run
+RunMenu.label=&Run
+RunLastAction.label=&Run Last Launched@Ctrl+F11
+RunConfigurations.label=R&un Configurations...
+RunHistoryMenuAction.label=R&un History
+RunWithConfigurationAction.label=Run A&s
+SelectAll.label=Select &All
+StepIntoAction.label=Step &Into@F5
+StepIntoAction.tooltip=Step Into
+StepOverAction.label=Step &Over@F6
+StepOverAction.tooltip=Step Over
+StepReturnAction.label=Step Ret&urn@F7
+StepReturnAction.tooltip=Step Return
+SuspendAction.label=&Suspend
+SuspendAction.tooltip=Suspend
+TerminateAction.label=&Terminate
+TerminateAction.tooltip=Terminate
+TerminateAllAction.label=Termi&nate All
+TerminateAndRemoveAction.label=Terminate and Remo&ve
+VariablesView.name=Variables
+VariableViewsPreferencePage.name=Variable Views
+
providerName=Eclipse.org \ No newline at end of file
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 9bf65bbf0..4459f65f0 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -1,705 +1,705 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.debug.ui"
- name="%pluginName"
- version="2.0.0"
- provider-name="%providerName"
- class="org.eclipse.debug.internal.ui.DebugUIPlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.debug.core"/>
-</requires>
-
-<!-- Runtime -->
-<runtime>
- <library name="dtui.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<!-- Extension points -->
-<extension-point id="debugModelPresentations" name="%DebugModelPresentationExtensionName"/>
-<extension-point id="launchShortcuts" name="%LaunchShortcutsName"/>
-<extension-point id="launchConfigurationTabGroups" name="%LaunchConfigurationTabGroupExtensionName"/>
-<extension-point id="launchConfigurationTypeImages" name="%LaunchConfigurationTypeImageExtensionName"/>
-<extension-point id="debugActionGroups" name="%DebugActionGroupsExtensionName"/>
-
-<!-- Extensions -->
-<extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="%DebugPerspective.name"
- icon="icons/full/cview16/debug_persp.gif"
- class="org.eclipse.debug.internal.ui.DebugPerspectiveFactory"
- id="org.eclipse.debug.ui.DebugPerspective">
- </perspective>
-</extension>
-<extension
- point="org.eclipse.ui.views">
- <category
- name="%DebugViewsCategory.name"
- id="org.eclipse.debug.ui">
- </category>
- <view
- name="%DebugView.name"
- icon="icons/full/cview16/debug_view.gif"
- category="org.eclipse.debug.ui"
- class="org.eclipse.debug.internal.ui.views.launch.LaunchView"
- id="org.eclipse.debug.ui.DebugView">
- </view>
- <view
- name="%BreakpointsView.name"
- icon="icons/full/cview16/breakpoint_view.gif"
- category="org.eclipse.debug.ui"
- class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView"
- id="org.eclipse.debug.ui.BreakpointView">
- </view>
- <view
- name="%VariablesView.name"
- icon="icons/full/cview16/variable_view.gif"
- category="org.eclipse.debug.ui"
- class="org.eclipse.debug.internal.ui.views.variables.VariablesView"
- id="org.eclipse.debug.ui.VariableView">
- </view>
- <view
- name="%ExpressionView.name"
- icon="icons/full/cview16/watchlist_view.gif"
- category="org.eclipse.debug.ui"
- class="org.eclipse.debug.internal.ui.views.expression.ExpressionView"
- id="org.eclipse.debug.ui.ExpressionView">
- </view>
- <view
- name="%ConsoleView.name"
- icon="icons/full/cview16/console_view.gif"
- category="org.eclipse.debug.ui"
- class="org.eclipse.debug.internal.ui.views.console.ConsoleView"
- id="org.eclipse.debug.ui.ConsoleView">
- </view>
-</extension>
-<extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="%DebugPreferencePage.name"
- class="org.eclipse.debug.internal.ui.preferences.DebugPreferencePage"
- id="org.eclipse.debug.ui.DebugPreferencePage">
- </page>
- <page
- name="%ConsolePreferencePage.name"
- category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.debug.internal.ui.preferences.ConsolePreferencePage"
- id="org.eclipse.debug.ui.ConsolePreferencePage">
- </page>
- <page
- name="%VariableViewsPreferencePage.name"
- category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.debug.internal.ui.preferences.VariableViewsPreferencePage"
- id="org.eclipse.debug.ui.VariableViewsPreferencePage">
- </page>
- <page
- name="%LaunchHistoryPreferencePage.name"
- category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.debug.internal.ui.preferences.LaunchHistoryPreferencePage"
- id="org.eclipse.debug.ui.LaunchHistoryPreferencePage">
- </page>
- <page
- name="%DebugActionGroupsPreferencePage.name"
- category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.debug.internal.ui.preferences.DebugActionGroupsPreferencePage"
- id="org.eclipse.debug.ui.DebugActionGroupsPreferencePage">
- </page>
-</extension>
-<extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="%DebugActionSet.label"
- visible="false"
- id="org.eclipse.debug.ui.debugActionSet">
- <menu
- label="%RunMenu.label"
- id="org.eclipse.ui.run"
- path="additions">
- <separator name="stepGroup"/>
- <groupMarker name="stepIntoGroup"/>
- <groupMarker name="stepOverGroup"/>
- <groupMarker name="stepReturnGroup"/>
- <groupMarker name="emptyStepGroup"/>
- </menu>
- <action
- label="%StepReturnAction.label"
- icon="icons/full/elcl16/stepreturn_co.gif"
- disabledIcon="icons/full/dlcl16/stepreturn_co.gif"
- hoverIcon="icons/full/clcl16/stepreturn_co.gif"
- helpContextId="step_return_action_context"
- class="org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
- menubarPath="org.eclipse.ui.run/stepReturnGroup"
- id="org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate">
- </action>
- <action
- label="%StepOverAction.label"
- icon="icons/full/elcl16/stepover_co.gif"
- disabledIcon="icons/full/dlcl16/stepover_co.gif"
- hoverIcon="icons/full/clcl16/stepover_co.gif"
- helpContextId="step_over_action_context"
- class="org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
- menubarPath="org.eclipse.ui.run/stepOverGroup"
- id="org.eclipse.debug.internal.ui.actions.StepOverActionDelegate">
- </action>
- <action
- label="%StepIntoAction.label"
- icon="icons/full/elcl16/stepinto_co.gif"
- disabledIcon="icons/full/dlcl16/stepinto_co.gif"
- hoverIcon="icons/full/clcl16/stepinto_co.gif"
- helpContextId="step_into_action_context"
- class="org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
- menubarPath="org.eclipse.ui.run/stepIntoGroup"
- id="org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate">
- </action>
- <action
- label="%TerminateAction.label"
- icon="icons/full/elcl16/terminate_co.gif"
- disabledIcon="icons/full/dlcl16/terminate_co.gif"
- hoverIcon="icons/full/clcl16/terminate_co.gif"
- helpContextId="terminate_action_context"
- class="org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
- menubarPath="org.eclipse.ui.run/stepGroup"
- id="org.eclipse.debug.internal.ui.actions.TerminateActionDelegate">
- </action>
- <action
- label="%SuspendAction.label"
- icon="icons/full/elcl16/suspend_co.gif"
- disabledIcon="icons/full/dlcl16/suspend_co.gif"
- hoverIcon="icons/full/clcl16/suspend_co.gif"
- helpContextId="suspend_action_context"
- class="org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
- menubarPath="org.eclipse.ui.run/stepGroup"
- id="org.eclipse.debug.internal.ui.actions.SuspendActionDelegate">
- </action>
- <action
- label="%ResumeAction.label"
- icon="icons/full/elcl16/resume_co.gif"
- disabledIcon="icons/full/dlcl16/resume_co.gif"
- hoverIcon="icons/full/clcl16/resume_co.gif"
- helpContextId="resume_action_context"
- class="org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
- menubarPath="org.eclipse.ui.run/stepGroup"
- id="org.eclipse.debug.internal.ui.actions.ResumeActionDelegate">
- </action>
- </actionSet>
-</extension>
-<extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="%LaunchActionSet.label"
- visible="false"
- id="org.eclipse.debug.ui.launchActionSet">
- <menu
- label="%RunMenu.label"
- id="org.eclipse.ui.run"
- path="additions">
- <separator name="relaunchGroup"/>
- <separator name="runGroup"/>
- <separator name="debugGroup"/>
- <separator name="emptyLaunchGroup"/>
- </menu>
- <action
- label="%OpenRunConfigurations.label"
- class="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations"
- menubarPath="org.eclipse.ui.run/runGroup"
- helpContextId="open_run_configurations_action_context"
- id="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations">
- </action>
- <action
- label="%RunWithConfigurationAction.label"
- class="org.eclipse.debug.internal.ui.actions.RunWithConfigurationAction"
- menubarPath="org.eclipse.ui.run/runGroup"
- helpContextId="run_with_configuration_action_context"
- id="org.eclipse.debug.internal.ui.actions.RunWithConfigurationAction">
- </action>
- <action
- label="%RunHistoryMenuAction.label"
- class="org.eclipse.debug.internal.ui.actions.RunHistoryMenuAction"
- menubarPath="org.eclipse.ui.run/runGroup"
- helpContextId="run_history_menu_action_context"
- id="org.eclipse.debug.internal.ui.actions.RunHistoryMenuAction">
- </action>
- <action
- label="%DebugLastAction.label"
- icon="icons/full/elcl16/debuglast_co.gif"
- disabledIcon="icons/full/dlcl16/debuglast_co.gif"
- hoverIcon="icons/full/clcl16/debuglast_co.gif"
- class="org.eclipse.debug.internal.ui.actions.DebugLastAction"
- menubarPath="org.eclipse.ui.run/relaunchGroup"
- helpContextId="debug_last_action_context"
- id="org.eclipse.debug.internal.ui.actions.DebugLastAction">
- </action>
- <action
- label="%RunLastAction.label"
- icon="icons/full/elcl16/runlast_co.gif"
- disabledIcon="icons/full/dlcl16/runlast_co.gif"
- hoverIcon="icons/full/clcl16/runlast_co.gif"
- helpContextId="run_last_action_context"
- class="org.eclipse.debug.internal.ui.actions.RunLastAction"
- menubarPath="org.eclipse.ui.run/relaunchGroup"
- id="org.eclipse.debug.internal.ui.actions.RunLastAction">
- </action>
- <action
- label="%RunDropDownAction.label"
- pulldown="true"
- icon="icons/full/etool16/run_exc.gif"
- disabledIcon="icons/full/dtool16/run_exc.gif"
- hoverIcon="icons/full/ctool16/run_exc.gif"
- helpContextId="run_action_context"
- class="org.eclipse.debug.internal.ui.actions.RunDropDownAction"
- toolbarPath="debug"
- id="org.eclipse.debug.internal.ui.actions.RunDropDownAction">
- </action>
- <action
- label="%OpenDebugConfigurations.label"
- class="org.eclipse.debug.internal.ui.actions.OpenDebugConfigurations"
- menubarPath="org.eclipse.ui.run/debugGroup"
- helpContextId="open_debug_configurations_action_context"
- id="org.eclipse.debug.internal.ui.actions.OpenDebugConfigurations">
- </action>
- <action
- label="%DebugWithConfigurationAction.label"
- class="org.eclipse.debug.internal.ui.actions.DebugWithConfigurationAction"
- menubarPath="org.eclipse.ui.run/debugGroup"
- helpContextId="debug_with_configuration_action_context"
- id="org.eclipse.debug.internal.ui.actions.DebugWithConfigurationAction">
- </action>
- <action
- label="%DebugHistoryMenuAction.label"
- class="org.eclipse.debug.internal.ui.actions.DebugHistoryMenuAction"
- menubarPath="org.eclipse.ui.run/debugGroup"
- helpContextId="debug_history_menu_action_context"
- id="org.eclipse.debug.internal.ui.actions.DebugHistoryMenuAction">
- </action>
- <action
- label="%DebugDropDownAction.label"
- pulldown="true"
- icon="icons/full/etool16/debug_exc.gif"
- disabledIcon="icons/full/dtool16/debug_exc.gif"
- hoverIcon="icons/full/ctool16/debug_exc.gif"
- helpContextId="debug_action_context"
- class="org.eclipse.debug.internal.ui.actions.DebugDropDownAction"
- toolbarPath="debug"
- id="org.eclipse.debug.internal.ui.actions.DebugDropDownAction">
- </action>
- </actionSet>
-</extension>
-
-<extension point = "org.eclipse.ui.viewActions">
-<!-- Contributions to Debug View Toolbar -->
- <viewContribution
- id = "org.eclipse.debug.ui.debugview.toolbar"
- targetID = "org.eclipse.debug.ui.DebugView">
-<!-- Thread Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.removeAllTerminated"
- toolbarPath = "threadGroup"
- icon = "icons/full/elcl16/rem_all_co.gif"
- disabledIcon="icons/full/dlcl16/rem_all_co.gif"
- hoverIcon="icons/full/clcl16/rem_all_co.gif"
- helpContextId = "remove_all_terminated_action_context"
- class = "org.eclipse.debug.internal.ui.actions.RemoveAllTerminatedAction"
- tooltip="%RemoveAllTerminatedAction.tooltip"
- label="%RemoveAllTerminatedAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.disconnect"
- toolbarPath = "threadGroup"
- icon = "icons/full/elcl16/disconnect_co.gif"
- disabledIcon="icons/full/dlcl16/disconnect_co.gif"
- hoverIcon="icons/full/clcl16/disconnect_co.gif"
- helpContextId = "disconnect_action_context"
- class = "org.eclipse.debug.internal.ui.actions.DisconnectActionDelegate"
- tooltip="%DisconnectAction.tooltip"
- label="%DisconnectAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.terminate"
- toolbarPath = "threadGroup"
- icon = "icons/full/elcl16/terminate_co.gif"
- disabledIcon= "icons/full/dlcl16/terminate_co.gif"
- hoverIcon= "icons/full/clcl16/terminate_co.gif"
- helpContextId = "terminate_action_context"
- class = "org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
- tooltip="%TerminateAction.tooltip"
- label="%TerminateAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.suspend"
- toolbarPath = "threadGroup"
- icon = "icons/full/elcl16/suspend_co.gif"
- disabledIcon= "icons/full/dlcl16/suspend_co.gif"
- hoverIcon= "icons/full/clcl16/suspend_co.gif"
- helpContextId = "suspend_action_context"
- class = "org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
- tooltip="%SuspendAction.tooltip"
- label="%SuspendAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.resume"
- toolbarPath = "threadGroup"
- icon = "icons/full/elcl16/resume_co.gif"
- disabledIcon= "icons/full/dlcl16/resume_co.gif"
- hoverIcon= "icons/full/clcl16/resume_co.gif"
- helpContextId = "resume_action_context"
- class = "org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
- tooltip="%ResumeAction.tooltip"
- label="%ResumeAction.label">
- </action>
-<!-- Step Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.stepReturn"
- toolbarPath = "stepReturnGroup"
- icon = "icons/full/elcl16/stepreturn_co.gif"
- disabledIcon= "icons/full/dlcl16/stepreturn_co.gif"
- hoverIcon= "icons/full/clcl16/stepreturn_co.gif"
- helpContextId = "step_return_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
- tooltip="%StepReturnAction.tooltip"
- label="%StepReturnAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.stepOver"
- toolbarPath = "stepOverGroup"
- icon = "icons/full/elcl16/stepover_co.gif"
- disabledIcon= "icons/full/dlcl16/stepover_co.gif"
- hoverIcon= "icons/full/clcl16/stepover_co.gif"
- helpContextId = "step_over_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
- tooltip="%StepOverAction.tooltip"
- label="%StepOverAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.toolbar.stepInto"
- toolbarPath = "stepIntoGroup"
- icon = "icons/full/elcl16/stepinto_co.gif"
- disabledIcon= "icons/full/dlcl16/stepinto_co.gif"
- hoverIcon= "icons/full/clcl16/stepinto_co.gif"
- helpContextId = "step_into_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
- tooltip="%StepIntoAction.tooltip"
- label="%StepIntoAction.label">
- </action>
- </viewContribution>
-<!-- Contributions to Console View Toolbar -->
- <viewContribution
- id = "org.eclipse.debug.ui.consoleview.toolbar"
- targetID = "org.eclipse.debug.ui.ConsoleView">
- <action
- id = "org.eclipse.debug.ui.consoleView.toolbar.terminate"
- icon = "icons/full/elcl16/terminate_co.gif"
- disabledIcon= "icons/full/dlcl16/terminate_co.gif"
- hoverIcon= "icons/full/clcl16/terminate_co.gif"
- helpContextId = "console_terminate_action_context"
- toolbarPath = "launchGroup"
- class = "org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate"
- tooltip="%TerminateAction.tooltip"
- label="%TerminateAction.label">
- </action>
- </viewContribution>
-<!-- Contributions to Breakpoints View Toolbar -->
- <viewContribution
- id = "org.eclipse.debug.ui.breakpointsview.toolbar"
- targetID = "org.eclipse.debug.ui.BreakpointView">
- <action
- id = "org.eclipse.debug.ui.breakpointsView.toolbar.removeAll"
- icon = "icons/full/elcl16/rem_all_co.gif"
- disabledIcon= "icons/full/dlcl16/rem_all_co.gif"
- hoverIcon= "icons/full/clcl16/rem_all_co.gif"
- helpContextId = "remove_all_breakpoints_action_context"
- toolbarPath = "breakpointGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveAllBreakpointsAction"
- tooltip="%RemoveAllBreakpointsAction.tooltip"
- label="%RemoveAllAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.breakpointsView.toolbar.remove"
- icon = "icons/full/elcl16/rem_co.gif"
- disabledIcon= "icons/full/dlcl16/rem_co.gif"
- hoverIcon= "icons/full/clcl16/rem_co.gif"
- helpContextId = "remove_breakpoint_action_context"
- toolbarPath = "breakpointGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveBreakpointAction"
- tooltip="%RemoveBreakpointAction.tooltip"
- label="%RemoveAction.label">
- </action>
- </viewContribution>
-<!-- Contributions to Expression View Toolbar -->
- <viewContribution
- id = "org.eclipse.debug.ui.expressionsView.toolbar"
- targetID = "org.eclipse.debug.ui.ExpressionView">
- <action
- id = "org.eclipse.debug.ui.expresssionsView.toolbar.removeAll"
- icon = "icons/full/elcl16/rem_all_co.gif"
- disabledIcon= "icons/full/dlcl16/rem_all_co.gif"
- hoverIcon= "icons/full/clcl16/rem_all_co.gif"
- helpContextId = "remove_all_expressions_action_context"
- toolbarPath = "expressionGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveAllExpressionsAction"
- tooltip="%RemoveAllExpressionsAction.tooltip"
- label="%RemoveAllAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.expresssionsView.toolbar.remove"
- icon = "icons/full/elcl16/rem_co.gif"
- disabledIcon= "icons/full/dlcl16/rem_co.gif"
- hoverIcon= "icons/full/clcl16/rem_co.gif"
- helpContextId = "remove_expression_action_context"
- toolbarPath = "expressionGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveExpressionAction"
- tooltip="%RemoveExpressionAction.tooltip"
- label="%RemoveAction.label">
- </action>
- </viewContribution>
-</extension>
-
-<extension point = "org.eclipse.ui.popupMenus">
-<!-- Contributions to Debug View Popup Menu -->
- <viewerContribution
- id = "org.eclipse.debug.ui.debugview.popupMenu"
- targetID = "org.eclipse.debug.ui.DebugView">
-<!-- Edit Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.copyToClipboard"
- menubarPath = "editGroup"
- icon = "icons/full/clcl16/copy_edit_co.gif"
- helpContextId = "copy_to_clipboard_action_context"
- class = "org.eclipse.debug.internal.ui.actions.CopyToClipboardActionDelegate"
- label="%CopyToClipboardAction.label">
- </action>
-<!-- Launch Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"
- menubarPath = "launchGroup"
- helpContextId = "terminate_all_action_context"
- icon = "icons/full/clcl16/terminate_all_co.gif"
- class = "org.eclipse.debug.internal.ui.actions.TerminateAllAction"
- label="%TerminateAllAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.relaunch"
- menubarPath = "launchGroup"
- icon = "icons/full/clcl16/runlast_co.gif"
- helpContextId = "relaunch_action_context"
- class = "org.eclipse.debug.internal.ui.actions.RelaunchActionDelegate"
- label="%RelaunchAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.terminateAndRemove"
- menubarPath = "launchGroup"
- helpContextId = "terminate_and_remove_action_context"
- icon = "icons/full/clcl16/terminate_rem_co.gif"
- class = "org.eclipse.debug.internal.ui.actions.TerminateAndRemoveActionDelegate"
- label="%TerminateAndRemoveAction.label">
- </action>
-<!-- Thread Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.removeAllTerminated"
- menubarPath = "launchGroup"
- icon = "icons/full/clcl16/rem_all_co.gif"
- helpContextId = "remove_all_terminated_action_context"
- class = "org.eclipse.debug.internal.ui.actions.RemoveAllTerminatedAction"
- label="%RemoveAllTerminatedAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.disconnect"
- menubarPath = "threadGroup"
- icon = "icons/full/clcl16/disconnect_co.gif"
- helpContextId = "disconnect_action_context"
- class = "org.eclipse.debug.internal.ui.actions.DisconnectActionDelegate"
- label="%DisconnectAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.terminate"
- menubarPath = "threadGroup"
- icon = "icons/full/clcl16/terminate_co.gif"
- helpContextId = "terminate_action_context"
- class = "org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
- label="%TerminateAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.suspend"
- menubarPath = "threadGroup"
- icon = "icons/full/clcl16/suspend_co.gif"
- helpContextId = "suspend_action_context"
- class = "org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
- label="%SuspendAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.resume"
- menubarPath = "threadGroup"
- icon = "icons/full/clcl16/resume_co.gif"
- helpContextId = "resume_action_context"
- class = "org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
- label="%ResumeAction.label">
- </action>
-<!-- Step Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.stepReturn"
- menubarPath = "stepReturnGroup"
- icon = "icons/full/clcl16/stepreturn_co.gif"
- helpContextId = "step_return_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
- label="%StepReturnAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.stepOver"
- menubarPath = "stepOverGroup"
- icon = "icons/full/clcl16/stepover_co.gif"
- helpContextId = "step_over_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
- label="%StepOverAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.stepInto"
- menubarPath = "stepIntoGroup"
- icon = "icons/full/clcl16/stepinto_co.gif"
- helpContextId = "step_into_action_context"
- class = "org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
- label="%StepIntoAction.label">
- </action>
- </viewerContribution>
- <!-- Contributions to Breakpoints View Popup Menu -->
- <viewerContribution
- id = "org.eclipse.debug.ui.breakpointview.popupMenu"
- targetID = "org.eclipse.debug.ui.BreakpointView">
- <action
- id="org.eclipse.debug.ui.actions.RemoveAllBreakpoints"
- icon = "icons/full/clcl16/rem_all_co.gif"
- label="%RemoveAllAction.label"
- menubarPath="breakpointGroup"
- helpContextId = "remove_all_breakpoints_action_context"
- class="org.eclipse.debug.internal.ui.actions.RemoveAllBreakpointsAction">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.RemoveBreakpoint"
- label="%RemoveAction.label"
- icon = "icons/full/clcl16/rem_co.gif"
- menubarPath="breakpointGroup"
- helpContextId = "remove_breakpoint_action_context"
- class="org.eclipse.debug.internal.ui.actions.RemoveBreakpointAction">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.DisableBreakpoint"
- label="%DisableBreakpointsAction.label"
- icon="icons/full/clcl16/disabled_co.gif"
- menubarPath="breakpointGroup"
- helpContextId = "disable_breakpoint_action_context"
- class="org.eclipse.debug.internal.ui.actions.DisableBreakpointsAction"
- enablesFor="2+">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.EnableBreakpoint"
- label="%EnableBreakpointsAction.label"
- icon="icons/full/clcl16/enabled_co.gif"
- menubarPath="breakpointGroup"
- helpContextId = "enable_breakpoint_action_context"
- class="org.eclipse.debug.internal.ui.actions.EnableBreakpointsAction"
- enablesFor="2+">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.SelectAllBreakpointsAction"
- label="%SelectAll.label"
- menubarPath="breakpointGroup"
- helpContextId = "select_all_breakpoints_action_context"
- class="org.eclipse.debug.internal.ui.actions.SelectAllBreakpointsAction">
- </action>
- </viewerContribution>
-<!-- Contributions to Variables View Popup Menu -->
- <viewerContribution
- id = "org.eclipse.debug.ui.variablesView.popupMenu"
- targetID = "org.eclipse.debug.ui.VariableView">
- <!-- Variable Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.copyVariablesToClipboard"
- menubarPath = "variableGroup"
- icon = "icons/full/clcl16/copy_edit_co.gif"
- helpContextId = "copy_variables_to_clipboard_action_context"
- class = "org.eclipse.debug.internal.ui.actions.CopyVariablesToClipboardActionDelegate"
- label="%CopyVariablesToClipboardAction.label">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.SelectAllVariablesAction"
- label="%SelectAll.label"
- menubarPath="variableGroup"
- helpContextId = "select_all_variables_action_context"
- class="org.eclipse.debug.internal.ui.actions.SelectAllVariablesAction">
- </action>
- </viewerContribution>
-<!-- Contributions to Expression View Popup Menu -->
- <viewerContribution
- id = "org.eclipse.debug.ui.expressionView.popupMenu"
- targetID = "org.eclipse.debug.ui.ExpressionView">
- <!-- Expression Group -->
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.removeAllExpressionsAction"
- menubarPath = "expressionGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveAllExpressionsAction"
- icon = "icons/full/clcl16/rem_all_co.gif"
- helpContextId = "remove_all_expressions_action_context"
- label="%RemoveAllAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.removeExpressionAction"
- menubarPath = "expressionGroup"
- class = "org.eclipse.debug.internal.ui.actions.RemoveExpressionAction"
- icon = "icons/full/clcl16/rem_co.gif"
- helpContextId = "remove_expression_action_context"
- label="%RemoveAction.label">
- </action>
- <action
- id = "org.eclipse.debug.ui.debugview.popupMenu.copyVariablesToClipboard"
- menubarPath = "expressionGroup"
- icon = "icons/full/clcl16/copy_edit_co.gif"
- helpContextId = "copy_variables_to_clipboard_action_context"
- class = "org.eclipse.debug.internal.ui.actions.CopyVariablesToClipboardActionDelegate"
- label="%CopyVariablesToClipboardAction.label">
- </action>
- <action
- id="org.eclipse.debug.ui.actions.SelectAllExpressionsAction"
- label="%SelectAll.label"
- menubarPath="expressionGroup"
- helpContextId = "select_all_expressions_action_context"
- class="org.eclipse.debug.internal.ui.actions.SelectAllExpressionsAction">
- </action>
- </viewerContribution>
-<!-- Contributions to Console View popup menu -->
- <viewerContribution
- id = "org.eclipse.debug.ui.consoleview.popupMenu"
- targetID = "org.eclipse.debug.ui.ConsoleView">
- <action
- id = "org.eclipse.debug.ui.consoleView.popupMenu.terminate"
- icon = "icons/full/clcl16/terminate_co.gif"
- menubarPath = "additions"
- helpContextId = "console_terminate_action_context"
- class = "org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate"
- label="%TerminateAction.label">
- </action>
- </viewerContribution>
-</extension>
-
-<extension
- id="instructionPointer"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- <persistent
- value="false">
- </persistent>
-</extension>
-
-<extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.debug.ui.debugActionSet">
- <part id="org.eclipse.debug.ui.DebugView"/>
- </actionSetPartAssociation>
-</extension>
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File written by PDE 1.0 -->
+<plugin
+ id="org.eclipse.debug.ui"
+ name="%pluginName"
+ version="2.0.0"
+ provider-name="%providerName"
+ class="org.eclipse.debug.internal.ui.DebugUIPlugin">
+<!-- Required plugins -->
+<requires>
+ <import plugin="org.apache.xerces"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.debug.core"/>
+</requires>
+
+<!-- Runtime -->
+<runtime>
+ <library name="dtui.jar">
+ <export name="*"/>
+ </library>
+</runtime>
+
+<!-- Extension points -->
+<extension-point id="debugModelPresentations" name="%DebugModelPresentationExtensionName"/>
+<extension-point id="launchShortcuts" name="%LaunchShortcutsName"/>
+<extension-point id="launchConfigurationTabGroups" name="%LaunchConfigurationTabGroupExtensionName"/>
+<extension-point id="launchConfigurationTypeImages" name="%LaunchConfigurationTypeImageExtensionName"/>
+<extension-point id="debugActionGroups" name="%DebugActionGroupsExtensionName"/>
+
+<!-- Extensions -->
+<extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="%DebugPerspective.name"
+ icon="icons/full/cview16/debug_persp.gif"
+ class="org.eclipse.debug.internal.ui.DebugPerspectiveFactory"
+ id="org.eclipse.debug.ui.DebugPerspective">
+ </perspective>
+</extension>
+<extension
+ point="org.eclipse.ui.views">
+ <category
+ name="%DebugViewsCategory.name"
+ id="org.eclipse.debug.ui">
+ </category>
+ <view
+ name="%DebugView.name"
+ icon="icons/full/cview16/debug_view.gif"
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.debug.internal.ui.views.launch.LaunchView"
+ id="org.eclipse.debug.ui.DebugView">
+ </view>
+ <view
+ name="%BreakpointsView.name"
+ icon="icons/full/cview16/breakpoint_view.gif"
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView"
+ id="org.eclipse.debug.ui.BreakpointView">
+ </view>
+ <view
+ name="%VariablesView.name"
+ icon="icons/full/cview16/variable_view.gif"
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.debug.internal.ui.views.variables.VariablesView"
+ id="org.eclipse.debug.ui.VariableView">
+ </view>
+ <view
+ name="%ExpressionView.name"
+ icon="icons/full/cview16/watchlist_view.gif"
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.debug.internal.ui.views.expression.ExpressionView"
+ id="org.eclipse.debug.ui.ExpressionView">
+ </view>
+ <view
+ name="%ConsoleView.name"
+ icon="icons/full/cview16/console_view.gif"
+ category="org.eclipse.debug.ui"
+ class="org.eclipse.debug.internal.ui.views.console.ConsoleView"
+ id="org.eclipse.debug.ui.ConsoleView">
+ </view>
+</extension>
+<extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%DebugPreferencePage.name"
+ class="org.eclipse.debug.internal.ui.preferences.DebugPreferencePage"
+ id="org.eclipse.debug.ui.DebugPreferencePage">
+ </page>
+ <page
+ name="%ConsolePreferencePage.name"
+ category="org.eclipse.debug.ui.DebugPreferencePage"
+ class="org.eclipse.debug.internal.ui.preferences.ConsolePreferencePage"
+ id="org.eclipse.debug.ui.ConsolePreferencePage">
+ </page>
+ <page
+ name="%VariableViewsPreferencePage.name"
+ category="org.eclipse.debug.ui.DebugPreferencePage"
+ class="org.eclipse.debug.internal.ui.preferences.VariableViewsPreferencePage"
+ id="org.eclipse.debug.ui.VariableViewsPreferencePage">
+ </page>
+ <page
+ name="%LaunchHistoryPreferencePage.name"
+ category="org.eclipse.debug.ui.DebugPreferencePage"
+ class="org.eclipse.debug.internal.ui.preferences.LaunchHistoryPreferencePage"
+ id="org.eclipse.debug.ui.LaunchHistoryPreferencePage">
+ </page>
+ <page
+ name="%DebugActionGroupsPreferencePage.name"
+ category="org.eclipse.debug.ui.DebugPreferencePage"
+ class="org.eclipse.debug.internal.ui.preferences.DebugActionGroupsPreferencePage"
+ id="org.eclipse.debug.ui.DebugActionGroupsPreferencePage">
+ </page>
+</extension>
+<extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%DebugActionSet.label"
+ visible="false"
+ id="org.eclipse.debug.ui.debugActionSet">
+ <menu
+ label="%RunMenu.label"
+ id="org.eclipse.ui.run"
+ path="additions">
+ <separator name="stepGroup"/>
+ <groupMarker name="stepIntoGroup"/>
+ <groupMarker name="stepOverGroup"/>
+ <groupMarker name="stepReturnGroup"/>
+ <groupMarker name="emptyStepGroup"/>
+ </menu>
+ <action
+ label="%StepReturnAction.label"
+ icon="icons/full/elcl16/stepreturn_co.gif"
+ disabledIcon="icons/full/dlcl16/stepreturn_co.gif"
+ hoverIcon="icons/full/clcl16/stepreturn_co.gif"
+ helpContextId="step_return_action_context"
+ class="org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepReturnGroup"
+ id="org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate">
+ </action>
+ <action
+ label="%StepOverAction.label"
+ icon="icons/full/elcl16/stepover_co.gif"
+ disabledIcon="icons/full/dlcl16/stepover_co.gif"
+ hoverIcon="icons/full/clcl16/stepover_co.gif"
+ helpContextId="step_over_action_context"
+ class="org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepOverGroup"
+ id="org.eclipse.debug.internal.ui.actions.StepOverActionDelegate">
+ </action>
+ <action
+ label="%StepIntoAction.label"
+ icon="icons/full/elcl16/stepinto_co.gif"
+ disabledIcon="icons/full/dlcl16/stepinto_co.gif"
+ hoverIcon="icons/full/clcl16/stepinto_co.gif"
+ helpContextId="step_into_action_context"
+ class="org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepIntoGroup"
+ id="org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate">
+ </action>
+ <action
+ label="%TerminateAction.label"
+ icon="icons/full/elcl16/terminate_co.gif"
+ disabledIcon="icons/full/dlcl16/terminate_co.gif"
+ hoverIcon="icons/full/clcl16/terminate_co.gif"
+ helpContextId="terminate_action_context"
+ class="org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepGroup"
+ id="org.eclipse.debug.internal.ui.actions.TerminateActionDelegate">
+ </action>
+ <action
+ label="%SuspendAction.label"
+ icon="icons/full/elcl16/suspend_co.gif"
+ disabledIcon="icons/full/dlcl16/suspend_co.gif"
+ hoverIcon="icons/full/clcl16/suspend_co.gif"
+ helpContextId="suspend_action_context"
+ class="org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepGroup"
+ id="org.eclipse.debug.internal.ui.actions.SuspendActionDelegate">
+ </action>
+ <action
+ label="%ResumeAction.label"
+ icon="icons/full/elcl16/resume_co.gif"
+ disabledIcon="icons/full/dlcl16/resume_co.gif"
+ hoverIcon="icons/full/clcl16/resume_co.gif"
+ helpContextId="resume_action_context"
+ class="org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
+ menubarPath="org.eclipse.ui.run/stepGroup"
+ id="org.eclipse.debug.internal.ui.actions.ResumeActionDelegate">
+ </action>
+ </actionSet>
+</extension>
+<extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%LaunchActionSet.label"
+ visible="false"
+ id="org.eclipse.debug.ui.launchActionSet">
+ <menu
+ label="%RunMenu.label"
+ id="org.eclipse.ui.run"
+ path="additions">
+ <separator name="relaunchGroup"/>
+ <separator name="runGroup"/>
+ <separator name="debugGroup"/>
+ <separator name="emptyLaunchGroup"/>
+ </menu>
+ <action
+ label="%OpenRunConfigurations.label"
+ class="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations"
+ menubarPath="org.eclipse.ui.run/runGroup"
+ helpContextId="open_run_configurations_action_context"
+ id="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations">
+ </action>
+ <action
+ label="%RunWithConfigurationAction.label"
+ class="org.eclipse.debug.internal.ui.actions.RunWithConfigurationAction"
+ menubarPath="org.eclipse.ui.run/runGroup"
+ helpContextId="run_with_configuration_action_context"
+ id="org.eclipse.debug.internal.ui.actions.RunWithConfigurationAction">
+ </action>
+ <action
+ label="%RunHistoryMenuAction.label"
+ class="org.eclipse.debug.internal.ui.actions.RunHistoryMenuAction"
+ menubarPath="org.eclipse.ui.run/runGroup"
+ helpContextId="run_history_menu_action_context"
+ id="org.eclipse.debug.internal.ui.actions.RunHistoryMenuAction">
+ </action>
+ <action
+ label="%DebugLastAction.label"
+ icon="icons/full/elcl16/debuglast_co.gif"
+ disabledIcon="icons/full/dlcl16/debuglast_co.gif"
+ hoverIcon="icons/full/clcl16/debuglast_co.gif"
+ class="org.eclipse.debug.internal.ui.actions.DebugLastAction"
+ menubarPath="org.eclipse.ui.run/relaunchGroup"
+ helpContextId="debug_last_action_context"
+ id="org.eclipse.debug.internal.ui.actions.DebugLastAction">
+ </action>
+ <action
+ label="%RunLastAction.label"
+ icon="icons/full/elcl16/runlast_co.gif"
+ disabledIcon="icons/full/dlcl16/runlast_co.gif"
+ hoverIcon="icons/full/clcl16/runlast_co.gif"
+ helpContextId="run_last_action_context"
+ class="org.eclipse.debug.internal.ui.actions.RunLastAction"
+ menubarPath="org.eclipse.ui.run/relaunchGroup"
+ id="org.eclipse.debug.internal.ui.actions.RunLastAction">
+ </action>
+ <action
+ label="%RunDropDownAction.label"
+ pulldown="true"
+ icon="icons/full/etool16/run_exc.gif"
+ disabledIcon="icons/full/dtool16/run_exc.gif"
+ hoverIcon="icons/full/ctool16/run_exc.gif"
+ helpContextId="run_action_context"
+ class="org.eclipse.debug.internal.ui.actions.RunDropDownAction"
+ toolbarPath="debug"
+ id="org.eclipse.debug.internal.ui.actions.RunDropDownAction">
+ </action>
+ <action
+ label="%OpenDebugConfigurations.label"
+ class="org.eclipse.debug.internal.ui.actions.OpenDebugConfigurations"
+ menubarPath="org.eclipse.ui.run/debugGroup"
+ helpContextId="open_debug_configurations_action_context"
+ id="org.eclipse.debug.internal.ui.actions.OpenDebugConfigurations">
+ </action>
+ <action
+ label="%DebugWithConfigurationAction.label"
+ class="org.eclipse.debug.internal.ui.actions.DebugWithConfigurationAction"
+ menubarPath="org.eclipse.ui.run/debugGroup"
+ helpContextId="debug_with_configuration_action_context"
+ id="org.eclipse.debug.internal.ui.actions.DebugWithConfigurationAction">
+ </action>
+ <action
+ label="%DebugHistoryMenuAction.label"
+ class="org.eclipse.debug.internal.ui.actions.DebugHistoryMenuAction"
+ menubarPath="org.eclipse.ui.run/debugGroup"
+ helpContextId="debug_history_menu_action_context"
+ id="org.eclipse.debug.internal.ui.actions.DebugHistoryMenuAction">
+ </action>
+ <action
+ label="%DebugDropDownAction.label"
+ pulldown="true"
+ icon="icons/full/etool16/debug_exc.gif"
+ disabledIcon="icons/full/dtool16/debug_exc.gif"
+ hoverIcon="icons/full/ctool16/debug_exc.gif"
+ helpContextId="debug_action_context"
+ class="org.eclipse.debug.internal.ui.actions.DebugDropDownAction"
+ toolbarPath="debug"
+ id="org.eclipse.debug.internal.ui.actions.DebugDropDownAction">
+ </action>
+ </actionSet>
+</extension>
+
+<extension point = "org.eclipse.ui.viewActions">
+<!-- Contributions to Debug View Toolbar -->
+ <viewContribution
+ id = "org.eclipse.debug.ui.debugview.toolbar"
+ targetID = "org.eclipse.debug.ui.DebugView">
+<!-- Thread Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.removeAllTerminated"
+ toolbarPath = "threadGroup"
+ icon = "icons/full/elcl16/rem_all_co.gif"
+ disabledIcon="icons/full/dlcl16/rem_all_co.gif"
+ hoverIcon="icons/full/clcl16/rem_all_co.gif"
+ helpContextId = "remove_all_terminated_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveAllTerminatedAction"
+ tooltip="%RemoveAllTerminatedAction.tooltip"
+ label="%RemoveAllTerminatedAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.disconnect"
+ toolbarPath = "threadGroup"
+ icon = "icons/full/elcl16/disconnect_co.gif"
+ disabledIcon="icons/full/dlcl16/disconnect_co.gif"
+ hoverIcon="icons/full/clcl16/disconnect_co.gif"
+ helpContextId = "disconnect_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.DisconnectActionDelegate"
+ tooltip="%DisconnectAction.tooltip"
+ label="%DisconnectAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.terminate"
+ toolbarPath = "threadGroup"
+ icon = "icons/full/elcl16/terminate_co.gif"
+ disabledIcon= "icons/full/dlcl16/terminate_co.gif"
+ hoverIcon= "icons/full/clcl16/terminate_co.gif"
+ helpContextId = "terminate_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
+ tooltip="%TerminateAction.tooltip"
+ label="%TerminateAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.suspend"
+ toolbarPath = "threadGroup"
+ icon = "icons/full/elcl16/suspend_co.gif"
+ disabledIcon= "icons/full/dlcl16/suspend_co.gif"
+ hoverIcon= "icons/full/clcl16/suspend_co.gif"
+ helpContextId = "suspend_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
+ tooltip="%SuspendAction.tooltip"
+ label="%SuspendAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.resume"
+ toolbarPath = "threadGroup"
+ icon = "icons/full/elcl16/resume_co.gif"
+ disabledIcon= "icons/full/dlcl16/resume_co.gif"
+ hoverIcon= "icons/full/clcl16/resume_co.gif"
+ helpContextId = "resume_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
+ tooltip="%ResumeAction.tooltip"
+ label="%ResumeAction.label">
+ </action>
+<!-- Step Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.stepReturn"
+ toolbarPath = "stepReturnGroup"
+ icon = "icons/full/elcl16/stepreturn_co.gif"
+ disabledIcon= "icons/full/dlcl16/stepreturn_co.gif"
+ hoverIcon= "icons/full/clcl16/stepreturn_co.gif"
+ helpContextId = "step_return_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
+ tooltip="%StepReturnAction.tooltip"
+ label="%StepReturnAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.stepOver"
+ toolbarPath = "stepOverGroup"
+ icon = "icons/full/elcl16/stepover_co.gif"
+ disabledIcon= "icons/full/dlcl16/stepover_co.gif"
+ hoverIcon= "icons/full/clcl16/stepover_co.gif"
+ helpContextId = "step_over_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
+ tooltip="%StepOverAction.tooltip"
+ label="%StepOverAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.toolbar.stepInto"
+ toolbarPath = "stepIntoGroup"
+ icon = "icons/full/elcl16/stepinto_co.gif"
+ disabledIcon= "icons/full/dlcl16/stepinto_co.gif"
+ hoverIcon= "icons/full/clcl16/stepinto_co.gif"
+ helpContextId = "step_into_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
+ tooltip="%StepIntoAction.tooltip"
+ label="%StepIntoAction.label">
+ </action>
+ </viewContribution>
+<!-- Contributions to Console View Toolbar -->
+ <viewContribution
+ id = "org.eclipse.debug.ui.consoleview.toolbar"
+ targetID = "org.eclipse.debug.ui.ConsoleView">
+ <action
+ id = "org.eclipse.debug.ui.consoleView.toolbar.terminate"
+ icon = "icons/full/elcl16/terminate_co.gif"
+ disabledIcon= "icons/full/dlcl16/terminate_co.gif"
+ hoverIcon= "icons/full/clcl16/terminate_co.gif"
+ helpContextId = "console_terminate_action_context"
+ toolbarPath = "launchGroup"
+ class = "org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate"
+ tooltip="%TerminateAction.tooltip"
+ label="%TerminateAction.label">
+ </action>
+ </viewContribution>
+<!-- Contributions to Breakpoints View Toolbar -->
+ <viewContribution
+ id = "org.eclipse.debug.ui.breakpointsview.toolbar"
+ targetID = "org.eclipse.debug.ui.BreakpointView">
+ <action
+ id = "org.eclipse.debug.ui.breakpointsView.toolbar.removeAll"
+ icon = "icons/full/elcl16/rem_all_co.gif"
+ disabledIcon= "icons/full/dlcl16/rem_all_co.gif"
+ hoverIcon= "icons/full/clcl16/rem_all_co.gif"
+ helpContextId = "remove_all_breakpoints_action_context"
+ toolbarPath = "breakpointGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveAllBreakpointsAction"
+ tooltip="%RemoveAllBreakpointsAction.tooltip"
+ label="%RemoveAllAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.breakpointsView.toolbar.remove"
+ icon = "icons/full/elcl16/rem_co.gif"
+ disabledIcon= "icons/full/dlcl16/rem_co.gif"
+ hoverIcon= "icons/full/clcl16/rem_co.gif"
+ helpContextId = "remove_breakpoint_action_context"
+ toolbarPath = "breakpointGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveBreakpointAction"
+ tooltip="%RemoveBreakpointAction.tooltip"
+ label="%RemoveAction.label">
+ </action>
+ </viewContribution>
+<!-- Contributions to Expression View Toolbar -->
+ <viewContribution
+ id = "org.eclipse.debug.ui.expressionsView.toolbar"
+ targetID = "org.eclipse.debug.ui.ExpressionView">
+ <action
+ id = "org.eclipse.debug.ui.expresssionsView.toolbar.removeAll"
+ icon = "icons/full/elcl16/rem_all_co.gif"
+ disabledIcon= "icons/full/dlcl16/rem_all_co.gif"
+ hoverIcon= "icons/full/clcl16/rem_all_co.gif"
+ helpContextId = "remove_all_expressions_action_context"
+ toolbarPath = "expressionGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveAllExpressionsAction"
+ tooltip="%RemoveAllExpressionsAction.tooltip"
+ label="%RemoveAllAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.expresssionsView.toolbar.remove"
+ icon = "icons/full/elcl16/rem_co.gif"
+ disabledIcon= "icons/full/dlcl16/rem_co.gif"
+ hoverIcon= "icons/full/clcl16/rem_co.gif"
+ helpContextId = "remove_expression_action_context"
+ toolbarPath = "expressionGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveExpressionAction"
+ tooltip="%RemoveExpressionAction.tooltip"
+ label="%RemoveAction.label">
+ </action>
+ </viewContribution>
+</extension>
+
+<extension point = "org.eclipse.ui.popupMenus">
+<!-- Contributions to Debug View Popup Menu -->
+ <viewerContribution
+ id = "org.eclipse.debug.ui.debugview.popupMenu"
+ targetID = "org.eclipse.debug.ui.DebugView">
+<!-- Edit Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.copyToClipboard"
+ menubarPath = "editGroup"
+ icon = "icons/full/clcl16/copy_edit_co.gif"
+ helpContextId = "copy_to_clipboard_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.CopyToClipboardActionDelegate"
+ label="%CopyToClipboardAction.label">
+ </action>
+<!-- Launch Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"
+ menubarPath = "launchGroup"
+ helpContextId = "terminate_all_action_context"
+ icon = "icons/full/clcl16/terminate_all_co.gif"
+ class = "org.eclipse.debug.internal.ui.actions.TerminateAllAction"
+ label="%TerminateAllAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.relaunch"
+ menubarPath = "launchGroup"
+ icon = "icons/full/clcl16/runlast_co.gif"
+ helpContextId = "relaunch_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.RelaunchActionDelegate"
+ label="%RelaunchAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.terminateAndRemove"
+ menubarPath = "launchGroup"
+ helpContextId = "terminate_and_remove_action_context"
+ icon = "icons/full/clcl16/terminate_rem_co.gif"
+ class = "org.eclipse.debug.internal.ui.actions.TerminateAndRemoveActionDelegate"
+ label="%TerminateAndRemoveAction.label">
+ </action>
+<!-- Thread Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.removeAllTerminated"
+ menubarPath = "launchGroup"
+ icon = "icons/full/clcl16/rem_all_co.gif"
+ helpContextId = "remove_all_terminated_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveAllTerminatedAction"
+ label="%RemoveAllTerminatedAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.disconnect"
+ menubarPath = "threadGroup"
+ icon = "icons/full/clcl16/disconnect_co.gif"
+ helpContextId = "disconnect_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.DisconnectActionDelegate"
+ label="%DisconnectAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.terminate"
+ menubarPath = "threadGroup"
+ icon = "icons/full/clcl16/terminate_co.gif"
+ helpContextId = "terminate_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.TerminateActionDelegate"
+ label="%TerminateAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.suspend"
+ menubarPath = "threadGroup"
+ icon = "icons/full/clcl16/suspend_co.gif"
+ helpContextId = "suspend_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.SuspendActionDelegate"
+ label="%SuspendAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.resume"
+ menubarPath = "threadGroup"
+ icon = "icons/full/clcl16/resume_co.gif"
+ helpContextId = "resume_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.ResumeActionDelegate"
+ label="%ResumeAction.label">
+ </action>
+<!-- Step Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.stepReturn"
+ menubarPath = "stepReturnGroup"
+ icon = "icons/full/clcl16/stepreturn_co.gif"
+ helpContextId = "step_return_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepReturnActionDelegate"
+ label="%StepReturnAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.stepOver"
+ menubarPath = "stepOverGroup"
+ icon = "icons/full/clcl16/stepover_co.gif"
+ helpContextId = "step_over_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepOverActionDelegate"
+ label="%StepOverAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.stepInto"
+ menubarPath = "stepIntoGroup"
+ icon = "icons/full/clcl16/stepinto_co.gif"
+ helpContextId = "step_into_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.StepIntoActionDelegate"
+ label="%StepIntoAction.label">
+ </action>
+ </viewerContribution>
+ <!-- Contributions to Breakpoints View Popup Menu -->
+ <viewerContribution
+ id = "org.eclipse.debug.ui.breakpointview.popupMenu"
+ targetID = "org.eclipse.debug.ui.BreakpointView">
+ <action
+ id="org.eclipse.debug.ui.actions.RemoveAllBreakpoints"
+ icon = "icons/full/clcl16/rem_all_co.gif"
+ label="%RemoveAllAction.label"
+ menubarPath="breakpointGroup"
+ helpContextId = "remove_all_breakpoints_action_context"
+ class="org.eclipse.debug.internal.ui.actions.RemoveAllBreakpointsAction">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.RemoveBreakpoint"
+ label="%RemoveAction.label"
+ icon = "icons/full/clcl16/rem_co.gif"
+ menubarPath="breakpointGroup"
+ helpContextId = "remove_breakpoint_action_context"
+ class="org.eclipse.debug.internal.ui.actions.RemoveBreakpointAction">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.DisableBreakpoint"
+ label="%DisableBreakpointsAction.label"
+ icon="icons/full/clcl16/disabled_co.gif"
+ menubarPath="breakpointGroup"
+ helpContextId = "disable_breakpoint_action_context"
+ class="org.eclipse.debug.internal.ui.actions.DisableBreakpointsAction"
+ enablesFor="2+">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.EnableBreakpoint"
+ label="%EnableBreakpointsAction.label"
+ icon="icons/full/clcl16/enabled_co.gif"
+ menubarPath="breakpointGroup"
+ helpContextId = "enable_breakpoint_action_context"
+ class="org.eclipse.debug.internal.ui.actions.EnableBreakpointsAction"
+ enablesFor="2+">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.SelectAllBreakpointsAction"
+ label="%SelectAll.label"
+ menubarPath="breakpointGroup"
+ helpContextId = "select_all_breakpoints_action_context"
+ class="org.eclipse.debug.internal.ui.actions.SelectAllBreakpointsAction">
+ </action>
+ </viewerContribution>
+<!-- Contributions to Variables View Popup Menu -->
+ <viewerContribution
+ id = "org.eclipse.debug.ui.variablesView.popupMenu"
+ targetID = "org.eclipse.debug.ui.VariableView">
+ <!-- Variable Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.copyVariablesToClipboard"
+ menubarPath = "variableGroup"
+ icon = "icons/full/clcl16/copy_edit_co.gif"
+ helpContextId = "copy_variables_to_clipboard_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.CopyVariablesToClipboardActionDelegate"
+ label="%CopyVariablesToClipboardAction.label">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.SelectAllVariablesAction"
+ label="%SelectAll.label"
+ menubarPath="variableGroup"
+ helpContextId = "select_all_variables_action_context"
+ class="org.eclipse.debug.internal.ui.actions.SelectAllVariablesAction">
+ </action>
+ </viewerContribution>
+<!-- Contributions to Expression View Popup Menu -->
+ <viewerContribution
+ id = "org.eclipse.debug.ui.expressionView.popupMenu"
+ targetID = "org.eclipse.debug.ui.ExpressionView">
+ <!-- Expression Group -->
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.removeAllExpressionsAction"
+ menubarPath = "expressionGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveAllExpressionsAction"
+ icon = "icons/full/clcl16/rem_all_co.gif"
+ helpContextId = "remove_all_expressions_action_context"
+ label="%RemoveAllAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.removeExpressionAction"
+ menubarPath = "expressionGroup"
+ class = "org.eclipse.debug.internal.ui.actions.RemoveExpressionAction"
+ icon = "icons/full/clcl16/rem_co.gif"
+ helpContextId = "remove_expression_action_context"
+ label="%RemoveAction.label">
+ </action>
+ <action
+ id = "org.eclipse.debug.ui.debugview.popupMenu.copyVariablesToClipboard"
+ menubarPath = "expressionGroup"
+ icon = "icons/full/clcl16/copy_edit_co.gif"
+ helpContextId = "copy_variables_to_clipboard_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.CopyVariablesToClipboardActionDelegate"
+ label="%CopyVariablesToClipboardAction.label">
+ </action>
+ <action
+ id="org.eclipse.debug.ui.actions.SelectAllExpressionsAction"
+ label="%SelectAll.label"
+ menubarPath="expressionGroup"
+ helpContextId = "select_all_expressions_action_context"
+ class="org.eclipse.debug.internal.ui.actions.SelectAllExpressionsAction">
+ </action>
+ </viewerContribution>
+<!-- Contributions to Console View popup menu -->
+ <viewerContribution
+ id = "org.eclipse.debug.ui.consoleview.popupMenu"
+ targetID = "org.eclipse.debug.ui.ConsoleView">
+ <action
+ id = "org.eclipse.debug.ui.consoleView.popupMenu.terminate"
+ icon = "icons/full/clcl16/terminate_co.gif"
+ menubarPath = "additions"
+ helpContextId = "console_terminate_action_context"
+ class = "org.eclipse.debug.internal.ui.actions.ConsoleTerminateActionDelegate"
+ label="%TerminateAction.label">
+ </action>
+ </viewerContribution>
+</extension>
+
+<extension
+ id="instructionPointer"
+ point="org.eclipse.core.resources.markers">
+ <super
+ type="org.eclipse.core.resources.textmarker">
+ </super>
+ <persistent
+ value="false">
+ </persistent>
+</extension>
+
+<extension point="org.eclipse.ui.actionSetPartAssociations">
+ <actionSetPartAssociation
+ targetID="org.eclipse.debug.ui.debugActionSet">
+ <part id="org.eclipse.debug.ui.DebugView"/>
+ </actionSetPartAssociation>
+</extension>
+</plugin>
diff --git a/org.eclipse.debug.ui/scripts/exportplugin.xml b/org.eclipse.debug.ui/scripts/exportplugin.xml
index f25747b98..0ef62d827 100644
--- a/org.eclipse.debug.ui/scripts/exportplugin.xml
+++ b/org.eclipse.debug.ui/scripts/exportplugin.xml
@@ -1,35 +1,35 @@
-<!-- Export a jar of .class files for the org.eclipse.debug.ui Eclipse plugin
- along with other important plugin files to the "plugin-export" subdirectory
- of the target Eclipse installation -->
-<project name="org.eclipse.debug.ui" default="export" basedir="..">
-
- <!-- Set the timestamp and important properties -->
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="dest" value="${destdir}/org.eclipse.debug.ui_2.0.0" />
- </target>
-
- <!-- Create the jar of .class files, and copy other important files to export dir -->
- <target name="export" depends="init">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/dtui.jar"
- basedir="bin"
- />
- <!-- Create the source zip -->
- <zip zipfile="${dest}/dtuisrc.zip">
- <fileset dir="ui"/>
- </zip>
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy file=".classpath" todir="${dest}"/>
- <copy file=".options" todir="${dest}"/>
- <copy todir="${dest}/icons">
- <fileset dir="icons" />
- </copy>
- </target>
-
-</project>
+<!-- Export a jar of .class files for the org.eclipse.debug.ui Eclipse plugin
+ along with other important plugin files to the "plugin-export" subdirectory
+ of the target Eclipse installation -->
+<project name="org.eclipse.debug.ui" default="export" basedir="..">
+
+ <!-- Set the timestamp and important properties -->
+ <target name="init">
+ <tstamp/>
+ <property name="destdir" value="../../plugin-export" />
+ <property name="dest" value="${destdir}/org.eclipse.debug.ui_2.0.0" />
+ </target>
+
+ <!-- Create the jar of .class files, and copy other important files to export dir -->
+ <target name="export" depends="init">
+ <mkdir dir="${destdir}" />
+ <delete dir="${dest}" />
+ <mkdir dir="${dest}" />
+ <jar
+ jarfile="${dest}/dtui.jar"
+ basedir="bin"
+ />
+ <!-- Create the source zip -->
+ <zip zipfile="${dest}/dtuisrc.zip">
+ <fileset dir="ui"/>
+ </zip>
+ <copy file="plugin.xml" todir="${dest}"/>
+ <copy file="plugin.properties" todir="${dest}"/>
+ <copy file=".classpath" todir="${dest}"/>
+ <copy file=".options" todir="${dest}"/>
+ <copy todir="${dest}/icons">
+ <fileset dir="icons" />
+ </copy>
+ </target>
+
+</project>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
index 58cd7e38c..55acf5f58 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
@@ -1,51 +1,51 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Generic color manager.
- */
-public class ColorManager {
-
- private static ColorManager fgColorManager;
-
- private ColorManager() {
- }
-
- public static ColorManager getDefault() {
- if (fgColorManager == null) {
- fgColorManager= new ColorManager();
- }
- return fgColorManager;
- }
-
- protected Map fColorTable= new HashMap(10);
-
- public Color getColor(RGB rgb) {
- Color color= (Color) fColorTable.get(rgb);
- if (color == null) {
- color= new Color(Display.getCurrent(), rgb);
- fColorTable.put(rgb, color);
- }
- return color;
- }
-
- public void dispose() {
- Iterator e= fColorTable.values().iterator();
- while (e.hasNext())
- ((Color) e.next()).dispose();
- }
-}
-
-
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Generic color manager.
+ */
+public class ColorManager {
+
+ private static ColorManager fgColorManager;
+
+ private ColorManager() {
+ }
+
+ public static ColorManager getDefault() {
+ if (fgColorManager == null) {
+ fgColorManager= new ColorManager();
+ }
+ return fgColorManager;
+ }
+
+ protected Map fColorTable= new HashMap(10);
+
+ public Color getColor(RGB rgb) {
+ Color color= (Color) fColorTable.get(rgb);
+ if (color == null) {
+ color= new Color(Display.getCurrent(), rgb);
+ fColorTable.put(rgb, color);
+ }
+ return color;
+ }
+
+ public void dispose() {
+ Iterator e= fColorTable.values().iterator();
+ while (e.hasNext())
+ ((Color) e.next()).dispose();
+ }
+}
+
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
index b71e267ed..7314557b7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
@@ -1,59 +1,59 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-/**
- * The debug perspective factory.
- */
-public class DebugPerspectiveFactory implements IPerspectiveFactory {
-
- /**
- * @see IPerspectiveFactory#createInitialLayout(IPageLayout)
- */
- public void createInitialLayout(IPageLayout layout) {
-
- IFolderLayout consoleFolder = layout.createFolder(IInternalDebugUIConstants.ID_CONSOLE_FOLDER_VIEW, IPageLayout.BOTTOM, (float)0.75, layout.getEditorArea());
- consoleFolder.addView(IDebugUIConstants.ID_CONSOLE_VIEW);
- consoleFolder.addView(IPageLayout.ID_TASK_LIST);
- consoleFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- consoleFolder.addPlaceholder(IPageLayout.ID_PROP_SHEET);
-
- IFolderLayout navFolder= layout.createFolder(IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW, IPageLayout.TOP, (float) 0.5, layout.getEditorArea());
- navFolder.addView(IDebugUIConstants.ID_DEBUG_VIEW);
- navFolder.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- IFolderLayout toolsFolder= layout.createFolder(IInternalDebugUIConstants.ID_TOOLS_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.5, IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW);
- toolsFolder.addView(IDebugUIConstants.ID_VARIABLE_VIEW);
- toolsFolder.addView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- toolsFolder.addView(IDebugUIConstants.ID_EXPRESSION_VIEW);
-
- IFolderLayout outlineFolder= layout.createFolder(IInternalDebugUIConstants.ID_OUTLINE_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.75, layout.getEditorArea());
- outlineFolder.addView(IPageLayout.ID_OUTLINE);
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
-
- setContentsOfShowViewMenu(layout);
- }
-
- /**
- * Sets the intial contents of the "Show View" menu.
- */
- protected void setContentsOfShowViewMenu(IPageLayout layout) {
- layout.addShowViewShortcut(IDebugUIConstants.ID_DEBUG_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_VARIABLE_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_EXPRESSION_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IDebugUIConstants.ID_CONSOLE_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
- }
-}
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/**
+ * The debug perspective factory.
+ */
+public class DebugPerspectiveFactory implements IPerspectiveFactory {
+
+ /**
+ * @see IPerspectiveFactory#createInitialLayout(IPageLayout)
+ */
+ public void createInitialLayout(IPageLayout layout) {
+
+ IFolderLayout consoleFolder = layout.createFolder(IInternalDebugUIConstants.ID_CONSOLE_FOLDER_VIEW, IPageLayout.BOTTOM, (float)0.75, layout.getEditorArea());
+ consoleFolder.addView(IDebugUIConstants.ID_CONSOLE_VIEW);
+ consoleFolder.addView(IPageLayout.ID_TASK_LIST);
+ consoleFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
+ consoleFolder.addPlaceholder(IPageLayout.ID_PROP_SHEET);
+
+ IFolderLayout navFolder= layout.createFolder(IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW, IPageLayout.TOP, (float) 0.5, layout.getEditorArea());
+ navFolder.addView(IDebugUIConstants.ID_DEBUG_VIEW);
+ navFolder.addPlaceholder(IPageLayout.ID_RES_NAV);
+
+ IFolderLayout toolsFolder= layout.createFolder(IInternalDebugUIConstants.ID_TOOLS_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.5, IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW);
+ toolsFolder.addView(IDebugUIConstants.ID_VARIABLE_VIEW);
+ toolsFolder.addView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
+ toolsFolder.addView(IDebugUIConstants.ID_EXPRESSION_VIEW);
+
+ IFolderLayout outlineFolder= layout.createFolder(IInternalDebugUIConstants.ID_OUTLINE_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.75, layout.getEditorArea());
+ outlineFolder.addView(IPageLayout.ID_OUTLINE);
+
+ layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
+ layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
+
+ setContentsOfShowViewMenu(layout);
+ }
+
+ /**
+ * Sets the intial contents of the "Show View" menu.
+ */
+ protected void setContentsOfShowViewMenu(IPageLayout layout) {
+ layout.addShowViewShortcut(IDebugUIConstants.ID_DEBUG_VIEW);
+ layout.addShowViewShortcut(IDebugUIConstants.ID_VARIABLE_VIEW);
+ layout.addShowViewShortcut(IDebugUIConstants.ID_BREAKPOINT_VIEW);
+ layout.addShowViewShortcut(IDebugUIConstants.ID_EXPRESSION_VIEW);
+ layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
+ layout.addShowViewShortcut(IDebugUIConstants.ID_CONSOLE_VIEW);
+ layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
index ad2eea3bf..707edd185 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
@@ -1,241 +1,241 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.HashMap;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * The images provided by the debug plugin.
- */
-public class DebugPluginImages {
-
- /**
- * The image registry containing <code>Image</code>s.
- */
- private static ImageRegistry imageRegistry;
-
- /**
- * A table of all the <code>ImageDescriptor</code>s.
- */
- private static HashMap imageDescriptors;
-
- private static final String ATTR_LAUNCH_CONFIG_TYPE_ICON = "icon"; //$NON-NLS-1$
- private static final String ATTR_LAUNCH_CONFIG_TYPE_ID = "configTypeID"; //$NON-NLS-1$
-
- /* Declare Common paths */
- private static URL ICON_BASE_URL= null;
-
- static {
- String pathSuffix = "icons/full/"; //$NON-NLS-1$
-
- try {
- ICON_BASE_URL= new URL(DebugUIPlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix);
- } catch (MalformedURLException e) {
- // do nothing
- }
- }
-
- // Use IPath and toOSString to build the names to ensure they have the slashes correct
- private final static String CTOOL= "ctool16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String LOCALTOOL= "clcl16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String DLCL= "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$
- private final static String ELCL= "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$
- private final static String OBJECT= "obj16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String WIZBAN= "wizban/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String OVR= "ovr16/"; //basic colors - size 7x8 //$NON-NLS-1$
- private final static String VIEW= "cview16/"; // views //$NON-NLS-1$
-
- /**
- * Declare all images
- */
- private static void declareImages() {
- // Actions
- declareRegistryImage(IDebugUIConstants.IMG_ACT_DEBUG, CTOOL + "debug_exc.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_ACT_RUN, CTOOL + "run_exc.gif"); //$NON-NLS-1$
-
- //menus
- declareRegistryImage(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE, LOCALTOOL + "changevariablevalue_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE, DLCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE, ELCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
-
- declareRegistryImage(IDebugUIConstants.IMG_LCL_CONTENT_ASSIST, LOCALTOOL + "metharg_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST, DLCL + "metharg_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_ELCL_CONTENT_ASSIST, ELCL + "metharg_obj.gif"); //$NON-NLS-1$
-
- //Local toolbars
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE, LOCALTOOL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_CLEAR, LOCALTOOL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_TYPE_NAMES, LOCALTOOL + "tnames_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DISCONNECT, LOCALTOOL + "disconnect_co.gif"); //$NON-NLS-1$
-
- // disabled local toolbars
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_CLEAR, DLCL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES, DLCL + "tnames_co.gif"); //$NON-NLS-1$
-
- // enabled local toolbars
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_CLEAR, ELCL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES, ELCL + "tnames_co.gif"); //$NON-NLS-1$
-
- //Object
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_DEBUG, OBJECT + "ldebug_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN, OBJECT + "lrun_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN_TERMINATED, OBJECT + "terminatedlaunch_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET, OBJECT + "debugt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED, OBJECT + "debugtt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING, OBJECT + "thread_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED, OBJECT + "threads_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED, OBJECT + "threadt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME, OBJECT + "stckframe_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME_RUNNING, OBJECT + "stckframe_running_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_VARIABLE, OBJECT + "genericvariable_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT, OBJECT + "brkp_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED, OBJECT + "brkpd_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS, OBJECT + "osprc_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS_TERMINATED, OBJECT + "osprct_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_EXPRESSION, OBJECT + "expression_obj.gif"); //$NON-NLS-1$
-
- // Views
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_BREAKPOINTS, VIEW + "breakpoint_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_CONSOLE, VIEW + "console_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_EXPRESSIONS, VIEW + "watchlist_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_LAUNCHES, VIEW + "debug_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_VARIABLES, VIEW + "variable_view.gif"); //$NON-NLS-1$
-
- // Perspectives
- declareRegistryImage(IDebugUIConstants.IMG_PERSPECTIVE_DEBUG, VIEW + "debug_persp.gif"); //$NON-NLS-1$
-
- //Wizard Banners
- declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_DEBUG, WIZBAN + "debug_wiz.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_RUN, WIZBAN + "run_wiz.gif"); //$NON-NLS-1$
-
- // Overlays
- declareRegistryImage(IDebugUIConstants.IMG_OVR_ERROR, OVR + "error.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT, OVR + "transparent.gif"); //$NON-NLS-1$
-
- // launch configuration types
- IPluginDescriptor pluginDescriptor = DebugUIPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= pluginDescriptor.getExtensionPoint(IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
- IConfigurationElement[] configElements= extensionPoint.getConfigurationElements();
- for (int i = 0; i < configElements.length; i++) {
- IConfigurationElement configElement = configElements[i];
- URL iconURL = configElement.getDeclaringExtension().getDeclaringPluginDescriptor().getInstallURL();
- String iconPath = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ICON);
- ImageDescriptor imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- try {
- iconURL = new URL(iconURL, iconPath);
- imageDescriptor = ImageDescriptor.createFromURL(iconURL);
- } catch (MalformedURLException mue) {
- DebugUIPlugin.log(mue);
- }
- String configTypeID = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID);
- imageRegistry.put(configTypeID, imageDescriptor);
- imageDescriptors.put(configTypeID, imageDescriptor);
- }
- }
-
- /**
- * Declare an Image in the registry table.
- * @param key The key to use when registering the image
- * @param path The path where the image can be found. This path is relative to where
- * this plugin class is found (i.e. typically the packages directory)
- */
- private final static void declareRegistryImage(String key, String path) {
- ImageDescriptor desc= ImageDescriptor.getMissingImageDescriptor();
- try {
- desc= ImageDescriptor.createFromURL(makeIconFileURL(path));
- } catch (MalformedURLException me) {
- DebugUIPlugin.log(me);
- }
- imageRegistry.put(key, desc);
- imageDescriptors.put(key, desc);
- }
-
- /**
- * Returns the ImageRegistry.
- */
- public static ImageRegistry getImageRegistry() {
- if (imageRegistry == null) {
- initializeImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * Initialize the image registry by declaring all of the required
- * graphics. This involves creating JFace image descriptors describing
- * how to create/find the image should it be needed.
- * The image is not actually allocated until requested.
- *
- * Prefix conventions
- * Wizard Banners WIZBAN_
- * Preference Banners PREF_BAN_
- * Property Page Banners PROPBAN_
- * Color toolbar CTOOL_
- * Enable toolbar ETOOL_
- * Disable toolbar DTOOL_
- * Local enabled toolbar ELCL_
- * Local Disable toolbar DLCL_
- * Object large OBJL_
- * Object small OBJS_
- * View VIEW_
- * Product images PROD_
- * Misc images MISC_
- *
- * Where are the images?
- * The images (typically gifs) are found in the same location as this plugin class.
- * This may mean the same package directory as the package holding this class.
- * The images are declared using this.getClass() to ensure they are looked up via
- * this plugin class.
- * @see JFace's ImageRegistry
- */
- public static ImageRegistry initializeImageRegistry() {
- imageRegistry= new ImageRegistry(DebugUIPlugin.getStandardDisplay());
- imageDescriptors = new HashMap(30);
- declareImages();
- return imageRegistry;
- }
-
- /**
- * Returns the <code>Image<code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static Image getImage(String key) {
- return getImageRegistry().get(key);
- }
-
- /**
- * Returns the <code>ImageDescriptor<code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (imageDescriptors == null) {
- initializeImageRegistry();
- }
- return (ImageDescriptor)imageDescriptors.get(key);
- }
-
- private static URL makeIconFileURL(String iconPath) throws MalformedURLException {
- if (ICON_BASE_URL == null) {
- throw new MalformedURLException();
- }
-
- return new URL(ICON_BASE_URL, iconPath);
- }
-}
-
-
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.HashMap;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * The images provided by the debug plugin.
+ */
+public class DebugPluginImages {
+
+ /**
+ * The image registry containing <code>Image</code>s.
+ */
+ private static ImageRegistry imageRegistry;
+
+ /**
+ * A table of all the <code>ImageDescriptor</code>s.
+ */
+ private static HashMap imageDescriptors;
+
+ private static final String ATTR_LAUNCH_CONFIG_TYPE_ICON = "icon"; //$NON-NLS-1$
+ private static final String ATTR_LAUNCH_CONFIG_TYPE_ID = "configTypeID"; //$NON-NLS-1$
+
+ /* Declare Common paths */
+ private static URL ICON_BASE_URL= null;
+
+ static {
+ String pathSuffix = "icons/full/"; //$NON-NLS-1$
+
+ try {
+ ICON_BASE_URL= new URL(DebugUIPlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix);
+ } catch (MalformedURLException e) {
+ // do nothing
+ }
+ }
+
+ // Use IPath and toOSString to build the names to ensure they have the slashes correct
+ private final static String CTOOL= "ctool16/"; //basic colors - size 16x16 //$NON-NLS-1$
+ private final static String LOCALTOOL= "clcl16/"; //basic colors - size 16x16 //$NON-NLS-1$
+ private final static String DLCL= "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$
+ private final static String ELCL= "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$
+ private final static String OBJECT= "obj16/"; //basic colors - size 16x16 //$NON-NLS-1$
+ private final static String WIZBAN= "wizban/"; //basic colors - size 16x16 //$NON-NLS-1$
+ private final static String OVR= "ovr16/"; //basic colors - size 7x8 //$NON-NLS-1$
+ private final static String VIEW= "cview16/"; // views //$NON-NLS-1$
+
+ /**
+ * Declare all images
+ */
+ private static void declareImages() {
+ // Actions
+ declareRegistryImage(IDebugUIConstants.IMG_ACT_DEBUG, CTOOL + "debug_exc.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_ACT_RUN, CTOOL + "run_exc.gif"); //$NON-NLS-1$
+
+ //menus
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE, LOCALTOOL + "changevariablevalue_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE, DLCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE, ELCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
+
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_CONTENT_ASSIST, LOCALTOOL + "metharg_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST, DLCL + "metharg_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_ELCL_CONTENT_ASSIST, ELCL + "metharg_obj.gif"); //$NON-NLS-1$
+
+ //Local toolbars
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE, LOCALTOOL + "toggledetailpane_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_CLEAR, LOCALTOOL + "clear_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_TYPE_NAMES, LOCALTOOL + "tnames_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_LCL_DISCONNECT, LOCALTOOL + "disconnect_co.gif"); //$NON-NLS-1$
+
+ // disabled local toolbars
+ declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_CLEAR, DLCL + "clear_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES, DLCL + "tnames_co.gif"); //$NON-NLS-1$
+
+ // enabled local toolbars
+ declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_CLEAR, ELCL + "clear_co.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES, ELCL + "tnames_co.gif"); //$NON-NLS-1$
+
+ //Object
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_DEBUG, OBJECT + "ldebug_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN, OBJECT + "lrun_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN_TERMINATED, OBJECT + "terminatedlaunch_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET, OBJECT + "debugt_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED, OBJECT + "debugtt_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING, OBJECT + "thread_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED, OBJECT + "threads_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED, OBJECT + "threadt_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME, OBJECT + "stckframe_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME_RUNNING, OBJECT + "stckframe_running_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_VARIABLE, OBJECT + "genericvariable_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT, OBJECT + "brkp_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED, OBJECT + "brkpd_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS, OBJECT + "osprc_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS_TERMINATED, OBJECT + "osprct_obj.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_EXPRESSION, OBJECT + "expression_obj.gif"); //$NON-NLS-1$
+
+ // Views
+ declareRegistryImage(IDebugUIConstants.IMG_VIEW_BREAKPOINTS, VIEW + "breakpoint_view.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_VIEW_CONSOLE, VIEW + "console_view.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_VIEW_EXPRESSIONS, VIEW + "watchlist_view.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_VIEW_LAUNCHES, VIEW + "debug_view.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_VIEW_VARIABLES, VIEW + "variable_view.gif"); //$NON-NLS-1$
+
+ // Perspectives
+ declareRegistryImage(IDebugUIConstants.IMG_PERSPECTIVE_DEBUG, VIEW + "debug_persp.gif"); //$NON-NLS-1$
+
+ //Wizard Banners
+ declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_DEBUG, WIZBAN + "debug_wiz.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_RUN, WIZBAN + "run_wiz.gif"); //$NON-NLS-1$
+
+ // Overlays
+ declareRegistryImage(IDebugUIConstants.IMG_OVR_ERROR, OVR + "error.gif"); //$NON-NLS-1$
+ declareRegistryImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT, OVR + "transparent.gif"); //$NON-NLS-1$
+
+ // launch configuration types
+ IPluginDescriptor pluginDescriptor = DebugUIPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= pluginDescriptor.getExtensionPoint(IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
+ IConfigurationElement[] configElements= extensionPoint.getConfigurationElements();
+ for (int i = 0; i < configElements.length; i++) {
+ IConfigurationElement configElement = configElements[i];
+ URL iconURL = configElement.getDeclaringExtension().getDeclaringPluginDescriptor().getInstallURL();
+ String iconPath = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ICON);
+ ImageDescriptor imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+ try {
+ iconURL = new URL(iconURL, iconPath);
+ imageDescriptor = ImageDescriptor.createFromURL(iconURL);
+ } catch (MalformedURLException mue) {
+ DebugUIPlugin.log(mue);
+ }
+ String configTypeID = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID);
+ imageRegistry.put(configTypeID, imageDescriptor);
+ imageDescriptors.put(configTypeID, imageDescriptor);
+ }
+ }
+
+ /**
+ * Declare an Image in the registry table.
+ * @param key The key to use when registering the image
+ * @param path The path where the image can be found. This path is relative to where
+ * this plugin class is found (i.e. typically the packages directory)
+ */
+ private final static void declareRegistryImage(String key, String path) {
+ ImageDescriptor desc= ImageDescriptor.getMissingImageDescriptor();
+ try {
+ desc= ImageDescriptor.createFromURL(makeIconFileURL(path));
+ } catch (MalformedURLException me) {
+ DebugUIPlugin.log(me);
+ }
+ imageRegistry.put(key, desc);
+ imageDescriptors.put(key, desc);
+ }
+
+ /**
+ * Returns the ImageRegistry.
+ */
+ public static ImageRegistry getImageRegistry() {
+ if (imageRegistry == null) {
+ initializeImageRegistry();
+ }
+ return imageRegistry;
+ }
+
+ /**
+ * Initialize the image registry by declaring all of the required
+ * graphics. This involves creating JFace image descriptors describing
+ * how to create/find the image should it be needed.
+ * The image is not actually allocated until requested.
+ *
+ * Prefix conventions
+ * Wizard Banners WIZBAN_
+ * Preference Banners PREF_BAN_
+ * Property Page Banners PROPBAN_
+ * Color toolbar CTOOL_
+ * Enable toolbar ETOOL_
+ * Disable toolbar DTOOL_
+ * Local enabled toolbar ELCL_
+ * Local Disable toolbar DLCL_
+ * Object large OBJL_
+ * Object small OBJS_
+ * View VIEW_
+ * Product images PROD_
+ * Misc images MISC_
+ *
+ * Where are the images?
+ * The images (typically gifs) are found in the same location as this plugin class.
+ * This may mean the same package directory as the package holding this class.
+ * The images are declared using this.getClass() to ensure they are looked up via
+ * this plugin class.
+ * @see JFace's ImageRegistry
+ */
+ public static ImageRegistry initializeImageRegistry() {
+ imageRegistry= new ImageRegistry(DebugUIPlugin.getStandardDisplay());
+ imageDescriptors = new HashMap(30);
+ declareImages();
+ return imageRegistry;
+ }
+
+ /**
+ * Returns the <code>Image<code> identified by the given key,
+ * or <code>null</code> if it does not exist.
+ */
+ public static Image getImage(String key) {
+ return getImageRegistry().get(key);
+ }
+
+ /**
+ * Returns the <code>ImageDescriptor<code> identified by the given key,
+ * or <code>null</code> if it does not exist.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ if (imageDescriptors == null) {
+ initializeImageRegistry();
+ }
+ return (ImageDescriptor)imageDescriptors.get(key);
+ }
+
+ private static URL makeIconFileURL(String iconPath) throws MalformedURLException {
+ if (ICON_BASE_URL == null) {
+ throw new MalformedURLException();
+ }
+
+ return new URL(ICON_BASE_URL, iconPath);
+ }
+}
+
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
index 448a795af..6f507f969 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
@@ -1,27 +1,27 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class DebugUIMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.ui.DebugUIMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private DebugUIMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class DebugUIMessages {
+
+ private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.ui.DebugUIMessages";//$NON-NLS-1$
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private DebugUIMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 8ea2e6e5f..4da2b5a4a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -1,539 +1,539 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.Serializer;
-import org.apache.xml.serialize.SerializerFactory;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager;
-import org.eclipse.debug.internal.ui.preferences.ConsolePreferencePage;
-import org.eclipse.debug.internal.ui.preferences.DebugActionGroupsManager;
-import org.eclipse.debug.internal.ui.preferences.DebugPreferencePage;
-import org.eclipse.debug.internal.ui.preferences.LaunchHistoryPreferencePage;
-import org.eclipse.debug.internal.ui.preferences.VariableViewsPreferencePage;
-import org.eclipse.debug.internal.ui.views.console.ConsoleDocumentManager;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.w3c.dom.Document;
-
-/**
- * The Debug UI Plugin.
- *
- */
-public class DebugUIPlugin extends AbstractUIPlugin {
-
- /**
- * The singleton debug plugin instance
- */
- private static DebugUIPlugin fgDebugUIPlugin= null;
-
- /**
- * A utility presentation used to obtain labels
- */
- protected static IDebugModelPresentation fgPresentation = null;
-
- /**
- * Default label provider
- */
- private static DefaultLabelProvider fgDefaultLabelProvider;
-
- /**
- * Flag indicating whether the debug UI is in trace
- * mode. When in trace mode, extra debug information
- * is produced.
- */
- private boolean fTrace = false;
-
- /**
- * Returns whether the debug UI plug-in is in trace
- * mode.
- *
- * @return whether the debug UI plug-in is in trace
- * mode
- */
- public boolean isTraceMode() {
- return fTrace;
- }
-
- /**
- * Logs the given message if in trace mode.
- *
- * @param String message to log
- */
- public static void logTraceMessage(String message) {
- if (getDefault().isTraceMode()) {
- IStatus s = new Status(IStatus.WARNING, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, message, null);
- getDefault().getLog().log(s);
- }
- }
-
- /**
- * Constructs the debug UI plugin
- */
- public DebugUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- fgDebugUIPlugin= this;
- }
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
- /**
- * Returns the singleton instance of the debug plugin.
- */
- public static DebugUIPlugin getDefault() {
- return fgDebugUIPlugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() == null) {
- // If the default instance is not yet initialized,
- // return a static identifier. This identifier must
- // match the plugin id defined in plugin.xml
- return "org.eclipse.debug.ui"; //$NON-NLS-1$
- }
- return getDefault().getDescriptor().getUniqueIdentifier();
- }
-
- public static IDebugModelPresentation getModelPresentation() {
- if (fgPresentation == null) {
- fgPresentation = new DelegatingModelPresentation();
- }
- return fgPresentation;
- }
-
- public static LaunchConfigurationManager getLaunchConfigurationManager() {
- return LaunchConfigurationManager.getDefault();
- }
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- public static Shell getShell() {
- if (getActiveWorkbenchWindow() != null) {
- return getActiveWorkbenchWindow().getShell();
- }
- return null;
- }
- /**
- * Returns the default label provider for the debug UI.
- */
- public static ILabelProvider getDefaultLabelProvider() {
- if (fgDefaultLabelProvider == null) {
- fgDefaultLabelProvider = new DefaultLabelProvider();
- }
- return fgDefaultLabelProvider;
- }
-
- /**
- * Creates an extension. If the extension plugin has not
- * been loaded a busy cursor will be activated during the duration of
- * the load.
- *
- * @param element the config element defining the extension
- * @param classAttribute the name of the attribute carrying the class
- * @return the extension object
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- IPluginDescriptor plugin = element.getDeclaringExtension().getDeclaringPluginDescriptor();
- if (plugin.isPluginActivated()) {
- return element.createExecutableExtension(classAttribute);
- } else {
- final Object [] ret = new Object[1];
- final CoreException [] exc = new CoreException[1];
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- ret[0] = element.createExecutableExtension(classAttribute);
- } catch (CoreException e) {
- exc[0] = e;
- }
- }
- });
- if (exc[0] != null) {
- throw exc[0];
- }
- else {
- return ret[0];
- }
- }
- }
-
- protected ImageRegistry createImageRegistry() {
- return DebugPluginImages.initializeImageRegistry();
- }
-
- /**
- * Shuts down this plug-in and discards all plug-in state.
- * If a plug-in has been started, this method is automatically
- * invoked by the platform core when the workbench is closed.
- * <p>
- * This method is intended to perform simple termination
- * of the plug-in environment. The platform may terminate invocations
- * that do not complete in a timely fashion.
- * </p><p>
- * By default this will save the preference and dialog stores (if they are in use).
- * </p><p>
- * Subclasses which override this method must call super first.
- * </p>
- */
- public void shutdown() throws CoreException {
-
- // shutdown the perspective manager
- PerspectiveManager.getDefault().shutdown();
- if (DebugActionGroupsManager.defaultExists()) {
- DebugActionGroupsManager.getDefault().shutdown();
- }
- if (LaunchConfigurationManager.defaultExists()) {
- LaunchConfigurationManager.getDefault().shutdown();
- }
- if (ConsoleDocumentManager.defaultExists()) {
- ConsoleDocumentManager.getDefault().shutdown();
- }
-
- ColorManager.getDefault().dispose();
- if (fgPresentation != null) {
- fgPresentation.dispose();
- }
-
- super.shutdown();
- }
-
- /**
- * @see AbstractUIPlugin#startup()
- */
- public void startup() throws CoreException {
- super.startup();
-
- PerspectiveManager.getDefault().startup();
- ConsoleDocumentManager.getDefault().startup();
-
- IAdapterManager manager= Platform.getAdapterManager();
- manager.registerAdapters(new DebugUIPropertiesAdapterFactory(), IDebugElement.class);
- manager.registerAdapters(new DebugUIPropertiesAdapterFactory(), IProcess.class);
-
- getStandardDisplay().asyncExec(
- new Runnable() {
- public void run() {
- createImageRegistry();
- }
- }
- );
- }
-
- /**
- * @see AbstractUIPlugin#initializeDefaultPreferences
- */
- protected void initializeDefaultPreferences(IPreferenceStore prefs) {
- DebugPreferencePage.initDefaults(prefs);
- ConsolePreferencePage.initDefaults(prefs);
- LaunchHistoryPreferencePage.initDefaults(prefs);
- VariableViewsPreferencePage.initDefaults(prefs);
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.xml.serialize.Method;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.Serializer;
+import org.apache.xml.serialize.SerializerFactory;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
+import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager;
+import org.eclipse.debug.internal.ui.preferences.ConsolePreferencePage;
+import org.eclipse.debug.internal.ui.preferences.DebugActionGroupsManager;
+import org.eclipse.debug.internal.ui.preferences.DebugPreferencePage;
+import org.eclipse.debug.internal.ui.preferences.LaunchHistoryPreferencePage;
+import org.eclipse.debug.internal.ui.preferences.VariableViewsPreferencePage;
+import org.eclipse.debug.internal.ui.views.console.ConsoleDocumentManager;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.w3c.dom.Document;
+
+/**
+ * The Debug UI Plugin.
+ *
+ */
+public class DebugUIPlugin extends AbstractUIPlugin {
+
+ /**
+ * The singleton debug plugin instance
+ */
+ private static DebugUIPlugin fgDebugUIPlugin= null;
+
+ /**
+ * A utility presentation used to obtain labels
+ */
+ protected static IDebugModelPresentation fgPresentation = null;
+
+ /**
+ * Default label provider
+ */
+ private static DefaultLabelProvider fgDefaultLabelProvider;
+
+ /**
+ * Flag indicating whether the debug UI is in trace
+ * mode. When in trace mode, extra debug information
+ * is produced.
+ */
+ private boolean fTrace = false;
+
+ /**
+ * Returns whether the debug UI plug-in is in trace
+ * mode.
+ *
+ * @return whether the debug UI plug-in is in trace
+ * mode
+ */
+ public boolean isTraceMode() {
+ return fTrace;
+ }
+
+ /**
+ * Logs the given message if in trace mode.
+ *
+ * @param String message to log
+ */
+ public static void logTraceMessage(String message) {
+ if (getDefault().isTraceMode()) {
+ IStatus s = new Status(IStatus.WARNING, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, message, null);
+ getDefault().getLog().log(s);
+ }
+ }
+
+ /**
+ * Constructs the debug UI plugin
+ */
+ public DebugUIPlugin(IPluginDescriptor descriptor) {
+ super(descriptor);
+ fgDebugUIPlugin= this;
+ }
+ protected ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
}
-
- protected IProcess getProcessFromInput(Object input) {
- IProcess processInput= null;
- if (input instanceof IProcess) {
- processInput= (IProcess) input;
- } else
- if (input instanceof ILaunch) {
- IDebugTarget target= ((ILaunch) input).getDebugTarget();
- if (target != null) {
- processInput= target.getProcess();
- } else {
- IProcess[] processes= ((ILaunch) input).getProcesses();
- if ((processes != null) && (processes.length > 0)) {
- processInput= processes[0];
- }
- }
- } else
- if (input instanceof IDebugElement) {
- processInput= ((IDebugElement) input).getDebugTarget().getProcess();
- }
-
- return processInput;
+ /**
+ * Returns the singleton instance of the debug plugin.
+ */
+ public static DebugUIPlugin getDefault() {
+ return fgDebugUIPlugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() == null) {
+ // If the default instance is not yet initialized,
+ // return a static identifier. This identifier must
+ // match the plugin id defined in plugin.xml
+ return "org.eclipse.debug.ui"; //$NON-NLS-1$
+ }
+ return getDefault().getDescriptor().getUniqueIdentifier();
+ }
+
+ public static IDebugModelPresentation getModelPresentation() {
+ if (fgPresentation == null) {
+ fgPresentation = new DelegatingModelPresentation();
+ }
+ return fgPresentation;
+ }
+
+ public static LaunchConfigurationManager getLaunchConfigurationManager() {
+ return LaunchConfigurationManager.getDefault();
}
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ public static Shell getShell() {
+ if (getActiveWorkbenchWindow() != null) {
+ return getActiveWorkbenchWindow().getShell();
+ }
+ return null;
+ }
+ /**
+ * Returns the default label provider for the debug UI.
+ */
+ public static ILabelProvider getDefaultLabelProvider() {
+ if (fgDefaultLabelProvider == null) {
+ fgDefaultLabelProvider = new DefaultLabelProvider();
+ }
+ return fgDefaultLabelProvider;
+ }
+
+ /**
+ * Creates an extension. If the extension plugin has not
+ * been loaded a busy cursor will be activated during the duration of
+ * the load.
+ *
+ * @param element the config element defining the extension
+ * @param classAttribute the name of the attribute carrying the class
+ * @return the extension object
+ */
+ public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
+ // If plugin has been loaded create extension.
+ // Otherwise, show busy cursor then create extension.
+ IPluginDescriptor plugin = element.getDeclaringExtension().getDeclaringPluginDescriptor();
+ if (plugin.isPluginActivated()) {
+ return element.createExecutableExtension(classAttribute);
+ } else {
+ final Object [] ret = new Object[1];
+ final CoreException [] exc = new CoreException[1];
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+ try {
+ ret[0] = element.createExecutableExtension(classAttribute);
+ } catch (CoreException e) {
+ exc[0] = e;
+ }
+ }
+ });
+ if (exc[0] != null) {
+ throw exc[0];
+ }
+ else {
+ return ret[0];
+ }
+ }
+ }
+
+ protected ImageRegistry createImageRegistry() {
+ return DebugPluginImages.initializeImageRegistry();
+ }
- /**
- * Utility method with conventions
- */
- public static void errorDialog(Shell shell, String title, String message, IStatus s) {
- log(s);
- // if the 'message' resource string and the IStatus' message are the same,
- // don't show both in the dialog
- if (s != null && message.equals(s.getMessage())) {
- message= null;
- }
- ErrorDialog.openError(shell, title, message, s);
- }
-
- /**
- * Utility method with conventions
- */
- public static void errorDialog(Shell shell, String title, String message, Throwable t) {
- log(t);
- IStatus status;
- if (t instanceof CoreException) {
- status= ((CoreException)t).getStatus();
- // if the 'message' resource string and the IStatus' message are the same,
- // don't show both in the dialog
- if (status != null && message.equals(status.getMessage())) {
- message= null;
- }
- } else {
- status= new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$
- }
- ErrorDialog.openError(shell, title, message, status);
- }
+ /**
+ * Shuts down this plug-in and discards all plug-in state.
+ * If a plug-in has been started, this method is automatically
+ * invoked by the platform core when the workbench is closed.
+ * <p>
+ * This method is intended to perform simple termination
+ * of the plug-in environment. The platform may terminate invocations
+ * that do not complete in a timely fashion.
+ * </p><p>
+ * By default this will save the preference and dialog stores (if they are in use).
+ * </p><p>
+ * Subclasses which override this method must call super first.
+ * </p>
+ */
+ public void shutdown() throws CoreException {
+
+ // shutdown the perspective manager
+ PerspectiveManager.getDefault().shutdown();
+ if (DebugActionGroupsManager.defaultExists()) {
+ DebugActionGroupsManager.getDefault().shutdown();
+ }
+ if (LaunchConfigurationManager.defaultExists()) {
+ LaunchConfigurationManager.getDefault().shutdown();
+ }
+ if (ConsoleDocumentManager.defaultExists()) {
+ ConsoleDocumentManager.getDefault().shutdown();
+ }
+
+ ColorManager.getDefault().dispose();
+ if (fgPresentation != null) {
+ fgPresentation.dispose();
+ }
+
+ super.shutdown();
+ }
+
+ /**
+ * @see AbstractUIPlugin#startup()
+ */
+ public void startup() throws CoreException {
+ super.startup();
+
+ PerspectiveManager.getDefault().startup();
+ ConsoleDocumentManager.getDefault().startup();
+
+ IAdapterManager manager= Platform.getAdapterManager();
+ manager.registerAdapters(new DebugUIPropertiesAdapterFactory(), IDebugElement.class);
+ manager.registerAdapters(new DebugUIPropertiesAdapterFactory(), IProcess.class);
+
+ getStandardDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ createImageRegistry();
+ }
+ }
+ );
+ }
+
+ /**
+ * @see AbstractUIPlugin#initializeDefaultPreferences
+ */
+ protected void initializeDefaultPreferences(IPreferenceStore prefs) {
+ DebugPreferencePage.initDefaults(prefs);
+ ConsolePreferencePage.initDefaults(prefs);
+ LaunchHistoryPreferencePage.initDefaults(prefs);
+ VariableViewsPreferencePage.initDefaults(prefs);
+ }
+
+ protected IProcess getProcessFromInput(Object input) {
+ IProcess processInput= null;
+ if (input instanceof IProcess) {
+ processInput= (IProcess) input;
+ } else
+ if (input instanceof ILaunch) {
+ IDebugTarget target= ((ILaunch) input).getDebugTarget();
+ if (target != null) {
+ processInput= target.getProcess();
+ } else {
+ IProcess[] processes= ((ILaunch) input).getProcesses();
+ if ((processes != null) && (processes.length > 0)) {
+ processInput= processes[0];
+ }
+ }
+ } else
+ if (input instanceof IDebugElement) {
+ processInput= ((IDebugElement) input).getDebugTarget().getProcess();
+ }
+
+ return processInput;
+ }
+
+ /**
+ * Utility method with conventions
+ */
+ public static void errorDialog(Shell shell, String title, String message, IStatus s) {
+ log(s);
+ // if the 'message' resource string and the IStatus' message are the same,
+ // don't show both in the dialog
+ if (s != null && message.equals(s.getMessage())) {
+ message= null;
+ }
+ ErrorDialog.openError(shell, title, message, s);
+ }
+
+ /**
+ * Utility method with conventions
+ */
+ public static void errorDialog(Shell shell, String title, String message, Throwable t) {
+ log(t);
+ IStatus status;
+ if (t instanceof CoreException) {
+ status= ((CoreException)t).getStatus();
+ // if the 'message' resource string and the IStatus' message are the same,
+ // don't show both in the dialog
+ if (status != null && message.equals(status.getMessage())) {
+ message= null;
+ }
+ } else {
+ status= new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$
+ }
+ ErrorDialog.openError(shell, title, message, status);
+ }
+
+ /**
+ * Logs the specified status with this plug-in's log.
+ *
+ * @param status status to log
+ */
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ /**
+ * Logs the specified throwable with this plug-in's log.
+ *
+ * @param t throwable to log
+ */
+ public static void log(Throwable t) {
+ IStatus status= new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Error logged from Debug UI: ", t); //$NON-NLS-1$
+ log(status);
+ }
+
+ /**
+ * Logs the given message if in debug mode.
+ *
+ * @param String message to log
+ */
+ public static void logDebugMessage(String message) {
+ if (getDefault().isDebugging()) {
+ logErrorMessage(message);
+ }
+ }
+
+ /**
+ * Logs an internal error with the specified message.
+ *
+ * @param message the error message to log
+ */
+ public static void logErrorMessage(String message) {
+ // this message is intentionally not internationalized, as an exception may
+ // be due to the resource bundle itself
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Internal message logged from Debug UI: " + message, null)); //$NON-NLS-1$
+ }
+
+ /**
+ * Save all dirty editors of all the workbench pages.
+ * Returns whether the operation succeeded.
+ *
+ * @return whether all saving was completed
+ */
+ protected static boolean saveAllPages(boolean confirm) {
+ if (getActiveWorkbenchWindow() == null) {
+ return false;
+ }
+ IWorkbench wb = getActiveWorkbenchWindow().getWorkbench();
+ IWorkbenchWindow[] windows = wb.getWorkbenchWindows();
+ for (int i = 0; i < windows.length; i++) {
+ IWorkbenchPage[] pages = windows[i].getPages();
+ for (int j = 0; j < pages.length; j++) {
+ if (!pages[j].saveAllEditors(confirm)) {
+ return false;
+ };
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Save & build the workspace according to the user-specified preferences. Return <code>false</code> if
+ * any problems were encountered, <code>true</code> otherwise.
+ */
+ public static boolean saveAndBuild() {
+ boolean status = true;
+ String saveDirty = getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADIO);
+ boolean buildBeforeLaunch = getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH);
+ boolean autobuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
+
+ // If we're ignoring dirty editors, check if we need to build
+ if (saveDirty.equals(IDebugUIConstants.PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH)) {
+ if (buildBeforeLaunch) {
+ return doBuild();
+ }
+ } else {
+ boolean prompt = false;
+ if (saveDirty.equals(IDebugUIConstants.PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH)) {
+ prompt = true;
+ }
+ status = saveAllPages(prompt);
+ if (status && !autobuilding && buildBeforeLaunch) {
+ status = doBuild();
+ }
+ }
+
+ return status;
+ }
+
+ private static boolean doBuild() {
+ ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
+ try {
+ dialog.run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ // cancelled by user
+ return false;
+ } catch (InvocationTargetException e) {
+ String title= DebugUIMessages.getString("DebugUIPlugin.Run/Debug_1"); //$NON-NLS-1$
+ String message= DebugUIMessages.getString("DebugUIPlugin.Build_error._Check_log_for_details._2"); //$NON-NLS-1$
+ Throwable t = e.getTargetException();
+ errorDialog(getShell(), title, message, t);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns the standard display to be used. The method first checks, if
+ * the thread calling this method has an associated display. If so, this
+ * display is returned. Otherwise the method returns the default display.
+ */
+ public static Display getStandardDisplay() {
+ Display display= Display.getCurrent();
+ if (display == null) {
+ display= Display.getDefault();
+ }
+ return display;
+ }
+
+ /**
+ * Returns the a color based on the type of output.
+ * Valid types:
+ * <li>CONSOLE_SYS_OUT_RGB</li>
+ * <li>CONSOLE_SYS_ERR_RGB</li>
+ * <li>CONSOLE_SYS_IN_RGB</li>
+ * <li>CHANGED_VARIABLE_RGB</li>
+ */
+ public static Color getPreferenceColor(String type) {
+ return ColorManager.getDefault().getColor(PreferenceConverter.getColor(getDefault().getPreferenceStore(), type));
+ }
+
+ public static ConsoleDocumentManager getConsoleDocumentManager() {
+ return ConsoleDocumentManager.getDefault();
+ }
+
+ /**
+ * Serializes a XML document into a string - encoded in UTF8 format,
+ * with platform line separators.
+ *
+ * @param doc document to serialize
+ * @return the document as a string
+ */
+ public static String serializeDocument(Document doc) throws IOException {
+ ByteArrayOutputStream s= new ByteArrayOutputStream();
+ OutputFormat format = new OutputFormat();
+ format.setIndenting(true);
+ format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
+
+ Serializer serializer =
+ SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(
+ new OutputStreamWriter(s, "UTF8"), //$NON-NLS-1$
+ format);
+ serializer.asDOMSerializer().serialize(doc);
+ return s.toString("UTF8"); //$NON-NLS-1$
+ }
+
+ /**
+ * Determines and returns the selection in the specified window. If nothing is
+ * actually selected, look for an active editor.
+ */
+ public static IStructuredSelection resolveSelection(IWorkbenchWindow window) {
+ if (window == null) {
+ return null;
+ }
+ ISelection selection= window.getSelectionService().getSelection();
+ if (selection == null || selection.isEmpty() || !(selection instanceof IStructuredSelection)) {
+ // there is no obvious selection - go fishing
+ selection= null;
+ IWorkbenchPage page= window.getActivePage();
+ if (page == null) {
+ //workspace is closed
+ return null;
+ }
+
+ // first, see if there is an active editor, and try its input element
+ IEditorPart editor= page.getActiveEditor();
+ Object element= null;
+ if (editor != null) {
+ element= editor.getEditorInput();
+ }
+
+ if (selection == null && element != null) {
+ selection= new StructuredSelection(element);
+ }
+ }
+ return (IStructuredSelection)selection;
+ }
+
+}
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- IStatus status= new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Error logged from Debug UI: ", t); //$NON-NLS-1$
- log(status);
- }
-
- /**
- * Logs the given message if in debug mode.
- *
- * @param String message to log
- */
- public static void logDebugMessage(String message) {
- if (getDefault().isDebugging()) {
- logErrorMessage(message);
- }
- }
-
- /**
- * Logs an internal error with the specified message.
- *
- * @param message the error message to log
- */
- public static void logErrorMessage(String message) {
- // this message is intentionally not internationalized, as an exception may
- // be due to the resource bundle itself
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Internal message logged from Debug UI: " + message, null)); //$NON-NLS-1$
- }
-
- /**
- * Save all dirty editors of all the workbench pages.
- * Returns whether the operation succeeded.
- *
- * @return whether all saving was completed
- */
- protected static boolean saveAllPages(boolean confirm) {
- if (getActiveWorkbenchWindow() == null) {
- return false;
- }
- IWorkbench wb = getActiveWorkbenchWindow().getWorkbench();
- IWorkbenchWindow[] windows = wb.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- IWorkbenchPage[] pages = windows[i].getPages();
- for (int j = 0; j < pages.length; j++) {
- if (!pages[j].saveAllEditors(confirm)) {
- return false;
- };
- }
- }
- return true;
- }
-
- /**
- * Save & build the workspace according to the user-specified preferences. Return <code>false</code> if
- * any problems were encountered, <code>true</code> otherwise.
- */
- public static boolean saveAndBuild() {
- boolean status = true;
- String saveDirty = getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADIO);
- boolean buildBeforeLaunch = getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH);
- boolean autobuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
-
- // If we're ignoring dirty editors, check if we need to build
- if (saveDirty.equals(IDebugUIConstants.PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH)) {
- if (buildBeforeLaunch) {
- return doBuild();
- }
- } else {
- boolean prompt = false;
- if (saveDirty.equals(IDebugUIConstants.PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH)) {
- prompt = true;
- }
- status = saveAllPages(prompt);
- if (status && !autobuilding && buildBeforeLaunch) {
- status = doBuild();
- }
- }
-
- return status;
- }
-
- private static boolean doBuild() {
- ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
- try {
- dialog.run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- });
- } catch (InterruptedException e) {
- // cancelled by user
- return false;
- } catch (InvocationTargetException e) {
- String title= DebugUIMessages.getString("DebugUIPlugin.Run/Debug_1"); //$NON-NLS-1$
- String message= DebugUIMessages.getString("DebugUIPlugin.Build_error._Check_log_for_details._2"); //$NON-NLS-1$
- Throwable t = e.getTargetException();
- errorDialog(getShell(), title, message, t);
- return false;
- }
- return true;
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if
- * the thread calling this method has an associated display. If so, this
- * display is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display= Display.getCurrent();
- if (display == null) {
- display= Display.getDefault();
- }
- return display;
- }
-
- /**
- * Returns the a color based on the type of output.
- * Valid types:
- * <li>CONSOLE_SYS_OUT_RGB</li>
- * <li>CONSOLE_SYS_ERR_RGB</li>
- * <li>CONSOLE_SYS_IN_RGB</li>
- * <li>CHANGED_VARIABLE_RGB</li>
- */
- public static Color getPreferenceColor(String type) {
- return ColorManager.getDefault().getColor(PreferenceConverter.getColor(getDefault().getPreferenceStore(), type));
- }
-
- public static ConsoleDocumentManager getConsoleDocumentManager() {
- return ConsoleDocumentManager.getDefault();
- }
-
- /**
- * Serializes a XML document into a string - encoded in UTF8 format,
- * with platform line separators.
- *
- * @param doc document to serialize
- * @return the document as a string
- */
- public static String serializeDocument(Document doc) throws IOException {
- ByteArrayOutputStream s= new ByteArrayOutputStream();
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
-
- Serializer serializer =
- SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(
- new OutputStreamWriter(s, "UTF8"), //$NON-NLS-1$
- format);
- serializer.asDOMSerializer().serialize(doc);
- return s.toString("UTF8"); //$NON-NLS-1$
- }
-
- /**
- * Determines and returns the selection in the specified window. If nothing is
- * actually selected, look for an active editor.
- */
- public static IStructuredSelection resolveSelection(IWorkbenchWindow window) {
- if (window == null) {
- return null;
- }
- ISelection selection= window.getSelectionService().getSelection();
- if (selection == null || selection.isEmpty() || !(selection instanceof IStructuredSelection)) {
- // there is no obvious selection - go fishing
- selection= null;
- IWorkbenchPage page= window.getActivePage();
- if (page == null) {
- //workspace is closed
- return null;
- }
-
- // first, see if there is an active editor, and try its input element
- IEditorPart editor= page.getActiveEditor();
- Object element= null;
- if (editor != null) {
- element= editor.getEditorInput();
- }
-
- if (selection == null && element != null) {
- selection= new StructuredSelection(element);
- }
- }
- return (IStructuredSelection)selection;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPropertiesAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPropertiesAdapterFactory.java
index f2aff3af0..5f88180d2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPropertiesAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPropertiesAdapterFactory.java
@@ -1,82 +1,82 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * This factory and the IWorkbenchAdapter that it provides exist so that
- * a properties dialog that is realized on a launches view element will have a
- * title.
- */
-/*package*/ class DebugUIPropertiesAdapterFactory implements IAdapterFactory {
-
- class DebugUIPropertiesAdapter implements IWorkbenchAdapter {
-
- /**
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren(Object o) {
- return new Object[0];
- }
-
- /**
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return DebugUITools.getDefaultImageDescriptor(object);
- }
-
- /**
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object o) {
- IDebugModelPresentation presentation= DebugUIPlugin.getModelPresentation();
- return presentation.getText(o);
- }
-
- /**
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object o) {
- return null;
- }
- }
-
- /**
- * @see IAdapterFactory#getAdapter(Object, Class)
- */
- public Object getAdapter(Object obj, Class adapterType) {
- if (adapterType.isInstance(obj)) {
- return obj;
- }
- if (adapterType == IWorkbenchAdapter.class) {
- if (obj instanceof IDebugElement) {
- return new DebugUIPropertiesAdapter();
- }
- if (obj instanceof IProcess) {
- return new DebugUIPropertiesAdapter();
- }
- }
- return null;
- }
-
- /**
- * @see IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {
- IWorkbenchAdapter.class
- };
- }
-}
-
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+/**
+ * This factory and the IWorkbenchAdapter that it provides exist so that
+ * a properties dialog that is realized on a launches view element will have a
+ * title.
+ */
+/*package*/ class DebugUIPropertiesAdapterFactory implements IAdapterFactory {
+
+ class DebugUIPropertiesAdapter implements IWorkbenchAdapter {
+
+ /**
+ * @see IWorkbenchAdapter#getChildren(Object)
+ */
+ public Object[] getChildren(Object o) {
+ return new Object[0];
+ }
+
+ /**
+ * @see IWorkbenchAdapter#getImageDescriptor(Object)
+ */
+ public ImageDescriptor getImageDescriptor(Object object) {
+ return DebugUITools.getDefaultImageDescriptor(object);
+ }
+
+ /**
+ * @see IWorkbenchAdapter#getLabel(Object)
+ */
+ public String getLabel(Object o) {
+ IDebugModelPresentation presentation= DebugUIPlugin.getModelPresentation();
+ return presentation.getText(o);
+ }
+
+ /**
+ * @see IWorkbenchAdapter#getParent(Object)
+ */
+ public Object getParent(Object o) {
+ return null;
+ }
+ }
+
+ /**
+ * @see IAdapterFactory#getAdapter(Object, Class)
+ */
+ public Object getAdapter(Object obj, Class adapterType) {
+ if (adapterType.isInstance(obj)) {
+ return obj;
+ }
+ if (adapterType == IWorkbenchAdapter.class) {
+ if (obj instanceof IDebugElement) {
+ return new DebugUIPropertiesAdapter();
+ }
+ if (obj instanceof IProcess) {
+ return new DebugUIPropertiesAdapter();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ return new Class[] {
+ IWorkbenchAdapter.class
+ };
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index d9957ec7d..4751370bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -1,292 +1,292 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-
-/**
- * A model presentation that delegates to the appropriate extension. This
- * presentation contains a table of specialized presentations that are defined
- * as <code>org.eclipse.debug.ui.debugModelPresentations</code> extensions. When
- * asked to render an object from a debug model, this presentation delegates
- * to the extension registered for that debug model.
- */
-public class DelegatingModelPresentation implements IDebugModelPresentation {
-
- /**
- * A mapping of attribute ids to their values
- * @see IDebugModelPresentation#setAttribute
- */
- private HashMap fAttributes= new HashMap(3);
- /**
- * A table of label providers keyed by debug model identifiers.
- */
- private HashMap fLabelProviders= new HashMap(5);
-
- /**
- * Constructs a new DelegatingLabelProvider that delegates to extensions
- * of kind <code>org.eclipse.debug.ui.debugLabelProvider</code>
- */
- public DelegatingModelPresentation() {
- IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
- IExtensionPoint point= descriptor.getExtensionPoint(IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
- if (point != null) {
- IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
- IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
- String id= elt.getAttribute("id"); //$NON-NLS-1$
- if (id != null) {
- IDebugModelPresentation lp= new LazyModelPresentation(elt);
- getLabelProviders().put(id, lp);
- }
- }
- }
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).addListener(listener);
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).dispose();
- }
- }
-
- /**
- * @see IDebugModelPresentation#getImage(Object)
- */
- public Image getImage(Object item) {
- // Attempt to delegate
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- Image image= lp.getImage(item);
- if (image != null) {
- return image;
- }
- }
- // If no delegate returned an image, use the default
- return getDefaultImage(item);
- }
-
- /**
- * @see IDebugModelPresentation#getText(Object)
- */
- public String getText(Object item) {
- // Attempt to delegate
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- String label= lp.getText(item);
- if (label != null) {
- return label;
- }
- }
- // If no delegate returned a text label, use the default
- if (showVariableTypeNames()) {
- try {
- if (item instanceof IExpression) {
- return new StringBuffer(((IExpression)item).getValue().getReferenceTypeName()).append(' ').append(getDefaultText(item)).toString(); //$NON-NLS-1$
- } else if (item instanceof IVariable) {
- return new StringBuffer(((IVariable)item).getValue().getReferenceTypeName()).append(' ').append(getDefaultText(item)).toString(); //$NON-NLS-1$
- }
- } catch (DebugException de) {
- DebugUIPlugin.log(de);
- }
- }
- return getDefaultText(item);
- }
-
- /**
- * @see IDebugModelPresentation#getEditorInput(Object)
- */
- public IEditorInput getEditorInput(Object item) {
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- return lp.getEditorInput(item);
- }
- return null;
- }
-
- /**
- * @see IDebugModelPresentation#getEditorId(IEditorInput, Object)
- */
- public String getEditorId(IEditorInput input, Object objectInput) {
- IDebugModelPresentation lp= getConfiguredPresentation(objectInput);
- if (lp != null) {
- return lp.getEditorId(input, objectInput);
- }
- return null;
- }
-
-
- /**
- * Returns a default text label for the debug element
- */
- protected String getDefaultText(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getText(element);
- }
-
- /**
- * Returns a default image for the debug element
- */
- protected Image getDefaultImage(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getImage(element);
- }
-
- /*
- * @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
- */
- public void computeDetail(IValue value, IValueDetailListener listener) {
- IDebugModelPresentation lp= getConfiguredPresentation(value);
- if (lp != null) {
- lp.computeDetail(value, listener);
- } else {
- listener.detailComputed(value, getText(value));
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).removeListener(listener);
- }
- }
-
- /**
- * Delegate to the appropriate label provider.
- *
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- if (element instanceof IDebugElement) {
- IDebugModelPresentation lp= getConfiguredPresentation((IDebugElement) element);
- if (lp != null) {
- return lp.isLabelProperty(element, property);
- }
- }
-
- return true;
- }
-
- /**
- * Returns a configured model presentation for the given object,
- * or <code>null</code> if one is not registered.
- */
- protected IDebugModelPresentation getConfiguredPresentation(Object element) {
- String id= null;
- if (element instanceof IDebugElement) {
- IDebugElement de= (IDebugElement) element;
- id= de.getModelIdentifier();
- } else if (element instanceof IMarker) {
- IMarker m= (IMarker) element;
- IBreakpoint bp = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(m);
- if (bp != null) {
- id= bp.getModelIdentifier();
- }
- } else if (element instanceof IBreakpoint) {
- id = ((IBreakpoint)element).getModelIdentifier();
- }
- if (id != null) {
- return getPresentation(id);
- }
-
- return null;
- }
-
- /**
- * Returns the presentation registered for the given id, or <code>null</code>
- * of nothing is registered for the id.
- */
- public IDebugModelPresentation getPresentation(String id) {
- return (IDebugModelPresentation) getLabelProviders().get(id);
- }
-
- /**
- * @see IDebugModelPresentation#setAttribute(String, Object)
- */
- public void setAttribute(String id, Object value) {
- if (value == null) {
- return;
- }
- getAttributes().put(id, value);
- Iterator presentations = fLabelProviders.values().iterator();
- while (presentations.hasNext()) {
- ((IDebugModelPresentation)presentations.next()).setAttribute(id, value);
- }
- }
-
- /**
- * Whether or not to show variable type names.
- * This option is configured per model presentation.
- * This allows this option to be set per view, for example.
- */
- protected boolean showVariableTypeNames() {
- Boolean show= (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
- show= show == null ? Boolean.FALSE : show;
- return show.booleanValue();
- }
-
- protected HashMap getAttributes() {
- return fAttributes;
- }
-
- protected void setAttributes(HashMap attributes) {
- fAttributes = attributes;
- }
-
- protected HashMap getLabelProviders() {
- return fLabelProviders;
- }
-
- protected void setLabelProviders(HashMap labelProviders) {
- fLabelProviders = labelProviders;
- }
-}
-
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IExpression;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * A model presentation that delegates to the appropriate extension. This
+ * presentation contains a table of specialized presentations that are defined
+ * as <code>org.eclipse.debug.ui.debugModelPresentations</code> extensions. When
+ * asked to render an object from a debug model, this presentation delegates
+ * to the extension registered for that debug model.
+ */
+public class DelegatingModelPresentation implements IDebugModelPresentation {
+
+ /**
+ * A mapping of attribute ids to their values
+ * @see IDebugModelPresentation#setAttribute
+ */
+ private HashMap fAttributes= new HashMap(3);
+ /**
+ * A table of label providers keyed by debug model identifiers.
+ */
+ private HashMap fLabelProviders= new HashMap(5);
+
+ /**
+ * Constructs a new DelegatingLabelProvider that delegates to extensions
+ * of kind <code>org.eclipse.debug.ui.debugLabelProvider</code>
+ */
+ public DelegatingModelPresentation() {
+ IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
+ IExtensionPoint point= descriptor.getExtensionPoint(IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
+ if (point != null) {
+ IExtension[] extensions= point.getExtensions();
+ for (int i= 0; i < extensions.length; i++) {
+ IExtension extension= extensions[i];
+ IConfigurationElement[] configElements= extension.getConfigurationElements();
+ for (int j= 0; j < configElements.length; j++) {
+ IConfigurationElement elt= configElements[j];
+ String id= elt.getAttribute("id"); //$NON-NLS-1$
+ if (id != null) {
+ IDebugModelPresentation lp= new LazyModelPresentation(elt);
+ getLabelProviders().put(id, lp);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Delegate to all extensions.
+ *
+ * @see IBaseLabelProvider#addListener(ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+ Iterator i= getLabelProviders().values().iterator();
+ while (i.hasNext()) {
+ ((ILabelProvider) i.next()).addListener(listener);
+ }
+ }
+
+ /**
+ * Delegate to all extensions.
+ *
+ * @see IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ Iterator i= getLabelProviders().values().iterator();
+ while (i.hasNext()) {
+ ((ILabelProvider) i.next()).dispose();
+ }
+ }
+
+ /**
+ * @see IDebugModelPresentation#getImage(Object)
+ */
+ public Image getImage(Object item) {
+ // Attempt to delegate
+ IDebugModelPresentation lp= getConfiguredPresentation(item);
+ if (lp != null) {
+ Image image= lp.getImage(item);
+ if (image != null) {
+ return image;
+ }
+ }
+ // If no delegate returned an image, use the default
+ return getDefaultImage(item);
+ }
+
+ /**
+ * @see IDebugModelPresentation#getText(Object)
+ */
+ public String getText(Object item) {
+ // Attempt to delegate
+ IDebugModelPresentation lp= getConfiguredPresentation(item);
+ if (lp != null) {
+ String label= lp.getText(item);
+ if (label != null) {
+ return label;
+ }
+ }
+ // If no delegate returned a text label, use the default
+ if (showVariableTypeNames()) {
+ try {
+ if (item instanceof IExpression) {
+ return new StringBuffer(((IExpression)item).getValue().getReferenceTypeName()).append(' ').append(getDefaultText(item)).toString(); //$NON-NLS-1$
+ } else if (item instanceof IVariable) {
+ return new StringBuffer(((IVariable)item).getValue().getReferenceTypeName()).append(' ').append(getDefaultText(item)).toString(); //$NON-NLS-1$
+ }
+ } catch (DebugException de) {
+ DebugUIPlugin.log(de);
+ }
+ }
+ return getDefaultText(item);
+ }
+
+ /**
+ * @see IDebugModelPresentation#getEditorInput(Object)
+ */
+ public IEditorInput getEditorInput(Object item) {
+ IDebugModelPresentation lp= getConfiguredPresentation(item);
+ if (lp != null) {
+ return lp.getEditorInput(item);
+ }
+ return null;
+ }
+
+ /**
+ * @see IDebugModelPresentation#getEditorId(IEditorInput, Object)
+ */
+ public String getEditorId(IEditorInput input, Object objectInput) {
+ IDebugModelPresentation lp= getConfiguredPresentation(objectInput);
+ if (lp != null) {
+ return lp.getEditorId(input, objectInput);
+ }
+ return null;
+ }
+
+
+ /**
+ * Returns a default text label for the debug element
+ */
+ protected String getDefaultText(Object element) {
+ return DebugUIPlugin.getDefaultLabelProvider().getText(element);
+ }
+
+ /**
+ * Returns a default image for the debug element
+ */
+ protected Image getDefaultImage(Object element) {
+ return DebugUIPlugin.getDefaultLabelProvider().getImage(element);
+ }
+
+ /*
+ * @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
+ */
+ public void computeDetail(IValue value, IValueDetailListener listener) {
+ IDebugModelPresentation lp= getConfiguredPresentation(value);
+ if (lp != null) {
+ lp.computeDetail(value, listener);
+ } else {
+ listener.detailComputed(value, getText(value));
+ }
+ }
+
+ /**
+ * Delegate to all extensions.
+ *
+ * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ Iterator i= getLabelProviders().values().iterator();
+ while (i.hasNext()) {
+ ((ILabelProvider) i.next()).removeListener(listener);
+ }
+ }
+
+ /**
+ * Delegate to the appropriate label provider.
+ *
+ * @see IBaseLabelProvider#isLabelProperty(Object, String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ if (element instanceof IDebugElement) {
+ IDebugModelPresentation lp= getConfiguredPresentation((IDebugElement) element);
+ if (lp != null) {
+ return lp.isLabelProperty(element, property);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns a configured model presentation for the given object,
+ * or <code>null</code> if one is not registered.
+ */
+ protected IDebugModelPresentation getConfiguredPresentation(Object element) {
+ String id= null;
+ if (element instanceof IDebugElement) {
+ IDebugElement de= (IDebugElement) element;
+ id= de.getModelIdentifier();
+ } else if (element instanceof IMarker) {
+ IMarker m= (IMarker) element;
+ IBreakpoint bp = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(m);
+ if (bp != null) {
+ id= bp.getModelIdentifier();
+ }
+ } else if (element instanceof IBreakpoint) {
+ id = ((IBreakpoint)element).getModelIdentifier();
+ }
+ if (id != null) {
+ return getPresentation(id);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the presentation registered for the given id, or <code>null</code>
+ * of nothing is registered for the id.
+ */
+ public IDebugModelPresentation getPresentation(String id) {
+ return (IDebugModelPresentation) getLabelProviders().get(id);
+ }
+
+ /**
+ * @see IDebugModelPresentation#setAttribute(String, Object)
+ */
+ public void setAttribute(String id, Object value) {
+ if (value == null) {
+ return;
+ }
+ getAttributes().put(id, value);
+ Iterator presentations = fLabelProviders.values().iterator();
+ while (presentations.hasNext()) {
+ ((IDebugModelPresentation)presentations.next()).setAttribute(id, value);
+ }
+ }
+
+ /**
+ * Whether or not to show variable type names.
+ * This option is configured per model presentation.
+ * This allows this option to be set per view, for example.
+ */
+ protected boolean showVariableTypeNames() {
+ Boolean show= (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
+ show= show == null ? Boolean.FALSE : show;
+ return show.booleanValue();
+ }
+
+ protected HashMap getAttributes() {
+ return fAttributes;
+ }
+
+ protected void setAttributes(HashMap attributes) {
+ fAttributes = attributes;
+ }
+
+ protected HashMap getLabelProviders() {
+ return fLabelProviders;
+ }
+
+ protected void setLabelProviders(HashMap labelProviders) {
+ fLabelProviders = labelProviders;
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
index 548fa188b..1ca3d33b2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
@@ -1,52 +1,52 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Help context ids for the debug ui.
- * <p>
- * This interface contains constants only; it is not intended to be implemented
- * or extended.
- * </p>
- *
- */
-public interface IDebugHelpContextIds {
-
- public static final String PREFIX = IDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$
-
- // Actions
- public static final String CHANGE_VALUE_ACTION = PREFIX + "change_value_action_context"; //$NON-NLS-1$
- public static final String CLEAR_CONSOLE_ACTION = PREFIX + "clear_console_action_context"; //$NON-NLS-1$
- public static final String OPEN_BREAKPOINT_ACTION = PREFIX + "open_breakpoint_action_context"; //$NON-NLS-1$
- public static final String RELAUNCH_HISTORY_ACTION = PREFIX + "relaunch_history_action_context"; //$NON-NLS-1$
- public static final String SHOW_DETAIL_PANE_ACTION = PREFIX + "show_detail_pane_action_context"; //$NON-NLS-1$
- public static final String SHOW_BREAKPOINTS_FOR_MODEL_ACTION = PREFIX + "show_breakpoints_for_model_action_context"; //$NON-NLS-1$
- public static final String SHOW_TYPES_ACTION = PREFIX + "show_types_action_context"; //$NON-NLS-1$
-
- // Views
- public static final String DEBUG_VIEW = PREFIX + "debug_view_context"; //$NON-NLS-1$
- public static final String VARIABLE_VIEW = PREFIX + "variable_view_context"; //$NON-NLS-1$
- public static final String BREAKPOINT_VIEW = PREFIX + "breakpoint_view_context"; //$NON-NLS-1$
- public static final String CONSOLE_VIEW = PREFIX + "console_view_context"; //$NON-NLS-1$
- public static final String EXPRESSION_VIEW = PREFIX + "expression_view_context"; //$NON-NLS-1$
-
- // Preference pages
- public static final String DEBUG_PREFERENCE_PAGE = PREFIX + "debug_preference_page_context"; //$NON-NLS-1$
- public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$
- public static final String VARIABLE_VIEWS_PREFERENCE_PAGE = PREFIX + "variable_views_preference_page_context"; //$NON-NLS-1$
- public static final String DEBUG_ACTION_GROUPS_PREFERENCE_PAGE = PREFIX + "debug_action_groups_views_preference_page_context"; //$NON-NLS-1$
- public static final String LAUNCH_HISTORY_PREFERENCE_PAGE = PREFIX + "launch_history_preference_page_context"; //$NON-NLS-1$
-
- // Dialogs
- public static final String LAUNCH_CONFIGURATION_DIALOG = PREFIX + "launch_configuration_dialog"; //$NON-NLS-1$
-
- // Launch configuration dialog pages
- public static final String LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB = PREFIX + "launch_configuration_dialog_common_tab"; //$NON-NLS-1$
-
-}
-
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.ui.IDebugUIConstants;
+
+/**
+ * Help context ids for the debug ui.
+ * <p>
+ * This interface contains constants only; it is not intended to be implemented
+ * or extended.
+ * </p>
+ *
+ */
+public interface IDebugHelpContextIds {
+
+ public static final String PREFIX = IDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$
+
+ // Actions
+ public static final String CHANGE_VALUE_ACTION = PREFIX + "change_value_action_context"; //$NON-NLS-1$
+ public static final String CLEAR_CONSOLE_ACTION = PREFIX + "clear_console_action_context"; //$NON-NLS-1$
+ public static final String OPEN_BREAKPOINT_ACTION = PREFIX + "open_breakpoint_action_context"; //$NON-NLS-1$
+ public static final String RELAUNCH_HISTORY_ACTION = PREFIX + "relaunch_history_action_context"; //$NON-NLS-1$
+ public static final String SHOW_DETAIL_PANE_ACTION = PREFIX + "show_detail_pane_action_context"; //$NON-NLS-1$
+ public static final String SHOW_BREAKPOINTS_FOR_MODEL_ACTION = PREFIX + "show_breakpoints_for_model_action_context"; //$NON-NLS-1$
+ public static final String SHOW_TYPES_ACTION = PREFIX + "show_types_action_context"; //$NON-NLS-1$
+
+ // Views
+ public static final String DEBUG_VIEW = PREFIX + "debug_view_context"; //$NON-NLS-1$
+ public static final String VARIABLE_VIEW = PREFIX + "variable_view_context"; //$NON-NLS-1$
+ public static final String BREAKPOINT_VIEW = PREFIX + "breakpoint_view_context"; //$NON-NLS-1$
+ public static final String CONSOLE_VIEW = PREFIX + "console_view_context"; //$NON-NLS-1$
+ public static final String EXPRESSION_VIEW = PREFIX + "expression_view_context"; //$NON-NLS-1$
+
+ // Preference pages
+ public static final String DEBUG_PREFERENCE_PAGE = PREFIX + "debug_preference_page_context"; //$NON-NLS-1$
+ public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$
+ public static final String VARIABLE_VIEWS_PREFERENCE_PAGE = PREFIX + "variable_views_preference_page_context"; //$NON-NLS-1$
+ public static final String DEBUG_ACTION_GROUPS_PREFERENCE_PAGE = PREFIX + "debug_action_groups_views_preference_page_context"; //$NON-NLS-1$
+ public static final String LAUNCH_HISTORY_PREFERENCE_PAGE = PREFIX + "launch_history_preference_page_context"; //$NON-NLS-1$
+
+ // Dialogs
+ public static final String LAUNCH_CONFIGURATION_DIALOG = PREFIX + "launch_configuration_dialog"; //$NON-NLS-1$
+
+ // Launch configuration dialog pages
+ public static final String LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB = PREFIX + "launch_configuration_dialog_common_tab"; //$NON-NLS-1$
+
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
index 155f62837..f2936377f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
@@ -1,36 +1,36 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-public interface IInternalDebugUIConstants {
-
- public static final String DIALOGSTORE_LASTEXTJAR= "org.eclipse.debug.ui.lastextjar"; //$NON-NLS-1$
-
- //Folders
- public static final String ID_NAVIGATOR_FOLDER_VIEW= "org.eclipse.debug.internal.ui.NavigatorFolderView"; //$NON-NLS-1$
- public static final String ID_TOOLS_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ToolsFolderView"; //$NON-NLS-1$
- public static final String ID_CONSOLE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ConsoleFolderView"; //$NON-NLS-1$
- public static final String ID_OUTLINE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.OutlineFolderView"; //$NON-NLS-1$
-
- //Current stack frame instruction pointer
- public static final String INSTRUCTION_POINTER= "org.eclipse.debug.ui.instructionPointer"; //$NON-NLS-1$
-
- // disabled local tool images
- public static final String IMG_DLCL_CLEAR= "IMG_DLCL_CLEAR"; //$NON-NLS-1$
- public static final String IMG_DLCL_DETAIL_PANE= "IMG_DLCL_DETAIL_PANE"; //$NON-NLS-1$
- public static final String IMG_DLCL_CHANGE_VARIABLE_VALUE= "IMG_DLCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
- public static final String IMG_DLCL_TYPE_NAMES= "IMG_DLCL_TYPE_NAMES"; //$NON-NLS-1$
-
- // enabled local tool images
- public static final String IMG_ELCL_CLEAR= "IMG_ELCL_CLEAR"; //$NON-NLS-1$
- public static final String IMG_ELCL_DETAIL_PANE= "IMG_ELCL_DETAIL_PANE"; //$NON-NLS-1$
- public static final String IMG_ELCL_CHANGE_VARIABLE_VALUE= "IMG_ELCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
- public static final String IMG_ELCL_TYPE_NAMES= "IMG_ELCL_TYPE_NAMES"; //$NON-NLS-1$
-
- /** Transparent overlay image identifier. */
- public static final String IMG_OVR_TRANSPARENT = "IMG_OVR_TRANSPARENT"; //$NON-NLS-1$
-
-}
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+public interface IInternalDebugUIConstants {
+
+ public static final String DIALOGSTORE_LASTEXTJAR= "org.eclipse.debug.ui.lastextjar"; //$NON-NLS-1$
+
+ //Folders
+ public static final String ID_NAVIGATOR_FOLDER_VIEW= "org.eclipse.debug.internal.ui.NavigatorFolderView"; //$NON-NLS-1$
+ public static final String ID_TOOLS_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ToolsFolderView"; //$NON-NLS-1$
+ public static final String ID_CONSOLE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ConsoleFolderView"; //$NON-NLS-1$
+ public static final String ID_OUTLINE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.OutlineFolderView"; //$NON-NLS-1$
+
+ //Current stack frame instruction pointer
+ public static final String INSTRUCTION_POINTER= "org.eclipse.debug.ui.instructionPointer"; //$NON-NLS-1$
+
+ // disabled local tool images
+ public static final String IMG_DLCL_CLEAR= "IMG_DLCL_CLEAR"; //$NON-NLS-1$
+ public static final String IMG_DLCL_DETAIL_PANE= "IMG_DLCL_DETAIL_PANE"; //$NON-NLS-1$
+ public static final String IMG_DLCL_CHANGE_VARIABLE_VALUE= "IMG_DLCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
+ public static final String IMG_DLCL_TYPE_NAMES= "IMG_DLCL_TYPE_NAMES"; //$NON-NLS-1$
+
+ // enabled local tool images
+ public static final String IMG_ELCL_CLEAR= "IMG_ELCL_CLEAR"; //$NON-NLS-1$
+ public static final String IMG_ELCL_DETAIL_PANE= "IMG_ELCL_DETAIL_PANE"; //$NON-NLS-1$
+ public static final String IMG_ELCL_CHANGE_VARIABLE_VALUE= "IMG_ELCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
+ public static final String IMG_ELCL_TYPE_NAMES= "IMG_ELCL_TYPE_NAMES"; //$NON-NLS-1$
+
+ /** Transparent overlay image identifier. */
+ public static final String IMG_OVR_TRANSPARENT = "IMG_OVR_TRANSPARENT"; //$NON-NLS-1$
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
index c283b6384..9e745c90d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
@@ -1,198 +1,198 @@
-package org.eclipse.debug.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-
-/**
- * A proxy to an IDebugModelPresentation extension. Instantiates the extension
- * when it is needed.
- */
-
-public class LazyModelPresentation implements IDebugModelPresentation {
-
- /**
- * A temporary mapping of attribute ids to their values
- * @see IDebugModelPresentation#setAttribute
- */
- protected HashMap fAttributes= new HashMap(3);
-
- /**
- * The config element that defines the extension
- */
- protected IConfigurationElement fConfig = null;
-
- /**
- * The actual presentation instance - null until called upon
- */
- protected IDebugModelPresentation fPresentation = null;
-
- /**
- * Temp holding for listeners - we do not add to presentation until
- * it needs to be instantiated.
- */
- protected ListenerList fListeners= new ListenerList(5);
- /**
- * Constructs a lazy presentation from the config element.
- */
- public LazyModelPresentation(IConfigurationElement configElement) {
- fConfig = configElement;
- }
-
- /**
- * @see IDebugModelPresentation#getImage(Object)
- */
- public Image getImage(Object element) {
- return getPresentation().getImage(element);
- }
-
- /**
- * @see IDebugModelPresentation#getText(Object)
- */
- public String getText(Object element) {
- return getPresentation().getText(element);
- }
-
- /**
- * @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
- */
- public void computeDetail(IValue value, IValueDetailListener listener) {
- getPresentation().computeDetail(value, listener);
- }
-
- /**
- * @see ISourcePresentation#getEditorInput(Object)
- */
- public IEditorInput getEditorInput(Object element) {
- return getPresentation().getEditorInput(element);
- }
-
- /**
- * @see ISourcePresentation#getEditorId(IEditorInput, Object)
- */
- public String getEditorId(IEditorInput input, Object inputObject) {
- return getPresentation().getEditorId(input, inputObject);
- }
-
- /**
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- if (fPresentation != null) {
- getPresentation().addListener(listener);
- }
- fListeners.add(listener);
- }
-
- /**
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- if (fPresentation != null) {
- getPresentation().dispose();
- }
- fListeners = null;
- }
-
- /**
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- if (fPresentation != null) {
- return getPresentation().isLabelProperty(element, property);
- }
- return false;
- }
-
- /**
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- if (fPresentation != null) {
- getPresentation().removeListener(listener);
- }
- fListeners.remove(listener);
- }
-
- /**
- * Returns the real presentation, instantiating if required.
- */
- protected IDebugModelPresentation getPresentation() {
- if (fPresentation == null) {
- try {
- fPresentation= (IDebugModelPresentation) DebugUIPlugin.createExtension(fConfig, "class"); //$NON-NLS-1$
- // configure it
- if (fListeners != null) {
- Object[] list = fListeners.getListeners();
- for (int i= 0; i < list.length; i++) {
- fPresentation.addListener((ILabelProviderListener)list[i]);
- }
- }
- Iterator keys= fAttributes.keySet().iterator();
- while (keys.hasNext()) {
- String key= (String)keys.next();
- fPresentation.setAttribute(key, fAttributes.get(key));
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return fPresentation;
- }
-
- /**
- * @see IDebugModelPresentation#setAttribute(String, Object)
- */
- public void setAttribute(String id, Object value) {
- if (value == null) {
- return;
- }
- if (fPresentation != null) {
- getPresentation().setAttribute(id, value);
- }
-
- fAttributes.put(id, value);
- }
-
- /**
- * Returns the identifier of the debug model this
- * presentation is registered for.
- */
- public String getDebugModelIdentifier() {
- return fConfig.getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * Returns a new source viewer configuration for the details
- * area of the variables view, or <code>null</code> if
- * unspecified.
- *
- * @return source viewer configuration or <code>null</code>
- * @exception CoreException if unable to create the specified
- * source viewer configuration
- */
- public SourceViewerConfiguration newDetailsViewerConfiguration() throws CoreException {
- String attr = fConfig.getAttribute("detailsViewerConfiguration"); //$NON-NLS-1$
- if (attr != null) {
- return (SourceViewerConfiguration)fConfig.createExecutableExtension("detailsViewerConfiguration"); //$NON-NLS-1$
- }
- return null;
- }
-
-
-}
+package org.eclipse.debug.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.util.ListenerList;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * A proxy to an IDebugModelPresentation extension. Instantiates the extension
+ * when it is needed.
+ */
+
+public class LazyModelPresentation implements IDebugModelPresentation {
+
+ /**
+ * A temporary mapping of attribute ids to their values
+ * @see IDebugModelPresentation#setAttribute
+ */
+ protected HashMap fAttributes= new HashMap(3);
+
+ /**
+ * The config element that defines the extension
+ */
+ protected IConfigurationElement fConfig = null;
+
+ /**
+ * The actual presentation instance - null until called upon
+ */
+ protected IDebugModelPresentation fPresentation = null;
+
+ /**
+ * Temp holding for listeners - we do not add to presentation until
+ * it needs to be instantiated.
+ */
+ protected ListenerList fListeners= new ListenerList(5);
+ /**
+ * Constructs a lazy presentation from the config element.
+ */
+ public LazyModelPresentation(IConfigurationElement configElement) {
+ fConfig = configElement;
+ }
+
+ /**
+ * @see IDebugModelPresentation#getImage(Object)
+ */
+ public Image getImage(Object element) {
+ return getPresentation().getImage(element);
+ }
+
+ /**
+ * @see IDebugModelPresentation#getText(Object)
+ */
+ public String getText(Object element) {
+ return getPresentation().getText(element);
+ }
+
+ /**
+ * @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
+ */
+ public void computeDetail(IValue value, IValueDetailListener listener) {
+ getPresentation().computeDetail(value, listener);
+ }
+
+ /**
+ * @see ISourcePresentation#getEditorInput(Object)
+ */
+ public IEditorInput getEditorInput(Object element) {
+ return getPresentation().getEditorInput(element);
+ }
+
+ /**
+ * @see ISourcePresentation#getEditorId(IEditorInput, Object)
+ */
+ public String getEditorId(IEditorInput input, Object inputObject) {
+ return getPresentation().getEditorId(input, inputObject);
+ }
+
+ /**
+ * @see IBaseLabelProvider#addListener(ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+ if (fPresentation != null) {
+ getPresentation().addListener(listener);
+ }
+ fListeners.add(listener);
+ }
+
+ /**
+ * @see IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ if (fPresentation != null) {
+ getPresentation().dispose();
+ }
+ fListeners = null;
+ }
+
+ /**
+ * @see IBaseLabelProvider#isLabelProperty(Object, String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ if (fPresentation != null) {
+ return getPresentation().isLabelProperty(element, property);
+ }
+ return false;
+ }
+
+ /**
+ * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ if (fPresentation != null) {
+ getPresentation().removeListener(listener);
+ }
+ fListeners.remove(listener);
+ }
+
+ /**
+ * Returns the real presentation, instantiating if required.
+ */
+ protected IDebugModelPresentation getPresentation() {
+ if (fPresentation == null) {
+ try {
+ fPresentation= (IDebugModelPresentation) DebugUIPlugin.createExtension(fConfig, "class"); //$NON-NLS-1$
+ // configure it
+ if (fListeners != null) {
+ Object[] list = fListeners.getListeners();
+ for (int i= 0; i < list.length; i++) {
+ fPresentation.addListener((ILabelProviderListener)list[i]);
+ }
+ }
+ Iterator keys= fAttributes.keySet().iterator();
+ while (keys.hasNext()) {
+ String key= (String)keys.next();
+ fPresentation.setAttribute(key, fAttributes.get(key));
+ }
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ return fPresentation;
+ }
+
+ /**
+ * @see IDebugModelPresentation#setAttribute(String, Object)
+ */
+ public void setAttribute(String id, Object value) {
+ if (value == null) {
+ return;
+ }
+ if (fPresentation != null) {
+ getPresentation().setAttribute(id, value);
+ }
+
+ fAttributes.put(id, value);
+ }
+
+ /**
+ * Returns the identifier of the debug model this
+ * presentation is registered for.
+ */
+ public String getDebugModelIdentifier() {
+ return fConfig.getAttribute("id"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns a new source viewer configuration for the details
+ * area of the variables view, or <code>null</code> if
+ * unspecified.
+ *
+ * @return source viewer configuration or <code>null</code>
+ * @exception CoreException if unable to create the specified
+ * source viewer configuration
+ */
+ public SourceViewerConfiguration newDetailsViewerConfiguration() throws CoreException {
+ String attr = fConfig.getAttribute("detailsViewerConfiguration"); //$NON-NLS-1$
+ if (attr != null) {
+ return (SourceViewerConfiguration)fConfig.createExecutableExtension("detailsViewerConfiguration"); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
index 1420a80e5..a10db3ef1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
@@ -1,329 +1,329 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public abstract class AbstractDebugActionDelegate implements IWorkbenchWindowActionDelegate, IViewActionDelegate, ISelectionListener {
-
- /**
- * The underlying action for this delegate
- */
- private IAction fAction;
- /**
- * This action's view part, or <code>null</code>
- * if not installed in a view.
- */
- private IViewPart fViewPart;
-
- /**
- * Cache of the most recent seletion
- */
- private IStructuredSelection fSelection;
-
- /**
- * Whether this delegate has been initialized
- */
- private boolean fInitialized = false;
-
- /**
- * The window associated with this action delegate
- * May be <code>null</code>
- */
- protected IWorkbenchWindow fWindow;
-
- /**
- * It's crucial that delegate actions have a zero-arg constructor so that
- * they can be reflected into existence when referenced in an action set
- * in the plugin's plugin.xml file.
- */
- public AbstractDebugActionDelegate() {
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose(){
- if (getWindow() != null) {
- getWindow().getSelectionService().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window){
- // listen to selection changes in the debug view
- setWindow(window);
- window.getSelectionService().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action){
- IStructuredSelection selection= getSelection();
-
- final Iterator enum= selection.iterator();
- String pluginId= DebugUIPlugin.getUniqueIdentifier();
- final MultiStatus ms=
- new MultiStatus(pluginId, DebugException.REQUEST_FAILED, getStatusMessage(), null);
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- while (enum.hasNext()) {
- Object element= enum.next();
- try {
- doAction(element);
- } catch (DebugException e) {
- ms.merge(e.getStatus());
- }
- }
- }
- });
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), getErrorDialogTitle(), getErrorDialogMessage(), ms);
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- /**
- * AbstractDebugActionDelegates come in 2 flavors: IViewActionDelegate,
- * IWorkbenchWindowActionDelegate delegates.
- * </p>
- * <ul>
- * <li>IViewActionDelegate delegate: getView() != null</li>
- * <li>IWorkbenchWindowActionDelegate: getView == null</li>
- * </ul>
- * <p>
- * Only want to call update(action, selection) for IViewActionDelegates.
- * An initialize call to update(action, selection) is made for all flavors to set the initial
- * enabled state of the underlying action.
- * IWorkbenchWindowActionDelegate's listen to selection changes
- * in the debug view only.
- * </p>
- *
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- boolean wasInitialized= initialize(action, s);
- if (!wasInitialized) {
- if (getView() != null) {
- update(action, s);
- }
- }
- }
-
- protected void update(IAction action, ISelection s) {
- if (s instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)s;
- action.setEnabled(getEnableStateForSelection(ss));
- setSelection(ss);
- } else {
- action.setEnabled(false);
- setSelection(StructuredSelection.EMPTY);
- }
- }
-
- /**
- * Return whether the action should be enabled or not based on the given selection.
- */
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.size() == 0) {
- return false;
- }
- Iterator enum= selection.iterator();
- int count= 0;
- while (enum.hasNext()) {
- count++;
- if (count > 1 && !enableForMultiSelection()) {
- return false;
- }
- Object element= enum.next();
- if (!isEnabledFor(element)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns whether this action should be enabled if there is
- * multi selection.
- */
- protected boolean enableForMultiSelection() {
- return true;
- }
-
- /**
- * Performs the specific action on this element.
- */
- protected abstract void doAction(Object element) throws DebugException;
-
- /**
- * Returns whether this action will work for the given element
- */
- protected abstract boolean isEnabledFor(Object element);
-
- /**
- * Returns the String to use as an error dialog title for
- * a failed action. Default is to return null.
- */
- protected String getErrorDialogTitle(){
- return null;
- }
- /**
- * Returns the String to use as an error dialog message for
- * a failed action. This message appears as the "Message:" in
- * the error dialog for this action.
- * Default is to return null.
- */
- protected String getErrorDialogMessage(){
- return null;
- }
- /**
- * Returns the String to use as a status message for
- * a failed action. This message appears as the "Reason:"
- * in the error dialog for this action.
- * Default is to return the empty String.
- */
- protected String getStatusMessage(){
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- fViewPart = view;
- }
-
- /**
- * Returns this action's view part, or <code>null</code>
- * if not installed in a view.
- *
- * @return view part or <code>null</code>
- */
- protected IViewPart getView() {
- return fViewPart;
- }
-
- /**
- * Initialize this delegate, updating this delegate's
- * presentation.
- * As well, all of the flavors of AbstractDebugActionDelegates need to
- * have the initial enabled state set with a call to update(IAction, ISelection).
- *
- * @param action the presentation for this action
- * @return whether the action was initialized
- */
- protected boolean initialize(IAction action, ISelection selection) {
- if (!isInitialized()) {
- setAction(action);
- if (getView() == null) {
- //update on the selection in the debug view
- IWorkbenchWindow window= getWindow();
- if (window != null && window.getShell() != null && !window.getShell().isDisposed()) {
- IWorkbenchPage page= window.getActivePage();
- if (page != null) {
- selection= page.getSelection(IDebugUIConstants.ID_DEBUG_VIEW);
- }
- }
- }
- update(action, selection);
- setInitialized(true);
- return true;
- }
- return false;
- }
-
- /**
- * Returns the most recent selection
- *
- * @return structured selection
- */
- protected IStructuredSelection getSelection() {
- if (getView() != null) {
- //cannot used the cached selection in a view
- //as the selection can be out of date for context menu
- //actions. See bug 14556
- ISelection s= getView().getViewSite().getSelectionProvider().getSelection();
- if (s instanceof IStructuredSelection) {
- return (IStructuredSelection)s;
- } else {
- return StructuredSelection.EMPTY;
- }
- }
- return fSelection;
- }
-
- /**
- * Sets the most recent selection
- *
- * @parm selection structured selection
- */
- private void setSelection(IStructuredSelection selection) {
- fSelection = selection;
- }
-
- /**
- * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- update(getAction(), selection);
- }
-
- protected void setAction(IAction action) {
- fAction = action;
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected void setView(IViewPart viewPart) {
- fViewPart = viewPart;
- }
-
- protected boolean isInitialized() {
- return fInitialized;
- }
-
- protected void setInitialized(boolean initialized) {
- fInitialized = initialized;
- }
-
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public abstract class AbstractDebugActionDelegate implements IWorkbenchWindowActionDelegate, IViewActionDelegate, ISelectionListener {
+
+ /**
+ * The underlying action for this delegate
+ */
+ private IAction fAction;
+ /**
+ * This action's view part, or <code>null</code>
+ * if not installed in a view.
+ */
+ private IViewPart fViewPart;
+
+ /**
+ * Cache of the most recent seletion
+ */
+ private IStructuredSelection fSelection;
+
+ /**
+ * Whether this delegate has been initialized
+ */
+ private boolean fInitialized = false;
+
+ /**
+ * The window associated with this action delegate
+ * May be <code>null</code>
+ */
+ protected IWorkbenchWindow fWindow;
+
+ /**
+ * It's crucial that delegate actions have a zero-arg constructor so that
+ * they can be reflected into existence when referenced in an action set
+ * in the plugin's plugin.xml file.
+ */
+ public AbstractDebugActionDelegate() {
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose(){
+ if (getWindow() != null) {
+ getWindow().getSelectionService().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
+ }
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window){
+ // listen to selection changes in the debug view
+ setWindow(window);
+ window.getSelectionService().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action){
+ IStructuredSelection selection= getSelection();
+
+ final Iterator enum= selection.iterator();
+ String pluginId= DebugUIPlugin.getUniqueIdentifier();
+ final MultiStatus ms=
+ new MultiStatus(pluginId, DebugException.REQUEST_FAILED, getStatusMessage(), null);
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ public void run() {
+ while (enum.hasNext()) {
+ Object element= enum.next();
+ try {
+ doAction(element);
+ } catch (DebugException e) {
+ ms.merge(e.getStatus());
+ }
+ }
+ }
+ });
+ if (!ms.isOK()) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), getErrorDialogTitle(), getErrorDialogMessage(), ms);
+ } else {
+ DebugUIPlugin.log(ms);
+ }
+ }
+ }
+
+ /**
+ * AbstractDebugActionDelegates come in 2 flavors: IViewActionDelegate,
+ * IWorkbenchWindowActionDelegate delegates.
+ * </p>
+ * <ul>
+ * <li>IViewActionDelegate delegate: getView() != null</li>
+ * <li>IWorkbenchWindowActionDelegate: getView == null</li>
+ * </ul>
+ * <p>
+ * Only want to call update(action, selection) for IViewActionDelegates.
+ * An initialize call to update(action, selection) is made for all flavors to set the initial
+ * enabled state of the underlying action.
+ * IWorkbenchWindowActionDelegate's listen to selection changes
+ * in the debug view only.
+ * </p>
+ *
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection s) {
+ boolean wasInitialized= initialize(action, s);
+ if (!wasInitialized) {
+ if (getView() != null) {
+ update(action, s);
+ }
+ }
+ }
+
+ protected void update(IAction action, ISelection s) {
+ if (s instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)s;
+ action.setEnabled(getEnableStateForSelection(ss));
+ setSelection(ss);
+ } else {
+ action.setEnabled(false);
+ setSelection(StructuredSelection.EMPTY);
+ }
+ }
+
+ /**
+ * Return whether the action should be enabled or not based on the given selection.
+ */
+ protected boolean getEnableStateForSelection(IStructuredSelection selection) {
+ if (selection.size() == 0) {
+ return false;
+ }
+ Iterator enum= selection.iterator();
+ int count= 0;
+ while (enum.hasNext()) {
+ count++;
+ if (count > 1 && !enableForMultiSelection()) {
+ return false;
+ }
+ Object element= enum.next();
+ if (!isEnabledFor(element)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Returns whether this action should be enabled if there is
+ * multi selection.
+ */
+ protected boolean enableForMultiSelection() {
+ return true;
+ }
+
+ /**
+ * Performs the specific action on this element.
+ */
+ protected abstract void doAction(Object element) throws DebugException;
+
+ /**
+ * Returns whether this action will work for the given element
+ */
+ protected abstract boolean isEnabledFor(Object element);
+
+ /**
+ * Returns the String to use as an error dialog title for
+ * a failed action. Default is to return null.
+ */
+ protected String getErrorDialogTitle(){
+ return null;
+ }
+ /**
+ * Returns the String to use as an error dialog message for
+ * a failed action. This message appears as the "Message:" in
+ * the error dialog for this action.
+ * Default is to return null.
+ */
+ protected String getErrorDialogMessage(){
+ return null;
+ }
+ /**
+ * Returns the String to use as a status message for
+ * a failed action. This message appears as the "Reason:"
+ * in the error dialog for this action.
+ * Default is to return the empty String.
+ */
+ protected String getStatusMessage(){
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ fViewPart = view;
+ }
+
+ /**
+ * Returns this action's view part, or <code>null</code>
+ * if not installed in a view.
+ *
+ * @return view part or <code>null</code>
+ */
+ protected IViewPart getView() {
+ return fViewPart;
+ }
+
+ /**
+ * Initialize this delegate, updating this delegate's
+ * presentation.
+ * As well, all of the flavors of AbstractDebugActionDelegates need to
+ * have the initial enabled state set with a call to update(IAction, ISelection).
+ *
+ * @param action the presentation for this action
+ * @return whether the action was initialized
+ */
+ protected boolean initialize(IAction action, ISelection selection) {
+ if (!isInitialized()) {
+ setAction(action);
+ if (getView() == null) {
+ //update on the selection in the debug view
+ IWorkbenchWindow window= getWindow();
+ if (window != null && window.getShell() != null && !window.getShell().isDisposed()) {
+ IWorkbenchPage page= window.getActivePage();
+ if (page != null) {
+ selection= page.getSelection(IDebugUIConstants.ID_DEBUG_VIEW);
+ }
+ }
+ }
+ update(action, selection);
+ setInitialized(true);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the most recent selection
+ *
+ * @return structured selection
+ */
+ protected IStructuredSelection getSelection() {
+ if (getView() != null) {
+ //cannot used the cached selection in a view
+ //as the selection can be out of date for context menu
+ //actions. See bug 14556
+ ISelection s= getView().getViewSite().getSelectionProvider().getSelection();
+ if (s instanceof IStructuredSelection) {
+ return (IStructuredSelection)s;
+ } else {
+ return StructuredSelection.EMPTY;
+ }
+ }
+ return fSelection;
+ }
+
+ /**
+ * Sets the most recent selection
+ *
+ * @parm selection structured selection
+ */
+ private void setSelection(IStructuredSelection selection) {
+ fSelection = selection;
+ }
+
+ /**
+ * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ update(getAction(), selection);
+ }
+
+ protected void setAction(IAction action) {
+ fAction = action;
+ }
+
+ protected IAction getAction() {
+ return fAction;
+ }
+
+ protected void setView(IViewPart viewPart) {
+ fViewPart = viewPart;
+ }
+
+ protected boolean isInitialized() {
+ return fInitialized;
+ }
+
+ protected void setInitialized(boolean initialized) {
+ fInitialized = initialized;
+ }
+
protected IWorkbenchWindow getWindow() {
return fWindow;
}
-
+
protected void setWindow(IWorkbenchWindow window) {
fWindow = window;
- }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractListenerActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractListenerActionDelegate.java
index 503dffeca..56ee5f4c8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractListenerActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractListenerActionDelegate.java
@@ -19,9 +19,9 @@ import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public abstract class AbstractListenerActionDelegate extends AbstractDebugActionDelegate implements IDebugEventSetListener, IPartListener, IPageListener {
+import org.eclipse.ui.IWorkbenchWindow;
+
+public abstract class AbstractListenerActionDelegate extends AbstractDebugActionDelegate implements IDebugEventSetListener, IPartListener, IPageListener {
/**
* @see IPartListener#partActivated(IWorkbenchPart)
@@ -133,22 +133,22 @@ public abstract class AbstractListenerActionDelegate extends AbstractDebugAction
}
}
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window){
- super.init(window);
+ /**
+ * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window){
+ super.init(window);
DebugPlugin.getDefault().addDebugEventListener(this);
window.addPageListener(this);
}
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ super.init(view);
DebugPlugin.getDefault().addDebugEventListener(this);
- setWindow(view.getViewSite().getWorkbenchWindow());
+ setWindow(view.getViewSite().getWorkbenchWindow());
getPage().addPartListener(this);
getPage().getWorkbenchWindow().addPageListener(this);
}
@@ -173,7 +173,7 @@ public abstract class AbstractListenerActionDelegate extends AbstractDebugAction
getPage().getWorkbenchWindow().getShell().getDisplay().asyncExec(r);
}
}
-
+
/**
* @see IPageListener#pageClosed(IWorkbenchPage)
*/
@@ -188,4 +188,4 @@ public abstract class AbstractListenerActionDelegate extends AbstractDebugAction
*/
public void pageOpened(IWorkbenchPage page) {
}
-}
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
index 8761960ab..2a387b0f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
@@ -1,66 +1,66 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewPart;
-
-public abstract class AbstractRemoveAllActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) {
- doAction();
- getAction().setEnabled(false);
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action){
- doAction(null);
- }
-
- protected abstract void doAction();
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return true;
- }
-
- protected void update(IAction action, ISelection s) {
- update();
- }
-
- protected abstract void update();
-
- /**
- * Remove all actions do care nothing about the current selection
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- if (!isInitialized()) {
- action.setEnabled(false);
- setAction(action);
- setInitialized(true);
- }
- update();
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- setView(view);
- setWindow(view.getViewSite().getWorkbenchWindow());
- getPage().addPartListener(this);
- getPage().getWorkbenchWindow().addPageListener(this);
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewPart;
+
+public abstract class AbstractRemoveAllActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) {
+ doAction();
+ getAction().setEnabled(false);
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action){
+ doAction(null);
+ }
+
+ protected abstract void doAction();
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return true;
+ }
+
+ protected void update(IAction action, ISelection s) {
+ update();
+ }
+
+ protected abstract void update();
+
+ /**
+ * Remove all actions do care nothing about the current selection
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection s) {
+ if (!isInitialized()) {
+ action.setEnabled(false);
+ setAction(action);
+ setInitialized(true);
+ }
+ update();
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ setView(view);
+ setWindow(view.getViewSite().getWorkbenchWindow());
+ getPage().addPartListener(this);
+ getPage().getWorkbenchWindow().addPageListener(this);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
index 19fe1cf31..7a2950364 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
@@ -1,27 +1,27 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ActionMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.ui.actions.ActionMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private ActionMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class ActionMessages {
+
+ private static final String RESOURCE_BUNDLE= "org.eclipse.debug.internal.ui.actions.ActionMessages";//$NON-NLS-1$
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private ActionMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
index 4af3246a2..801087739 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
@@ -1,109 +1,109 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-ChangeVariableValue.errorDialogMessage=Setting the variable value failed.
-ChangeVariableValue.errorDialogTitle=Setting variable value
-ChangeVariableValue.title=&Change Variable Value
-ChangeVariableValue.toolTipText=Changes the Value of a Simple Type Variable
-
-ClearOutputAction.title=Clea&r
-ClearOutputAction.toolTipText=Clear Console
-
-CopyToClipboardActionDelegate.Problem_Copying_to_Clipboard_1=Problem Copying to Clipboard
-CopyToClipboardActionDelegate.There_was_a_problem_when_accessing_the_system_clipboard._Retry__2=There was a problem when accessing the system clipboard. Retry?
-
-DisconnectActionDelegate.Disconnect_3=Disconnect
-DisconnectActionDelegate.Disconnect_failed_1=Disconnect failed
-DisconnectActionDelegate.Exceptions_occurred_attempting_to_disconnect._2=Exceptions occurred attempting to disconnect.
-
-EnableBreakpointAction.Enable_breakpoint(s)_failed_2=Enable/Disable breakpoint(s) failed
-EnableBreakpointAction.Enabling_breakpoints_3=Enabling/disabling breakpoints
-EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4=Exceptions occurred enabling/disabling the breakpoint(s).
-
-OpenBreakpointMarkerAction.&Go_to_File_1=&Go to File
-OpenBreakpointMarkerAction.Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2=Exceptions occurred attempting to open the editor for the breakpoint resource
-OpenBreakpointMarkerAction.Go_to_Breakpoint_1=Go to File
-OpenBreakpointMarkerAction.Go_to_File_for_Breakpoint_2=Go to File for Breakpoint
-
-RelaunchActionDelegate.An_exception_occurred_while_launching_2=An exception occurred while launching
-RelaunchActionDelegate.Launch_Failed_1=Launch Failed
-RelaunchActionDelegate.Launch_1=Launch
-
-RemoveAllBreakpointsAction.Breakpoint(s)_removal_failed_3=Breakpoint(s) removal failed
-RemoveAllBreakpointsAction.Exceptions_occurred_removing_breakpoints._5=Exceptions occurred removing breakpoints.
-RemoveAllBreakpointsAction.Removing_all_breakpoints_4=Removing all breakpoints
-
-RemoveBreakpointAction.Breakpoint(s)_removal_failed_3=Breakpoint(s) removal failed
-RemoveBreakpointAction.Exceptions_occurred_attempting_to_remove_a_breakpoint._5=Exceptions occurred attempting to remove a breakpoint.
-RemoveBreakpointAction.Removing_a_breakpoint_4=Removing a breakpoint
-
-ResumeActionDelegate.Exceptions_occurred_attempting_to_resume._2=Exceptions occurred attempting to resume.
-ResumeActionDelegate.Resume_3=Resume
-ResumeActionDelegate.Resume_failed._1=Resume failed.
-
-ShowDetailPaneAction.Show_detail_pane_2=Show Detail Pane
-ShowDetailPaneAction.Show_Variable_Detail_Pane_1=Show &Detail Pane
-
-ShowSupportedBreakpointsAction.Show_For_Selected=Show Supported &Breakpoints
-ShowSupportedBreakpointsAction.tooltip=Show Breakpoints Supported by Selected Target
-
-ShowTypesAction.Show_&Type_Names_1=Show &Type Names
-ShowTypesAction.Show_Type_Names=Show Type Names
-
-StepIntoActionDelegate.Exceptions_occurred_attempting_to_step_into_the_frame_2=Exceptions occurred attempting to step into the frame
-StepIntoActionDelegate.Step_Into_3=Step Into
-StepIntoActionDelegate.Step_into_failed_1=Step into failed
-
-StepOverActionDelegate.Exceptions_occurred_attempting_to_step_over_the_frame_2=Exceptions occurred attempting to step over the frame
-StepOverActionDelegate.Step_over_3=Step Over
-StepOverActionDelegate.Step_over_failed_1=Step over failed
-
-StepReturnActionDelegate.Exceptions_occurred_attempting_to_run_to_return_of_the_frame._2=Exceptions occurred attempting to run to return of the frame.
-StepReturnActionDelegate.Run_to_Return_3=Step Return
-StepReturnActionDelegate.Run_to_return_failed._1=Step return failed.
-
-SuspendActionDelegate.Exceptions_occurred_attempting_to_suspend._2=Exceptions occurred attempting to suspend.
-SuspendActionDelegate.Suspend_3=Suspend
-SuspendActionDelegate.Suspend_failed_1=Suspend failed
-
-TerminateActionDelegate.Exceptions_occurred_attempting_to_terminate._2=Exceptions occurred attempting to terminate.
-TerminateActionDelegate.Terminate_3=Terminate
-
-TerminateActionDelegate.Terminate_failed._1=Terminate failed.
-TerminateAllAction.Exceptions_occurred_attempting_to_terminate_all._5=Exceptions occurred attempting to terminate all.
-TerminateAllAction.Terminate_All_2=Terminate All
-TerminateAllAction.Terminate_all_failed_3=Terminate all failed
-
-TerminateAndRemoveActionDelegate.Exceptions_occurred_attempting_to_terminate_and_remove_2=Exceptions occurred attempting to terminate and remove
-TerminateAndRemoveActionDelegate.Terminate_and_Remove;_3=Terminate and Remove;
-TerminateAndRemoveActionDelegate.Terminate_and_remove_failed_1=Terminate and remove failed
-
-TextViewerGotoLineAction.Enter_line_number__8=Enter line number (1...{0}):
-TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2=Exceptions occurred attempt to go to line
-TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4=Go to &Line...@Ctrl+L
-TextViewerGotoLineAction.Go_To_Line_1=Go to Line
-TextViewerGotoLineAction.Line_number_out_of_range_1=Line number out of range
-TextViewerGotoLineAction.Not_a_number_2=Not a number
-DebugDropDownAction.Debug_last_launched_1=Debug Last Launched:
-RunDropDownAction.Run_last_launched_1=Run Last Launched:
-DebugDropDownAction.Debug_1=Debug
-RunDropDownAction.Run_1=Run
-DebugWithConfigurationAction.Debug_As_1=Debug &As
-RunWithConfigurationAction.Run_As_1=Run &As
-OpenDebugConfigurations.Debug..._1=&Debug...
-OpenRunConfigurations.Run..._1=&Run...
-RelaunchLastAction.Cannot_relaunch_1=Cannot relaunch
-RelaunchLastAction.Cannot_relaunch_[{0}]_because_it_does_not_support_{2}_mode_2=Cannot relaunch [{0}] because it does not support {1} mode
-RelaunchLastAction.Error_relaunching_3=Error relaunching
-RelaunchLastAction.Error_encountered_attempting_to_relaunch_4=Error encountered attempting to relaunch
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+ChangeVariableValue.errorDialogMessage=Setting the variable value failed.
+ChangeVariableValue.errorDialogTitle=Setting variable value
+ChangeVariableValue.title=&Change Variable Value
+ChangeVariableValue.toolTipText=Changes the Value of a Simple Type Variable
+
+ClearOutputAction.title=Clea&r
+ClearOutputAction.toolTipText=Clear Console
+
+CopyToClipboardActionDelegate.Problem_Copying_to_Clipboard_1=Problem Copying to Clipboard
+CopyToClipboardActionDelegate.There_was_a_problem_when_accessing_the_system_clipboard._Retry__2=There was a problem when accessing the system clipboard. Retry?
+
+DisconnectActionDelegate.Disconnect_3=Disconnect
+DisconnectActionDelegate.Disconnect_failed_1=Disconnect failed
+DisconnectActionDelegate.Exceptions_occurred_attempting_to_disconnect._2=Exceptions occurred attempting to disconnect.
+
+EnableBreakpointAction.Enable_breakpoint(s)_failed_2=Enable/Disable breakpoint(s) failed
+EnableBreakpointAction.Enabling_breakpoints_3=Enabling/disabling breakpoints
+EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4=Exceptions occurred enabling/disabling the breakpoint(s).
+
+OpenBreakpointMarkerAction.&Go_to_File_1=&Go to File
+OpenBreakpointMarkerAction.Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2=Exceptions occurred attempting to open the editor for the breakpoint resource
+OpenBreakpointMarkerAction.Go_to_Breakpoint_1=Go to File
+OpenBreakpointMarkerAction.Go_to_File_for_Breakpoint_2=Go to File for Breakpoint
+
+RelaunchActionDelegate.An_exception_occurred_while_launching_2=An exception occurred while launching
+RelaunchActionDelegate.Launch_Failed_1=Launch Failed
+RelaunchActionDelegate.Launch_1=Launch
+
+RemoveAllBreakpointsAction.Breakpoint(s)_removal_failed_3=Breakpoint(s) removal failed
+RemoveAllBreakpointsAction.Exceptions_occurred_removing_breakpoints._5=Exceptions occurred removing breakpoints.
+RemoveAllBreakpointsAction.Removing_all_breakpoints_4=Removing all breakpoints
+
+RemoveBreakpointAction.Breakpoint(s)_removal_failed_3=Breakpoint(s) removal failed
+RemoveBreakpointAction.Exceptions_occurred_attempting_to_remove_a_breakpoint._5=Exceptions occurred attempting to remove a breakpoint.
+RemoveBreakpointAction.Removing_a_breakpoint_4=Removing a breakpoint
+
+ResumeActionDelegate.Exceptions_occurred_attempting_to_resume._2=Exceptions occurred attempting to resume.
+ResumeActionDelegate.Resume_3=Resume
+ResumeActionDelegate.Resume_failed._1=Resume failed.
+
+ShowDetailPaneAction.Show_detail_pane_2=Show Detail Pane
+ShowDetailPaneAction.Show_Variable_Detail_Pane_1=Show &Detail Pane
+
+ShowSupportedBreakpointsAction.Show_For_Selected=Show Supported &Breakpoints
+ShowSupportedBreakpointsAction.tooltip=Show Breakpoints Supported by Selected Target
+
+ShowTypesAction.Show_&Type_Names_1=Show &Type Names
+ShowTypesAction.Show_Type_Names=Show Type Names
+
+StepIntoActionDelegate.Exceptions_occurred_attempting_to_step_into_the_frame_2=Exceptions occurred attempting to step into the frame
+StepIntoActionDelegate.Step_Into_3=Step Into
+StepIntoActionDelegate.Step_into_failed_1=Step into failed
+
+StepOverActionDelegate.Exceptions_occurred_attempting_to_step_over_the_frame_2=Exceptions occurred attempting to step over the frame
+StepOverActionDelegate.Step_over_3=Step Over
+StepOverActionDelegate.Step_over_failed_1=Step over failed
+
+StepReturnActionDelegate.Exceptions_occurred_attempting_to_run_to_return_of_the_frame._2=Exceptions occurred attempting to run to return of the frame.
+StepReturnActionDelegate.Run_to_Return_3=Step Return
+StepReturnActionDelegate.Run_to_return_failed._1=Step return failed.
+
+SuspendActionDelegate.Exceptions_occurred_attempting_to_suspend._2=Exceptions occurred attempting to suspend.
+SuspendActionDelegate.Suspend_3=Suspend
+SuspendActionDelegate.Suspend_failed_1=Suspend failed
+
+TerminateActionDelegate.Exceptions_occurred_attempting_to_terminate._2=Exceptions occurred attempting to terminate.
+TerminateActionDelegate.Terminate_3=Terminate
+
+TerminateActionDelegate.Terminate_failed._1=Terminate failed.
+TerminateAllAction.Exceptions_occurred_attempting_to_terminate_all._5=Exceptions occurred attempting to terminate all.
+TerminateAllAction.Terminate_All_2=Terminate All
+TerminateAllAction.Terminate_all_failed_3=Terminate all failed
+
+TerminateAndRemoveActionDelegate.Exceptions_occurred_attempting_to_terminate_and_remove_2=Exceptions occurred attempting to terminate and remove
+TerminateAndRemoveActionDelegate.Terminate_and_Remove;_3=Terminate and Remove;
+TerminateAndRemoveActionDelegate.Terminate_and_remove_failed_1=Terminate and remove failed
+
+TextViewerGotoLineAction.Enter_line_number__8=Enter line number (1...{0}):
+TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2=Exceptions occurred attempt to go to line
+TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4=Go to &Line...@Ctrl+L
+TextViewerGotoLineAction.Go_To_Line_1=Go to Line
+TextViewerGotoLineAction.Line_number_out_of_range_1=Line number out of range
+TextViewerGotoLineAction.Not_a_number_2=Not a number
+DebugDropDownAction.Debug_last_launched_1=Debug Last Launched:
+RunDropDownAction.Run_last_launched_1=Run Last Launched:
+DebugDropDownAction.Debug_1=Debug
+RunDropDownAction.Run_1=Run
+DebugWithConfigurationAction.Debug_As_1=Debug &As
+RunWithConfigurationAction.Run_As_1=Run &As
+OpenDebugConfigurations.Debug..._1=&Debug...
+OpenRunConfigurations.Run..._1=&Run...
+RelaunchLastAction.Cannot_relaunch_1=Cannot relaunch
+RelaunchLastAction.Cannot_relaunch_[{0}]_because_it_does_not_support_{2}_mode_2=Cannot relaunch [{0}] because it does not support {1} mode
+RelaunchLastAction.Error_relaunching_3=Error relaunching
+RelaunchLastAction.Error_encountered_attempting_to_relaunch_4=Error encountered attempting to relaunch
ChangeVariableValueSet_Variable_Value_1=Set Variable Value
ChangeVariableValueEnter_a_new_value_for__2=Enter a new value for
ChangeVariableValueAn_exception_occurred_3=An exception occurred
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ChangeVariableValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ChangeVariableValueAction.java
index b0f58560e..d7312a1df 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ChangeVariableValueAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ChangeVariableValueAction.java
@@ -1,142 +1,142 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import java.util.Iterator;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValueModification;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.SelectionProviderAction;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Action for changing the value of primitives and <code>String</code> variables.
- */
-public class ChangeVariableValueAction extends SelectionProviderAction {
-
- private ChangeVariableValueInputDialog fInputDialog;
- protected IVariable fVariable;
-
- public ChangeVariableValueAction(Viewer viewer) {
- super(viewer, ActionMessages.getString("ChangeVariableValue.title")); //$NON-NLS-1$
- setDescription(ActionMessages.getString("ChangeVariableValue.toolTipText")); //$NON-NLS-1$
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE));
- WorkbenchHelp.setHelp(
- this,
- IDebugHelpContextIds.CHANGE_VALUE_ACTION);
- }
-
- /**
- * Edit the variable value with an inline text editor.
- */
- protected void doActionPerformed(final IVariable variable) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- Shell activeShell= window.getShell();
-
- // If a previous edit is still in progress, don't start another
- if (fInputDialog != null) {
- return;
- }
-
- fVariable = variable;
- String name= ""; //$NON-NLS-1$
- String value= ""; //$NON-NLS-1$
- try {
- name= fVariable.getName();
- value= fVariable.getValue().getValueString();
- } catch (DebugException exception) {
- DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("ChangeVariableValue.errorDialogTitle"),ActionMessages.getString("ChangeVariableValue.errorDialogMessage"), exception); //$NON-NLS-2$ //$NON-NLS-1$
- fInputDialog= null;
- return;
- }
- fInputDialog= new ChangeVariableValueInputDialog(activeShell, ActionMessages.getString("ChangeVariableValueSet_Variable_Value_1"), ActionMessages.getString("ChangeVariableValueEnter_a_new_value_for__2") + name + ':', value, new IInputValidator() { //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * Returns an error string if the input is invalid
- */
- public String isValid(String input) {
- try {
- if (fVariable.verifyValue(input)) {
- return null; // null means valid
- }
- } catch (DebugException exception) {
- return ActionMessages.getString("ChangeVariableValueAn_exception_occurred_3"); //$NON-NLS-1$
- }
- return ActionMessages.getString("ChangeVariableValueInvalid_value_4"); //$NON-NLS-1$
- }
- });
-
- fInputDialog.open();
- String newValue= fInputDialog.getValue();
- if (newValue != null) {
- // null value means cancel was pressed
- try {
- fVariable.setValue(newValue);
- getSelectionProvider().setSelection(new StructuredSelection(variable));
- } catch (DebugException de) {
- DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("ChangeVariableValue.errorDialogTitle"),ActionMessages.getString("ChangeVariableValue.errorDialogMessage"), de); //$NON-NLS-2$ //$NON-NLS-1$
- fInputDialog= null;
- return;
- }
- }
- fInputDialog= null;
- }
-
- /**
- * Updates the enabled state of this action based
- * on the selection
- */
- protected void update(IStructuredSelection sel) {
- Iterator iter= sel.iterator();
- if (iter.hasNext()) {
- Object object= iter.next();
- if (object instanceof IValueModification) {
- IValueModification varMod= (IValueModification)object;
- if (!varMod.supportsValueModification()) {
- setEnabled(false);
- return;
- }
- setEnabled(!iter.hasNext());
- return;
- }
- }
- setEnabled(false);
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- Iterator iterator= getStructuredSelection().iterator();
- doActionPerformed((IVariable)iterator.next());
- }
-
- /**
- * @see SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void selectionChanged(IStructuredSelection sel) {
- update(sel);
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import java.util.Iterator;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IValueModification;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.SelectionProviderAction;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+/**
+ * Action for changing the value of primitives and <code>String</code> variables.
+ */
+public class ChangeVariableValueAction extends SelectionProviderAction {
+
+ private ChangeVariableValueInputDialog fInputDialog;
+ protected IVariable fVariable;
+
+ public ChangeVariableValueAction(Viewer viewer) {
+ super(viewer, ActionMessages.getString("ChangeVariableValue.title")); //$NON-NLS-1$
+ setDescription(ActionMessages.getString("ChangeVariableValue.toolTipText")); //$NON-NLS-1$
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE));
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE));
+ WorkbenchHelp.setHelp(
+ this,
+ IDebugHelpContextIds.CHANGE_VALUE_ACTION);
+ }
+
+ /**
+ * Edit the variable value with an inline text editor.
+ */
+ protected void doActionPerformed(final IVariable variable) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window == null) {
+ return;
+ }
+ Shell activeShell= window.getShell();
+
+ // If a previous edit is still in progress, don't start another
+ if (fInputDialog != null) {
+ return;
+ }
+
+ fVariable = variable;
+ String name= ""; //$NON-NLS-1$
+ String value= ""; //$NON-NLS-1$
+ try {
+ name= fVariable.getName();
+ value= fVariable.getValue().getValueString();
+ } catch (DebugException exception) {
+ DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("ChangeVariableValue.errorDialogTitle"),ActionMessages.getString("ChangeVariableValue.errorDialogMessage"), exception); //$NON-NLS-2$ //$NON-NLS-1$
+ fInputDialog= null;
+ return;
+ }
+ fInputDialog= new ChangeVariableValueInputDialog(activeShell, ActionMessages.getString("ChangeVariableValueSet_Variable_Value_1"), ActionMessages.getString("ChangeVariableValueEnter_a_new_value_for__2") + name + ':', value, new IInputValidator() { //$NON-NLS-1$ //$NON-NLS-2$
+ /**
+ * Returns an error string if the input is invalid
+ */
+ public String isValid(String input) {
+ try {
+ if (fVariable.verifyValue(input)) {
+ return null; // null means valid
+ }
+ } catch (DebugException exception) {
+ return ActionMessages.getString("ChangeVariableValueAn_exception_occurred_3"); //$NON-NLS-1$
+ }
+ return ActionMessages.getString("ChangeVariableValueInvalid_value_4"); //$NON-NLS-1$
+ }
+ });
+
+ fInputDialog.open();
+ String newValue= fInputDialog.getValue();
+ if (newValue != null) {
+ // null value means cancel was pressed
+ try {
+ fVariable.setValue(newValue);
+ getSelectionProvider().setSelection(new StructuredSelection(variable));
+ } catch (DebugException de) {
+ DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("ChangeVariableValue.errorDialogTitle"),ActionMessages.getString("ChangeVariableValue.errorDialogMessage"), de); //$NON-NLS-2$ //$NON-NLS-1$
+ fInputDialog= null;
+ return;
+ }
+ }
+ fInputDialog= null;
+ }
+
+ /**
+ * Updates the enabled state of this action based
+ * on the selection
+ */
+ protected void update(IStructuredSelection sel) {
+ Iterator iter= sel.iterator();
+ if (iter.hasNext()) {
+ Object object= iter.next();
+ if (object instanceof IValueModification) {
+ IValueModification varMod= (IValueModification)object;
+ if (!varMod.supportsValueModification()) {
+ setEnabled(false);
+ return;
+ }
+ setEnabled(!iter.hasNext());
+ return;
+ }
+ }
+ setEnabled(false);
+ }
+
+ /**
+ * @see IAction#run()
+ */
+ public void run() {
+ Iterator iterator= getStructuredSelection().iterator();
+ doActionPerformed((IVariable)iterator.next());
+ }
+
+ /**
+ * @see SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void selectionChanged(IStructuredSelection sel) {
+ update(sel);
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ClearOutputAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ClearOutputAction.java
index d8771c061..b18fe5bec 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ClearOutputAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ClearOutputAction.java
@@ -1,44 +1,44 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.console.ConsoleViewer;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Clears the output of the selected launches
- */
-public class ClearOutputAction extends Action {
-
- private ConsoleViewer fConsoleViewer;
-
- public ClearOutputAction(ConsoleViewer viewer) {
- super(ActionMessages.getString("ClearOutputAction.title")); //$NON-NLS-1$
- fConsoleViewer= viewer;
- setToolTipText(ActionMessages.getString("ClearOutputAction.toolTipText")); //$NON-NLS-1$
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CLEAR));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_CLEAR));
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_CLEAR));
- WorkbenchHelp.setHelp(
- this,
- IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fConsoleViewer.clearDocument();
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.views.console.ConsoleViewer;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+/**
+ * Clears the output of the selected launches
+ */
+public class ClearOutputAction extends Action {
+
+ private ConsoleViewer fConsoleViewer;
+
+ public ClearOutputAction(ConsoleViewer viewer) {
+ super(ActionMessages.getString("ClearOutputAction.title")); //$NON-NLS-1$
+ fConsoleViewer= viewer;
+ setToolTipText(ActionMessages.getString("ClearOutputAction.toolTipText")); //$NON-NLS-1$
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CLEAR));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_CLEAR));
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_CLEAR));
+ WorkbenchHelp.setHelp(
+ this,
+ IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
+ }
+
+ /**
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ fConsoleViewer.clearDocument();
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConsoleTerminateActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConsoleTerminateActionDelegate.java
index d29ffd007..820fee576 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConsoleTerminateActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConsoleTerminateActionDelegate.java
@@ -1,84 +1,84 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.views.console.ConsoleView;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Terminate action for the console. Terminates the process
- * currently being displayed in the console.
- */
-public class ConsoleTerminateActionDelegate extends TerminateActionDelegate implements IUpdate {
-
- /**
- * Returns a selection with the console view's
- * current process, or an empty selection.
- *
- * @return structured selection
- */
- protected IStructuredSelection getSelection() {
- IViewPart view = getView();
- if (view instanceof ConsoleView) {
- IProcess process = ((ConsoleView)view).getProcess();
- if (process != null) {
- return new StructuredSelection(process);
- }
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @see AbstractDebugActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
- IDebugView debugView= (IDebugView)view.getAdapter(IDebugView.class);
- if (debugView != null) {
- debugView.add(this);
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#dispose()
- */
- public void dispose() {
- IViewPart view= getView();
- IDebugView debugView= (IDebugView)view.getAdapter(IDebugView.class);
- if (debugView != null) {
- debugView.remove(this);
- }
- super.dispose();
- }
-
- /**
- * @see IUpdate#update()
- */
- public void update() {
- if (getAction() != null) {
- update(getAction(), null);
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(IAction, ISelection)
- */
- protected void update(IAction action, ISelection s) {
- //only update on the current process associated with the
- //console view
- s= getSelection();
- super.update(action, s);
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.views.console.ConsoleView;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.texteditor.IUpdate;
+
+/**
+ * Terminate action for the console. Terminates the process
+ * currently being displayed in the console.
+ */
+public class ConsoleTerminateActionDelegate extends TerminateActionDelegate implements IUpdate {
+
+ /**
+ * Returns a selection with the console view's
+ * current process, or an empty selection.
+ *
+ * @return structured selection
+ */
+ protected IStructuredSelection getSelection() {
+ IViewPart view = getView();
+ if (view instanceof ConsoleView) {
+ IProcess process = ((ConsoleView)view).getProcess();
+ if (process != null) {
+ return new StructuredSelection(process);
+ }
+ }
+ return StructuredSelection.EMPTY;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ super.init(view);
+ IDebugView debugView= (IDebugView)view.getAdapter(IDebugView.class);
+ if (debugView != null) {
+ debugView.add(this);
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#dispose()
+ */
+ public void dispose() {
+ IViewPart view= getView();
+ IDebugView debugView= (IDebugView)view.getAdapter(IDebugView.class);
+ if (debugView != null) {
+ debugView.remove(this);
+ }
+ super.dispose();
+ }
+
+ /**
+ * @see IUpdate#update()
+ */
+ public void update() {
+ if (getAction() != null) {
+ update(getAction(), null);
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(IAction, ISelection)
+ */
+ protected void update(IAction action, ISelection s) {
+ //only update on the current process associated with the
+ //console view
+ s= getSelection();
+ super.update(action, s);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyToClipboardActionDelegate.java
index 9939bc05e..39ff91c0b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyToClipboardActionDelegate.java
@@ -1,201 +1,201 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ContentViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Display;
-
-public class CopyToClipboardActionDelegate extends AbstractDebugActionDelegate {
-
- private ContentViewer fViewer;
-
- /**
- * @see AbstractDebugActionDelegate#initialize(IAction, ISelection)
- */
- protected boolean initialize(IAction action, ISelection selection) {
- if (!isInitialized()) {
- IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
- if (adapter != null) {
- if (adapter.getViewer() instanceof ContentViewer) {
- setViewer((ContentViewer) adapter.getViewer());
- }
- adapter.setAction(getActionId(), action);
- }
- return super.initialize(action, selection);
- }
- return false;
- }
-
- protected String getActionId() {
- return IDebugView.COPY_ACTION;
- }
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return getViewer() != null && element instanceof IDebugElement;
- }
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element, StringBuffer buffer) {
- append(element, buffer, (ILabelProvider)getViewer().getLabelProvider(), 0);
- }
-
- /**
- * Appends the representation of the specified element (using the label provider and indent)
- * to the buffer. For elements down to stack frames, children representations
- * are append to the buffer as well.
- */
- protected void append(Object e, StringBuffer buffer, ILabelProvider lp, int indent) {
- for (int i= 0; i < indent; i++) {
- buffer.append('\t');
- }
- buffer.append(lp.getText(e));
- buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
- if (shouldAppendChildren(e)) {
- Object[] children= new Object[0];
- children= getChildren(e);
- for (int i = 0;i < children.length; i++) {
- Object de= children[i];
- append(de, buffer, lp, indent + 1);
- }
- }
- }
-
- protected Object getParent(Object e) {
- return ((ITreeContentProvider) getViewer().getContentProvider()).getParent(e);
- }
-
- /**
- * Returns the children of the parent after applying the filters
- * that are present in the viewer.
- */
- protected Object[] getChildren(Object parent) {
- Object[] children= ((ITreeContentProvider)getViewer().getContentProvider()).getChildren(parent);
- ViewerFilter[] filters= ((StructuredViewer)getViewer()).getFilters();
- if (filters != null) {
- for (int i= 0; i < filters.length; i++) {
- ViewerFilter f = filters[i];
- children = f.filter(getViewer(), parent, children);
- }
- }
- return children;
- }
-
- /**
- * Do the specific action using the current selection.
- */
- public void run(IAction action) {
- final Iterator iter= pruneSelection();
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- StringBuffer buffer= new StringBuffer();
- while (iter.hasNext()) {
- doAction(iter.next(), buffer);
- }
- TextTransfer plainTextTransfer = TextTransfer.getInstance();
- Clipboard clipboard= new Clipboard(getViewer().getControl().getDisplay());
- try {
- doCopy(clipboard, plainTextTransfer, buffer);
- } finally {
- clipboard.dispose();
- }
- }
- });
- }
-
- protected void doCopy(Clipboard clipboard, TextTransfer plainTextTransfer, StringBuffer buffer) {
- try {
- clipboard.setContents(
- new String[]{buffer.toString()},
- new Transfer[]{plainTextTransfer});
- } catch (SWTError e){
- if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) {
- throw e;
- }
- if (MessageDialog.openQuestion(getViewer().getControl().getShell(), ActionMessages.getString("CopyToClipboardActionDelegate.Problem_Copying_to_Clipboard_1"), ActionMessages.getString("CopyToClipboardActionDelegate.There_was_a_problem_when_accessing_the_system_clipboard._Retry__2"))) { //$NON-NLS-1$ //$NON-NLS-2$
- doCopy(clipboard, plainTextTransfer, buffer);
- }
- }
- }
-
- /**
- * Removes the duplicate items from the selection.
- * That is, if both a parent and a child are in a selection
- * remove the child.
- */
- protected Iterator pruneSelection() {
- IStructuredSelection selection= (IStructuredSelection)getViewer().getSelection();
- List elements= new ArrayList(selection.size());
- Iterator iter= selection.iterator();
- while (iter.hasNext()) {
- Object element= iter.next();
- if (isEnabledFor(element)) {
- if(walkHierarchy(element, elements)) {
- elements.add(element);
- }
- }
- }
- return elements.iterator();
- }
-
- /**
- * Returns whether the parent of the specified
- * element is already contained in the collection.
- */
- protected boolean walkHierarchy(Object element, List elements) {
- Object parent= getParent(element);
- if (parent == null) {
- return true;
- }
- if (elements.contains(parent)) {
- return false;
- }
- return walkHierarchy(parent, elements);
- }
-
- protected boolean shouldAppendChildren(Object e) {
- return e instanceof IDebugTarget || e instanceof IThread;
- }
-
- protected ContentViewer getViewer() {
- return fViewer;
- }
-
- protected void setViewer(ContentViewer viewer) {
- fViewer = viewer;
- }
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) {
- //not used
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ContentViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Display;
+
+public class CopyToClipboardActionDelegate extends AbstractDebugActionDelegate {
+
+ private ContentViewer fViewer;
+
+ /**
+ * @see AbstractDebugActionDelegate#initialize(IAction, ISelection)
+ */
+ protected boolean initialize(IAction action, ISelection selection) {
+ if (!isInitialized()) {
+ IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
+ if (adapter != null) {
+ if (adapter.getViewer() instanceof ContentViewer) {
+ setViewer((ContentViewer) adapter.getViewer());
+ }
+ adapter.setAction(getActionId(), action);
+ }
+ return super.initialize(action, selection);
+ }
+ return false;
+ }
+
+ protected String getActionId() {
+ return IDebugView.COPY_ACTION;
+ }
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return getViewer() != null && element instanceof IDebugElement;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element, StringBuffer buffer) {
+ append(element, buffer, (ILabelProvider)getViewer().getLabelProvider(), 0);
+ }
+
+ /**
+ * Appends the representation of the specified element (using the label provider and indent)
+ * to the buffer. For elements down to stack frames, children representations
+ * are append to the buffer as well.
+ */
+ protected void append(Object e, StringBuffer buffer, ILabelProvider lp, int indent) {
+ for (int i= 0; i < indent; i++) {
+ buffer.append('\t');
+ }
+ buffer.append(lp.getText(e));
+ buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
+ if (shouldAppendChildren(e)) {
+ Object[] children= new Object[0];
+ children= getChildren(e);
+ for (int i = 0;i < children.length; i++) {
+ Object de= children[i];
+ append(de, buffer, lp, indent + 1);
+ }
+ }
+ }
+
+ protected Object getParent(Object e) {
+ return ((ITreeContentProvider) getViewer().getContentProvider()).getParent(e);
+ }
+
+ /**
+ * Returns the children of the parent after applying the filters
+ * that are present in the viewer.
+ */
+ protected Object[] getChildren(Object parent) {
+ Object[] children= ((ITreeContentProvider)getViewer().getContentProvider()).getChildren(parent);
+ ViewerFilter[] filters= ((StructuredViewer)getViewer()).getFilters();
+ if (filters != null) {
+ for (int i= 0; i < filters.length; i++) {
+ ViewerFilter f = filters[i];
+ children = f.filter(getViewer(), parent, children);
+ }
+ }
+ return children;
+ }
+
+ /**
+ * Do the specific action using the current selection.
+ */
+ public void run(IAction action) {
+ final Iterator iter= pruneSelection();
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ public void run() {
+ StringBuffer buffer= new StringBuffer();
+ while (iter.hasNext()) {
+ doAction(iter.next(), buffer);
+ }
+ TextTransfer plainTextTransfer = TextTransfer.getInstance();
+ Clipboard clipboard= new Clipboard(getViewer().getControl().getDisplay());
+ try {
+ doCopy(clipboard, plainTextTransfer, buffer);
+ } finally {
+ clipboard.dispose();
+ }
+ }
+ });
+ }
+
+ protected void doCopy(Clipboard clipboard, TextTransfer plainTextTransfer, StringBuffer buffer) {
+ try {
+ clipboard.setContents(
+ new String[]{buffer.toString()},
+ new Transfer[]{plainTextTransfer});
+ } catch (SWTError e){
+ if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) {
+ throw e;
+ }
+ if (MessageDialog.openQuestion(getViewer().getControl().getShell(), ActionMessages.getString("CopyToClipboardActionDelegate.Problem_Copying_to_Clipboard_1"), ActionMessages.getString("CopyToClipboardActionDelegate.There_was_a_problem_when_accessing_the_system_clipboard._Retry__2"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ doCopy(clipboard, plainTextTransfer, buffer);
+ }
+ }
+ }
+
+ /**
+ * Removes the duplicate items from the selection.
+ * That is, if both a parent and a child are in a selection
+ * remove the child.
+ */
+ protected Iterator pruneSelection() {
+ IStructuredSelection selection= (IStructuredSelection)getViewer().getSelection();
+ List elements= new ArrayList(selection.size());
+ Iterator iter= selection.iterator();
+ while (iter.hasNext()) {
+ Object element= iter.next();
+ if (isEnabledFor(element)) {
+ if(walkHierarchy(element, elements)) {
+ elements.add(element);
+ }
+ }
+ }
+ return elements.iterator();
+ }
+
+ /**
+ * Returns whether the parent of the specified
+ * element is already contained in the collection.
+ */
+ protected boolean walkHierarchy(Object element, List elements) {
+ Object parent= getParent(element);
+ if (parent == null) {
+ return true;
+ }
+ if (elements.contains(parent)) {
+ return false;
+ }
+ return walkHierarchy(parent, elements);
+ }
+
+ protected boolean shouldAppendChildren(Object e) {
+ return e instanceof IDebugTarget || e instanceof IThread;
+ }
+
+ protected ContentViewer getViewer() {
+ return fViewer;
+ }
+
+ protected void setViewer(ContentViewer viewer) {
+ fViewer = viewer;
+ }
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) {
+ //not used
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyVariablesToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyVariablesToClipboardActionDelegate.java
index 302721218..ee8f09c95 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyVariablesToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CopyVariablesToClipboardActionDelegate.java
@@ -1,35 +1,35 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- * Used to copy the values of variables to the clipboard from
- * the Variables and Expression views.
- */
-public class CopyVariablesToClipboardActionDelegate extends CopyToClipboardActionDelegate {
-
- /**
- * Only append children that are visible in the tree viewer
- */
- protected boolean shouldAppendChildren(Object e) {
- return((TreeViewer)getViewer()).getExpandedState(e);
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof IDebugElement;
- }
-
- protected String getActionId() {
- return IDebugView.COPY_ACTION + ".Variables"; //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.viewers.TreeViewer;
+
+/**
+ * Used to copy the values of variables to the clipboard from
+ * the Variables and Expression views.
+ */
+public class CopyVariablesToClipboardActionDelegate extends CopyToClipboardActionDelegate {
+
+ /**
+ * Only append children that are visible in the tree viewer
+ */
+ protected boolean shouldAppendChildren(Object e) {
+ return((TreeViewer)getViewer()).getExpandedState(e);
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof IDebugElement;
+ }
+
+ protected String getActionId() {
+ return IDebugView.COPY_ACTION + ".Variables"; //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugDropDownAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugDropDownAction.java
index 1d0969abb..d9f79fc41 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugDropDownAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugDropDownAction.java
@@ -1,59 +1,59 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-import org.eclipse.debug.ui.actions.DebugAction;
-
-public class DebugDropDownAction extends LaunchDropDownAction {
-
-
- public DebugDropDownAction() {
- super(new DebugAction());
- }
-
- protected DebugDropDownAction(ExecutionAction action) {
- super(action);
- }
-
- /**
- * @see LaunchDropDownAction#getMode()
- */
- public String getMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-
- /**
- * @see LaunchDropDownAction#getHistory()
- */
- public LaunchConfigurationHistoryElement[] getHistory() {
- return DebugUIPlugin.getLaunchConfigurationManager().getDebugHistory();
- }
-
- /**
- * @see LaunchDropDownAction#getFavorites()
- */
- public LaunchConfigurationHistoryElement[] getFavorites() {
- return DebugUIPlugin.getLaunchConfigurationManager().getDebugFavorites();
- }
-
- /**
- * @see LaunchDropDownAction#getLastLaunchPrefix()
- */
- protected String getLastLaunchPrefix() {
- return ActionMessages.getString("DebugDropDownAction.Debug_last_launched_1"); //$NON-NLS-1$
- }
-
- /**
- * @see LaunchDropDownAction#getTooltipPrefix()
- */
- protected String getStaticTooltip() {
- return ActionMessages.getString("DebugDropDownAction.Debug_1"); //$NON-NLS-1$
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+import org.eclipse.debug.ui.actions.DebugAction;
+
+public class DebugDropDownAction extends LaunchDropDownAction {
+
+
+ public DebugDropDownAction() {
+ super(new DebugAction());
+ }
+
+ protected DebugDropDownAction(ExecutionAction action) {
+ super(action);
+ }
+
+ /**
+ * @see LaunchDropDownAction#getMode()
+ */
+ public String getMode() {
+ return ILaunchManager.DEBUG_MODE;
+ }
+
+ /**
+ * @see LaunchDropDownAction#getHistory()
+ */
+ public LaunchConfigurationHistoryElement[] getHistory() {
+ return DebugUIPlugin.getLaunchConfigurationManager().getDebugHistory();
+ }
+
+ /**
+ * @see LaunchDropDownAction#getFavorites()
+ */
+ public LaunchConfigurationHistoryElement[] getFavorites() {
+ return DebugUIPlugin.getLaunchConfigurationManager().getDebugFavorites();
+ }
+
+ /**
+ * @see LaunchDropDownAction#getLastLaunchPrefix()
+ */
+ protected String getLastLaunchPrefix() {
+ return ActionMessages.getString("DebugDropDownAction.Debug_last_launched_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see LaunchDropDownAction#getTooltipPrefix()
+ */
+ protected String getStaticTooltip() {
+ return ActionMessages.getString("DebugDropDownAction.Debug_1"); //$NON-NLS-1$
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java
index 8bebe6e78..b40e8829f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java
@@ -1,90 +1,90 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-
-public class DebugHistoryMenuAction extends DebugDropDownAction implements IMenuCreator {
-
- private MenuListener fMenuListener= null;
- private Menu fTopMenu= null;
-
- public DebugHistoryMenuAction() {
- super(null);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (action instanceof Action) {
- if (getActionProxy() == null) {
- ((Action)action).setMenuCreator(this);
- setActionProxy(action);
- }
- } else {
- action.setEnabled(false);
- }
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- //do nothing as the action strictly generates the history sub menu
- }
-
- /**
- * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
- */
- public void runWithEvent(IAction action, Event event) {
- //do nothing as the action strictly generates the history sub menu
- }
-
- public Menu getMenu(Menu parent) {
- cleanup();
- Menu menu= new Menu(parent);
- parent.addMenuListener(getDebugActionSetMenuListener());
- fTopMenu= parent;
- setCreatedMenu(menu);
- Menu subMenu= createMenu(menu);
- return subMenu;
- }
-
- /**
- * @see LaunchDropDownAction#getDebugActionSetMenuListener()
- */
- protected MenuListener getDebugActionSetMenuListener() {
- if (fMenuListener == null) {
- fMenuListener= super.getDebugActionSetMenuListener();
- }
- return fMenuListener;
- }
-
- public void dispose() {
- cleanup();
- super.dispose();
- }
-
- protected void cleanup() {
- if (fTopMenu != null && !fTopMenu.isDisposed()) {
- fTopMenu.removeMenuListener(getDebugActionSetMenuListener());
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#createTopSeparator(Menu)
- */
- protected void createTopSeparator(Menu menu) {
- }
-
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+
+public class DebugHistoryMenuAction extends DebugDropDownAction implements IMenuCreator {
+
+ private MenuListener fMenuListener= null;
+ private Menu fTopMenu= null;
+
+ public DebugHistoryMenuAction() {
+ super(null);
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (action instanceof Action) {
+ if (getActionProxy() == null) {
+ ((Action)action).setMenuCreator(this);
+ setActionProxy(action);
+ }
+ } else {
+ action.setEnabled(false);
+ }
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ //do nothing as the action strictly generates the history sub menu
+ }
+
+ /**
+ * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
+ */
+ public void runWithEvent(IAction action, Event event) {
+ //do nothing as the action strictly generates the history sub menu
+ }
+
+ public Menu getMenu(Menu parent) {
+ cleanup();
+ Menu menu= new Menu(parent);
+ parent.addMenuListener(getDebugActionSetMenuListener());
+ fTopMenu= parent;
+ setCreatedMenu(menu);
+ Menu subMenu= createMenu(menu);
+ return subMenu;
+ }
+
+ /**
+ * @see LaunchDropDownAction#getDebugActionSetMenuListener()
+ */
+ protected MenuListener getDebugActionSetMenuListener() {
+ if (fMenuListener == null) {
+ fMenuListener= super.getDebugActionSetMenuListener();
+ }
+ return fMenuListener;
+ }
+
+ public void dispose() {
+ cleanup();
+ super.dispose();
+ }
+
+ protected void cleanup() {
+ if (fTopMenu != null && !fTopMenu.isDisposed()) {
+ fTopMenu.removeMenuListener(getDebugActionSetMenuListener());
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#createTopSeparator(Menu)
+ */
+ protected void createTopSeparator(Menu menu) {
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisableBreakpointsAction.java
index 3c14eaa86..1525f6213 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisableBreakpointsAction.java
@@ -5,9 +5,9 @@ Copyright (c) 2002 IBM Corp. All rights reserved.
This file is made available under the terms of the Common Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-public class DisableBreakpointsAction extends EnableBreakpointsAction {
+**********************************************************************/
+
+public class DisableBreakpointsAction extends EnableBreakpointsAction {
/**
* This action disables breakpoints.
@@ -15,4 +15,4 @@ public class DisableBreakpointsAction extends EnableBreakpointsAction {
protected boolean isEnableAction() {
return false;
}
-}
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisconnectActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisconnectActionDelegate.java
index c91b8b567..f4eac569e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisconnectActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DisconnectActionDelegate.java
@@ -1,59 +1,59 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IDisconnect;
-
-public class DisconnectActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) throws DebugException {
- if (element instanceof IDisconnect) {
- ((IDisconnect) element).disconnect();
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof IDisconnect && ((IDisconnect) element).canDisconnect();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("DisconnectActionDelegate.Exceptions_occurred_attempting_to_disconnect._2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("DisconnectActionDelegate.Disconnect_failed_1"); //$NON-NLS-1$
- }
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("DisconnectActionDelegate.Disconnect_3"); //$NON-NLS-1$
- }
-
- /**
- * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
- */
- protected void doHandleDebugEvent(DebugEvent event) {
- if (event.getKind() == DebugEvent.TERMINATE && event.getSource() instanceof IDebugTarget) {
- update(getAction(), getSelection());
- }
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IDisconnect;
+
+public class DisconnectActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) throws DebugException {
+ if (element instanceof IDisconnect) {
+ ((IDisconnect) element).disconnect();
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof IDisconnect && ((IDisconnect) element).canDisconnect();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("DisconnectActionDelegate.Exceptions_occurred_attempting_to_disconnect._2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("DisconnectActionDelegate.Disconnect_failed_1"); //$NON-NLS-1$
+ }
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("DisconnectActionDelegate.Disconnect_3"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
+ */
+ protected void doHandleDebugEvent(DebugEvent event) {
+ if (event.getKind() == DebugEvent.TERMINATE && event.getSource() instanceof IDebugTarget) {
+ update(getAction(), getSelection());
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EnableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EnableBreakpointsAction.java
index 56bbc2d72..822a6bcb2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EnableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EnableBreakpointsAction.java
@@ -1,247 +1,247 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class EnableBreakpointsAction implements IViewActionDelegate, IPartListener, IBreakpointListener {
-
- private IViewPart fView;
- private IAction fAction;
-
- public EnableBreakpointsAction() {
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView(IViewPart view) {
- fView = view;
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- setView(view);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- view.getViewSite().getPage().addPartListener(this);
- }
-
- protected void update() {
- selectionChanged(getAction(), getView().getViewSite().getSelectionProvider().getSelection());
- }
-
- /**
- * This action enables breakpoints.
- */
- protected boolean isEnableAction() {
- return true;
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- IStructuredSelection selection= getSelection();
- int size= selection.size();
- if (size == 0) {
- return;
- }
- Iterator enum= selection.iterator();
- MultiStatus ms= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString("EnableBreakpointAction.Enable_breakpoint(s)_failed_2"), null); //$NON-NLS-1$
- while (enum.hasNext()) {
- IBreakpoint breakpoint = (IBreakpoint) enum.next();
- try {
- if (size > 1) {
- if (isEnableAction()) {
- breakpoint.setEnabled(true);
- } else {
- breakpoint.setEnabled(false);
- }
- } else {
- breakpoint.setEnabled(!breakpoint.isEnabled());
- }
- } catch (CoreException e) {
- ms.merge(e.getStatus());
- }
- }
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("EnableBreakpointAction.Enabling_breakpoints_3"), ActionMessages.getString("EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4"), ms); //$NON-NLS-2$ //$NON-NLS-1$
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- private IStructuredSelection getSelection() {
- return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- setAction(action);
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- IStructuredSelection sel= (IStructuredSelection)selection;
- Object o= sel.getFirstElement();
- if (!(o instanceof IBreakpoint)) {
- return;
- }
-
- Iterator enum= sel.iterator();
- boolean allEnabled= true;
- boolean allDisabled= true;
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointListener;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+
+public class EnableBreakpointsAction implements IViewActionDelegate, IPartListener, IBreakpointListener {
+
+ private IViewPart fView;
+ private IAction fAction;
+
+ public EnableBreakpointsAction() {
+ }
+
+ protected IViewPart getView() {
+ return fView;
+ }
+
+ protected void setView(IViewPart view) {
+ fView = view;
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ setView(view);
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
+ view.getViewSite().getPage().addPartListener(this);
+ }
+
+ protected void update() {
+ selectionChanged(getAction(), getView().getViewSite().getSelectionProvider().getSelection());
+ }
+
+ /**
+ * This action enables breakpoints.
+ */
+ protected boolean isEnableAction() {
+ return true;
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ IStructuredSelection selection= getSelection();
+ int size= selection.size();
+ if (size == 0) {
+ return;
+ }
+ Iterator enum= selection.iterator();
+ MultiStatus ms= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString("EnableBreakpointAction.Enable_breakpoint(s)_failed_2"), null); //$NON-NLS-1$
while (enum.hasNext()) {
- IBreakpoint bp= (IBreakpoint)enum.next();
- try {
- if (bp.isEnabled()) {
- allDisabled= false;
- } else {
- allEnabled= false;
- }
- } catch (CoreException ce) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("EnableBreakpointAction.Enabling_breakpoints_3"), ActionMessages.getString("EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4"), ce); //$NON-NLS-2$ //$NON-NLS-1$
- } else {
- DebugUIPlugin.log(ce);
- }
- }
- }
-
- if (isEnableAction()) {
- action.setEnabled(!allEnabled);
- } else {
- action.setEnabled(!allDisabled);
- }
- }
-
-
- /**
- * Removes this action as a breakpoint and part listener.
- */
- public void dispose() {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- getView().getViewSite().getPage().removePartListener(this);
- }
-
- /**
- * @see IBreakpointListener#breakpointAdded(IBreakpoint)
- */
- public void breakpointAdded(IBreakpoint breakpoint) {
- }
-
- /**
- * @see IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta)
- */
- public void breakpointRemoved(final IBreakpoint breakpoint, IMarkerDelta delta) {
- asynchUpdate();
- }
-
- /**
- * @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
- */
- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
- asynchUpdate();
- }
-
- protected void asynchUpdate() {
- if (getAction() == null) {
- return;
- }
- IWorkbenchWindow window= getView().getViewSite().getPage().getWorkbenchWindow();
- if (window == null) {
- return;
- }
- Shell shell= window.getShell();
- if (shell == null || shell.isDisposed()) {
- return;
- }
- Runnable r= new Runnable() {
- public void run() {
- IWorkbenchWindow window= getView().getViewSite().getPage().getWorkbenchWindow();
- if (window == null) {
- return;
- }
- Shell shell= window.getShell();
- if (shell == null || shell.isDisposed()) {
- return;
- }
- update();
- }
- };
-
- shell.getDisplay().asyncExec(r);
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected void setAction(IAction action) {
- fAction = action;
- }
- /**
- * @see IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- if (part.equals(getView())) {
- dispose();
- }
- }
-
- /**
- * @see IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- }
-}
-
+ IBreakpoint breakpoint = (IBreakpoint) enum.next();
+ try {
+ if (size > 1) {
+ if (isEnableAction()) {
+ breakpoint.setEnabled(true);
+ } else {
+ breakpoint.setEnabled(false);
+ }
+ } else {
+ breakpoint.setEnabled(!breakpoint.isEnabled());
+ }
+ } catch (CoreException e) {
+ ms.merge(e.getStatus());
+ }
+ }
+ if (!ms.isOK()) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("EnableBreakpointAction.Enabling_breakpoints_3"), ActionMessages.getString("EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4"), ms); //$NON-NLS-2$ //$NON-NLS-1$
+ } else {
+ DebugUIPlugin.log(ms);
+ }
+ }
+ }
+
+ private IStructuredSelection getSelection() {
+ return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ setAction(action);
+ if (!(selection instanceof IStructuredSelection)) {
+ return;
+ }
+ IStructuredSelection sel= (IStructuredSelection)selection;
+ Object o= sel.getFirstElement();
+ if (!(o instanceof IBreakpoint)) {
+ return;
+ }
+
+ Iterator enum= sel.iterator();
+ boolean allEnabled= true;
+ boolean allDisabled= true;
+ while (enum.hasNext()) {
+ IBreakpoint bp= (IBreakpoint)enum.next();
+ try {
+ if (bp.isEnabled()) {
+ allDisabled= false;
+ } else {
+ allEnabled= false;
+ }
+ } catch (CoreException ce) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("EnableBreakpointAction.Enabling_breakpoints_3"), ActionMessages.getString("EnableBreakpointAction.Exceptions_occurred_enabling_the_breakpoint(s)._4"), ce); //$NON-NLS-2$ //$NON-NLS-1$
+ } else {
+ DebugUIPlugin.log(ce);
+ }
+ }
+ }
+
+ if (isEnableAction()) {
+ action.setEnabled(!allEnabled);
+ } else {
+ action.setEnabled(!allDisabled);
+ }
+ }
+
+
+ /**
+ * Removes this action as a breakpoint and part listener.
+ */
+ public void dispose() {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
+ getView().getViewSite().getPage().removePartListener(this);
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointAdded(IBreakpoint)
+ */
+ public void breakpointAdded(IBreakpoint breakpoint) {
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointRemoved(final IBreakpoint breakpoint, IMarkerDelta delta) {
+ asynchUpdate();
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
+ asynchUpdate();
+ }
+
+ protected void asynchUpdate() {
+ if (getAction() == null) {
+ return;
+ }
+ IWorkbenchWindow window= getView().getViewSite().getPage().getWorkbenchWindow();
+ if (window == null) {
+ return;
+ }
+ Shell shell= window.getShell();
+ if (shell == null || shell.isDisposed()) {
+ return;
+ }
+ Runnable r= new Runnable() {
+ public void run() {
+ IWorkbenchWindow window= getView().getViewSite().getPage().getWorkbenchWindow();
+ if (window == null) {
+ return;
+ }
+ Shell shell= window.getShell();
+ if (shell == null || shell.isDisposed()) {
+ return;
+ }
+ update();
+ }
+ };
+
+ shell.getDisplay().asyncExec(r);
+ }
+
+ protected IAction getAction() {
+ return fAction;
+ }
+
+ protected void setAction(IAction action) {
+ fAction = action;
+ }
+ /**
+ * @see IPartListener#partActivated(IWorkbenchPart)
+ */
+ public void partActivated(IWorkbenchPart part) {
+ }
+
+ /**
+ * @see IPartListener#partBroughtToTop(IWorkbenchPart)
+ */
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ /**
+ * @see IPartListener#partClosed(IWorkbenchPart)
+ */
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(getView())) {
+ dispose();
+ }
+ }
+
+ /**
+ * @see IPartListener#partDeactivated(IWorkbenchPart)
+ */
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ /**
+ * @see IPartListener#partOpened(IWorkbenchPart)
+ */
+ public void partOpened(IWorkbenchPart part) {
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
index d37191248..a9db82e45 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
@@ -1,47 +1,47 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegateWithEvent;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * This is the super class of the Run & Debug actions which appears in the desktop menu and toolbar.
- */
-public abstract class ExecutionAction implements IActionDelegateWithEvent {
-
- /**
- * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
- */
- public void runWithEvent(IAction action, Event event) {
- openLaunchConfigurationDialog();
- }
-
- /**
- * Open the launch configuration dialog, passing in the current workbench selection.
- */
- private void openLaunchConfigurationDialog() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- IStructuredSelection selection= DebugUIPlugin.resolveSelection(dwindow);
- LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(DebugUIPlugin.getShell(), selection, getMode());
- dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST);
- dialog.open();
- }
-
- /**
- * Returns the mode of a launcher to use for this action
- */
- protected abstract String getMode();
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegateWithEvent;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * This is the super class of the Run & Debug actions which appears in the desktop menu and toolbar.
+ */
+public abstract class ExecutionAction implements IActionDelegateWithEvent {
+
+ /**
+ * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
+ */
+ public void runWithEvent(IAction action, Event event) {
+ openLaunchConfigurationDialog();
+ }
+
+ /**
+ * Open the launch configuration dialog, passing in the current workbench selection.
+ */
+ private void openLaunchConfigurationDialog() {
+ IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (dwindow == null) {
+ return;
+ }
+ IStructuredSelection selection= DebugUIPlugin.resolveSelection(dwindow);
+ LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(DebugUIPlugin.getShell(), selection, getMode());
+ dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST);
+ dialog.open();
+ }
+
+ /**
+ * Returns the mode of a launcher to use for this action
+ */
+ protected abstract String getMode();
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchDropDownAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchDropDownAction.java
index e84fe3fa1..4cdd6b7cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchDropDownAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchDropDownAction.java
@@ -1,338 +1,338 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.SubContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionDelegateWithEvent;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-
-/**
- * Superclass of run & debug pulldown actions.
- */
-public abstract class LaunchDropDownAction implements IWorkbenchWindowPulldownDelegate2,
- IActionDelegateWithEvent,
- ILaunchHistoryChangedListener {
-
- private ExecutionAction fLaunchAction;
-
- private Menu fCreatedMenu;
-
- private DebugWithConfigurationAction fDebugWithAction;
- private RunWithConfigurationAction fRunWithAction;
-
- /**
- * This action delegate's proxy.
- */
- private IAction fActionProxy;
-
- /**
- * The tooltip that was specified in XML for this action.
- */
- private String fOriginalTooltip;
-
- protected void setActionProxy(IAction action) {
- fActionProxy = action;
- }
-
- protected IAction getActionProxy() {
- return fActionProxy;
- }
-
- public LaunchDropDownAction(ExecutionAction launchAction) {
- setLaunchAction(launchAction);
- }
-
- private void createMenuForAction(Menu parent, IAction action, int count) {
- if (count > 0) {
- StringBuffer label= new StringBuffer();
- if (count < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(count);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- }
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /**
- * Initialize this action so that it can dynamically set its tooltip.
- */
- protected void initialize(IAction action) {
- DebugUIPlugin.getLaunchConfigurationManager().addLaunchHistoryListener(this);
- fOriginalTooltip = action.getToolTipText();
- setActionProxy(action);
- updateTooltip();
- }
-
- /**
- * Updates this action's tooltip to correspond to the most recent launch.
- */
- protected void updateTooltip() {
- LaunchConfigurationHistoryElement lastLaunched = getLastLaunch();
- String tooltip= fOriginalTooltip;
- if (lastLaunched != null) {
- tooltip= getLastLaunchPrefix() + lastLaunched.getLaunchConfiguration().getName();
- } else {
- tooltip= getStaticTooltip();
- }
- getActionProxy().setToolTipText(tooltip);
- }
-
- /**
- * @see ILaunchHistoryChangedListener#launchHistoryChanged()
- */
- public void launchHistoryChanged() {
- updateTooltip();
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- DebugUIPlugin.getLaunchConfigurationManager().removeLaunchHistoryListener(this);
- }
-
- /**
- * Return the last launch that occurred in the workspace.
- */
- protected LaunchConfigurationHistoryElement getLastLaunch() {
- return DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
- }
-
- /**
- * @see IWorkbenchWindowPulldownDelegate#getMenu(Control)
- */
- public Menu getMenu(Control parent) {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- setCreatedMenu(new Menu(parent));
- return createMenu(getCreatedMenu());
- }
-
- /**
- * @see IMenuCreator#getMenu(Menu)
- */
- public Menu getMenu(Menu parent) {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- setCreatedMenu(new Menu(parent));
- return createMenu(getCreatedMenu());
- }
-
- /**
- * Create the drop-down menu based on whether the config style pref is set
- */
- protected Menu createMenu(Menu menu) {
- LaunchConfigurationHistoryElement[] historyList= getHistory();
- LaunchConfigurationHistoryElement[] favoriteList = getFavorites();
-
- // Add any favorites
- int total = 0;
- for (int i = 0; i < favoriteList.length; i++) {
- LaunchConfigurationHistoryElement launch= favoriteList[i];
- RelaunchHistoryLaunchAction newAction= new RelaunchHistoryLaunchAction(launch);
- createMenuForAction(menu, newAction, total + 1);
- total++;
- }
-
- // Separator between favorites and history
- if (favoriteList.length > 0) {
- if (historyList.length > 0) {
- new MenuItem(menu, SWT.SEPARATOR);
- } else {
- createTopSeparator(menu);
- }
- }
-
- // Add history launches next
- for (int i = 0; i < historyList.length; i++) {
- LaunchConfigurationHistoryElement launch= historyList[i];
- RelaunchHistoryLaunchAction newAction= new RelaunchHistoryLaunchAction(launch);
- createMenuForAction(menu, newAction, total+1);
- total++;
- }
-
- // Separator between history and common actions
- if (historyList.length > 0) {
- createTopSeparator(menu);
- }
-
- // Add the actions to bring up the dialog
- if (getLaunchAction() != null) {
- // Cascading menu for config type 'shortcuts'
- if (getMode() == ILaunchManager.DEBUG_MODE) {
- createMenuForAction(menu, getDebugWithAction(), -1);
- } else {
- createMenuForAction(menu, getRunWithAction(), -1);
- }
-
- // Add non-shortcutted access to the launch configuration dialog
- OpenLaunchConfigurationsAction action = null;
- if (getMode() == ILaunchManager.DEBUG_MODE) {
- action = new OpenDebugConfigurations();
- } else {
- action = new OpenRunConfigurations();
- }
- createMenuForAction(menu, action, -1);
- }
- return menu;
- }
-
- /**
- * Create a separator at the top of the history/favorites area. This method may
- * be overridden to prevent a separator from being placed at the top.
- */
- protected void createTopSeparator(Menu menu) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
-
- /**
- * @see runWithEvent(IAction, Event)
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- }
-
- /**
- * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
- */
- public void runWithEvent(IAction action, Event event) {
- getLaunchAction().runWithEvent(action, event);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection){
- if (fActionProxy == null) {
- initialize(action);
- }
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window){
- }
-
- /**
- * Returns an array of previous launches applicable to this drop down.
- */
- public abstract LaunchConfigurationHistoryElement[] getHistory();
-
- /**
- * Returns an array of favorites applicable to this drop down.
- */
- public abstract LaunchConfigurationHistoryElement[] getFavorites();
-
- /**
- * Returns the mode (e.g., 'run' or 'debug') of this drop down.
- */
- public abstract String getMode();
-
- /**
- * Return the String to use as the first part of the tooltip for this action
- * when there is no launch history.
- */
- protected abstract String getStaticTooltip();
-
- /**
- * Return the String to use as the first part of the tooltip for this action
- * when there is a launch history.
- */
- protected abstract String getLastLaunchPrefix();
-
- protected ExecutionAction getLaunchAction() {
- return fLaunchAction;
- }
-
- protected void setLaunchAction(ExecutionAction launchAction) {
- fLaunchAction = launchAction;
- }
-
- /**
- * A menu listener that is used to constantly flag the debug
- * action set menu as dirty so that any underlying changes to the
- * contributions will be shown.
- * As well, if there are no history items, disable the action.
- */
- protected MenuListener getDebugActionSetMenuListener() {
- return new MenuListener() {
- public void menuShown(MenuEvent e) {
- getActionProxy().setEnabled(getHistory().length > 0 || getFavorites().length > 0);
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window instanceof ApplicationWindow) {
- ApplicationWindow appWindow= (ApplicationWindow)window;
- IMenuManager manager= appWindow.getMenuBarManager();
- IContributionItem actionSetItem= manager.findUsingPath("org.eclipse.ui.run"); //$NON-NLS-1$
- if (actionSetItem instanceof SubContributionItem) {
- IContributionItem item= ((SubContributionItem)actionSetItem).getInnerItem();
- if (item instanceof IMenuManager) {
- ((IMenuManager)item).markDirty();
- }
- }
- }
- }
- public void menuHidden(MenuEvent e) {
- }
- };
- }
-
- protected Menu getCreatedMenu() {
- return fCreatedMenu;
- }
-
- protected void setCreatedMenu(Menu createdMenu) {
- fCreatedMenu = createdMenu;
- }
-
- protected IAction getDebugWithAction() {
- if (fDebugWithAction == null) {
- fDebugWithAction= new DebugWithConfigurationAction();
- } else {
- fDebugWithAction.dispose();
- }
- return fDebugWithAction;
- }
-
- protected IAction getRunWithAction() {
- if (fRunWithAction == null) {
- fRunWithAction= new RunWithConfigurationAction();
- } else {
- fRunWithAction.dispose();
- }
- return fRunWithAction;
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.SubContributionItem;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IActionDelegateWithEvent;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
+
+/**
+ * Superclass of run & debug pulldown actions.
+ */
+public abstract class LaunchDropDownAction implements IWorkbenchWindowPulldownDelegate2,
+ IActionDelegateWithEvent,
+ ILaunchHistoryChangedListener {
+
+ private ExecutionAction fLaunchAction;
+
+ private Menu fCreatedMenu;
+
+ private DebugWithConfigurationAction fDebugWithAction;
+ private RunWithConfigurationAction fRunWithAction;
+
+ /**
+ * This action delegate's proxy.
+ */
+ private IAction fActionProxy;
+
+ /**
+ * The tooltip that was specified in XML for this action.
+ */
+ private String fOriginalTooltip;
+
+ protected void setActionProxy(IAction action) {
+ fActionProxy = action;
+ }
+
+ protected IAction getActionProxy() {
+ return fActionProxy;
+ }
+
+ public LaunchDropDownAction(ExecutionAction launchAction) {
+ setLaunchAction(launchAction);
+ }
+
+ private void createMenuForAction(Menu parent, IAction action, int count) {
+ if (count > 0) {
+ StringBuffer label= new StringBuffer();
+ if (count < 10) {
+ //add the numerical accelerator
+ label.append('&');
+ label.append(count);
+ label.append(' ');
+ }
+ label.append(action.getText());
+ action.setText(label.toString());
+ }
+ ActionContributionItem item= new ActionContributionItem(action);
+ item.fill(parent, -1);
+ }
+
+ /**
+ * Initialize this action so that it can dynamically set its tooltip.
+ */
+ protected void initialize(IAction action) {
+ DebugUIPlugin.getLaunchConfigurationManager().addLaunchHistoryListener(this);
+ fOriginalTooltip = action.getToolTipText();
+ setActionProxy(action);
+ updateTooltip();
+ }
+
+ /**
+ * Updates this action's tooltip to correspond to the most recent launch.
+ */
+ protected void updateTooltip() {
+ LaunchConfigurationHistoryElement lastLaunched = getLastLaunch();
+ String tooltip= fOriginalTooltip;
+ if (lastLaunched != null) {
+ tooltip= getLastLaunchPrefix() + lastLaunched.getLaunchConfiguration().getName();
+ } else {
+ tooltip= getStaticTooltip();
+ }
+ getActionProxy().setToolTipText(tooltip);
+ }
+
+ /**
+ * @see ILaunchHistoryChangedListener#launchHistoryChanged()
+ */
+ public void launchHistoryChanged() {
+ updateTooltip();
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ if (getCreatedMenu() != null) {
+ getCreatedMenu().dispose();
+ }
+ DebugUIPlugin.getLaunchConfigurationManager().removeLaunchHistoryListener(this);
+ }
+
+ /**
+ * Return the last launch that occurred in the workspace.
+ */
+ protected LaunchConfigurationHistoryElement getLastLaunch() {
+ return DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
+ }
+
+ /**
+ * @see IWorkbenchWindowPulldownDelegate#getMenu(Control)
+ */
+ public Menu getMenu(Control parent) {
+ if (getCreatedMenu() != null) {
+ getCreatedMenu().dispose();
+ }
+ setCreatedMenu(new Menu(parent));
+ return createMenu(getCreatedMenu());
+ }
+
+ /**
+ * @see IMenuCreator#getMenu(Menu)
+ */
+ public Menu getMenu(Menu parent) {
+ if (getCreatedMenu() != null) {
+ getCreatedMenu().dispose();
+ }
+ setCreatedMenu(new Menu(parent));
+ return createMenu(getCreatedMenu());
+ }
+
+ /**
+ * Create the drop-down menu based on whether the config style pref is set
+ */
+ protected Menu createMenu(Menu menu) {
+ LaunchConfigurationHistoryElement[] historyList= getHistory();
+ LaunchConfigurationHistoryElement[] favoriteList = getFavorites();
+
+ // Add any favorites
+ int total = 0;
+ for (int i = 0; i < favoriteList.length; i++) {
+ LaunchConfigurationHistoryElement launch= favoriteList[i];
+ RelaunchHistoryLaunchAction newAction= new RelaunchHistoryLaunchAction(launch);
+ createMenuForAction(menu, newAction, total + 1);
+ total++;
+ }
+
+ // Separator between favorites and history
+ if (favoriteList.length > 0) {
+ if (historyList.length > 0) {
+ new MenuItem(menu, SWT.SEPARATOR);
+ } else {
+ createTopSeparator(menu);
+ }
+ }
+
+ // Add history launches next
+ for (int i = 0; i < historyList.length; i++) {
+ LaunchConfigurationHistoryElement launch= historyList[i];
+ RelaunchHistoryLaunchAction newAction= new RelaunchHistoryLaunchAction(launch);
+ createMenuForAction(menu, newAction, total+1);
+ total++;
+ }
+
+ // Separator between history and common actions
+ if (historyList.length > 0) {
+ createTopSeparator(menu);
+ }
+
+ // Add the actions to bring up the dialog
+ if (getLaunchAction() != null) {
+ // Cascading menu for config type 'shortcuts'
+ if (getMode() == ILaunchManager.DEBUG_MODE) {
+ createMenuForAction(menu, getDebugWithAction(), -1);
+ } else {
+ createMenuForAction(menu, getRunWithAction(), -1);
+ }
+
+ // Add non-shortcutted access to the launch configuration dialog
+ OpenLaunchConfigurationsAction action = null;
+ if (getMode() == ILaunchManager.DEBUG_MODE) {
+ action = new OpenDebugConfigurations();
+ } else {
+ action = new OpenRunConfigurations();
+ }
+ createMenuForAction(menu, action, -1);
+ }
+ return menu;
+ }
+
+ /**
+ * Create a separator at the top of the history/favorites area. This method may
+ * be overridden to prevent a separator from being placed at the top.
+ */
+ protected void createTopSeparator(Menu menu) {
+ new MenuItem(menu, SWT.SEPARATOR);
+ }
+
+ /**
+ * @see runWithEvent(IAction, Event)
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ }
+
+ /**
+ * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
+ */
+ public void runWithEvent(IAction action, Event event) {
+ getLaunchAction().runWithEvent(action, event);
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection){
+ if (fActionProxy == null) {
+ initialize(action);
+ }
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window){
+ }
+
+ /**
+ * Returns an array of previous launches applicable to this drop down.
+ */
+ public abstract LaunchConfigurationHistoryElement[] getHistory();
+
+ /**
+ * Returns an array of favorites applicable to this drop down.
+ */
+ public abstract LaunchConfigurationHistoryElement[] getFavorites();
+
+ /**
+ * Returns the mode (e.g., 'run' or 'debug') of this drop down.
+ */
+ public abstract String getMode();
+
+ /**
+ * Return the String to use as the first part of the tooltip for this action
+ * when there is no launch history.
+ */
+ protected abstract String getStaticTooltip();
+
+ /**
+ * Return the String to use as the first part of the tooltip for this action
+ * when there is a launch history.
+ */
+ protected abstract String getLastLaunchPrefix();
+
+ protected ExecutionAction getLaunchAction() {
+ return fLaunchAction;
+ }
+
+ protected void setLaunchAction(ExecutionAction launchAction) {
+ fLaunchAction = launchAction;
+ }
+
+ /**
+ * A menu listener that is used to constantly flag the debug
+ * action set menu as dirty so that any underlying changes to the
+ * contributions will be shown.
+ * As well, if there are no history items, disable the action.
+ */
+ protected MenuListener getDebugActionSetMenuListener() {
+ return new MenuListener() {
+ public void menuShown(MenuEvent e) {
+ getActionProxy().setEnabled(getHistory().length > 0 || getFavorites().length > 0);
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window instanceof ApplicationWindow) {
+ ApplicationWindow appWindow= (ApplicationWindow)window;
+ IMenuManager manager= appWindow.getMenuBarManager();
+ IContributionItem actionSetItem= manager.findUsingPath("org.eclipse.ui.run"); //$NON-NLS-1$
+ if (actionSetItem instanceof SubContributionItem) {
+ IContributionItem item= ((SubContributionItem)actionSetItem).getInnerItem();
+ if (item instanceof IMenuManager) {
+ ((IMenuManager)item).markDirty();
+ }
+ }
+ }
+ }
+ public void menuHidden(MenuEvent e) {
+ }
+ };
+ }
+
+ protected Menu getCreatedMenu() {
+ return fCreatedMenu;
+ }
+
+ protected void setCreatedMenu(Menu createdMenu) {
+ fCreatedMenu = createdMenu;
+ }
+
+ protected IAction getDebugWithAction() {
+ if (fDebugWithAction == null) {
+ fDebugWithAction= new DebugWithConfigurationAction();
+ } else {
+ fDebugWithAction.dispose();
+ }
+ return fDebugWithAction;
+ }
+
+ protected IAction getRunWithAction() {
+ if (fRunWithAction == null) {
+ fRunWithAction= new RunWithConfigurationAction();
+ } else {
+ fRunWithAction.dispose();
+ }
+ return fRunWithAction;
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenBreakpointMarkerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenBreakpointMarkerAction.java
index a38cc4fcb..797b4700a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenBreakpointMarkerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenBreakpointMarkerAction.java
@@ -1,86 +1,86 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.Iterator;
-
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.SelectionProviderAction;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-public class OpenBreakpointMarkerAction extends SelectionProviderAction {
-
- protected static DelegatingModelPresentation fgPresentation = new DelegatingModelPresentation();
-
- public OpenBreakpointMarkerAction(ISelectionProvider selectionProvider) {
- super(selectionProvider, ActionMessages.getString("OpenBreakpointMarkerAction.&Go_to_File_1")); //$NON-NLS-1$
- setToolTipText(ActionMessages.getString("OpenBreakpointMarkerAction.Go_to_File_for_Breakpoint_2")); //$NON-NLS-1$
- ISharedImages images= DebugUIPlugin.getDefault().getWorkbench().getSharedImages();
- setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_OPEN_MARKER));
- WorkbenchHelp.setHelp(
- this,
- IDebugHelpContextIds.OPEN_BREAKPOINT_ACTION);
- setEnabled(false);
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- IWorkbenchPage page= dwindow.getActivePage();
- if (page == null) {
- return;
- }
-
- IStructuredSelection selection= getStructuredSelection();
- if (selection.isEmpty()) {
- setEnabled(false);
- return;
- }
- Iterator enum= selection.iterator();
- IBreakpoint breakpoint= (IBreakpoint)enum.next();
- IEditorInput input= fgPresentation.getEditorInput(breakpoint);
- IEditorPart part= null;
- if (input != null) {
- String editorId = fgPresentation.getEditorId(input, breakpoint);
- try {
- part= page.openEditor(input, editorId);
- } catch (PartInitException e) {
- DebugUIPlugin.errorDialog(dwindow.getShell(), ActionMessages.getString("OpenBreakpointMarkerAction.Go_to_Breakpoint_1"), ActionMessages.getString("OpenBreakpointMarkerAction.Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (part != null) {
- part.setFocus();
- part.gotoMarker(breakpoint.getMarker());
- }
- }
-
- /**
- * @see SelectionProviderAction#selectionChanged(ISelection)
- */
- public void selectionChanged(IStructuredSelection sel) {
- if (sel.size() == 1) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.Iterator;
+
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.SelectionProviderAction;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+public class OpenBreakpointMarkerAction extends SelectionProviderAction {
+
+ protected static DelegatingModelPresentation fgPresentation = new DelegatingModelPresentation();
+
+ public OpenBreakpointMarkerAction(ISelectionProvider selectionProvider) {
+ super(selectionProvider, ActionMessages.getString("OpenBreakpointMarkerAction.&Go_to_File_1")); //$NON-NLS-1$
+ setToolTipText(ActionMessages.getString("OpenBreakpointMarkerAction.Go_to_File_for_Breakpoint_2")); //$NON-NLS-1$
+ ISharedImages images= DebugUIPlugin.getDefault().getWorkbench().getSharedImages();
+ setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_OPEN_MARKER));
+ WorkbenchHelp.setHelp(
+ this,
+ IDebugHelpContextIds.OPEN_BREAKPOINT_ACTION);
+ setEnabled(false);
+ }
+
+ /**
+ * @see IAction#run()
+ */
+ public void run() {
+ IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (dwindow == null) {
+ return;
+ }
+ IWorkbenchPage page= dwindow.getActivePage();
+ if (page == null) {
+ return;
+ }
+
+ IStructuredSelection selection= getStructuredSelection();
+ if (selection.isEmpty()) {
+ setEnabled(false);
+ return;
+ }
+ Iterator enum= selection.iterator();
+ IBreakpoint breakpoint= (IBreakpoint)enum.next();
+ IEditorInput input= fgPresentation.getEditorInput(breakpoint);
+ IEditorPart part= null;
+ if (input != null) {
+ String editorId = fgPresentation.getEditorId(input, breakpoint);
+ try {
+ part= page.openEditor(input, editorId);
+ } catch (PartInitException e) {
+ DebugUIPlugin.errorDialog(dwindow.getShell(), ActionMessages.getString("OpenBreakpointMarkerAction.Go_to_Breakpoint_1"), ActionMessages.getString("OpenBreakpointMarkerAction.Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ if (part != null) {
+ part.setFocus();
+ part.gotoMarker(breakpoint.getMarker());
+ }
+ }
+
+ /**
+ * @see SelectionProviderAction#selectionChanged(ISelection)
+ */
+ public void selectionChanged(IStructuredSelection sel) {
+ if (sel.size() == 1) {
+ setEnabled(true);
+ } else {
+ setEnabled(false);
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
index 43d12cf7f..37c0f7436 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
@@ -1,98 +1,98 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-
-public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object object) {
- if (object instanceof IDebugElement) {
- relaunch((IDebugElement)object);
- } else if (object instanceof ILaunch) {
- relaunch((ILaunch)object);
- } else if (object instanceof IProcess) {
- relaunch((IProcess)object);
- }
- }
-
- public static void relaunch(LaunchConfigurationHistoryElement history) {
- relaunch(history.getLaunchConfiguration(), history.getMode());
- }
-
- public static void relaunch(IDebugElement element) {
- relaunch(element.getLaunch());
- }
-
- public static void relaunch(IProcess process) {
- relaunch(process.getLaunch());
- }
-
- public static void relaunch(ILaunch launch) {
- relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
- }
-
- public static void relaunch(ILaunch launch, String mode) {
- relaunch(launch.getLaunchConfiguration(), mode);
- }
-
- /**
- * Re-launches the given configuration in the specified mode.
- */
- public static void relaunch(ILaunchConfiguration config, String mode) {
- try {
- config.launch(mode, null);
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.getString("RelaunchActionDelegate.Launch_Failed_1"), ActionMessages.getString("RelaunchActionDelegate.An_exception_occurred_while_launching_2"), ce); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- ILaunch launch= null;
- if (element instanceof ILaunch) {
- launch= (ILaunch)element;
- } else if (element instanceof IDebugElement) {
- launch= ((IDebugElement)element).getLaunch();
- } else if (element instanceof IProcess) {
- launch= ((IProcess)element).getLaunch();
- }
-
- return launch != null && launch.getLaunchConfiguration() != null;
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("RelaunchActionDelegate.Launch_Failed_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("RelaunchActionDelegate.Launch_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("RelaunchActionDelegate.An_exception_occurred_while_launching_2"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+
+public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object object) {
+ if (object instanceof IDebugElement) {
+ relaunch((IDebugElement)object);
+ } else if (object instanceof ILaunch) {
+ relaunch((ILaunch)object);
+ } else if (object instanceof IProcess) {
+ relaunch((IProcess)object);
+ }
+ }
+
+ public static void relaunch(LaunchConfigurationHistoryElement history) {
+ relaunch(history.getLaunchConfiguration(), history.getMode());
+ }
+
+ public static void relaunch(IDebugElement element) {
+ relaunch(element.getLaunch());
+ }
+
+ public static void relaunch(IProcess process) {
+ relaunch(process.getLaunch());
+ }
+
+ public static void relaunch(ILaunch launch) {
+ relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
+ }
+
+ public static void relaunch(ILaunch launch, String mode) {
+ relaunch(launch.getLaunchConfiguration(), mode);
+ }
+
+ /**
+ * Re-launches the given configuration in the specified mode.
+ */
+ public static void relaunch(ILaunchConfiguration config, String mode) {
+ try {
+ config.launch(mode, null);
+ } catch (CoreException ce) {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.getString("RelaunchActionDelegate.Launch_Failed_1"), ActionMessages.getString("RelaunchActionDelegate.An_exception_occurred_while_launching_2"), ce); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ ILaunch launch= null;
+ if (element instanceof ILaunch) {
+ launch= (ILaunch)element;
+ } else if (element instanceof IDebugElement) {
+ launch= ((IDebugElement)element).getLaunch();
+ } else if (element instanceof IProcess) {
+ launch= ((IProcess)element).getLaunch();
+ }
+
+ return launch != null && launch.getLaunchConfiguration() != null;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("RelaunchActionDelegate.Launch_Failed_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("RelaunchActionDelegate.Launch_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("RelaunchActionDelegate.An_exception_occurred_while_launching_2"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchHistoryLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchHistoryLaunchAction.java
index 294b8c790..21ffdb562 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchHistoryLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchHistoryLaunchAction.java
@@ -1,63 +1,63 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Re-launches a previous launch.
- */
-public class RelaunchHistoryLaunchAction extends Action {
-
- protected LaunchConfigurationHistoryElement fLaunch;
-
- public RelaunchHistoryLaunchAction(LaunchConfigurationHistoryElement launch) {
- super();
- fLaunch= launch;
- setText(launch.getLabel());
- ImageDescriptor descriptor= null;
- if (launch.getLaunchConfiguration() != null) {
- descriptor = DebugUITools.getDefaultImageDescriptor(launch.getLaunchConfiguration());
- } else {
- if (launch.getMode().equals(ILaunchManager.DEBUG_MODE)) {
- descriptor= DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_DEBUG);
- } else {
- descriptor= DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_RUN);
- }
- }
-
- if (descriptor != null) {
- setImageDescriptor(descriptor);
- }
- WorkbenchHelp.setHelp(
- this,
- IDebugHelpContextIds.RELAUNCH_HISTORY_ACTION);
- }
-
- /**
- * @see IAction
- */
- public void run() {
- if (!DebugUITools.saveAndBuildBeforeLaunch()) {
- return;
- }
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- RelaunchActionDelegate.relaunch(fLaunch);
- }
- });
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+/**
+ * Re-launches a previous launch.
+ */
+public class RelaunchHistoryLaunchAction extends Action {
+
+ protected LaunchConfigurationHistoryElement fLaunch;
+
+ public RelaunchHistoryLaunchAction(LaunchConfigurationHistoryElement launch) {
+ super();
+ fLaunch= launch;
+ setText(launch.getLabel());
+ ImageDescriptor descriptor= null;
+ if (launch.getLaunchConfiguration() != null) {
+ descriptor = DebugUITools.getDefaultImageDescriptor(launch.getLaunchConfiguration());
+ } else {
+ if (launch.getMode().equals(ILaunchManager.DEBUG_MODE)) {
+ descriptor= DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_DEBUG);
+ } else {
+ descriptor= DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_RUN);
+ }
+ }
+
+ if (descriptor != null) {
+ setImageDescriptor(descriptor);
+ }
+ WorkbenchHelp.setHelp(
+ this,
+ IDebugHelpContextIds.RELAUNCH_HISTORY_ACTION);
+ }
+
+ /**
+ * @see IAction
+ */
+ public void run() {
+ if (!DebugUITools.saveAndBuildBeforeLaunch()) {
+ return;
+ }
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ public void run() {
+ RelaunchActionDelegate.relaunch(fLaunch);
+ }
+ });
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
index 8dc0193c6..33eeb9b10 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
@@ -1,115 +1,115 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Relaunches the last launch.
- */
-public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelegate {
-
- private IWorkbenchWindow fWorkbenchWindow;
-
- /**
- * @see IWorkbenchWindowActionDelegate
- */
- public void dispose(){
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate
- */
- public void init(IWorkbenchWindow window){
- fWorkbenchWindow = window;
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action){
- try {
- final LaunchConfigurationHistoryElement historyElement = getLastLaunch();
- if (historyElement != null) {
- final ILaunchConfiguration historyConfig = historyElement.getLaunchConfiguration();
- if (historyConfig.supportsMode(getMode())) {
- if (!DebugUITools.saveAndBuildBeforeLaunch()) {
- return;
- }
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- RelaunchActionDelegate.relaunch(historyConfig, getMode());
- }
- });
- } else {
- String configName = historyElement.getLaunchConfiguration().getName();
- String title = ActionMessages.getString("RelaunchLastAction.Cannot_relaunch_1"); //$NON-NLS-1$
- String message = MessageFormat.format(ActionMessages.getString("RelaunchLastAction.Cannot_relaunch_[{0}]_because_it_does_not_support_{2}_mode_2"), new String[] {configName, getMode()}); //$NON-NLS-1$
- MessageDialog.openError(getShell(), title, message);
- }
- } else {
- // If the history is empty, just open the launch config dialog
- openLaunchConfigurationDialog();
- }
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), ActionMessages.getString("RelaunchLastAction.Error_relaunching_3"), ActionMessages.getString("RelaunchLastAction.Error_encountered_attempting_to_relaunch_4"), ce); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Open the launch configuration dialog, passing in the current workbench selection.
- */
- private void openLaunchConfigurationDialog() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- IStructuredSelection selection= DebugUIPlugin.resolveSelection(dwindow);
- LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(DebugUIPlugin.getShell(), selection, getMode());
- dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED);
- dialog.open();
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection){
- }
-
- /**
- * Return the last launch that occurred in the workspace.
- */
- protected LaunchConfigurationHistoryElement getLastLaunch() {
- return DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
- }
-
- protected Shell getShell() {
- return fWorkbenchWindow.getShell();
- }
-
- /**
- * Returns the mode (run or debug) of this action.
- */
- public abstract String getMode();
-
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+/**
+ * Relaunches the last launch.
+ */
+public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow fWorkbenchWindow;
+
+ /**
+ * @see IWorkbenchWindowActionDelegate
+ */
+ public void dispose(){
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate
+ */
+ public void init(IWorkbenchWindow window){
+ fWorkbenchWindow = window;
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action){
+ try {
+ final LaunchConfigurationHistoryElement historyElement = getLastLaunch();
+ if (historyElement != null) {
+ final ILaunchConfiguration historyConfig = historyElement.getLaunchConfiguration();
+ if (historyConfig.supportsMode(getMode())) {
+ if (!DebugUITools.saveAndBuildBeforeLaunch()) {
+ return;
+ }
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ public void run() {
+ RelaunchActionDelegate.relaunch(historyConfig, getMode());
+ }
+ });
+ } else {
+ String configName = historyElement.getLaunchConfiguration().getName();
+ String title = ActionMessages.getString("RelaunchLastAction.Cannot_relaunch_1"); //$NON-NLS-1$
+ String message = MessageFormat.format(ActionMessages.getString("RelaunchLastAction.Cannot_relaunch_[{0}]_because_it_does_not_support_{2}_mode_2"), new String[] {configName, getMode()}); //$NON-NLS-1$
+ MessageDialog.openError(getShell(), title, message);
+ }
+ } else {
+ // If the history is empty, just open the launch config dialog
+ openLaunchConfigurationDialog();
+ }
+ } catch (CoreException ce) {
+ DebugUIPlugin.errorDialog(getShell(), ActionMessages.getString("RelaunchLastAction.Error_relaunching_3"), ActionMessages.getString("RelaunchLastAction.Error_encountered_attempting_to_relaunch_4"), ce); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * Open the launch configuration dialog, passing in the current workbench selection.
+ */
+ private void openLaunchConfigurationDialog() {
+ IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (dwindow == null) {
+ return;
+ }
+ IStructuredSelection selection= DebugUIPlugin.resolveSelection(dwindow);
+ LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(DebugUIPlugin.getShell(), selection, getMode());
+ dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED);
+ dialog.open();
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection){
+ }
+
+ /**
+ * Return the last launch that occurred in the workspace.
+ */
+ protected LaunchConfigurationHistoryElement getLastLaunch() {
+ return DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
+ }
+
+ protected Shell getShell() {
+ return fWorkbenchWindow.getShell();
+ }
+
+ /**
+ * Returns the mode (run or debug) of this action.
+ */
+ public abstract String getMode();
+
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllBreakpointsAction.java
index 484bc70ed..6ebafd1fe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllBreakpointsAction.java
@@ -1,98 +1,98 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointListener;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Removes all breakpoints from the source (markers) and remove all
- * breakpoints from processes
- */
-public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate implements IBreakpointListener {
-
- protected void doAction() {
- final IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager();
- final IBreakpoint[] breakpoints= breakpointManager.getBreakpoints();
- final MultiStatus ms= new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString("RemoveAllBreakpointsAction.Breakpoint(s)_removal_failed_3"), null); //$NON-NLS-1$
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor pm) {
- for (int i= 0; i < breakpoints.length; i++) {
- try {
- breakpointManager.removeBreakpoint(breakpoints[i], true);
- } catch (CoreException e) {
- ms.merge(e.getStatus());
- }
- }
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(r, null);
- } catch (CoreException e) {
- ms.merge(e.getStatus());
- }
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("RemoveAllBreakpointsAction.Removing_all_breakpoints_4"),ActionMessages.getString("RemoveAllBreakpointsAction.Exceptions_occurred_removing_breakpoints._5"), ms); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- protected void update() {
- getAction().setEnabled(
- DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints());
- }
-
- /**
- * @see IBreakpointListener#breakpointAdded(IBreakpoint)
- */
- public void breakpointAdded(IBreakpoint breakpoint) {
- if (getAction() != null && !getAction().isEnabled()){
- update();
- }
- }
-
- /**
- * @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
- */
- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
- }
-
- /**
- * @see IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta)
- */
- public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
- if (getAction() != null) {
- update();
- }
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- }
-
- public void dispose() {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- super.dispose();
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointListener;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Removes all breakpoints from the source (markers) and remove all
+ * breakpoints from processes
+ */
+public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate implements IBreakpointListener {
+
+ protected void doAction() {
+ final IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager();
+ final IBreakpoint[] breakpoints= breakpointManager.getBreakpoints();
+ final MultiStatus ms= new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString("RemoveAllBreakpointsAction.Breakpoint(s)_removal_failed_3"), null); //$NON-NLS-1$
+ IWorkspaceRunnable r = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor pm) {
+ for (int i= 0; i < breakpoints.length; i++) {
+ try {
+ breakpointManager.removeBreakpoint(breakpoints[i], true);
+ } catch (CoreException e) {
+ ms.merge(e.getStatus());
+ }
+ }
+ }
+ };
+ try {
+ ResourcesPlugin.getWorkspace().run(r, null);
+ } catch (CoreException e) {
+ ms.merge(e.getStatus());
+ }
+ if (!ms.isOK()) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("RemoveAllBreakpointsAction.Removing_all_breakpoints_4"),ActionMessages.getString("RemoveAllBreakpointsAction.Exceptions_occurred_removing_breakpoints._5"), ms); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ protected void update() {
+ getAction().setEnabled(
+ DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints());
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointAdded(IBreakpoint)
+ */
+ public void breakpointAdded(IBreakpoint breakpoint) {
+ if (getAction() != null && !getAction().isEnabled()){
+ update();
+ }
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+ if (getAction() != null) {
+ update();
+ }
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ super.init(view);
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
+ }
+
+ public void dispose() {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
+ super.dispose();
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllExpressionsAction.java
index 93419b511..fc1f97b59 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllExpressionsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllExpressionsAction.java
@@ -1,29 +1,29 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-
-/**
- * Removes all expressions from the expressions view.
- */
-public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate {
-
- protected void doAction() {
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- IExpression[] expressions= manager.getExpressions();
- for (int i= 0; i < expressions.length; i++) {
- manager.removeExpression(expressions[i]);
- }
- }
-
- protected void update() {
- getAction().setEnabled(
- DebugPlugin.getDefault().getExpressionManager().hasExpressions());
- }
-}
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IExpressionManager;
+import org.eclipse.debug.core.model.IExpression;
+
+/**
+ * Removes all expressions from the expressions view.
+ */
+public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate {
+
+ protected void doAction() {
+ IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
+ IExpression[] expressions= manager.getExpressions();
+ for (int i= 0; i < expressions.length; i++) {
+ manager.removeExpression(expressions[i]);
+ }
+ }
+
+ protected void update() {
+ getAction().setEnabled(
+ DebugPlugin.getDefault().getExpressionManager().hasExpressions());
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
index 49c66e286..6a756e3d0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
@@ -1,149 +1,149 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Removes all terminated/detached launches from the
- * active debug view.
- */
-public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate implements ILaunchListener {
-
- /**
- * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
- */
- protected void doHandleDebugEvent(DebugEvent event) {
- if (event.getKind() == DebugEvent.TERMINATE) {
- Object source= event.getSource();
- if (source instanceof IDebugTarget) {
- ILaunch launch= ((IDebugTarget)source).getLaunch();
- if (launch.isTerminated() && launchIsRegistered(launch)) {
- getAction().setEnabled(true);
- }
- } else if (source instanceof IProcess) {
- ILaunch launch= ((IProcess)source).getLaunch();
- if (launch.isTerminated() && launchIsRegistered(launch)) {
- getAction().setEnabled(true);
- }
- }
- }
- }
-
- private boolean launchIsRegistered(ILaunch iLaunch) {
- ILaunch[] launches= DebugPlugin.getDefault().getLaunchManager().getLaunches();
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewPart;
+
+/**
+ * Removes all terminated/detached launches from the
+ * active debug view.
+ */
+public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate implements ILaunchListener {
+
+ /**
+ * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
+ */
+ protected void doHandleDebugEvent(DebugEvent event) {
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ Object source= event.getSource();
+ if (source instanceof IDebugTarget) {
+ ILaunch launch= ((IDebugTarget)source).getLaunch();
+ if (launch.isTerminated() && launchIsRegistered(launch)) {
+ getAction().setEnabled(true);
+ }
+ } else if (source instanceof IProcess) {
+ ILaunch launch= ((IProcess)source).getLaunch();
+ if (launch.isTerminated() && launchIsRegistered(launch)) {
+ getAction().setEnabled(true);
+ }
+ }
+ }
+ }
+
+ private boolean launchIsRegistered(ILaunch iLaunch) {
+ ILaunch[] launches= DebugPlugin.getDefault().getLaunchManager().getLaunches();
for (int i = 0; i < launches.length; i++) {
ILaunch launch = launches[i];
- if (launch.equals(iLaunch)) {
- return true;
+ if (launch.equals(iLaunch)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Updates the enabled state of this action to enabled if at
+ * least one launch is terminated and relative to the current perspective.
+ */
+ protected void update() {
+ Object[] elements = getElements();
+ if (elements != null) {
+ for (int i= 0; i < elements.length; i++) {
+ if (elements[i] instanceof ILaunch) {
+ ILaunch launch= (ILaunch)elements[i];
+ if (launch.isTerminated()) {
+ getAction().setEnabled(true);
+ return;
+ }
+ }
+ }
+ }
+ getAction().setEnabled(false);
+ }
+
+ /**
+ * Returns the top level elements in the active debug
+ * view, or <code>null</code> if none.
+ *
+ * @return array of object
+ */
+ protected Object[] getElements() {
+ IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class);
+ if (view != null) {
+ Viewer viewer = view.getViewer();
+ if (viewer instanceof StructuredViewer) {
+ IStructuredContentProvider cp = (IStructuredContentProvider)((StructuredViewer)viewer).getContentProvider();
+ Object input = viewer.getInput();
+ return cp.getElements(input);
+ }
+ }
+ return null;
+ }
+
+ protected void doAction() {
+ Object[] elements = getElements();
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof ILaunch) {
+ ILaunch launch = (ILaunch)elements[i];
+ if (launch.isTerminated()) {
+ manager.removeLaunch(launch);
+ }
}
- }
- return false;
- }
-
- /**
- * Updates the enabled state of this action to enabled if at
- * least one launch is terminated and relative to the current perspective.
- */
- protected void update() {
- Object[] elements = getElements();
- if (elements != null) {
- for (int i= 0; i < elements.length; i++) {
- if (elements[i] instanceof ILaunch) {
- ILaunch launch= (ILaunch)elements[i];
- if (launch.isTerminated()) {
- getAction().setEnabled(true);
- return;
- }
- }
- }
- }
- getAction().setEnabled(false);
- }
-
- /**
- * Returns the top level elements in the active debug
- * view, or <code>null</code> if none.
- *
- * @return array of object
- */
- protected Object[] getElements() {
- IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class);
- if (view != null) {
- Viewer viewer = view.getViewer();
- if (viewer instanceof StructuredViewer) {
- IStructuredContentProvider cp = (IStructuredContentProvider)((StructuredViewer)viewer).getContentProvider();
- Object input = viewer.getInput();
- return cp.getElements(input);
- }
- }
- return null;
- }
-
- protected void doAction() {
- Object[] elements = getElements();
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof ILaunch) {
- ILaunch launch = (ILaunch)elements[i];
- if (launch.isTerminated()) {
- manager.removeLaunch(launch);
- }
- }
- }
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- //removes as a debug event listener
- super.dispose();
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- }
-
- /**
- * @see ILaunchListener#launchAdded(ILaunch)
- */
- public void launchAdded(ILaunch launch) {
- }
-
- /**
- * @see ILaunchListener#launchChanged(ILaunch)
- */
- public void launchChanged(ILaunch launch) {
- }
-
- /**
- * @see ILaunchListener#launchRemoved(ILaunch)
- */
- public void launchRemoved(ILaunch launch) {
- if (getAction().isEnabled()) {
- update();
- }
- }
-}
-
+ }
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ super.init(view);
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
+ DebugPlugin.getDefault().addDebugEventListener(this);
+ }
+
+ /**
+ * @see IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ //removes as a debug event listener
+ super.dispose();
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
+ }
+
+ /**
+ * @see ILaunchListener#launchAdded(ILaunch)
+ */
+ public void launchAdded(ILaunch launch) {
+ }
+
+ /**
+ * @see ILaunchListener#launchChanged(ILaunch)
+ */
+ public void launchChanged(ILaunch launch) {
+ }
+
+ /**
+ * @see ILaunchListener#launchRemoved(ILaunch)
+ */
+ public void launchRemoved(ILaunch launch) {
+ if (getAction().isEnabled()) {
+ update();
+ }
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveBreakpointAction.java
index 3d9a911ad..afac3e192 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveBreakpointAction.java
@@ -1,80 +1,80 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class RemoveBreakpointAction extends AbstractRemoveActionDelegate {
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- IStructuredSelection selection= getSelection();
- final Iterator itr= selection.iterator();
- final MultiStatus ms = new MultiStatus(DebugUIPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED,
- ActionMessages.getString("RemoveBreakpointAction.Breakpoint(s)_removal_failed_3"), null); //$NON-NLS-1$
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- while (itr.hasNext()) {
- try {
- Object next= itr.next();
- if (next instanceof IBreakpoint) {
- IBreakpoint breakpoint= (IBreakpoint)next;
- breakpointManager.removeBreakpoint(breakpoint, true);
- }
- } catch (CoreException ce) {
- ms.merge(ce.getStatus());
- }
- }
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null);
- } catch (CoreException ce) {
- ms.merge(ce.getStatus());
- }
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("RemoveBreakpointAction.Removing_a_breakpoint_4"),ActionMessages.getString("RemoveBreakpointAction.Exceptions_occurred_attempting_to_remove_a_breakpoint._5") , ms); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) throws DebugException {
- //not used
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof IBreakpoint;
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+
+public class RemoveBreakpointAction extends AbstractRemoveActionDelegate {
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ IStructuredSelection selection= getSelection();
+ final Iterator itr= selection.iterator();
+ final MultiStatus ms = new MultiStatus(DebugUIPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED,
+ ActionMessages.getString("RemoveBreakpointAction.Breakpoint(s)_removal_failed_3"), null); //$NON-NLS-1$
+ IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) {
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ while (itr.hasNext()) {
+ try {
+ Object next= itr.next();
+ if (next instanceof IBreakpoint) {
+ IBreakpoint breakpoint= (IBreakpoint)next;
+ breakpointManager.removeBreakpoint(breakpoint, true);
+ }
+ } catch (CoreException ce) {
+ ms.merge(ce.getStatus());
+ }
+ }
+ }
+ };
+ try {
+ ResourcesPlugin.getWorkspace().run(runnable, null);
+ } catch (CoreException ce) {
+ ms.merge(ce.getStatus());
+ }
+ if (!ms.isOK()) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("RemoveBreakpointAction.Removing_a_breakpoint_4"),ActionMessages.getString("RemoveBreakpointAction.Exceptions_occurred_attempting_to_remove_a_breakpoint._5") , ms); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ DebugUIPlugin.log(ms);
+ }
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) throws DebugException {
+ //not used
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof IBreakpoint;
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveExpressionAction.java
index 40ed2763f..1ac7e2018 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveExpressionAction.java
@@ -1,60 +1,60 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-public class RemoveExpressionAction extends AbstractRemoveActionDelegate {
-
- protected void doAction(Object element) {
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- IExpression exp = getExpression(element);
- if (exp != null) {
- manager.removeExpression(exp);
- }
- }
-
- /**
- * Returns the expression associated with the given
- * element.
- *
- * @param element an expression of child of an expression in
- * the expression view.
- * @return associated expression
- */
- protected IExpression getExpression(Object obj) {
- if (getView() == null) {
- return null;
- }
- IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
- if (adapter != null) {
- Viewer v= adapter.getViewer();
- if (v instanceof TreeViewer) {
- ITreeContentProvider cp = (ITreeContentProvider)((TreeViewer)v).getContentProvider();
- while (!(obj instanceof IExpression) && obj != null) {
- obj = cp.getParent(obj);
- }
- return (IExpression)obj;
- }
- }
- return null;
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof IVariable || element instanceof IExpression;
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IExpressionManager;
+import org.eclipse.debug.core.model.IExpression;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+public class RemoveExpressionAction extends AbstractRemoveActionDelegate {
+
+ protected void doAction(Object element) {
+ IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
+ IExpression exp = getExpression(element);
+ if (exp != null) {
+ manager.removeExpression(exp);
+ }
+ }
+
+ /**
+ * Returns the expression associated with the given
+ * element.
+ *
+ * @param element an expression of child of an expression in
+ * the expression view.
+ * @return associated expression
+ */
+ protected IExpression getExpression(Object obj) {
+ if (getView() == null) {
+ return null;
+ }
+ IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
+ if (adapter != null) {
+ Viewer v= adapter.getViewer();
+ if (v instanceof TreeViewer) {
+ ITreeContentProvider cp = (ITreeContentProvider)((TreeViewer)v).getContentProvider();
+ while (!(obj instanceof IExpression) && obj != null) {
+ obj = cp.getParent(obj);
+ }
+ return (IExpression)obj;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof IVariable || element instanceof IExpression;
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ResumeActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ResumeActionDelegate.java
index a12d09138..53a131ff0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ResumeActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ResumeActionDelegate.java
@@ -1,61 +1,61 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class ResumeActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object object) throws DebugException {
- if (object instanceof ISuspendResume) {
- ((ISuspendResume)object).resume();
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof ISuspendResume && ((ISuspendResume) element).canResume();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getEnableStateForSelection(IStructuredSelection)
- */
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.size() == 1) {
- return isEnabledFor(selection.getFirstElement());
- } else {
- return false;
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("ResumeActionDelegate.Exceptions_occurred_attempting_to_resume._2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("ResumeActionDelegate.Resume_failed._1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("ResumeActionDelegate.Resume_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+public class ResumeActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object object) throws DebugException {
+ if (object instanceof ISuspendResume) {
+ ((ISuspendResume)object).resume();
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof ISuspendResume && ((ISuspendResume) element).canResume();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getEnableStateForSelection(IStructuredSelection)
+ */
+ protected boolean getEnableStateForSelection(IStructuredSelection selection) {
+ if (selection.size() == 1) {
+ return isEnabledFor(selection.getFirstElement());
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("ResumeActionDelegate.Exceptions_occurred_attempting_to_resume._2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("ResumeActionDelegate.Resume_failed._1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("ResumeActionDelegate.Resume_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunDropDownAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunDropDownAction.java
index 19833d49d..2a8dc5f91 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunDropDownAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunDropDownAction.java
@@ -1,57 +1,57 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
-import org.eclipse.debug.ui.actions.RunAction;
-
-public class RunDropDownAction extends LaunchDropDownAction {
-
- public RunDropDownAction() {
- super(new RunAction());
- }
-
- protected RunDropDownAction(ExecutionAction action) {
- super(action);
- }
-
- /**
- * @see LaunchDropDownAction#getMode()
- */
- public String getMode() {
- return ILaunchManager.RUN_MODE;
- }
-
- /**
- * @see LaunchDropDownAction#getHistory()
- */
- public LaunchConfigurationHistoryElement[] getHistory() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getRunHistory();
- }
-
- /**
- * @see LaunchDropDownAction#getFavorites()
- */
- public LaunchConfigurationHistoryElement[] getFavorites() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getRunFavorites();
- }
-
- /**
- * @see LaunchDropDownAction#getLastLaunchPrefix()
- */
- protected String getLastLaunchPrefix() {
- return ActionMessages.getString("RunDropDownAction.Run_last_launched_1"); //$NON-NLS-1$
- }
- /**
- * @see LaunchDropDownAction#getTooltipPrefix()
- */
- protected String getStaticTooltip() {
- return ActionMessages.getString("RunDropDownAction.Run_1"); //$NON-NLS-1$
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationHistoryElement;
+import org.eclipse.debug.ui.actions.RunAction;
+
+public class RunDropDownAction extends LaunchDropDownAction {
+
+ public RunDropDownAction() {
+ super(new RunAction());
+ }
+
+ protected RunDropDownAction(ExecutionAction action) {
+ super(action);
+ }
+
+ /**
+ * @see LaunchDropDownAction#getMode()
+ */
+ public String getMode() {
+ return ILaunchManager.RUN_MODE;
+ }
+
+ /**
+ * @see LaunchDropDownAction#getHistory()
+ */
+ public LaunchConfigurationHistoryElement[] getHistory() {
+ return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getRunHistory();
+ }
+
+ /**
+ * @see LaunchDropDownAction#getFavorites()
+ */
+ public LaunchConfigurationHistoryElement[] getFavorites() {
+ return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getRunFavorites();
+ }
+
+ /**
+ * @see LaunchDropDownAction#getLastLaunchPrefix()
+ */
+ protected String getLastLaunchPrefix() {
+ return ActionMessages.getString("RunDropDownAction.Run_last_launched_1"); //$NON-NLS-1$
+ }
+ /**
+ * @see LaunchDropDownAction#getTooltipPrefix()
+ */
+ protected String getStaticTooltip() {
+ return ActionMessages.getString("RunDropDownAction.Run_1"); //$NON-NLS-1$
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java
index 9b058f30d..288ad0443 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java
@@ -1,90 +1,90 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-
-public class RunHistoryMenuAction extends RunDropDownAction implements IMenuCreator {
-
- private MenuListener fMenuListener= null;
- private Menu fTopMenu= null;
-
- public RunHistoryMenuAction() {
- super(null);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (action instanceof Action) {
- if (getActionProxy() == null) {
- ((Action)action).setMenuCreator(this);
- setActionProxy(action);
- }
- } else {
- action.setEnabled(false);
- }
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- //do nothing as the action strictly generates the history sub menu
- }
-
- /**
- * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
- */
- public void runWithEvent(IAction action, Event event) {
- //do nothing as the action strictly generates the history sub menu
- }
-
- public Menu getMenu(Menu parent) {
- cleanup();
- Menu menu= new Menu(parent);
- parent.addMenuListener(getDebugActionSetMenuListener());
- fTopMenu= parent;
- setCreatedMenu(menu);
- Menu submenu= createMenu(menu);
- return submenu;
- }
-
- /**
- * @see LaunchDropDownAction#getDebugActionSetMenuListener()
- */
- protected MenuListener getDebugActionSetMenuListener() {
- if (fMenuListener == null) {
- fMenuListener= super.getDebugActionSetMenuListener();
- }
- return fMenuListener;
- }
-
- public void dispose() {
- cleanup();
- super.dispose();
- }
-
- protected void cleanup() {
- if (fTopMenu != null && !fTopMenu.isDisposed()) {
- fTopMenu.removeMenuListener(getDebugActionSetMenuListener());
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#createTopSeparator(Menu)
- */
- protected void createTopSeparator(Menu menu) {
- }
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+
+public class RunHistoryMenuAction extends RunDropDownAction implements IMenuCreator {
+
+ private MenuListener fMenuListener= null;
+ private Menu fTopMenu= null;
+
+ public RunHistoryMenuAction() {
+ super(null);
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (action instanceof Action) {
+ if (getActionProxy() == null) {
+ ((Action)action).setMenuCreator(this);
+ setActionProxy(action);
+ }
+ } else {
+ action.setEnabled(false);
+ }
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ //do nothing as the action strictly generates the history sub menu
+ }
+
+ /**
+ * @see IActionDelegateWithEvent#runWithEvent(IAction, Event)
+ */
+ public void runWithEvent(IAction action, Event event) {
+ //do nothing as the action strictly generates the history sub menu
+ }
+
+ public Menu getMenu(Menu parent) {
+ cleanup();
+ Menu menu= new Menu(parent);
+ parent.addMenuListener(getDebugActionSetMenuListener());
+ fTopMenu= parent;
+ setCreatedMenu(menu);
+ Menu submenu= createMenu(menu);
+ return submenu;
+ }
+
+ /**
+ * @see LaunchDropDownAction#getDebugActionSetMenuListener()
+ */
+ protected MenuListener getDebugActionSetMenuListener() {
+ if (fMenuListener == null) {
+ fMenuListener= super.getDebugActionSetMenuListener();
+ }
+ return fMenuListener;
+ }
+
+ public void dispose() {
+ cleanup();
+ super.dispose();
+ }
+
+ protected void cleanup() {
+ if (fTopMenu != null && !fTopMenu.isDisposed()) {
+ fTopMenu.removeMenuListener(getDebugActionSetMenuListener());
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#createTopSeparator(Menu)
+ */
+ protected void createTopSeparator(Menu menu) {
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ShowTypesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ShowTypesAction.java
index ea67c69a7..5c7f5bb6c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ShowTypesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ShowTypesAction.java
@@ -1,81 +1,81 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * An action that toggles the state of a viewer to
- * show/hide type names of variables.
- * Only viewers that use a <code>VariableLabelProvider</code> to render its
- * elements are effected.
- */
-public class ShowTypesAction extends Action {
-
- private StructuredViewer fViewer;
-
- public ShowTypesAction(StructuredViewer viewer) {
- super(ActionMessages.getString("ShowTypesAction.Show_&Type_Names_1")); //$NON-NLS-1$
- setViewer(viewer);
- setToolTipText(ActionMessages.getString("ShowTypesAction.Show_Type_Names")); //$NON-NLS-1$
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_TYPE_NAMES));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES));
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES));
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction"); //$NON-NLS-1$
- WorkbenchHelp.setHelp(this, IDebugHelpContextIds.SHOW_TYPES_ACTION);
- }
-
- /**
- * @see Action#run()
- */
- public void run() {
- valueChanged(isChecked());
- }
-
- private void valueChanged(boolean on) {
- if (getViewer().getControl().isDisposed()) {
- return;
- }
- ILabelProvider labelProvider= (ILabelProvider)getViewer().getLabelProvider();
- if (labelProvider instanceof IDebugModelPresentation) {
- IDebugModelPresentation debugLabelProvider= (IDebugModelPresentation)labelProvider;
- debugLabelProvider.setAttribute(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, (on ? Boolean.TRUE : Boolean.FALSE));
- BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
- public void run() {
- getViewer().refresh();
- }
- });
- }
- }
-
- /**
- * @see Action#setChecked(boolean)
- */
- public void setChecked(boolean value) {
- super.setChecked(value);
- valueChanged(value);
- }
-
- protected StructuredViewer getViewer() {
- return fViewer;
- }
-
- protected void setViewer(StructuredViewer viewer) {
- fViewer = viewer;
- }
-}
-
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+/**
+ * An action that toggles the state of a viewer to
+ * show/hide type names of variables.
+ * Only viewers that use a <code>VariableLabelProvider</code> to render its
+ * elements are effected.
+ */
+public class ShowTypesAction extends Action {
+
+ private StructuredViewer fViewer;
+
+ public ShowTypesAction(StructuredViewer viewer) {
+ super(ActionMessages.getString("ShowTypesAction.Show_&Type_Names_1")); //$NON-NLS-1$
+ setViewer(viewer);
+ setToolTipText(ActionMessages.getString("ShowTypesAction.Show_Type_Names")); //$NON-NLS-1$
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_TYPE_NAMES));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES));
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES));
+ setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction"); //$NON-NLS-1$
+ WorkbenchHelp.setHelp(this, IDebugHelpContextIds.SHOW_TYPES_ACTION);
+ }
+
+ /**
+ * @see Action#run()
+ */
+ public void run() {
+ valueChanged(isChecked());
+ }
+
+ private void valueChanged(boolean on) {
+ if (getViewer().getControl().isDisposed()) {
+ return;
+ }
+ ILabelProvider labelProvider= (ILabelProvider)getViewer().getLabelProvider();
+ if (labelProvider instanceof IDebugModelPresentation) {
+ IDebugModelPresentation debugLabelProvider= (IDebugModelPresentation)labelProvider;
+ debugLabelProvider.setAttribute(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, (on ? Boolean.TRUE : Boolean.FALSE));
+ BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
+ public void run() {
+ getViewer().refresh();
+ }
+ });
+ }
+ }
+
+ /**
+ * @see Action#setChecked(boolean)
+ */
+ public void setChecked(boolean value) {
+ super.setChecked(value);
+ valueChanged(value);
+ }
+
+ protected StructuredViewer getViewer() {
+ return fViewer;
+ }
+
+ protected void setViewer(StructuredViewer viewer) {
+ fViewer = viewer;
+ }
+}
+
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepActionDelegate.java
index 0379a47a1..90b25ec25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepActionDelegate.java
@@ -1,51 +1,51 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStep;
-
-public abstract class StepActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object object) throws DebugException {
- if (object instanceof IStep) {
- stepAction((IStep)object);
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- if (element instanceof IStep) {
- return checkCapability((IStep)element);
- }
- return false;
- }
-
- /**
- * @see AbstractDebugActionDelegate#enableForMultiSelection()
- */
- protected boolean enableForMultiSelection() {
- return false;
- }
-
- /**
- * Returns whether the <code>IStep</code> has the capability to perform the
- * requested step action.
- */
- protected abstract boolean checkCapability(IStep element);
-
- /**
- * Performs the specific step action.
- *
- * @exception DebugException if the action fails
- */
- protected abstract void stepAction(IStep element) throws DebugException;
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IStep;
+
+public abstract class StepActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object object) throws DebugException {
+ if (object instanceof IStep) {
+ stepAction((IStep)object);
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ if (element instanceof IStep) {
+ return checkCapability((IStep)element);
+ }
+ return false;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#enableForMultiSelection()
+ */
+ protected boolean enableForMultiSelection() {
+ return false;
+ }
+
+ /**
+ * Returns whether the <code>IStep</code> has the capability to perform the
+ * requested step action.
+ */
+ protected abstract boolean checkCapability(IStep element);
+
+ /**
+ * Performs the specific step action.
+ *
+ * @exception DebugException if the action fails
+ */
+ protected abstract void stepAction(IStep element) throws DebugException;
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepIntoActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepIntoActionDelegate.java
index bfd9fde9e..bb12f0b75 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepIntoActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepIntoActionDelegate.java
@@ -1,47 +1,47 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStep;
-
-public class StepIntoActionDelegate extends StepActionDelegate {
-
- /**
- * @see StepActionDelegate#checkCapability(IStep)
- */
- protected boolean checkCapability(IStep element) {
- return element.canStepInto();
- }
-
- /**
- * @see StepActionDelegate#stepAction(IStep)
- */
- protected void stepAction(IStep element) throws DebugException {
- element.stepInto();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("StepIntoActionDelegate.Exceptions_occurred_attempting_to_step_into_the_frame_2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("StepIntoActionDelegate.Step_into_failed_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("StepIntoActionDelegate.Step_Into_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IStep;
+
+public class StepIntoActionDelegate extends StepActionDelegate {
+
+ /**
+ * @see StepActionDelegate#checkCapability(IStep)
+ */
+ protected boolean checkCapability(IStep element) {
+ return element.canStepInto();
+ }
+
+ /**
+ * @see StepActionDelegate#stepAction(IStep)
+ */
+ protected void stepAction(IStep element) throws DebugException {
+ element.stepInto();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("StepIntoActionDelegate.Exceptions_occurred_attempting_to_step_into_the_frame_2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("StepIntoActionDelegate.Step_into_failed_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("StepIntoActionDelegate.Step_Into_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepOverActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepOverActionDelegate.java
index e6f4ae479..b26126b7c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepOverActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepOverActionDelegate.java
@@ -1,47 +1,47 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStep;
-
-public class StepOverActionDelegate extends StepActionDelegate {
-
- /**
- * @see StepActionDelegate#checkCapability(IStep)
- */
- protected boolean checkCapability(IStep element) {
- return element.canStepOver();
- }
-
- /**
- * @see StepActionDelegate#stepAction(IStep)
- */
- protected void stepAction(IStep element) throws DebugException {
- element.stepOver();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("StepOverActionDelegate.Exceptions_occurred_attempting_to_step_over_the_frame_2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("StepOverActionDelegate.Step_over_failed_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("StepOverActionDelegate.Step_over_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IStep;
+
+public class StepOverActionDelegate extends StepActionDelegate {
+
+ /**
+ * @see StepActionDelegate#checkCapability(IStep)
+ */
+ protected boolean checkCapability(IStep element) {
+ return element.canStepOver();
+ }
+
+ /**
+ * @see StepActionDelegate#stepAction(IStep)
+ */
+ protected void stepAction(IStep element) throws DebugException {
+ element.stepOver();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("StepOverActionDelegate.Exceptions_occurred_attempting_to_step_over_the_frame_2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("StepOverActionDelegate.Step_over_failed_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("StepOverActionDelegate.Step_over_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepReturnActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepReturnActionDelegate.java
index cc9ce7b88..3323f9f74 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepReturnActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StepReturnActionDelegate.java
@@ -1,47 +1,47 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStep;
-
-public class StepReturnActionDelegate extends StepActionDelegate {
-
- /**
- * @see StepActionDelegate#checkCapability(IStep)
- */
- protected boolean checkCapability(IStep element) {
- return element.canStepReturn();
- }
-
- /**
- * @see StepActionDelegate#stepAction(IStep)
- */
- protected void stepAction(IStep element) throws DebugException {
- element.stepReturn();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("StepReturnActionDelegate.Exceptions_occurred_attempting_to_run_to_return_of_the_frame._2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("StepReturnActionDelegate.Run_to_return_failed._1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("StepReturnActionDelegate.Run_to_Return_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IStep;
+
+public class StepReturnActionDelegate extends StepActionDelegate {
+
+ /**
+ * @see StepActionDelegate#checkCapability(IStep)
+ */
+ protected boolean checkCapability(IStep element) {
+ return element.canStepReturn();
+ }
+
+ /**
+ * @see StepActionDelegate#stepAction(IStep)
+ */
+ protected void stepAction(IStep element) throws DebugException {
+ element.stepReturn();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("StepReturnActionDelegate.Exceptions_occurred_attempting_to_run_to_return_of_the_frame._2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("StepReturnActionDelegate.Run_to_return_failed._1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("StepReturnActionDelegate.Run_to_Return_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SuspendActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SuspendActionDelegate.java
index b4af0a250..bfd8c910e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SuspendActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SuspendActionDelegate.java
@@ -1,61 +1,61 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class SuspendActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) throws DebugException {
- if (element instanceof ISuspendResume) {
- ((ISuspendResume) element).suspend();
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof ISuspendResume && ((ISuspendResume)element).canSuspend();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getEnableStateForSelection(IStructuredSelection)
- */
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.size() == 1) {
- return isEnabledFor(selection.getFirstElement());
- } else {
- return false;
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("SuspendActionDelegate.Exceptions_occurred_attempting_to_suspend._2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("SuspendActionDelegate.Suspend_failed_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("SuspendActionDelegate.Suspend_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+public class SuspendActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) throws DebugException {
+ if (element instanceof ISuspendResume) {
+ ((ISuspendResume) element).suspend();
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof ISuspendResume && ((ISuspendResume)element).canSuspend();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getEnableStateForSelection(IStructuredSelection)
+ */
+ protected boolean getEnableStateForSelection(IStructuredSelection selection) {
+ if (selection.size() == 1) {
+ return isEnabledFor(selection.getFirstElement());
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("SuspendActionDelegate.Exceptions_occurred_attempting_to_suspend._2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("SuspendActionDelegate.Suspend_failed_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("SuspendActionDelegate.Suspend_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateActionDelegate.java
index 0eac9ccc5..a209aa6a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateActionDelegate.java
@@ -1,61 +1,61 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ITerminate;
-
-public class TerminateActionDelegate extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) throws DebugException {
- if (element instanceof ITerminate) {
- ((ITerminate)element).terminate();
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return element instanceof ITerminate && ((ITerminate)element).canTerminate();
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("TerminateActionDelegate.Exceptions_occurred_attempting_to_terminate._2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("TerminateActionDelegate.Terminate_failed._1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("TerminateActionDelegate.Terminate_3"); //$NON-NLS-1$
- }
-
- /**
- * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
- */
- protected void doHandleDebugEvent(DebugEvent event) {
- if (event.getKind() == DebugEvent.TERMINATE) {
- update(getAction(), getSelection());
- }
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.ITerminate;
+
+public class TerminateActionDelegate extends AbstractListenerActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) throws DebugException {
+ if (element instanceof ITerminate) {
+ ((ITerminate)element).terminate();
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return element instanceof ITerminate && ((ITerminate)element).canTerminate();
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("TerminateActionDelegate.Exceptions_occurred_attempting_to_terminate._2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("TerminateActionDelegate.Terminate_failed._1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("TerminateActionDelegate.Terminate_3"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ListenerActionDelegate#doHandleDebugEvent(DebugEvent)
+ */
+ protected void doHandleDebugEvent(DebugEvent event) {
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ update(getAction(), getSelection());
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAllAction.java
index 465fa061b..9279f5313 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAllAction.java
@@ -1,94 +1,94 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Terminates all launches.
- */
-public class TerminateAllAction extends AbstractListenerActionDelegate {
-
- protected void doAction(Object element) {
- //not used
- }
-
- protected void update() {
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches= lManager.getLaunches();
- for (int i= 0; i< launches.length; i++) {
- ILaunch launch= launches[i];
- if (!launch.isTerminated()) {
- getAction().setEnabled(true);
- return;
- }
- }
- getAction().setEnabled(false);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- setAction(action);
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches= lManager.getLaunches();
- MultiStatus ms = new MultiStatus(DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, ActionMessages.getString("TerminateAllAction.Terminate_all_failed_3"), null); //$NON-NLS-1$
- for (int i= 0; i < launches.length; i++) {
- ILaunch launch= (ILaunch) launches[i];
- if (!launch.isTerminated()) {
- try {
- launch.terminate();
- } catch (DebugException de) {
- ms.merge(de.getStatus());
- }
- }
- }
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("TerminateAllAction.Terminate_All_2"),ActionMessages.getString("TerminateAllAction.Exceptions_occurred_attempting_to_terminate_all._5") , ms); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- return true;
- }
-
-
- protected void doHandleDebugEvent(DebugEvent event) {
- switch (event.getKind()) {
- case DebugEvent.TERMINATE :
- update();
- break;
- case DebugEvent.CREATE :
- update();
- break;
- }
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Terminates all launches.
+ */
+public class TerminateAllAction extends AbstractListenerActionDelegate {
+
+ protected void doAction(Object element) {
+ //not used
+ }
+
+ protected void update() {
+ ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
+ ILaunch[] launches= lManager.getLaunches();
+ for (int i= 0; i< launches.length; i++) {
+ ILaunch launch= launches[i];
+ if (!launch.isTerminated()) {
+ getAction().setEnabled(true);
+ return;
+ }
+ }
+ getAction().setEnabled(false);
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ setAction(action);
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
+ ILaunch[] launches= lManager.getLaunches();
+ MultiStatus ms = new MultiStatus(DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, ActionMessages.getString("TerminateAllAction.Terminate_all_failed_3"), null); //$NON-NLS-1$
+ for (int i= 0; i < launches.length; i++) {
+ ILaunch launch= (ILaunch) launches[i];
+ if (!launch.isTerminated()) {
+ try {
+ launch.terminate();
+ } catch (DebugException de) {
+ ms.merge(de.getStatus());
+ }
+ }
+ }
+ if (!ms.isOK()) {
+ IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.getString("TerminateAllAction.Terminate_All_2"),ActionMessages.getString("TerminateAllAction.Exceptions_occurred_attempting_to_terminate_all._5") , ms); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ DebugUIPlugin.log(ms);
+ }
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ return true;
+ }
+
+
+ protected void doHandleDebugEvent(DebugEvent event) {
+ switch (event.getKind()) {
+ case DebugEvent.TERMINATE :
+ update();
+ break;
+ case DebugEvent.CREATE :
+ update();
+ break;
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAndRemoveActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAndRemoveActionDelegate.java
index 6ab65b134..e0af08ece 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAndRemoveActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TerminateAndRemoveActionDelegate.java
@@ -1,76 +1,76 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ITerminate;
-
-public class TerminateAndRemoveActionDelegate extends AbstractDebugActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) throws DebugException {
- try {
- if (element instanceof ITerminate) {
- ITerminate terminate= (ITerminate)element;
- if (!terminate.isTerminated()) {
- terminate.terminate();
- }
- }
- } finally {
- ILaunch launch= null;
- if (element instanceof ILaunch) {
- launch= (ILaunch) element;
- } else if (element instanceof IDebugElement) {
- launch= ((IDebugElement) element).getLaunch();
- } else if (element instanceof IProcess) {
- launch= ((IProcess) element).getLaunch();
- }
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- lManager.removeLaunch(launch);
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- if (element instanceof ITerminate) {
- ITerminate terminate= (ITerminate)element;
- //do not want to terminate an attach launch that does not
- //have termination enabled
- return terminate.canTerminate() || terminate.isTerminated();
- }
- return false;
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.getString("TerminateAndRemoveActionDelegate.Exceptions_occurred_attempting_to_terminate_and_remove_2"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString("TerminateAndRemoveActionDelegate.Terminate_and_remove_failed_1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle() {
- return ActionMessages.getString("TerminateAndRemoveActionDelegate.Terminate_and_Remove;_3"); //$NON-NLS-1$
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ITerminate;
+
+public class TerminateAndRemoveActionDelegate extends AbstractDebugActionDelegate {
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) throws DebugException {
+ try {
+ if (element instanceof ITerminate) {
+ ITerminate terminate= (ITerminate)element;
+ if (!terminate.isTerminated()) {
+ terminate.terminate();
+ }
+ }
+ } finally {
+ ILaunch launch= null;
+ if (element instanceof ILaunch) {
+ launch= (ILaunch) element;
+ } else if (element instanceof IDebugElement) {
+ launch= ((IDebugElement) element).getLaunch();
+ } else if (element instanceof IProcess) {
+ launch= ((IProcess) element).getLaunch();
+ }
+ ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
+ lManager.removeLaunch(launch);
+ }
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#isEnabledFor(Object)
+ */
+ protected boolean isEnabledFor(Object element) {
+ if (element instanceof ITerminate) {
+ ITerminate terminate= (ITerminate)element;
+ //do not want to terminate an attach launch that does not
+ //have termination enabled
+ return terminate.canTerminate() || terminate.isTerminated();
+ }
+ return false;
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getStatusMessage()
+ */
+ protected String getStatusMessage() {
+ return ActionMessages.getString("TerminateAndRemoveActionDelegate.Exceptions_occurred_attempting_to_terminate_and_remove_2"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogMessage()
+ */
+ protected String getErrorDialogMessage() {
+ return ActionMessages.getString("TerminateAndRemoveActionDelegate.Terminate_and_remove_failed_1"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#getErrorDialogTitle()
+ */
+ protected String getErrorDialogTitle() {
+ return ActionMessages.getString("TerminateAndRemoveActionDelegate.Terminate_and_Remove;_3"); //$NON-NLS-1$
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerAction.java
index 61df99e45..e4dc6cd73 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerAction.java
@@ -1,56 +1,56 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.ui.texteditor.IUpdate;
-
-public class TextViewerAction extends Action implements IUpdate {
-
- private int fOperationCode= -1;
- private ITextOperationTarget fOperationTarget;
-
- public TextViewerAction(ITextViewer viewer, int operationCode) {
- fOperationCode= operationCode;
- fOperationTarget= viewer.getTextOperationTarget();
- update();
- }
-
- /**
- * Updates the enabled state of the action.
- * Fires a property change if the enabled state changes.
- *
- * @see Action#firePropertyChange(String, Object, Object)
- */
- public void update() {
-
- boolean wasEnabled= isEnabled();
- boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode));
- setEnabled(isEnabled);
-
- if (wasEnabled != isEnabled) {
- firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
- }
- }
-
- /**
- * @see Action#run()
- */
- public void run() {
- if (fOperationCode != -1 && fOperationTarget != null) {
- fOperationTarget.doOperation(fOperationCode);
- }
- }
-
- public void configureAction(String text, String toolTipText, String description) {
- setText(text);
- setToolTipText(toolTipText);
- setDescription(description);
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.ui.texteditor.IUpdate;
+
+public class TextViewerAction extends Action implements IUpdate {
+
+ private int fOperationCode= -1;
+ private ITextOperationTarget fOperationTarget;
+
+ public TextViewerAction(ITextViewer viewer, int operationCode) {
+ fOperationCode= operationCode;
+ fOperationTarget= viewer.getTextOperationTarget();
+ update();
+ }
+
+ /**
+ * Updates the enabled state of the action.
+ * Fires a property change if the enabled state changes.
+ *
+ * @see Action#firePropertyChange(String, Object, Object)
+ */
+ public void update() {
+
+ boolean wasEnabled= isEnabled();
+ boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode));
+ setEnabled(isEnabled);
+
+ if (wasEnabled != isEnabled) {
+ firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
+ }
+ }
+
+ /**
+ * @see Action#run()
+ */
+ public void run() {
+ if (fOperationCode != -1 && fOperationTarget != null) {
+ fOperationTarget.doOperation(fOperationCode);
+ }
+ }
+
+ public void configureAction(String text, String toolTipText, String description) {
+ setText(text);
+ setToolTipText(toolTipText);
+ setDescription(description);
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerGotoLineAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerGotoLineAction.java
index bdb0133c0..20e887e8a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerGotoLineAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/TextViewerGotoLineAction.java
@@ -1,107 +1,107 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.console.ConsoleViewer;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-
-public class TextViewerGotoLineAction extends TextViewerAction {
-
- /**
- * Validates whether the text found in the input field of the
- * dialog forms a valid line number, i.e. one to which can be
- * jumped.
- */
- class NumberValidator implements IInputValidator {
-
- public String isValid(String input) {
- try {
- int i= Integer.parseInt(input);
- if (i <= 0 || fLastLine < i)
- return ActionMessages.getString("TextViewerGotoLineAction.Line_number_out_of_range_1"); //$NON-NLS-1$
-
- } catch (NumberFormatException x) {
- return ActionMessages.getString("TextViewerGotoLineAction.Not_a_number_2"); //$NON-NLS-1$
- }
-
- return null;
- }
- };
-
- protected int fLastLine;
- protected ITextViewer fTextViewer;
-
- /**
- * Constructs a goto line action for the console using the provided resource bundle
- */
- public TextViewerGotoLineAction(ConsoleViewer viewer) {
- super(viewer, -1);
- fTextViewer= viewer;
- setText(ActionMessages.getString("TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4")); //$NON-NLS-1$
- setToolTipText(ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
- setDescription(ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
- }
-
- /**
- * @see TextViewerAction#update()
- */
- public void update() {
- }
-
- /**
- * Jumps to the line.
- */
- protected void gotoLine(int line) {
-
- IDocument document= fTextViewer.getDocument();
- try {
- int start= document.getLineOffset(line);
- int length= document.getLineLength(line);
- fTextViewer.getTextWidget().setSelection(start, start + length);
- fTextViewer.revealRange(start, length);
- } catch (BadLocationException x) {
- DebugUIPlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @see Action#run()
- */
- public void run() {
- try {
- Point selection= fTextViewer.getTextWidget().getSelection();
- IDocument document= fTextViewer.getDocument();
- fLastLine= document.getLineOfOffset(document.getLength()) + 1;
- int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1;
- String title= ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"); //$NON-NLS-1$
- String message= MessageFormat.format(ActionMessages.getString("TextViewerGotoLineAction.Enter_line_number__8"), new Object[] {new Integer(fLastLine)}); //$NON-NLS-1$
- String value= Integer.toString(startLine);
- Shell activeShell= fTextViewer.getTextWidget().getShell();
- InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator());
- if (d.open() == d.OK) {
- try {
- int line= Integer.parseInt(d.getValue());
- gotoLine(line - 1);
- } catch (NumberFormatException x) {
- DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- } catch (BadLocationException x) {
- DebugUIPlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
- }
-}
-
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.views.console.ConsoleViewer;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+public class TextViewerGotoLineAction extends TextViewerAction {
+
+ /**
+ * Validates whether the text found in the input field of the
+ * dialog forms a valid line number, i.e. one to which can be
+ * jumped.
+ */
+ class NumberValidator implements IInputValidator {
+
+ public String isValid(String input) {
+ try {
+ int i= Integer.parseInt(input);
+ if (i <= 0 || fLastLine < i)
+ return ActionMessages.getString("TextViewerGotoLineAction.Line_number_out_of_range_1"); //$NON-NLS-1$
+
+ } catch (NumberFormatException x) {
+ return ActionMessages.getString("TextViewerGotoLineAction.Not_a_number_2"); //$NON-NLS-1$
+ }
+
+ return null;
+ }
+ };
+
+ protected int fLastLine;
+ protected ITextViewer fTextViewer;
+
+ /**
+ * Constructs a goto line action for the console using the provided resource bundle
+ */
+ public TextViewerGotoLineAction(ConsoleViewer viewer) {
+ super(viewer, -1);
+ fTextViewer= viewer;
+ setText(ActionMessages.getString("TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4")); //$NON-NLS-1$
+ setToolTipText(ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
+ setDescription(ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
+ }
+
+ /**
+ * @see TextViewerAction#update()
+ */
+ public void update() {
+ }
+
+ /**
+ * Jumps to the line.
+ */
+ protected void gotoLine(int line) {
+
+ IDocument document= fTextViewer.getDocument();
+ try {
+ int start= document.getLineOffset(line);
+ int length= document.getLineLength(line);
+ fTextViewer.getTextWidget().setSelection(start, start + length);
+ fTextViewer.revealRange(start, length);
+ } catch (BadLocationException x) {
+ DebugUIPlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * @see Action#run()
+ */
+ public void run() {
+ try {
+ Point selection= fTextViewer.getTextWidget().getSelection();
+ IDocument document= fTextViewer.getDocument();
+ fLastLine= document.getLineOfOffset(document.getLength()) + 1;
+ int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1;
+ String title= ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"); //$NON-NLS-1$
+ String message= MessageFormat.format(ActionMessages.getString("TextViewerGotoLineAction.Enter_line_number__8"), new Object[] {new Integer(fLastLine)}); //$NON-NLS-1$
+ String value= Integer.toString(startLine);
+ Shell activeShell= fTextViewer.getTextWidget().getShell();
+ InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator());
+ if (d.open() == d.OK) {
+ try {
+ int line= Integer.parseInt(d.getValue());
+ gotoLine(line - 1);
+ } catch (NumberFormatException x) {
+ DebugUIPlugin.errorDialog(activeShell, ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ } catch (BadLocationException x) {
+ DebugUIPlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ActionMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ActionMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
index 4a37e3ed8..35c1714c6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
@@ -1,84 +1,84 @@
-package org.eclipse.debug.internal.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.custom.BusyIndicator;
-
-/**
- * A generic Toggle filter action, meant to be subclassed to provide
- * a specific filter.
- */
-public abstract class ToggleFilterAction extends Action {
-
- /**
- * The viewer that this action works for
- */
- private StructuredViewer fViewer;
-
- /**
- * The filter this action applies to the viewer
- */
- private ViewerFilter fViewerFilter;
-
- public void run() {
- valueChanged(isChecked());
- }
- /**
- * Adds or removes the viewer filter depending
- * on the value of the parameter.
- */
- protected void valueChanged(final boolean on) {
- if (getViewer().getControl().isDisposed()) {
- return;
- }
- BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
- public void run() {
- if (on) {
- ViewerFilter filter= getViewerFilter();
- ViewerFilter[] filters= getViewer().getFilters();
- boolean alreadyAdded= false;
- for (int i= 0; i < filters.length; i++) {
- ViewerFilter addedFilter= filters[i];
- if (addedFilter.equals(filter)) {
- alreadyAdded= true;
- break;
- }
- }
- if (!alreadyAdded) {
- getViewer().addFilter(filter);
- }
-
- } else {
- getViewer().removeFilter(getViewerFilter());
- }
- }
- });
- }
-
- /**
- * Returns the <code>ViewerFilter</code> that this action
- * will add/remove from the viewer, or <code>null</code>
- * if no filter is involved.
- */
- protected ViewerFilter getViewerFilter() {
- return fViewerFilter;
- }
-
- protected void setViewerFilter(ViewerFilter filter) {
- fViewerFilter= filter;
- }
-
- protected StructuredViewer getViewer() {
- return fViewer;
- }
-
- protected void setViewer(StructuredViewer viewer) {
- fViewer = viewer;
- }
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.custom.BusyIndicator;
+
+/**
+ * A generic Toggle filter action, meant to be subclassed to provide
+ * a specific filter.
+ */
+public abstract class ToggleFilterAction extends Action {
+
+ /**
+ * The viewer that this action works for
+ */
+ private StructuredViewer fViewer;
+
+ /**
+ * The filter this action applies to the viewer
+ */
+ private ViewerFilter fViewerFilter;
+
+ public void run() {
+ valueChanged(isChecked());
+ }
+ /**
+ * Adds or removes the viewer filter depending
+ * on the value of the parameter.
+ */
+ protected void valueChanged(final boolean on) {
+ if (getViewer().getControl().isDisposed()) {
+ return;
+ }
+ BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
+ public void run() {
+ if (on) {
+ ViewerFilter filter= getViewerFilter();
+ ViewerFilter[] filters= getViewer().getFilters();
+ boolean alreadyAdded= false;
+ for (int i= 0; i < filters.length; i++) {
+ ViewerFilter addedFilter= filters[i];
+ if (addedFilter.equals(filter)) {
+ alreadyAdded= true;
+ break;
+ }
+ }
+ if (!alreadyAdded) {
+ getViewer().addFilter(filter);
+ }
+
+ } else {
+ getViewer().removeFilter(getViewerFilter());
+ }
+ }
+ });
+ }
+
+ /**
+ * Returns the <code>ViewerFilter</code> that this action
+ * will add/remove from the viewer, or <code>null</code>
+ * if no filter is involved.
+ */
+ protected ViewerFilter getViewerFilter() {
+ return fViewerFilter;
+ }
+
+ protected void setViewerFilter(ViewerFilter filter) {
+ fViewerFilter= filter;
+ }
+
+ protected StructuredViewer getViewer() {
+ return fViewer;
+ }
+
+ protected void setViewer(StructuredViewer viewer) {
+ fViewer = viewer;
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
index cc55e7f29..69b6a6952 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
@@ -1,3063 +1,3063 @@
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.PixelConverter;
-import org.eclipse.debug.internal.ui.SWTUtil;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.model.WorkbenchViewerSorter;
-
-/**
- * The dialog used to edit and launch launch configurations.
- */
-public class LaunchConfigurationDialog extends TitleAreaDialog
- implements ISelectionChangedListener,
- ILaunchConfigurationListener,
- ILaunchConfigurationDialog,
- IDoubleClickListener {
-
- /**
- * The tree of launch configurations
- */
- private TreeViewer fConfigTree;
-
- /**
- * The workbench context present when this dialog is opened.
- */
- private Object fContext;
-
- /**
- * The IResource corresponding to <code>fContext</code>.
- */
- private IResource fResourceContext;
-
- /**
- * The mode (run or debug) for this dialog.
- */
- private String fMode;
-
- /**
- * The Composite used to insert an adjustable 'sash' between the tree and the tabs.
- */
- private SashForm fSashForm;
-
- /**
- * Default weights for the SashForm that specify how wide the selection and
- * edit areas aree relative to each other.
- */
- private static final int[] DEFAULT_SASH_WEIGHTS = new int[] {11, 30};
-
- /**
- * The launch configuration selection area.
- */
- private Composite fSelectionArea;
-
- /**
- * The launch configuration edit area.
- */
- private Composite fEditArea;
-
- /**
- * The 'New configuration' action.
- */
- private ButtonAction fButtonActionNew;
-
- /**
- * The 'Duplicate configuration' action.
- */
- private ButtonAction fButtonActionDuplicate;
-
- /**
- * The 'Delete configuration' action.
- */
- private ButtonAction fButtonActionDelete;
-
- /**
- * The 'apply' button
- */
- private Button fApplyButton;
-
- /**
- * The 'revert' button
- */
- private Button fRevertButton;
-
- /**
- * The 'cancel' button that appears when the in-dialog progress monitor is shown.
- */
- private Button fProgressMonitorCancelButton;
-
- /**
- * Flag indicating if the progress monitor part's Cancel button has been pressed.
- */
- private boolean fCancelButtonPressed;
-
- /**
- * The text widget displaying the name of the
- * launch configuration under edit
- */
- private Text fNameText;
-
- private String fLastSavedName = null;
-
- /**
- * Container for the edit area <code>TabFolder</code>
- */
- private Composite fTabComposite;
-
- /**
- * The tab folder that contains tabs for the selected configuration
- */
- private TabFolder fTabFolder;
-
- /**
- * Flag that indicates when the tabs are being disposed.
- */
- private boolean fDisposingTabs = false;
-
- /**
- * The current (working copy) launch configuration
- * being displayed/edited or <code>null</code> if
- * none
- */
- private ILaunchConfigurationWorkingCopy fWorkingCopy;
-
- /**
- * The actual (non-working copy) launch configuration that underlies the current working copy
- */
- private ILaunchConfiguration fUnderlyingConfig;
-
- /**
- * Clients of this dialog may set an 'initial configuration type', which means that when
- * the dialog is opened, a configuration of that type will be created, initialized, and
- * saved. Note that the initial config type is ignored if single-click launching is enabled.
- */
- private ILaunchConfigurationType fInitialConfigType;
-
- /**
- * When this dialog is opened in <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code>
- * mode, this specifies the selection that is initially shown in the dialog.
- */
- private IStructuredSelection fInitialSelection;
-
- /**
- * The current tab group being displayed
- */
- private ILaunchConfigurationTabGroup fTabGroup;
-
- /**
- * The type of config tabs are currently displayed
- * for
- */
- private ILaunchConfigurationType fTabType;
-
- /**
- * The index of the currently selected tab
- */
- private int fCurrentTabIndex;
-
- private ProgressMonitorPart fProgressMonitorPart;
- private Cursor waitCursor;
- private Cursor arrowCursor;
- private MessageDialog fWindowClosingDialog;
-
- /**
- * Whether initlialing tabs
- */
- private boolean fInitializingTabs = false;
-
- /**
- * Indicates if selection changes in the tree should be ignored
- */
- private boolean fIgnoreSelectionChanges = false;
-
- /**
- * Previously selected element in the tree
- */
- private Object fSelectedTreeObject;
-
- /**
- * The number of 'long-running' operations currently taking place in this dialog
- */
- private long fActiveRunningOperations = 0;
-
- /**
- * Id for 'Launch' button.
- */
- protected static final int ID_LAUNCH_BUTTON = IDialogConstants.CLIENT_ID + 1;
-
- /**
- * Id for 'Close' button.
- */
- protected static final int ID_CLOSE_BUTTON = IDialogConstants.CLIENT_ID + 2;
-
- /**
- * Id for 'Cancel' button.
- */
- protected static final int ID_CANCEL_BUTTON = IDialogConstants.CLIENT_ID + 3;
-
- /**
- * Constrant String used as key for setting and retrieving current Control with focus
- */
- private static final String FOCUS_CONTROL = "focusControl";//$NON-NLS-1$
-
- /**
- * The height in pixels of this dialog's progress indicator
- */
- private static int PROGRESS_INDICATOR_HEIGHT = 18;
-
- /**
- * Constant specifying how wide this dialog is allowed to get (as a percentage of
- * total available screen width) as a result of tab labels in the edit area.
- */
- private static final float MAX_DIALOG_WIDTH_PERCENT = 0.75f;
-
- /**
- * Empty array
- */
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- protected static final String DEFAULT_NEW_CONFIG_NAME = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.New_configuration_1"); //$NON-NLS-1$
-
- /**
- * Size of this dialog if there is no preference specifying a size.
- */
- protected static final Point DEFAULT_INITIAL_DIALOG_SIZE = new Point(620, 560);
-
- /**
- * Status area messages
- */
- protected static final String LAUNCH_STATUS_OK_MESSAGE = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ready_to_launch_2"); //$NON-NLS-1$
- protected static final String LAUNCH_STATUS_STARTING_FROM_SCRATCH_MESSAGE
- = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Select_a_configuration_to_launch_or_a_config_type_to_create_a_new_configuration_3"); //$NON-NLS-1$
-
- private String fCantSaveErrorMessage;
-
- /**
- * Constant specifying that the launch configuration dialog should not actually open,
- * but instead should attempt to re-launch the last configuration that was sucessfully
- * launched in the workspace. If there is no last launched configuration, just open the dialog.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST = 0;
-
- /**
- * Constant specifying that this dialog should be opened with a new configuration of a type
- * specified via <code>setInitialConfigType()</code> selected.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_NEW_CONFIG_OF_TYPE = 1;
-
- /**
- * Constant specifying that this dialog should be opened with the last configuration launched
- * in the workspace selected.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED = 2;
-
- /**
- * Constant specifying that this dialog should be opened with the value specified via
- * <code>setInitialSelection()</code> selected.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION = 3;
-
- /**
- * Specifies how this dialog behaves when opened. Value is one of the
- * 'LAUNCH_CONFIGURATION_DIALOG' constants defined in this class.
- */
- private int fOpenMode = LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST;
-
- /**
- * Constructs a new launch configuration dialog on the given
- * parent shell.
- *
- * @param shell the parent shell
- * @param selection the selection used to initialize this dialog, typically the
- * current workbench selection
- * @param mode one of <code>ILaunchManager.RUN_MODE</code> or
- * <code>ILaunchManager.DEBUG_MODE</code>
- */
- public LaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setContext(resolveContext(selection));
- setMode(mode);
- }
-
- /**
- * Set the flag indicating how this dialog behaves when the <code>open()</code> method is called.
- * Valid values are defined by the LAUNCH_CONFIGURATION_DIALOG... constants in this class.
- */
- public void setOpenMode(int mode) {
- fOpenMode = mode;
- }
-
- protected int getOpenMode() {
- return fOpenMode;
- }
-
- /**
- * Returns the Object to be used as context for this dialog, derived from the specified selection.
- * If the specified selection has as its first element an IFile whose extension matches
- * <code>ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION</code>, then return
- * the launch configuration declared in the IFile. Otherwise, return the first element
- * in the specified selection.
- */
- protected Object resolveContext(IStructuredSelection selection) {
-
- // Empty selection means no context
- if ((selection == null) || (selection.isEmpty())) {
- return null;
- }
-
- // If first element is a launch config file, create a launch configuration from it
- // and make this the context, otherwise just return the first element
- Object firstSelected = selection.getFirstElement();
- if (firstSelected instanceof IFile) {
- IFile file = (IFile) firstSelected;
- if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) {
- return getLaunchManager().getLaunchConfiguration(file);
- }
- }
- return firstSelected;
- }
-
- /**
- * A launch configuration dialog overrides this method
- * to create a custom set of buttons in the button bar.
- * This dialog has 'Launch' and 'Cancel'
- * buttons.
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
- createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Close_1"), false); //$NON-NLS-1$
- }
-
- /**
- * Handle the 'save and launch' & 'launch' buttons here, all others are handled
- * in <code>Dialog</code>
- *
- * @see Dialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == ID_LAUNCH_BUTTON) {
- handleLaunchPressed();
- } else if (buttonId == ID_CLOSE_BUTTON) {
- handleClosePressed();
- } else {
- super.buttonPressed(buttonId);
- }
- }
-
- /**
- * Returns the appropriate text for the launch button - run or debug.
- */
- protected String getLaunchButtonText() {
- if (getMode() == ILaunchManager.DEBUG_MODE) {
- return LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Deb&ug_4"); //$NON-NLS-1$
- } else {
- return LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.R&un_5"); //$NON-NLS-1$
- }
- }
-
- /**
- * @see Dialog#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- Control contents = super.createContents(parent);
- initializeBounds();
- initializeSashForm();
- createContextMenu(getTreeViewer().getControl());
- getLaunchManager().addLaunchConfigurationListener(this);
- ensureSelectionAreaWidth();
- doInitialTreeSelection();
- return contents;
- }
-
- /**
- * Initialize the relative weights (widths) of the 2 sides of the sash.
- */
- protected void initializeSashForm() {
- int[] sashWeights = DEFAULT_SASH_WEIGHTS;
- String sashWeightString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SASH_WEIGHTS);
- if (sashWeightString.length() > 0) {
- Point sashWeightPoint = parseCoordinates(sashWeightString);
- if (sashWeightPoint != null) {
- sashWeights[0] = sashWeightPoint.x;
- sashWeights[1] = sashWeightPoint.y;
- }
- }
- getSashForm().setWeights(sashWeights);
- }
-
- /**
- * Check if the selection area is currently wide enough so that both the 'New' &
- * 'Delete' buttons are shown without truncation. If so, do nothing. Otherwise,
- * increase the width of this dialog's Shell just enough so that both buttons
- * are shown cleanly.
- */
- protected void ensureSelectionAreaWidth() {
- Button newButton = getButtonActionNew().getButton();
- Button deleteButton = getButtonActionDelete().getButton();
- int requiredWidth = newButton.getBounds().width + deleteButton.getBounds().width;
- int marginWidth = ((GridLayout)getSelectionArea().getLayout()).marginWidth;
- int horizontalSpacing = ((GridLayout)getSelectionArea().getLayout()).horizontalSpacing;
- requiredWidth += (2 * marginWidth) + horizontalSpacing;
- int currentWidth = getSelectionArea().getBounds().width;
-
- if (requiredWidth > currentWidth) {
- int[] newSashWeights = new int[2];
- newSashWeights[0] = requiredWidth;
- newSashWeights[1] = getEditArea().getBounds().width;
- Shell shell= getShell();
- Point shellSize= shell.getSize();
- setShellSize(shellSize.x + (requiredWidth - currentWidth), shellSize.y);
- getSashForm().setWeights(newSashWeights);
- }
- }
-
- /**
- * Creates a pop-up menu on the specified control.
- */
- protected void createContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
- }
-
- /**
- * Fill the specified context menu with the basic launch configuration
- * management actions - New, Duplicate & Delete.
- */
- protected void fillContextMenu(IMenuManager menu) {
- if (getButtonActionNew().isEnabled()) {
- menu.add(getButtonActionNew());
- }
- if (getButtonActionDuplicate().isEnabled()) {
- menu.add(getButtonActionDuplicate());
- }
- if (getButtonActionDelete().isEnabled()) {
- menu.add(getButtonActionDelete());
- }
- }
-
- /**
- * Set the initial selection in the tree.
- */
- protected void doInitialTreeSelection() {
- getTreeViewer().setSelection(getInitialSelection());
- }
-
- /**
- * Write out this dialog's Shell size, location & sash weights to the preference store.
- */
- protected void persistShellGeometry() {
- Point shellLocation = getShell().getLocation();
- Point shellSize = getShell().getSize();
- int[] sashWeights = getSashForm().getWeights();
- String locationString = serializeCoords(shellLocation);
- String sizeString = serializeCoords(shellSize);
- String sashWeightString = serializeCoords(new Point(sashWeights[0], sashWeights[1]));
- getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_LOCATION, locationString);
- getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SIZE, sizeString);
- getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SASH_WEIGHTS, sashWeightString);
- }
-
- /**
- * @see Window#close()
- */
- public boolean close() {
- getLaunchManager().removeLaunchConfigurationListener(this);
- persistShellGeometry();
- return super.close();
- }
-
- /**
- * Determine the first configuration for this dialog. If single-click launching is
- * enabled, launch the configuration WITHOUT realizing the dialog. If single-click
- * launching was successful, this method returns
- * <code>ILaunchConfigurationDialog.SINGLE_CLICK_LAUNCHED</code>. Otherwise, open the
- * dialog in the specified mode.
- *
- * @see Window#open()
- */
- public int open() {
- int mode = getOpenMode();
- if (mode == LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST) {
- return doLastLaunchedConfig(true);
- } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED) {
- return doLastLaunchedConfig(false);
- } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_NEW_CONFIG_OF_TYPE) {
- return openDialogOnNewConfigOfSpecifiedType();
- } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION) {
- return openDialogOnSelection();
- }
- return super.open();
- }
-
- /**
- * Retrieve the last launched configuration in the workspace. If <code>launch</code>
- * is <code>true</code>, launch this configuration without showing the dialog, otherwise
- * just set the initial selection in the dialog to the last launched configuration.
- */
- protected int doLastLaunchedConfig(boolean launch) {
- ILaunchConfiguration lastLaunchedConfig = getLastLaunchedWorkbenchConfiguration();
- if (launch) {
- try {
- if (lastLaunchedConfig != null) {
- if (lastLaunchedConfig.supportsMode(getMode())) {
- fUnderlyingConfig = lastLaunchedConfig;
- doLaunch(lastLaunchedConfig);
- } else {
- // If we're trying to launch, but the last launched config doesn't
- // support the current mode of the dialog, show an error dialog
- String configName = lastLaunchedConfig.getName();
- String title = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cannot_relaunch_1"); //$NON-NLS-1$
- String message = MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cannot_relaunch_[{1}]_because_it_does_not_support_{2}_mode_2"), new String[] {configName, getMode()}); //$NON-NLS-1$
- MessageDialog.openError(getShell(), title, message);
- }
- return ILaunchConfigurationDialog.LAUNCHED_BEFORE_OPENING;
- }
- } catch(CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_6"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_processing_launch_configuration._See_log_for_more_information_7"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (lastLaunchedConfig != null) {
- setInitialSelection(new StructuredSelection(lastLaunchedConfig));
- }
- return super.open();
- }
-
- /**
- * Realize this dialog so that a new configuration of the type that was specified via
- * <code>setInitialConfigType()</code> is selected.
- */
- protected int openDialogOnNewConfigOfSpecifiedType() {
- ILaunchConfigurationType configType = getInitialConfigType();
- ILaunchConfiguration config = null;
- if (configType != null) {
- config = createConfigOfType(configType);
- }
- if (config != null) {
- setInitialSelection(new StructuredSelection(config));
- }
- return super.open();
- }
-
- /**
- * Open this dialog with the selection set to the value specified by
- * <code>setInitialSelection()</code>.
- */
- protected int openDialogOnSelection() {
- // Nothing special is required, the dialog will open and whatever was specified
- // via setInitialSelection() will be selected in the tree
- return super.open();
- }
-
- /**
- * Return the last launched configuration in the workspace.
- */
- protected ILaunchConfiguration getLastLaunchedWorkbenchConfiguration() {
- LaunchConfigurationHistoryElement historyElement = DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
- if (historyElement != null) {
- return historyElement.getLaunchConfiguration();
- }
- return null;
- }
-
- /**
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
- */
- protected Control createDialogArea(Composite parent) {
- GridData gd;
- Composite dialogComp = (Composite)super.createDialogArea(parent);
- Composite topComp = new Composite(dialogComp, SWT.NONE);
- gd = new GridData(GridData.FILL_BOTH);
- topComp.setLayoutData(gd);
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns = 2;
- topLayout.marginHeight = 5;
- topLayout.marginWidth = 0;
- topComp.setLayout(topLayout);
-
- // Set the things that TitleAreaDialog takes care of
- setTitle(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Create,_manage,_and_run_launch_configurations_8")); //$NON-NLS-1$
- setMessage(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ready_to_launch_2")); //$NON-NLS-1$
- setModeLabelState();
-
- // Create the SashForm that contains the selection area on the left,
- // and the edit area on the right
- setSashForm(new SashForm(topComp, SWT.NONE));
- getSashForm().setOrientation(SWT.HORIZONTAL);
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- getSashForm().setLayoutData(gd);
-
- // Build the launch configuration selection area and put it into the composite.
- Composite launchConfigSelectionArea = createLaunchConfigurationSelectionArea(getSashForm());
- gd = new GridData(GridData.FILL_VERTICAL);
- launchConfigSelectionArea.setLayoutData(gd);
-
- // Build the launch configuration edit area and put it into the composite.
- Composite editAreaComp = createLaunchConfigurationEditArea(getSashForm());
- gd = new GridData(GridData.FILL_BOTH);
- editAreaComp.setLayoutData(gd);
-
- // Build the separator line that demarcates the button bar
- Label separator = new Label(topComp, SWT.HORIZONTAL | SWT.SEPARATOR);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- separator.setLayoutData(gd);
-
- dialogComp.layout(true);
-
- return dialogComp;
- }
-
- /**
- * Create and return a launch configuration of the specified type.
- * This method is intended to be called before the UI has been realized, such as in
- * the case of single-click launching or creating a config for an initial configuration
- * type.
- */
- protected ILaunchConfiguration createConfigOfType(ILaunchConfigurationType configType) {
- ILaunchConfigurationWorkingCopy workingCopy = null;
- try {
- workingCopy = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(DEFAULT_NEW_CONFIG_NAME));
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- return null;
- }
-
- ILaunchConfiguration config = null;
- try {
- ILaunchConfigurationTabGroup group= createGroup(configType);
- group.setDefaults(workingCopy);
- group.dispose();
-
- // Assign a name to the config if it doesn't already have one
- if (workingCopy.getName().trim().length() == 0) {
- IResource res = getResourceContext();
- String name = ""; //$NON-NLS-1$
- if (res != null) {
- name = res.getName();
- }
- name = generateName(name);
- workingCopy.rename(name);
- }
-
- config = workingCopy.doSave();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return null;
- }
-
- return config;
- }
-
- /**
- * Returns tab group for the given type of launch configuration.
- * Tabs are initialized to be contained in this dialog.
- *
- * @exception CoreException if unable to instantiate a tab group
- */
- protected ILaunchConfigurationTabGroup createGroup(final ILaunchConfigurationType configType) throws CoreException {
- // Use a final Object array to store the tab group and any exception that
- // results from the Runnable
- final Object[] finalArray = new Object[2];
- Runnable runnable = new Runnable() {
- public void run() {
- ILaunchConfigurationTabGroup tabGroup = null;
- try {
- tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(configType);
- finalArray[0] = tabGroup;
- } catch (CoreException ce) {
- finalArray[1] = ce;
- return;
- }
- tabGroup.createTabs(LaunchConfigurationDialog.this, getMode());
- ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(LaunchConfigurationDialog.this);
- }
- }
- };
-
- // Creating the tabs can result in plugin loading, so we show the busy cursor
- BusyIndicator.showWhile(getDisplay(), runnable);
-
- // Re-throw any CoreException if there was one
- if (finalArray[1] != null) {
- throw (CoreException)finalArray[1];
- }
-
- // Otherwise return the tab group
- return (ILaunchConfigurationTabGroup)finalArray[0];
- }
-
- /**
- * Returns the selected IResource context from the workbench,
- * or <code>null</code> if there was no context in the workbench.
- */
- protected IResource getResourceContext() {
- if (fResourceContext == null) {
- Object workbenchSelection = getContext();
- if (workbenchSelection instanceof IResource) {
- fResourceContext = (IResource)workbenchSelection;
- } else if (workbenchSelection instanceof IAdaptable) {
- fResourceContext = (IResource) ((IAdaptable)workbenchSelection).getAdapter(IResource.class);
- }
- }
- return fResourceContext;
- }
-
- /**
- * Set the title area image based on the mode this dialog was initialized with
- */
- protected void setModeLabelState() {
- Image image;
- if (getMode().equals(ILaunchManager.DEBUG_MODE)) {
- image = DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_DEBUG);
- } else {
- image = DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_RUN);
- }
- setTitleImage(image);
- }
-
- /**
- * Convenience method to set the selection on the configuration tree.
- */
- protected void setTreeViewerSelection(ISelection selection) {
- getTreeViewer().setSelection(selection);
- }
-
- private void setLastSavedName(String lastSavedName) {
- this.fLastSavedName = lastSavedName;
- }
-
- private String getLastSavedName() {
- return fLastSavedName;
- }
-
- /**
- * Update buttons and message.
- */
- protected void refreshStatus() {
- updateButtons();
- updateMessage();
- }
-
- /**
- * Verify the attributes common to all launch configuration.
- * Indicate failure by throwing a <code>CoreException</code>.
- */
- protected void verifyStandardAttributes() throws CoreException {
- verifyName();
- }
-
- /**
- * Verify that the launch configuration name is valid.
- */
- protected void verifyName() throws CoreException {
- String currentName = getNameTextWidget().getText().trim();
-
- // If there is no name, complain
- if (currentName.length() < 1) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getUniqueIdentifier(),
- 0,
- LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Name_required_for_launch_configuration_11"), //$NON-NLS-1$
- null));
- }
-
- // If the name hasn't changed from the last saved name, do nothing
- if (currentName.equals(getLastSavedName())) {
- return;
- }
-
- // See if name contains any 'illegal' characters
- IStatus status = ResourcesPlugin.getWorkspace().validateName(currentName, IResource.FILE);
- if (status.getCode() != IStatus.OK) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
- 0,
- status.getMessage(),
- null));
- }
-
- // Otherwise, if there's already a config with the same name, complain
- if (getLaunchManager().isExistingLaunchConfigurationName(currentName)) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
- 0,
- LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_configuration_already_exists_with_this_name_12"), //$NON-NLS-1$
- null));
- }
- }
-
- /**
- * If the name is valid, rename the current launch configuration. Otherwise, show an
- * appropriate error message.
- */
- protected void updateConfigFromName() {
- if (getLaunchConfiguration() != null) {
- try {
- verifyName();
- } catch (CoreException ce) {
- refreshStatus();
- return;
- }
-
- getLaunchConfiguration().rename(getNameTextWidget().getText().trim());
- refreshStatus();
- }
- }
-
- protected Display getDisplay() {
- Shell shell = getShell();
- if (shell != null) {
- return shell.getDisplay();
- } else {
- return Display.getDefault();
- }
- }
-
- /**
- * Creates the launch configuration selection area of the dialog.
- * This area displays a tree of launch configurations that the user
- * may select, and allows users to create new configurations, and
- * delete and duplicate existing configurations.
- *
- * @return the composite used for launch configuration selection area
- */
- protected Composite createLaunchConfigurationSelectionArea(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setSelectionArea(comp);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = 0;
- layout.marginWidth = 5;
- comp.setLayout(layout);
-
- Label treeLabel = new Label(comp, SWT.NONE);
- treeLabel.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Con&figurations__1")); //$NON-NLS-1$
- GridData gd = new GridData();
- gd.horizontalSpan = 3;
- treeLabel.setLayoutData(gd);
-
- TreeViewer tree = new TreeViewer(comp);
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 3;
- // Set width hint to 0 to force tree to only be as wide as the combined
- // width of the 'New' & 'Delete' buttons. Otherwise tree wants to be much wider.
- gd.widthHint = 0;
- tree.getControl().setLayoutData(gd);
- tree.setContentProvider(new LaunchConfigurationContentProvider());
- tree.setLabelProvider(DebugUITools.newDebugModelPresentation());
- tree.setSorter(new WorkbenchViewerSorter());
- setTreeViewer(tree);
- tree.addSelectionChangedListener(this);
- tree.setInput(ResourcesPlugin.getWorkspace().getRoot());
- tree.expandAll();
- tree.addDoubleClickListener(this);
- tree.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleTreeViewerKeyPressed(e);
- }
- });
-
- Button newButton = SWTUtil.createPushButton(comp, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ne&w_13"), null); //$NON-NLS-1$
- setButtonActionNew(new ButtonActionNew(newButton.getText(), newButton));
-
- Button deleteButton = SWTUtil.createPushButton(comp, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Dele&te_14"), null); //$NON-NLS-1$
- setButtonActionDelete(new ButtonActionDelete(deleteButton.getText(), deleteButton));
-
- setButtonActionDuplicate(new ButtonActionDuplicate(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Duplicate_1"), null)); //$NON-NLS-1$
-
- return comp;
- }
-
- /**
- * Creates the launch configuration edit area of the dialog.
- * This area displays the name of the launch configuration
- * currently being edited, as well as a tab folder of tabs
- * that are applicable to the launch configuration.
- *
- * @return the composite used for launch configuration editing
- */
- protected Composite createLaunchConfigurationEditArea(Composite parent) {
- Composite outerComp = new Composite(parent, SWT.NONE);
- GridLayout outerCompLayout = new GridLayout();
- outerCompLayout.numColumns = 1;
- outerCompLayout.marginHeight = 0;
- outerCompLayout.marginWidth = 0;
- outerComp.setLayout(outerCompLayout);
-
- Composite comp = new Composite(outerComp, SWT.NONE);
- setEditArea(comp);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 5;
- comp.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(gd);
-
- Label nameLabel = new Label(comp, SWT.HORIZONTAL | SWT.LEFT);
- nameLabel.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.&Name__16")); //$NON-NLS-1$
- gd = new GridData(GridData.BEGINNING);
- nameLabel.setLayoutData(gd);
-
- Text nameText = new Text(comp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- nameText.setLayoutData(gd);
- setNameTextWidget(nameText);
-
- getNameTextWidget().addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateConfigFromName();
- }
- }
- );
-
- Label spacer = new Label(comp, SWT.NONE);
- gd = new GridData();
- gd.horizontalSpan = 2;
- spacer.setLayoutData(gd);
-
- fTabComposite = new Composite(comp, SWT.NONE);
- GridLayout outerTabCompositeLayout = new GridLayout();
- outerTabCompositeLayout.marginHeight = 0;
- outerTabCompositeLayout.marginWidth = 0;
- fTabComposite.setLayout(outerTabCompositeLayout);
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- fTabComposite.setLayoutData(gd);
-
- TabFolder tabFolder = new TabFolder(fTabComposite, SWT.NONE);
- setTabFolder(tabFolder);
- gd = new GridData(GridData.FILL_BOTH);
- tabFolder.setLayoutData(gd);
- getTabFolder().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleTabSelected();
- }
- });
-
- Composite buttonComp = new Composite(comp, SWT.NONE);
- GridLayout buttonCompLayout = new GridLayout();
- buttonCompLayout.numColumns = 2;
- buttonComp.setLayout(buttonCompLayout);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gd.horizontalSpan = 2;
- buttonComp.setLayoutData(gd);
-
- setApplyButton(new Button(buttonComp, SWT.PUSH));
- getApplyButton().setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.&Apply_17")); //$NON-NLS-1$
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- getApplyButton().setLayoutData(gd);
- SWTUtil.setButtonDimensionHint(getApplyButton());
- getApplyButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleApplyPressed();
- }
- });
-
- setRevertButton(new Button(buttonComp, SWT.PUSH));
- getRevertButton().setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Revert_2")); //$NON-NLS-1$
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- getRevertButton().setLayoutData(gd);
- SWTUtil.setButtonDimensionHint(getRevertButton());
- getRevertButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleRevertPressed();
- }
- });
-
- return outerComp;
- }
-
- /**
- * @see Dialog#createButtonBar(Composite)
- */
- protected Control createButtonBar(Composite parent) {
- Composite composite= new Composite(parent, SWT.NULL);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- GridLayout pmLayout = new GridLayout();
- pmLayout.numColumns = 3;
- setProgressMonitorPart(new ProgressMonitorPart(composite, pmLayout, PROGRESS_INDICATOR_HEIGHT));
- Button cancelButton = createButton(getProgressMonitorPart(), ID_CANCEL_BUTTON, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cancel_3"), true); //$NON-NLS-1$
- setProgressMonitorCancelButton(cancelButton);
- getProgressMonitorCancelButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- setCancelButtonPressed(true);
- }
- });
- getProgressMonitorPart().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- getProgressMonitorPart().setVisible(false);
-
- return super.createButtonBar(composite);
- }
-
- /**
- * Sets the title for the dialog, and establishes the help context.
- *
- * @see org.eclipse.jface.window.Window#configureShell(Shell);
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configurations_18")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(
- shell,
- IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG);
- }
-
- /**
- * @see Window#getInitialLocation(Point)
- */
- protected Point getInitialLocation(Point initialSize) {
- String locationString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_LOCATION);
- if (locationString.length() > 0) {
- Point locationPoint = parseCoordinates(locationString);
- if (locationPoint != null) {
- return locationPoint;
- }
- }
- return super.getInitialLocation(initialSize);
- }
-
- /**
- * @see Window#getInitialSize()
- */
- protected Point getInitialSize() {
- String sizeString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SIZE);
- if (sizeString.length() > 0) {
- Point sizePoint = parseCoordinates(sizeString);
- if (sizePoint != null) {
- return sizePoint;
- }
- }
- return DEFAULT_INITIAL_DIALOG_SIZE;
- }
-
- /**
- * Given a coordinate String of the form "123x456" return a Point object whose
- * X value is 123 and Y value is 456. Return <code>null</code> if the String
- * is not in the specified form.
- */
- protected Point parseCoordinates(String coordString) {
- int byIndex = coordString.indexOf('x');
- if (byIndex < 0) {
- return null;
- }
-
- try {
- int x = Integer.parseInt(coordString.substring(0, byIndex));
- int y = Integer.parseInt(coordString.substring(byIndex + 1));
- return new Point(x, y);
- } catch (NumberFormatException nfe) {
- return null;
- }
- }
-
- /**
- * Given a Point object, return a String of the form "XCoordxYCoord".
- */
- protected String serializeCoords(Point coords) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(coords.x);
- buffer.append('x');
- buffer.append(coords.y);
- return buffer.toString();
- }
-
- private void setSashForm(SashForm sashForm) {
- fSashForm = sashForm;
- }
-
- protected SashForm getSashForm() {
- return fSashForm;
- }
-
- /**
- * Sets the tree viewer used to display launch configurations.
- *
- * @param viewer the tree viewer used to display launch
- * configurations
- */
- private void setTreeViewer(TreeViewer viewer) {
- fConfigTree = viewer;
- }
-
- /**
- * Returns the tree viewer used to display launch configurations.
- *
- * @param the tree viewer used to display launch configurations
- */
- protected TreeViewer getTreeViewer() {
- return fConfigTree;
- }
-
- protected IStructuredSelection getTreeViewerSelection() {
- return (IStructuredSelection)getTreeViewer().getSelection();
- }
-
- protected Object getTreeViewerFirstSelectedElement() {
- IStructuredSelection selection = getTreeViewerSelection();
- if (selection == null) {
- return null;
- }
- return selection.getFirstElement();
- }
-
- /**
- * Content provider for launch configuration tree.
- */
- class LaunchConfigurationContentProvider implements ITreeContentProvider {
-
- /**
- * Actual launch configurations have no children. Launch configuration types have
- * all configurations of that type as children, minus any configurations that are
- * marked as private.
- *
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ILaunchConfiguration) {
- return EMPTY_ARRAY;
- } else if (parentElement instanceof ILaunchConfigurationType) {
- try {
- ILaunchConfigurationType type = (ILaunchConfigurationType)parentElement;
- ILaunchConfiguration[] allConfigs = getLaunchManager().getLaunchConfigurations(type);
- ArrayList filteredConfigs = new ArrayList(allConfigs.length);
- for (int i = 0; i < allConfigs.length; i++) {
- ILaunchConfiguration config = allConfigs[i];
- if (config.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false)) {
- continue;
- }
- filteredConfigs.add(config);
- }
- return filteredConfigs.toArray();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- return getLaunchManager().getLaunchConfigurationTypes();
- }
- return EMPTY_ARRAY;
- }
-
- /**
- * @see ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element) {
- if (element instanceof ILaunchConfiguration) {
- if (!((ILaunchConfiguration)element).exists()) {
- return null;
- }
- try {
- return ((ILaunchConfiguration)element).getType();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else if (element instanceof ILaunchConfigurationType) {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
- return null;
- }
-
- /**
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof ILaunchConfiguration) {
- return false;
- } else {
- return getChildren(element).length > 0;
- }
- }
-
- /**
- * Return only the launch configuration types that support the current mode AND
- * are marked as 'public'.
- *
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- ILaunchConfigurationType[] allTypes = getLaunchManager().getLaunchConfigurationTypes();
- ArrayList list = new ArrayList(allTypes.length);
- String mode = getMode();
- for (int i = 0; i < allTypes.length; i++) {
- ILaunchConfigurationType configType = allTypes[i];
- if (configType.supportsMode(mode) && configType.isPublic()) {
- list.add(configType);
- }
- }
- return list.toArray();
- }
-
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- /**
- * Returns the launch manager.
- *
- * @return the launch manager
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Returns whether this dialog is currently open
- */
- protected boolean isVisible() {
- return getTreeViewer() != null;
- }
-
- /**
- * Notification that selection has changed in the launch configuration tree.
- * <p>
- * If the currently displayed configuration is not saved,
- * prompt for saving before moving on to the new selection.
- * </p>
- *
- * @param event selection changed event
- */
- public void selectionChanged(SelectionChangedEvent event) {
-
- // Ignore selectionChange events that occur while saving
- if (ignoreSelectionChanges()) {
- return;
- }
-
- // Get the new selection
- IStructuredSelection selection = (IStructuredSelection)event.getSelection();
- if (selection.isEmpty()) {
- getEditArea().setVisible(false);
- setWorkingCopy(null);
- setSelectedTreeObject(null);
- setDefaultMessage();
- updateButtons();
- return;
- }
-
- // Get details of the new selection
- Object firstSelectedElement = selection.getFirstElement();
- boolean singleSelection = selection.size() == 1;
- boolean configSelected = firstSelectedElement instanceof ILaunchConfiguration;
-
- // If selection is the same, don't bother
- Object lastSelectedTreeObj = getSelectedTreeObject();
- if (singleSelection && (lastSelectedTreeObj != null) && lastSelectedTreeObj.equals(firstSelectedElement)) {
- getEditArea().setVisible(lastSelectedTreeObj instanceof ILaunchConfiguration);
- return;
- }
-
- // Take care of any unsaved changes. If the user aborts, reset selection
- // to whatever it was previously selected
- boolean canReplaceConfig = canDiscardCurrentConfig();
- if (!canReplaceConfig) {
- StructuredSelection prevSelection;
- if (lastSelectedTreeObj == null) {
- prevSelection = StructuredSelection.EMPTY;
- } else {
- prevSelection = new StructuredSelection(lastSelectedTreeObj);
- }
- setTreeViewerSelection(prevSelection);
- return;
- }
-
- // If a config is selected, update the edit area for it, if a config type is
- // selected, clear the edit area
- if (singleSelection && configSelected) {
- ILaunchConfiguration config = (ILaunchConfiguration) firstSelectedElement;
- setLastSavedName(config.getName());
- setLaunchConfiguration(config, false);
- } else if (singleSelection && firstSelectedElement instanceof ILaunchConfigurationType) {
- if (canReplaceConfig) {
- clearLaunchConfiguration();
- getEditArea().setVisible(false);
- disposeExistingTabs();
- }
- } else {
- // multi-selection
- clearLaunchConfiguration();
- getEditArea().setVisible(false);
- }
-
- updateButtons();
- if (singleSelection) {
- setSelectedTreeObject(firstSelectedElement);
- } else {
- setSelectedTreeObject(null);
- }
- }
-
- protected void setProgressMonitorPart(ProgressMonitorPart part) {
- fProgressMonitorPart = part;
- }
-
- protected ProgressMonitorPart getProgressMonitorPart() {
- return fProgressMonitorPart;
- }
-
- protected void setProgressMonitorCancelButton(Button button) {
- fProgressMonitorCancelButton = button;
- }
-
- protected Button getProgressMonitorCancelButton() {
- return fProgressMonitorCancelButton;
- }
-
- /**
- * Sets the configuration to display/edit.
- * Updates the tab folder to contain the appropriate pages.
- * Sets all configuration-related state appropriately.
- *
- * @param config the launch configuration to display/edit
- * @param init whether to initialize the config with default values
- */
- protected void setLaunchConfiguration(ILaunchConfiguration config, boolean init) {
- try {
-
- // turn on initializing flag to ignore message updates
- setInitializingTabs(true);
-
- getEditArea().setVisible(true);
- showTabsForConfigType(config.getType());
-
- if (config.isWorkingCopy()) {
- setWorkingCopy((ILaunchConfigurationWorkingCopy)config);
- } else {
- setWorkingCopy(config.getWorkingCopy());
- }
- fUnderlyingConfig = getLaunchConfiguration().getOriginal();
-
- // update the name field before to avoid verify error
- getNameTextWidget().setText(config.getName());
-
- // Set the defaults for all tabs before any are initialized
- // so that every tab can see ALL the default values
- if (init) {
- getTabGroup().setDefaults(getLaunchConfiguration());
- }
-
- // update the tabs with the new working copy
- getTabGroup().initializeFrom(getLaunchConfiguration());
-
- // update the name field after in case client changed it
- getNameTextWidget().setText(config.getName());
-
- // turn off initializing flag to update message
- setInitializingTabs(false);
-
- refreshStatus();
-
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_setting_launch_configuration_24"), ce); //$NON-NLS-1$ //$NON-NLS-2$
- clearLaunchConfiguration();
- return;
- }
- }
-
- /**
- * Clears the configuration being shown/edited.
- * Resets all configuration-related state.
- */
- protected void clearLaunchConfiguration() {
- setWorkingCopy(null);
- fUnderlyingConfig = null;
- setLastSavedName(null);
- getNameTextWidget().setText(""); //$NON-NLS-1$
- refreshStatus();
- }
-
- /**
- * Populate the tabs in the configuration edit area to be appropriate to the current
- * launch configuration type.
- */
- protected void showTabsForConfigType(ILaunchConfigurationType configType) {
-
- // Don't do any work if the current tabs are for the current config type
- if (getTabType() != null && getTabType().equals(configType)) {
- return;
- }
-
- // Avoid flicker
- getEditArea().setVisible(false);
-
- // Dispose the current tabs
- disposeExistingTabs();
-
- // Build the new tabs
- ILaunchConfigurationTabGroup group = null;
- try {
- group = createGroup(configType);
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_creating_launch_configuration_tabs_27"),ce); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
-
- // Create the Control for each tab, and determine the maximum tab dimensions
- PixelConverter pixelConverter = new PixelConverter(getTabFolder());
- int runningTabWidth = 0;
- ILaunchConfigurationTab[] tabs = group.getTabs();
- Point contentSize = new Point(0, 0);
- for (int i = 0; i < tabs.length; i++) {
- TabItem tab = new TabItem(getTabFolder(), SWT.NONE);
- String name = tabs[i].getName();
- if (name == null) {
- name = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.unspecified_28"); //$NON-NLS-1$
- }
- tab.setText(name);
- Image image = tabs[i].getImage();
- tab.setImage(image);
- runningTabWidth += pixelConverter.convertWidthInCharsToPixels(name.length() + 5);
- if (image != null) {
- runningTabWidth += image.getBounds().width;
- }
- tabs[i].createControl(tab.getParent());
- Control control = tabs[i].getControl();
- if (control != null) {
- tab.setControl(control);
- Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- if (size.x > contentSize.x) {
- contentSize.x = size.x;
- }
- if (size.y > contentSize.y) {
- contentSize.y = size.y;
- }
- }
- }
-
- // Determine if more space is needed to show all tab labels across the top of the
- // tab folder. If so, only increase size of dialog to some percent of the available
- // screen real estate.
- if (runningTabWidth > contentSize.x) {
- int maxAllowedWidth = (int) (getDisplay().getBounds().width * MAX_DIALOG_WIDTH_PERCENT);
- int otherWidth = getSashForm().SASH_WIDTH + getSelectionArea().getBounds().width;
- int totalWidth = runningTabWidth + otherWidth;
- if (totalWidth > maxAllowedWidth) {
- contentSize.x = maxAllowedWidth - otherWidth;
- } else {
- contentSize.x = runningTabWidth;
- }
- }
-
- // Adjust the maximum tab dimensions to account for the extra space required for the tab labels
- Rectangle tabFolderBoundingBox = getTabFolder().computeTrim(0, 0, contentSize.x, contentSize.y);
- contentSize.x = tabFolderBoundingBox.width;
- contentSize.y = tabFolderBoundingBox.height;
-
- // Force recalculation of sizes
- getTabFolder().layout(true);
-
- // Calculate difference between required space for tab folder and current size,
- // then increase size of this dialog's Shell by that amount
- Rectangle rect = fTabComposite.getClientArea();
- Point containerSize= new Point(rect.width, rect.height);
- int hdiff= contentSize.x - containerSize.x;
- int vdiff= contentSize.y - containerSize.y;
- // Only increase size of dialog, never shrink it
- if (hdiff > 0 || vdiff > 0) {
- int[] newSashWeights = null;
- if (hdiff > 0) {
- newSashWeights = calculateNewSashWeights(hdiff);
- }
- hdiff= Math.max(0, hdiff);
- vdiff= Math.max(0, vdiff);
- Shell shell= getShell();
- Point shellSize= shell.getSize();
- setShellSize(shellSize.x + hdiff, shellSize.y + vdiff);
- // Adjust the sash weights so that all of the increase in width
- // is given to the tab area
- if (newSashWeights != null) {
- getSashForm().setWeights(newSashWeights);
- }
- }
-
- setTabGroup(group);
- setTabType(configType);
- getEditArea().setVisible(true);
- }
-
- /**
- * Calculate & return a 2 element integer array that specifies the relative
- * weights of the selection area and the edit area, based on the specified
- * increase in width of the owning shell. The point of this method is calculate
- * sash weights such that when the shell gets wider, all of the increase in width
- * is given to the edit area (tab folder), and the selection area (tree) stays
- * the same width.
- */
- protected int[] calculateNewSashWeights(int widthIncrease) {
- int[] newWeights = new int[2];
- newWeights[0] = getSelectionArea().getBounds().width;
- newWeights[1] = getEditArea().getBounds().width + widthIncrease;
- return newWeights;
- }
-
- /**
- * Increase the size of this dialog's <code>Shell</code> by the specified amounts.
- * Do not increase the size of the Shell beyond the bounds of the Display.
- */
- private void setShellSize(int width, int height) {
- Rectangle bounds = getShell().getDisplay().getBounds();
- getShell().setSize(Math.min(width, bounds.width), Math.min(height, bounds.height));
- }
-
- protected void disposeExistingTabs() {
- setDisposingTabs(true);
- TabItem[] oldTabs = getTabFolder().getItems();
- for (int i = 0; i < oldTabs.length; i++) {
- oldTabs[i].dispose();
- }
- if (getTabGroup() != null) {
- getTabGroup().dispose();
- }
- setTabGroup(null);
- setTabType(null);
- setDisposingTabs(false);
- }
-
- /**
- * Sets the current launch configuration that is being
- * displayed/edited.
- */
- protected void setWorkingCopy(ILaunchConfigurationWorkingCopy workingCopy) {
- fWorkingCopy = workingCopy;
- }
-
- protected boolean isWorkingCopyDirty() {
- ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
- if (workingCopy == null) {
- return false;
- }
-
- // Working copy hasn't been saved
- if (workingCopy.getOriginal() == null) {
- return true;
- }
-
- // Name has changed. Normally, this would be caught in the 'contentsEqual'
- // check below, however there are some circumstances where this fails, such as
- // when the name is invalid
- if (isNameDirty()) {
- return true;
- }
-
- updateWorkingCopyFromPages();
- ILaunchConfiguration original = workingCopy.getOriginal();
- return !original.contentsEqual(workingCopy);
- }
-
- /**
- * Return <code>true</code> if the name has been modified since the last time it was saved.
- */
- protected boolean isNameDirty() {
- String currentName = getNameTextWidget().getText().trim();
- return !currentName.equals(getLastSavedName());
- }
-
- protected void setContext(Object context) {
- fContext = context;
- }
-
- protected Object getContext() {
- return fContext;
- }
-
- protected void setMode(String mode) {
- fMode = mode;
- }
-
- /**
- * @see ILaunchConfigurationDialog#getMode()
- */
- public String getMode() {
- return fMode;
- }
-
- /**
- * Sets the text widget used to display the name
- * of the configuration being displayed/edited
- *
- * @param widget the text widget used to display the name
- * of the configuration being displayed/edited
- */
- private void setNameTextWidget(Text widget) {
- fNameText = widget;
- }
-
- /**
- * Returns the text widget used to display the name
- * of the configuration being displayed/edited
- *
- * @return the text widget used to display the name
- * of the configuration being displayed/edited
- */
- protected Text getNameTextWidget() {
- return fNameText;
- }
-
- /**
- * Sets the 'apply' button.
- *
- * @param button the 'apply' button.
- */
- private void setApplyButton(Button button) {
- fApplyButton = button;
- }
-
- /**
- * Returns the 'apply' button
- *
- * @return the 'apply' button
- */
- protected Button getApplyButton() {
- return fApplyButton;
- }
-
- /**
- * Sets the 'revert' button.
- *
- * @param button the 'revert' button.
- */
- private void setRevertButton(Button button) {
- fRevertButton = button;
- }
-
- /**
- * Returns the 'revert' button
- *
- * @return the 'revert' button
- */
- protected Button getRevertButton() {
- return fRevertButton;
- }
-
- private void setDisposingTabs(boolean disposing) {
- fDisposingTabs = disposing;
- }
-
- private boolean isDisposingTabs() {
- return fDisposingTabs;
- }
-
- /**
- * Sets the tab folder
- *
- * @param folder the tab folder
- */
- private void setTabFolder(TabFolder folder) {
- fTabFolder = folder;
- }
-
- /**
- * Returns the tab folder
- *
- * @return the tab folder
- */
- protected TabFolder getTabFolder() {
- return fTabFolder;
- }
-
- /**
- * Sets the current tab group being displayed
- *
- * @param group the current tab group being displayed
- */
- private void setTabGroup(ILaunchConfigurationTabGroup group) {
- fTabGroup = group;
- }
-
- /**
- * Returns the current tab group
- *
- * @return the current tab group, or <code>null</code> if none
- */
- public ILaunchConfigurationTabGroup getTabGroup() {
- return fTabGroup;
- }
-
- /**
- * @see ILaunchConfigurationDialog#getTabs()
- */
- public ILaunchConfigurationTab[] getTabs() {
- if (getTabGroup() == null) {
- return null;
- } else {
- return getTabGroup().getTabs();
- }
- }
-
- /**
- * @see ILaunchConfigurationListener#launchConfigurationAdded(ILaunchConfiguration)
- */
- public void launchConfigurationAdded(ILaunchConfiguration configuration) {
- setIgnoreSelectionChanges(true);
- try {
- setWorkingCopy(configuration.getWorkingCopy());
- fUnderlyingConfig = configuration;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- getTreeViewer().refresh();
- updateButtons();
- setIgnoreSelectionChanges(false);
- }
-
- /**
- * @see ILaunchConfigurationListener#launchConfigurationChanged(ILaunchConfiguration)
- */
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {
- }
-
- /**
- * @see ILaunchConfigurationListener#launchConfigurationRemoved(ILaunchConfiguration)
- */
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
- getTreeViewer().remove(configuration);
- }
-
- protected void setIgnoreSelectionChanges(boolean ignore) {
- fIgnoreSelectionChanges = ignore;
- }
-
- protected boolean ignoreSelectionChanges() {
- return fIgnoreSelectionChanges;
- }
-
- /**
- * Return whether the current configuration can be discarded. This involves determining
- * if it is dirty, and if it is, asking the user what to do.
- */
- protected boolean canDiscardCurrentConfig() {
- // If there is no working copy, there's no problem, return true
- ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
- if (workingCopy == null) {
- return true;
- }
-
- if (isWorkingCopyDirty()) {
- return showUnsavedChangesDialog();
- } else {
- return true;
- }
- }
-
- /**
- * Show the user a dialog appropriate to whether the unsaved changes in the current config
- * can be saved or not. Return <code>true</code> if the user indicated that they wish to replace
- * the current config, either by saving changes or by discarding the, return <code>false</code>
- * otherwise.
- */
- protected boolean showUnsavedChangesDialog() {
- if (canSaveConfig()) {
- return showSaveChangesDialog();
- } else {
- return showDiscardChangesDialog();
- }
- }
-
- /**
- * Create and return a dialog that asks the user whether they want to save
- * unsaved changes. Return <code>true </code> if they chose to save changes,
- * <code>false</code> otherwise.
- */
- protected boolean showSaveChangesDialog() {
- StringBuffer buffer = new StringBuffer(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.The_configuration___29")); //$NON-NLS-1$
- buffer.append(getLaunchConfiguration().getName());
- buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.__has_unsaved_changes.__Do_you_wish_to_save_them__30")); //$NON-NLS-1$
- MessageDialog dialog = new MessageDialog(getShell(),
- LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Save_changes__31"), //$NON-NLS-1$
- null,
- buffer.toString(),
- MessageDialog.QUESTION,
- new String[] {LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Yes_32"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_33"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cancel_34")}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- 0);
- // If user clicked 'Cancel' or closed dialog, return false
- int selectedButton = dialog.open();
- if ((selectedButton < 0) || (selectedButton == 2)) {
- return false;
- }
-
- // If they hit 'Yes', save the working copy
- if (selectedButton == 0) {
- saveConfig();
- }
-
- return true;
- }
-
- /**
- * Create and return a dialog that asks the user whether they want to discard
- * unsaved changes. Return <code>true</code> if they chose to discard changes,
- * <code>false</code> otherwise.
- */
- protected boolean showDiscardChangesDialog() {
- StringBuffer buffer = new StringBuffer(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.The_configuration___35")); //$NON-NLS-1$
- buffer.append(getNameTextWidget().getText());
- buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.__has_unsaved_changes_that_CANNOT_be_saved_because_of_the_following_error_36")); //$NON-NLS-1$
- buffer.append(fCantSaveErrorMessage);
- buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_discard_changes_37")); //$NON-NLS-1$
- MessageDialog dialog = new MessageDialog(getShell(),
- LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Discard_changes__38"), //$NON-NLS-1$
- null,
- buffer.toString(),
- MessageDialog.QUESTION,
- new String[] {LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Yes_32"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_33")}, //$NON-NLS-1$ //$NON-NLS-2$
- 1);
- // If user clicked 'Yes', return true
- int selectedButton = dialog.open();
- if (selectedButton == 0) {
- return true;
- }
- return false;
- }
-
- /**
- * Return <code>true</code> if the current configuration can be saved, <code>false</code>
- * otherwise. Note this is NOT the same thing as the config simply being valid. It is
- * possible to save a config that does not validate. This method determines whether the
- * config can be saved without causing a serious error. For example, a shared config that
- * has no specified location would cause this method to return <code>false</code>.
- */
- protected boolean canSaveConfig() {
-
- fCantSaveErrorMessage = null;
-
- // First make sure that name doesn't prevent saving the config
- try {
- verifyName();
- } catch (CoreException ce) {
- fCantSaveErrorMessage = ce.getStatus().getMessage();
- return false;
- }
-
- // Next, make sure none of the tabs object to saving the config
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs == null) {
- fCantSaveErrorMessage = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_tabs_found_41"); //$NON-NLS-1$
- return false;
- }
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].canSave()) {
- fCantSaveErrorMessage = tabs[i].getErrorMessage();
- return false;
- }
- }
- return true;
- }
-
- /**
- * Notification the 'New' action has been activated.
- */
- protected void handleNewAction() {
-
- // Take care of any unsaved changes
- if (!canDiscardCurrentConfig()) {
- return;
- }
-
- // The 'New' action should only be enabled if a single config type is selected
- Object selectedElement = getTreeViewerFirstSelectedElement();
- if (!(selectedElement instanceof ILaunchConfigurationType)) {
- return;
- }
-
- // Construct a new config of the selected type and select the result in the tree
- ILaunchConfigurationType configType = (ILaunchConfigurationType) selectedElement;
- constructNewConfig(configType);
- getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
- }
-
- /**
- * Notification the 'Duplicate' action has been activated.
- */
- protected void handleDuplicateAction() {
-
- // Take care of any unsaved changes
- if (!canDiscardCurrentConfig()) {
- return;
- }
-
- // The 'Duplicate' action should only be enabled if a single config is selected
- Object selectedElement = getTreeViewerFirstSelectedElement();
- if (!(selectedElement instanceof ILaunchConfiguration)) {
- return;
- }
-
- // Duplicate the selected config and select the dupe in the tree
- ILaunchConfiguration copyFromConfig = (ILaunchConfiguration) selectedElement;
- String newName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(copyFromConfig.getName());
- try {
- ILaunchConfigurationWorkingCopy newWorkingCopy = copyFromConfig.copy(newName);
- setLaunchConfiguration(newWorkingCopy, false);
- doSave();
- getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- }
-
- /**
- * Create a new configuration of the specified type and select it in the tree.
- */
- protected void doHandleNewConfiguration(ILaunchConfigurationType configType) {
- constructNewConfig(configType);
- getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
- }
-
- /**
- * Make a copy of the specified configuration and select it in the tree.
- */
- protected void doHandleCopyConfiguration(ILaunchConfiguration copyFromConfig) {
- String newName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(copyFromConfig.getName());
- try {
- ILaunchConfigurationWorkingCopy newWorkingCopy = copyFromConfig.copy(newName);
- setLaunchConfiguration(newWorkingCopy, false);
- doSave();
- getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- }
-
- /**
- * If a config type is selected, create a new config of that type initialized to
- * fWorkbenchSelection. If a config is selected, create of new config of the
- * same type as the selected config.
- * protected void constructNewConfig() {
- */
- protected void constructNewConfig(ILaunchConfigurationType configType) {
- try {
- ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(DEFAULT_NEW_CONFIG_NAME));
- setLastSavedName(null);
- setLaunchConfiguration(wc, true);
- doSave();
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_creating_new_launch_configuration_45"), ce); //$NON-NLS-1$ //$NON-NLS-2$
- clearLaunchConfiguration();
- return;
- }
- }
-
- /**
- * Notification the 'Delete' action has been activated
- */
- protected void handleDeleteAction() {
- IStructuredSelection selection = getTreeViewerSelection();
-
- // The 'Delete' button is disabled if the selection contains anything other than configurations (no types)
- ILaunchConfiguration firstSelectedConfig = (ILaunchConfiguration) selection.getFirstElement();
- ILaunchConfigurationType firstSelectedConfigType = null;
- try {
- firstSelectedConfigType = firstSelectedConfig.getType();
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
-
- // Initialize data used to set the selection after deletion
- int typeIndex= -1; // The index of the deleted configuration's type
- int configIndex= -1; // The index of the deleted configuration
- TreeItem[] items= getTreeViewer().getTree().getItems();
- TreeItem typeItem;
- for (int i= 0, numTypes= items.length; i < numTypes; i++) {
- typeItem= items[i];
- if (typeItem.getData() == firstSelectedConfigType) {
- typeIndex= i;
- TreeItem[] configs= typeItem.getItems();
- for (int j= 0, numConfigs= configs.length; j < numConfigs; j++) {
- if (configs[j].getData() == firstSelectedConfig) {
- configIndex= j;
- break;
- }
- }
- }
-
- }
-
- // Make the user confirm the deletion
- String dialogMessage = selection.size() > 1 ? LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configurations__1") : LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configuration__2"); //$NON-NLS-1$ //$NON-NLS-2$
- boolean ok = MessageDialog.openQuestion(this.getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Confirm_Launch_Configuration_Deletion_3"), dialogMessage); //$NON-NLS-1$
- if (!ok) {
- return;
- }
-
-
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- clearLaunchConfiguration();
- Object selectedElement = iterator.next();
- if (selectedElement instanceof ILaunchConfiguration) {
- try {
- ((ILaunchConfiguration)selectedElement).delete();
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- }
- }
-
- IStructuredSelection newSelection= null;
- if (typeIndex != -1 && configIndex != -1) {
- // Reset selection to the next config
- TreeItem[] configItems= getTreeViewer().getTree().getItems()[typeIndex].getItems();
- int numItems= configItems.length;
- if (numItems > configIndex) { // Select the item at the same index as the deleted
- newSelection= new StructuredSelection(configItems[configIndex].getData());
- } else if (numItems > 0) { // Deleted the last item(s). Select the last item
- newSelection= new StructuredSelection(configItems[numItems - 1].getData());
- }
- }
- if (newSelection == null) {
- // Reset selection to the config type of the first selected configuration
- newSelection = new StructuredSelection(firstSelectedConfigType);
- }
- getTreeViewer().setSelection(newSelection);
- }
-
- /**
- * Notification the 'Close' button has been pressed.
- */
- protected void handleClosePressed() {
- if (canDiscardCurrentConfig()) {
- disposeExistingTabs();
- cancelPressed();
- }
- }
-
- /**
- * Notification that the 'Apply' button has been pressed
- */
- protected void handleApplyPressed() {
- saveConfig();
- getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
- }
-
- /**
- * Notification that the 'Revert' button has been pressed
- */
- protected void handleRevertPressed() {
- setLaunchConfiguration(getLaunchConfiguration().getOriginal(), false);
- }
-
- protected void saveConfig() {
- try {
- // trim name
- Text widget = getNameTextWidget();
- widget.setText(widget.getText().trim());
- doSave();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_46"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_saving_launch_configuration_47"), e); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
-
- updateButtons();
- }
-
- /**
- * Notification that a tab has been selected
- *
- * Disallow tab changing when the current tab is invalid.
- * Update the config from the tab being left, and refresh
- * the tab being entered.
- */
- protected void handleTabSelected() {
- if (isDisposingTabs()) {
- return;
- }
- ILaunchConfigurationTab[] tabs = getTabs();
- if (fCurrentTabIndex == getTabFolder().getSelectionIndex() || tabs == null || tabs.length == 0 || fCurrentTabIndex > (tabs.length - 1)) {
- return;
- }
- if (fCurrentTabIndex != -1) {
- ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
- ILaunchConfigurationWorkingCopy wc = getLaunchConfiguration();
- if (wc != null) {
- // apply changes when leaving a tab
- tab.performApply(getLaunchConfiguration());
- // re-initialize a tab when entering it
- getActiveTab().initializeFrom(wc);
- }
- }
- fCurrentTabIndex = getTabFolder().getSelectionIndex();
- refreshStatus();
- }
-
- /**
- * Iterate over the pages to update the working copy
- */
- protected void updateWorkingCopyFromPages() {
- ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
- if (getTabGroup() != null) {
- getTabGroup().performApply(workingCopy);
- }
- }
-
- /**
- * Do the save
- */
- protected void doSave() throws CoreException {
- ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
- updateWorkingCopyFromPages();
- if (isWorkingCopyDirty()) {
- fUnderlyingConfig = workingCopy.doSave();
- setWorkingCopy(fUnderlyingConfig.getWorkingCopy());
- setLastSavedName(fUnderlyingConfig.getName());
- }
- }
-
- /**
- * Notification the 'launch' button has been pressed.
- * Save and launch.
- */
- protected void handleLaunchPressed() {
- int result = CANCEL;
- try {
- doSave();
- result = doLaunch(getLaunchConfiguration());
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_6"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_launching_configuration._See_log_for_more_information_49"), e); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
- if (result == OK) {
- if (fUnderlyingConfig != null) {
- try {
- getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAST_LAUNCH_CONFIGURATION_SELECTION, fUnderlyingConfig.getMemento());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- disposeExistingTabs();
- close();
- } else {
- getShell().setFocus();
- }
- }
-
- /**
- * Save the working copy if necessary, then launch the underlying configuration.
- *
- * @return one of CANCEL or OK
- */
- protected int doLaunch(ILaunchConfiguration config) throws CoreException {
-
- if (!DebugUITools.saveAndBuildBeforeLaunch()) {
- return CANCEL;
- }
-
- // If the configuration is a working copy and is dirty or doesn't yet exist, save it
- if (config instanceof ILaunchConfigurationWorkingCopy) {
- ILaunchConfigurationWorkingCopy workingCopy = (ILaunchConfigurationWorkingCopy) config;
- if (isWorkingCopyDirty() || !workingCopy.exists()) {
- fUnderlyingConfig = workingCopy.doSave();
- }
- }
-
- // liftoff
- ILaunch launch = launchWithProgress();
-
- // If the launch was cancelled, get out. Otherwise, notify the tabs of the successful launch.
- if (cancelButtonPressed()) {
- launch.terminate();
- return CANCEL;
- } else if (launch != null) {
- ILaunchConfigurationTabGroup group = getTabGroup();
- boolean disposeTabs = false;
- if (group == null) {
- // when launching without realizing this dialog, the tabs
- // may not exist - create and then dispose so we can notify them of a launch
- disposeTabs = true;
- group = createGroup(config.getType());
- }
- group.launched(launch);
- if (disposeTabs) {
- group.dispose();
- }
- }
-
- return OK;
- }
-
- /**
- * @return the resulting launch, or <code>null</code> if cancelled.
- * @exception CoreException if an exception occurrs launching
- */
- private ILaunch launchWithProgress() throws CoreException {
- final ILaunch[] launchResult = new ILaunch[1];
- // Do the launch
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- launchResult[0] = fUnderlyingConfig.launch(getMode(), monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- try {
- run(true, true, runnable);
- } catch (InterruptedException e) {
- return null;
- } catch (InvocationTargetException e) {
- Throwable t = e.getTargetException();
- if (t instanceof CoreException) {
- throw (CoreException)t;
- } else {
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, DebugException.INTERNAL_ERROR, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_launching_50"), t); //$NON-NLS-1$
- throw new CoreException(status);
- }
- } finally {
- //remove any "error" launch
- ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches= manager.getLaunches();
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.PixelConverter;
+import org.eclipse.debug.internal.ui.SWTUtil;
+import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.ControlEnableState;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.operation.ModalContext;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.ProgressMonitorPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.model.WorkbenchViewerSorter;
+
+/**
+ * The dialog used to edit and launch launch configurations.
+ */
+public class LaunchConfigurationDialog extends TitleAreaDialog
+ implements ISelectionChangedListener,
+ ILaunchConfigurationListener,
+ ILaunchConfigurationDialog,
+ IDoubleClickListener {
+
+ /**
+ * The tree of launch configurations
+ */
+ private TreeViewer fConfigTree;
+
+ /**
+ * The workbench context present when this dialog is opened.
+ */
+ private Object fContext;
+
+ /**
+ * The IResource corresponding to <code>fContext</code>.
+ */
+ private IResource fResourceContext;
+
+ /**
+ * The mode (run or debug) for this dialog.
+ */
+ private String fMode;
+
+ /**
+ * The Composite used to insert an adjustable 'sash' between the tree and the tabs.
+ */
+ private SashForm fSashForm;
+
+ /**
+ * Default weights for the SashForm that specify how wide the selection and
+ * edit areas aree relative to each other.
+ */
+ private static final int[] DEFAULT_SASH_WEIGHTS = new int[] {11, 30};
+
+ /**
+ * The launch configuration selection area.
+ */
+ private Composite fSelectionArea;
+
+ /**
+ * The launch configuration edit area.
+ */
+ private Composite fEditArea;
+
+ /**
+ * The 'New configuration' action.
+ */
+ private ButtonAction fButtonActionNew;
+
+ /**
+ * The 'Duplicate configuration' action.
+ */
+ private ButtonAction fButtonActionDuplicate;
+
+ /**
+ * The 'Delete configuration' action.
+ */
+ private ButtonAction fButtonActionDelete;
+
+ /**
+ * The 'apply' button
+ */
+ private Button fApplyButton;
+
+ /**
+ * The 'revert' button
+ */
+ private Button fRevertButton;
+
+ /**
+ * The 'cancel' button that appears when the in-dialog progress monitor is shown.
+ */
+ private Button fProgressMonitorCancelButton;
+
+ /**
+ * Flag indicating if the progress monitor part's Cancel button has been pressed.
+ */
+ private boolean fCancelButtonPressed;
+
+ /**
+ * The text widget displaying the name of the
+ * launch configuration under edit
+ */
+ private Text fNameText;
+
+ private String fLastSavedName = null;
+
+ /**
+ * Container for the edit area <code>TabFolder</code>
+ */
+ private Composite fTabComposite;
+
+ /**
+ * The tab folder that contains tabs for the selected configuration
+ */
+ private TabFolder fTabFolder;
+
+ /**
+ * Flag that indicates when the tabs are being disposed.
+ */
+ private boolean fDisposingTabs = false;
+
+ /**
+ * The current (working copy) launch configuration
+ * being displayed/edited or <code>null</code> if
+ * none
+ */
+ private ILaunchConfigurationWorkingCopy fWorkingCopy;
+
+ /**
+ * The actual (non-working copy) launch configuration that underlies the current working copy
+ */
+ private ILaunchConfiguration fUnderlyingConfig;
+
+ /**
+ * Clients of this dialog may set an 'initial configuration type', which means that when
+ * the dialog is opened, a configuration of that type will be created, initialized, and
+ * saved. Note that the initial config type is ignored if single-click launching is enabled.
+ */
+ private ILaunchConfigurationType fInitialConfigType;
+
+ /**
+ * When this dialog is opened in <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code>
+ * mode, this specifies the selection that is initially shown in the dialog.
+ */
+ private IStructuredSelection fInitialSelection;
+
+ /**
+ * The current tab group being displayed
+ */
+ private ILaunchConfigurationTabGroup fTabGroup;
+
+ /**
+ * The type of config tabs are currently displayed
+ * for
+ */
+ private ILaunchConfigurationType fTabType;
+
+ /**
+ * The index of the currently selected tab
+ */
+ private int fCurrentTabIndex;
+
+ private ProgressMonitorPart fProgressMonitorPart;
+ private Cursor waitCursor;
+ private Cursor arrowCursor;
+ private MessageDialog fWindowClosingDialog;
+
+ /**
+ * Whether initlialing tabs
+ */
+ private boolean fInitializingTabs = false;
+
+ /**
+ * Indicates if selection changes in the tree should be ignored
+ */
+ private boolean fIgnoreSelectionChanges = false;
+
+ /**
+ * Previously selected element in the tree
+ */
+ private Object fSelectedTreeObject;
+
+ /**
+ * The number of 'long-running' operations currently taking place in this dialog
+ */
+ private long fActiveRunningOperations = 0;
+
+ /**
+ * Id for 'Launch' button.
+ */
+ protected static final int ID_LAUNCH_BUTTON = IDialogConstants.CLIENT_ID + 1;
+
+ /**
+ * Id for 'Close' button.
+ */
+ protected static final int ID_CLOSE_BUTTON = IDialogConstants.CLIENT_ID + 2;
+
+ /**
+ * Id for 'Cancel' button.
+ */
+ protected static final int ID_CANCEL_BUTTON = IDialogConstants.CLIENT_ID + 3;
+
+ /**
+ * Constrant String used as key for setting and retrieving current Control with focus
+ */
+ private static final String FOCUS_CONTROL = "focusControl";//$NON-NLS-1$
+
+ /**
+ * The height in pixels of this dialog's progress indicator
+ */
+ private static int PROGRESS_INDICATOR_HEIGHT = 18;
+
+ /**
+ * Constant specifying how wide this dialog is allowed to get (as a percentage of
+ * total available screen width) as a result of tab labels in the edit area.
+ */
+ private static final float MAX_DIALOG_WIDTH_PERCENT = 0.75f;
+
+ /**
+ * Empty array
+ */
+ protected static final Object[] EMPTY_ARRAY = new Object[0];
+
+ protected static final String DEFAULT_NEW_CONFIG_NAME = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.New_configuration_1"); //$NON-NLS-1$
+
+ /**
+ * Size of this dialog if there is no preference specifying a size.
+ */
+ protected static final Point DEFAULT_INITIAL_DIALOG_SIZE = new Point(620, 560);
+
+ /**
+ * Status area messages
+ */
+ protected static final String LAUNCH_STATUS_OK_MESSAGE = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ready_to_launch_2"); //$NON-NLS-1$
+ protected static final String LAUNCH_STATUS_STARTING_FROM_SCRATCH_MESSAGE
+ = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Select_a_configuration_to_launch_or_a_config_type_to_create_a_new_configuration_3"); //$NON-NLS-1$
+
+ private String fCantSaveErrorMessage;
+
+ /**
+ * Constant specifying that the launch configuration dialog should not actually open,
+ * but instead should attempt to re-launch the last configuration that was sucessfully
+ * launched in the workspace. If there is no last launched configuration, just open the dialog.
+ */
+ public static final int LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST = 0;
+
+ /**
+ * Constant specifying that this dialog should be opened with a new configuration of a type
+ * specified via <code>setInitialConfigType()</code> selected.
+ */
+ public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_NEW_CONFIG_OF_TYPE = 1;
+
+ /**
+ * Constant specifying that this dialog should be opened with the last configuration launched
+ * in the workspace selected.
+ */
+ public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED = 2;
+
+ /**
+ * Constant specifying that this dialog should be opened with the value specified via
+ * <code>setInitialSelection()</code> selected.
+ */
+ public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION = 3;
+
+ /**
+ * Specifies how this dialog behaves when opened. Value is one of the
+ * 'LAUNCH_CONFIGURATION_DIALOG' constants defined in this class.
+ */
+ private int fOpenMode = LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST;
+
+ /**
+ * Constructs a new launch configuration dialog on the given
+ * parent shell.
+ *
+ * @param shell the parent shell
+ * @param selection the selection used to initialize this dialog, typically the
+ * current workbench selection
+ * @param mode one of <code>ILaunchManager.RUN_MODE</code> or
+ * <code>ILaunchManager.DEBUG_MODE</code>
+ */
+ public LaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
+ super(shell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setContext(resolveContext(selection));
+ setMode(mode);
+ }
+
+ /**
+ * Set the flag indicating how this dialog behaves when the <code>open()</code> method is called.
+ * Valid values are defined by the LAUNCH_CONFIGURATION_DIALOG... constants in this class.
+ */
+ public void setOpenMode(int mode) {
+ fOpenMode = mode;
+ }
+
+ protected int getOpenMode() {
+ return fOpenMode;
+ }
+
+ /**
+ * Returns the Object to be used as context for this dialog, derived from the specified selection.
+ * If the specified selection has as its first element an IFile whose extension matches
+ * <code>ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION</code>, then return
+ * the launch configuration declared in the IFile. Otherwise, return the first element
+ * in the specified selection.
+ */
+ protected Object resolveContext(IStructuredSelection selection) {
+
+ // Empty selection means no context
+ if ((selection == null) || (selection.isEmpty())) {
+ return null;
+ }
+
+ // If first element is a launch config file, create a launch configuration from it
+ // and make this the context, otherwise just return the first element
+ Object firstSelected = selection.getFirstElement();
+ if (firstSelected instanceof IFile) {
+ IFile file = (IFile) firstSelected;
+ if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) {
+ return getLaunchManager().getLaunchConfiguration(file);
+ }
+ }
+ return firstSelected;
+ }
+
+ /**
+ * A launch configuration dialog overrides this method
+ * to create a custom set of buttons in the button bar.
+ * This dialog has 'Launch' and 'Cancel'
+ * buttons.
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
+ createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Close_1"), false); //$NON-NLS-1$
+ }
+
+ /**
+ * Handle the 'save and launch' & 'launch' buttons here, all others are handled
+ * in <code>Dialog</code>
+ *
+ * @see Dialog#buttonPressed(int)
+ */
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == ID_LAUNCH_BUTTON) {
+ handleLaunchPressed();
+ } else if (buttonId == ID_CLOSE_BUTTON) {
+ handleClosePressed();
+ } else {
+ super.buttonPressed(buttonId);
+ }
+ }
+
+ /**
+ * Returns the appropriate text for the launch button - run or debug.
+ */
+ protected String getLaunchButtonText() {
+ if (getMode() == ILaunchManager.DEBUG_MODE) {
+ return LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Deb&ug_4"); //$NON-NLS-1$
+ } else {
+ return LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.R&un_5"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @see Dialog#createContents(Composite)
+ */
+ protected Control createContents(Composite parent) {
+ Control contents = super.createContents(parent);
+ initializeBounds();
+ initializeSashForm();
+ createContextMenu(getTreeViewer().getControl());
+ getLaunchManager().addLaunchConfigurationListener(this);
+ ensureSelectionAreaWidth();
+ doInitialTreeSelection();
+ return contents;
+ }
+
+ /**
+ * Initialize the relative weights (widths) of the 2 sides of the sash.
+ */
+ protected void initializeSashForm() {
+ int[] sashWeights = DEFAULT_SASH_WEIGHTS;
+ String sashWeightString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SASH_WEIGHTS);
+ if (sashWeightString.length() > 0) {
+ Point sashWeightPoint = parseCoordinates(sashWeightString);
+ if (sashWeightPoint != null) {
+ sashWeights[0] = sashWeightPoint.x;
+ sashWeights[1] = sashWeightPoint.y;
+ }
+ }
+ getSashForm().setWeights(sashWeights);
+ }
+
+ /**
+ * Check if the selection area is currently wide enough so that both the 'New' &
+ * 'Delete' buttons are shown without truncation. If so, do nothing. Otherwise,
+ * increase the width of this dialog's Shell just enough so that both buttons
+ * are shown cleanly.
+ */
+ protected void ensureSelectionAreaWidth() {
+ Button newButton = getButtonActionNew().getButton();
+ Button deleteButton = getButtonActionDelete().getButton();
+ int requiredWidth = newButton.getBounds().width + deleteButton.getBounds().width;
+ int marginWidth = ((GridLayout)getSelectionArea().getLayout()).marginWidth;
+ int horizontalSpacing = ((GridLayout)getSelectionArea().getLayout()).horizontalSpacing;
+ requiredWidth += (2 * marginWidth) + horizontalSpacing;
+ int currentWidth = getSelectionArea().getBounds().width;
+
+ if (requiredWidth > currentWidth) {
+ int[] newSashWeights = new int[2];
+ newSashWeights[0] = requiredWidth;
+ newSashWeights[1] = getEditArea().getBounds().width;
+ Shell shell= getShell();
+ Point shellSize= shell.getSize();
+ setShellSize(shellSize.x + (requiredWidth - currentWidth), shellSize.y);
+ getSashForm().setWeights(newSashWeights);
+ }
+ }
+
+ /**
+ * Creates a pop-up menu on the specified control.
+ */
+ protected void createContextMenu(Control menuControl) {
+ MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager mgr) {
+ fillContextMenu(mgr);
+ }
+ });
+ Menu menu= menuMgr.createContextMenu(menuControl);
+ menuControl.setMenu(menu);
+ }
+
+ /**
+ * Fill the specified context menu with the basic launch configuration
+ * management actions - New, Duplicate & Delete.
+ */
+ protected void fillContextMenu(IMenuManager menu) {
+ if (getButtonActionNew().isEnabled()) {
+ menu.add(getButtonActionNew());
+ }
+ if (getButtonActionDuplicate().isEnabled()) {
+ menu.add(getButtonActionDuplicate());
+ }
+ if (getButtonActionDelete().isEnabled()) {
+ menu.add(getButtonActionDelete());
+ }
+ }
+
+ /**
+ * Set the initial selection in the tree.
+ */
+ protected void doInitialTreeSelection() {
+ getTreeViewer().setSelection(getInitialSelection());
+ }
+
+ /**
+ * Write out this dialog's Shell size, location & sash weights to the preference store.
+ */
+ protected void persistShellGeometry() {
+ Point shellLocation = getShell().getLocation();
+ Point shellSize = getShell().getSize();
+ int[] sashWeights = getSashForm().getWeights();
+ String locationString = serializeCoords(shellLocation);
+ String sizeString = serializeCoords(shellSize);
+ String sashWeightString = serializeCoords(new Point(sashWeights[0], sashWeights[1]));
+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_LOCATION, locationString);
+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SIZE, sizeString);
+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SASH_WEIGHTS, sashWeightString);
+ }
+
+ /**
+ * @see Window#close()
+ */
+ public boolean close() {
+ getLaunchManager().removeLaunchConfigurationListener(this);
+ persistShellGeometry();
+ return super.close();
+ }
+
+ /**
+ * Determine the first configuration for this dialog. If single-click launching is
+ * enabled, launch the configuration WITHOUT realizing the dialog. If single-click
+ * launching was successful, this method returns
+ * <code>ILaunchConfigurationDialog.SINGLE_CLICK_LAUNCHED</code>. Otherwise, open the
+ * dialog in the specified mode.
+ *
+ * @see Window#open()
+ */
+ public int open() {
+ int mode = getOpenMode();
+ if (mode == LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST) {
+ return doLastLaunchedConfig(true);
+ } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED) {
+ return doLastLaunchedConfig(false);
+ } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_NEW_CONFIG_OF_TYPE) {
+ return openDialogOnNewConfigOfSpecifiedType();
+ } else if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION) {
+ return openDialogOnSelection();
+ }
+ return super.open();
+ }
+
+ /**
+ * Retrieve the last launched configuration in the workspace. If <code>launch</code>
+ * is <code>true</code>, launch this configuration without showing the dialog, otherwise
+ * just set the initial selection in the dialog to the last launched configuration.
+ */
+ protected int doLastLaunchedConfig(boolean launch) {
+ ILaunchConfiguration lastLaunchedConfig = getLastLaunchedWorkbenchConfiguration();
+ if (launch) {
+ try {
+ if (lastLaunchedConfig != null) {
+ if (lastLaunchedConfig.supportsMode(getMode())) {
+ fUnderlyingConfig = lastLaunchedConfig;
+ doLaunch(lastLaunchedConfig);
+ } else {
+ // If we're trying to launch, but the last launched config doesn't
+ // support the current mode of the dialog, show an error dialog
+ String configName = lastLaunchedConfig.getName();
+ String title = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cannot_relaunch_1"); //$NON-NLS-1$
+ String message = MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cannot_relaunch_[{1}]_because_it_does_not_support_{2}_mode_2"), new String[] {configName, getMode()}); //$NON-NLS-1$
+ MessageDialog.openError(getShell(), title, message);
+ }
+ return ILaunchConfigurationDialog.LAUNCHED_BEFORE_OPENING;
+ }
+ } catch(CoreException e) {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_6"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_processing_launch_configuration._See_log_for_more_information_7"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ if (lastLaunchedConfig != null) {
+ setInitialSelection(new StructuredSelection(lastLaunchedConfig));
+ }
+ return super.open();
+ }
+
+ /**
+ * Realize this dialog so that a new configuration of the type that was specified via
+ * <code>setInitialConfigType()</code> is selected.
+ */
+ protected int openDialogOnNewConfigOfSpecifiedType() {
+ ILaunchConfigurationType configType = getInitialConfigType();
+ ILaunchConfiguration config = null;
+ if (configType != null) {
+ config = createConfigOfType(configType);
+ }
+ if (config != null) {
+ setInitialSelection(new StructuredSelection(config));
+ }
+ return super.open();
+ }
+
+ /**
+ * Open this dialog with the selection set to the value specified by
+ * <code>setInitialSelection()</code>.
+ */
+ protected int openDialogOnSelection() {
+ // Nothing special is required, the dialog will open and whatever was specified
+ // via setInitialSelection() will be selected in the tree
+ return super.open();
+ }
+
+ /**
+ * Return the last launched configuration in the workspace.
+ */
+ protected ILaunchConfiguration getLastLaunchedWorkbenchConfiguration() {
+ LaunchConfigurationHistoryElement historyElement = DebugUIPlugin.getLaunchConfigurationManager().getLastLaunch();
+ if (historyElement != null) {
+ return historyElement.getLaunchConfiguration();
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ GridData gd;
+ Composite dialogComp = (Composite)super.createDialogArea(parent);
+ Composite topComp = new Composite(dialogComp, SWT.NONE);
+ gd = new GridData(GridData.FILL_BOTH);
+ topComp.setLayoutData(gd);
+ GridLayout topLayout = new GridLayout();
+ topLayout.numColumns = 2;
+ topLayout.marginHeight = 5;
+ topLayout.marginWidth = 0;
+ topComp.setLayout(topLayout);
+
+ // Set the things that TitleAreaDialog takes care of
+ setTitle(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Create,_manage,_and_run_launch_configurations_8")); //$NON-NLS-1$
+ setMessage(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ready_to_launch_2")); //$NON-NLS-1$
+ setModeLabelState();
+
+ // Create the SashForm that contains the selection area on the left,
+ // and the edit area on the right
+ setSashForm(new SashForm(topComp, SWT.NONE));
+ getSashForm().setOrientation(SWT.HORIZONTAL);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ getSashForm().setLayoutData(gd);
+
+ // Build the launch configuration selection area and put it into the composite.
+ Composite launchConfigSelectionArea = createLaunchConfigurationSelectionArea(getSashForm());
+ gd = new GridData(GridData.FILL_VERTICAL);
+ launchConfigSelectionArea.setLayoutData(gd);
+
+ // Build the launch configuration edit area and put it into the composite.
+ Composite editAreaComp = createLaunchConfigurationEditArea(getSashForm());
+ gd = new GridData(GridData.FILL_BOTH);
+ editAreaComp.setLayoutData(gd);
+
+ // Build the separator line that demarcates the button bar
+ Label separator = new Label(topComp, SWT.HORIZONTAL | SWT.SEPARATOR);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ separator.setLayoutData(gd);
+
+ dialogComp.layout(true);
+
+ return dialogComp;
+ }
+
+ /**
+ * Create and return a launch configuration of the specified type.
+ * This method is intended to be called before the UI has been realized, such as in
+ * the case of single-click launching or creating a config for an initial configuration
+ * type.
+ */
+ protected ILaunchConfiguration createConfigOfType(ILaunchConfigurationType configType) {
+ ILaunchConfigurationWorkingCopy workingCopy = null;
+ try {
+ workingCopy = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(DEFAULT_NEW_CONFIG_NAME));
+ } catch (CoreException ce) {
+ DebugUIPlugin.log(ce);
+ return null;
+ }
+
+ ILaunchConfiguration config = null;
+ try {
+ ILaunchConfigurationTabGroup group= createGroup(configType);
+ group.setDefaults(workingCopy);
+ group.dispose();
+
+ // Assign a name to the config if it doesn't already have one
+ if (workingCopy.getName().trim().length() == 0) {
+ IResource res = getResourceContext();
+ String name = ""; //$NON-NLS-1$
+ if (res != null) {
+ name = res.getName();
+ }
+ name = generateName(name);
+ workingCopy.rename(name);
+ }
+
+ config = workingCopy.doSave();
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ return null;
+ }
+
+ return config;
+ }
+
+ /**
+ * Returns tab group for the given type of launch configuration.
+ * Tabs are initialized to be contained in this dialog.
+ *
+ * @exception CoreException if unable to instantiate a tab group
+ */
+ protected ILaunchConfigurationTabGroup createGroup(final ILaunchConfigurationType configType) throws CoreException {
+ // Use a final Object array to store the tab group and any exception that
+ // results from the Runnable
+ final Object[] finalArray = new Object[2];
+ Runnable runnable = new Runnable() {
+ public void run() {
+ ILaunchConfigurationTabGroup tabGroup = null;
+ try {
+ tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(configType);
+ finalArray[0] = tabGroup;
+ } catch (CoreException ce) {
+ finalArray[1] = ce;
+ return;
+ }
+ tabGroup.createTabs(LaunchConfigurationDialog.this, getMode());
+ ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
+ for (int i = 0; i < tabs.length; i++) {
+ tabs[i].setLaunchConfigurationDialog(LaunchConfigurationDialog.this);
+ }
+ }
+ };
+
+ // Creating the tabs can result in plugin loading, so we show the busy cursor
+ BusyIndicator.showWhile(getDisplay(), runnable);
+
+ // Re-throw any CoreException if there was one
+ if (finalArray[1] != null) {
+ throw (CoreException)finalArray[1];
+ }
+
+ // Otherwise return the tab group
+ return (ILaunchConfigurationTabGroup)finalArray[0];
+ }
+
+ /**
+ * Returns the selected IResource context from the workbench,
+ * or <code>null</code> if there was no context in the workbench.
+ */
+ protected IResource getResourceContext() {
+ if (fResourceContext == null) {
+ Object workbenchSelection = getContext();
+ if (workbenchSelection instanceof IResource) {
+ fResourceContext = (IResource)workbenchSelection;
+ } else if (workbenchSelection instanceof IAdaptable) {
+ fResourceContext = (IResource) ((IAdaptable)workbenchSelection).getAdapter(IResource.class);
+ }
+ }
+ return fResourceContext;
+ }
+
+ /**
+ * Set the title area image based on the mode this dialog was initialized with
+ */
+ protected void setModeLabelState() {
+ Image image;
+ if (getMode().equals(ILaunchManager.DEBUG_MODE)) {
+ image = DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_DEBUG);
+ } else {
+ image = DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_RUN);
+ }
+ setTitleImage(image);
+ }
+
+ /**
+ * Convenience method to set the selection on the configuration tree.
+ */
+ protected void setTreeViewerSelection(ISelection selection) {
+ getTreeViewer().setSelection(selection);
+ }
+
+ private void setLastSavedName(String lastSavedName) {
+ this.fLastSavedName = lastSavedName;
+ }
+
+ private String getLastSavedName() {
+ return fLastSavedName;
+ }
+
+ /**
+ * Update buttons and message.
+ */
+ protected void refreshStatus() {
+ updateButtons();
+ updateMessage();
+ }
+
+ /**
+ * Verify the attributes common to all launch configuration.
+ * Indicate failure by throwing a <code>CoreException</code>.
+ */
+ protected void verifyStandardAttributes() throws CoreException {
+ verifyName();
+ }
+
+ /**
+ * Verify that the launch configuration name is valid.
+ */
+ protected void verifyName() throws CoreException {
+ String currentName = getNameTextWidget().getText().trim();
+
+ // If there is no name, complain
+ if (currentName.length() < 1) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ DebugUIPlugin.getUniqueIdentifier(),
+ 0,
+ LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Name_required_for_launch_configuration_11"), //$NON-NLS-1$
+ null));
+ }
+
+ // If the name hasn't changed from the last saved name, do nothing
+ if (currentName.equals(getLastSavedName())) {
+ return;
+ }
+
+ // See if name contains any 'illegal' characters
+ IStatus status = ResourcesPlugin.getWorkspace().validateName(currentName, IResource.FILE);
+ if (status.getCode() != IStatus.OK) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
+ 0,
+ status.getMessage(),
+ null));
+ }
+
+ // Otherwise, if there's already a config with the same name, complain
+ if (getLaunchManager().isExistingLaunchConfigurationName(currentName)) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
+ 0,
+ LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_configuration_already_exists_with_this_name_12"), //$NON-NLS-1$
+ null));
+ }
+ }
+
+ /**
+ * If the name is valid, rename the current launch configuration. Otherwise, show an
+ * appropriate error message.
+ */
+ protected void updateConfigFromName() {
+ if (getLaunchConfiguration() != null) {
+ try {
+ verifyName();
+ } catch (CoreException ce) {
+ refreshStatus();
+ return;
+ }
+
+ getLaunchConfiguration().rename(getNameTextWidget().getText().trim());
+ refreshStatus();
+ }
+ }
+
+ protected Display getDisplay() {
+ Shell shell = getShell();
+ if (shell != null) {
+ return shell.getDisplay();
+ } else {
+ return Display.getDefault();
+ }
+ }
+
+ /**
+ * Creates the launch configuration selection area of the dialog.
+ * This area displays a tree of launch configurations that the user
+ * may select, and allows users to create new configurations, and
+ * delete and duplicate existing configurations.
+ *
+ * @return the composite used for launch configuration selection area
+ */
+ protected Composite createLaunchConfigurationSelectionArea(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ setSelectionArea(comp);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ layout.marginHeight = 0;
+ layout.marginWidth = 5;
+ comp.setLayout(layout);
+
+ Label treeLabel = new Label(comp, SWT.NONE);
+ treeLabel.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Con&figurations__1")); //$NON-NLS-1$
+ GridData gd = new GridData();
+ gd.horizontalSpan = 3;
+ treeLabel.setLayoutData(gd);
+
+ TreeViewer tree = new TreeViewer(comp);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 3;
+ // Set width hint to 0 to force tree to only be as wide as the combined
+ // width of the 'New' & 'Delete' buttons. Otherwise tree wants to be much wider.
+ gd.widthHint = 0;
+ tree.getControl().setLayoutData(gd);
+ tree.setContentProvider(new LaunchConfigurationContentProvider());
+ tree.setLabelProvider(DebugUITools.newDebugModelPresentation());
+ tree.setSorter(new WorkbenchViewerSorter());
+ setTreeViewer(tree);
+ tree.addSelectionChangedListener(this);
+ tree.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ tree.expandAll();
+ tree.addDoubleClickListener(this);
+ tree.getControl().addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ handleTreeViewerKeyPressed(e);
+ }
+ });
+
+ Button newButton = SWTUtil.createPushButton(comp, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Ne&w_13"), null); //$NON-NLS-1$
+ setButtonActionNew(new ButtonActionNew(newButton.getText(), newButton));
+
+ Button deleteButton = SWTUtil.createPushButton(comp, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Dele&te_14"), null); //$NON-NLS-1$
+ setButtonActionDelete(new ButtonActionDelete(deleteButton.getText(), deleteButton));
+
+ setButtonActionDuplicate(new ButtonActionDuplicate(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Duplicate_1"), null)); //$NON-NLS-1$
+
+ return comp;
+ }
+
+ /**
+ * Creates the launch configuration edit area of the dialog.
+ * This area displays the name of the launch configuration
+ * currently being edited, as well as a tab folder of tabs
+ * that are applicable to the launch configuration.
+ *
+ * @return the composite used for launch configuration editing
+ */
+ protected Composite createLaunchConfigurationEditArea(Composite parent) {
+ Composite outerComp = new Composite(parent, SWT.NONE);
+ GridLayout outerCompLayout = new GridLayout();
+ outerCompLayout.numColumns = 1;
+ outerCompLayout.marginHeight = 0;
+ outerCompLayout.marginWidth = 0;
+ outerComp.setLayout(outerCompLayout);
+
+ Composite comp = new Composite(outerComp, SWT.NONE);
+ setEditArea(comp);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginWidth = 5;
+ comp.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ comp.setLayoutData(gd);
+
+ Label nameLabel = new Label(comp, SWT.HORIZONTAL | SWT.LEFT);
+ nameLabel.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.&Name__16")); //$NON-NLS-1$
+ gd = new GridData(GridData.BEGINNING);
+ nameLabel.setLayoutData(gd);
+
+ Text nameText = new Text(comp, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ nameText.setLayoutData(gd);
+ setNameTextWidget(nameText);
+
+ getNameTextWidget().addModifyListener(
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateConfigFromName();
+ }
+ }
+ );
+
+ Label spacer = new Label(comp, SWT.NONE);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ spacer.setLayoutData(gd);
+
+ fTabComposite = new Composite(comp, SWT.NONE);
+ GridLayout outerTabCompositeLayout = new GridLayout();
+ outerTabCompositeLayout.marginHeight = 0;
+ outerTabCompositeLayout.marginWidth = 0;
+ fTabComposite.setLayout(outerTabCompositeLayout);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ fTabComposite.setLayoutData(gd);
+
+ TabFolder tabFolder = new TabFolder(fTabComposite, SWT.NONE);
+ setTabFolder(tabFolder);
+ gd = new GridData(GridData.FILL_BOTH);
+ tabFolder.setLayoutData(gd);
+ getTabFolder().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ handleTabSelected();
+ }
+ });
+
+ Composite buttonComp = new Composite(comp, SWT.NONE);
+ GridLayout buttonCompLayout = new GridLayout();
+ buttonCompLayout.numColumns = 2;
+ buttonComp.setLayout(buttonCompLayout);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gd.horizontalSpan = 2;
+ buttonComp.setLayoutData(gd);
+
+ setApplyButton(new Button(buttonComp, SWT.PUSH));
+ getApplyButton().setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.&Apply_17")); //$NON-NLS-1$
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ getApplyButton().setLayoutData(gd);
+ SWTUtil.setButtonDimensionHint(getApplyButton());
+ getApplyButton().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ handleApplyPressed();
+ }
+ });
+
+ setRevertButton(new Button(buttonComp, SWT.PUSH));
+ getRevertButton().setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Revert_2")); //$NON-NLS-1$
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ getRevertButton().setLayoutData(gd);
+ SWTUtil.setButtonDimensionHint(getRevertButton());
+ getRevertButton().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ handleRevertPressed();
+ }
+ });
+
+ return outerComp;
+ }
+
+ /**
+ * @see Dialog#createButtonBar(Composite)
+ */
+ protected Control createButtonBar(Composite parent) {
+ Composite composite= new Composite(parent, SWT.NULL);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ GridLayout pmLayout = new GridLayout();
+ pmLayout.numColumns = 3;
+ setProgressMonitorPart(new ProgressMonitorPart(composite, pmLayout, PROGRESS_INDICATOR_HEIGHT));
+ Button cancelButton = createButton(getProgressMonitorPart(), ID_CANCEL_BUTTON, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cancel_3"), true); //$NON-NLS-1$
+ setProgressMonitorCancelButton(cancelButton);
+ getProgressMonitorCancelButton().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ setCancelButtonPressed(true);
+ }
+ });
+ getProgressMonitorPart().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ getProgressMonitorPart().setVisible(false);
+
+ return super.createButtonBar(composite);
+ }
+
+ /**
+ * Sets the title for the dialog, and establishes the help context.
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(Shell);
+ */
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configurations_18")); //$NON-NLS-1$
+ WorkbenchHelp.setHelp(
+ shell,
+ IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG);
+ }
+
+ /**
+ * @see Window#getInitialLocation(Point)
+ */
+ protected Point getInitialLocation(Point initialSize) {
+ String locationString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_LOCATION);
+ if (locationString.length() > 0) {
+ Point locationPoint = parseCoordinates(locationString);
+ if (locationPoint != null) {
+ return locationPoint;
+ }
+ }
+ return super.getInitialLocation(initialSize);
+ }
+
+ /**
+ * @see Window#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ String sizeString = getPreferenceStore().getString(IDebugPreferenceConstants.PREF_LAUNCH_CONFIGURATION_DIALOG_SIZE);
+ if (sizeString.length() > 0) {
+ Point sizePoint = parseCoordinates(sizeString);
+ if (sizePoint != null) {
+ return sizePoint;
+ }
+ }
+ return DEFAULT_INITIAL_DIALOG_SIZE;
+ }
+
+ /**
+ * Given a coordinate String of the form "123x456" return a Point object whose
+ * X value is 123 and Y value is 456. Return <code>null</code> if the String
+ * is not in the specified form.
+ */
+ protected Point parseCoordinates(String coordString) {
+ int byIndex = coordString.indexOf('x');
+ if (byIndex < 0) {
+ return null;
+ }
+
+ try {
+ int x = Integer.parseInt(coordString.substring(0, byIndex));
+ int y = Integer.parseInt(coordString.substring(byIndex + 1));
+ return new Point(x, y);
+ } catch (NumberFormatException nfe) {
+ return null;
+ }
+ }
+
+ /**
+ * Given a Point object, return a String of the form "XCoordxYCoord".
+ */
+ protected String serializeCoords(Point coords) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(coords.x);
+ buffer.append('x');
+ buffer.append(coords.y);
+ return buffer.toString();
+ }
+
+ private void setSashForm(SashForm sashForm) {
+ fSashForm = sashForm;
+ }
+
+ protected SashForm getSashForm() {
+ return fSashForm;
+ }
+
+ /**
+ * Sets the tree viewer used to display launch configurations.
+ *
+ * @param viewer the tree viewer used to display launch
+ * configurations
+ */
+ private void setTreeViewer(TreeViewer viewer) {
+ fConfigTree = viewer;
+ }
+
+ /**
+ * Returns the tree viewer used to display launch configurations.
+ *
+ * @param the tree viewer used to display launch configurations
+ */
+ protected TreeViewer getTreeViewer() {
+ return fConfigTree;
+ }
+
+ protected IStructuredSelection getTreeViewerSelection() {
+ return (IStructuredSelection)getTreeViewer().getSelection();
+ }
+
+ protected Object getTreeViewerFirstSelectedElement() {
+ IStructuredSelection selection = getTreeViewerSelection();
+ if (selection == null) {
+ return null;
+ }
+ return selection.getFirstElement();
+ }
+
+ /**
+ * Content provider for launch configuration tree.
+ */
+ class LaunchConfigurationContentProvider implements ITreeContentProvider {
+
+ /**
+ * Actual launch configurations have no children. Launch configuration types have
+ * all configurations of that type as children, minus any configurations that are
+ * marked as private.
+ *
+ * @see ITreeContentProvider#getChildren(Object)
+ */
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof ILaunchConfiguration) {
+ return EMPTY_ARRAY;
+ } else if (parentElement instanceof ILaunchConfigurationType) {
+ try {
+ ILaunchConfigurationType type = (ILaunchConfigurationType)parentElement;
+ ILaunchConfiguration[] allConfigs = getLaunchManager().getLaunchConfigurations(type);
+ ArrayList filteredConfigs = new ArrayList(allConfigs.length);
+ for (int i = 0; i < allConfigs.length; i++) {
+ ILaunchConfiguration config = allConfigs[i];
+ if (config.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false)) {
+ continue;
+ }
+ filteredConfigs.add(config);
+ }
+ return filteredConfigs.toArray();
+ } catch (CoreException e) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else {
+ return getLaunchManager().getLaunchConfigurationTypes();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ /**
+ * @see ITreeContentProvider#getParent(Object)
+ */
+ public Object getParent(Object element) {
+ if (element instanceof ILaunchConfiguration) {
+ if (!((ILaunchConfiguration)element).exists()) {
+ return null;
+ }
+ try {
+ return ((ILaunchConfiguration)element).getType();
+ } catch (CoreException e) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else if (element instanceof ILaunchConfigurationType) {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+ return null;
+ }
+
+ /**
+ * @see ITreeContentProvider#hasChildren(Object)
+ */
+ public boolean hasChildren(Object element) {
+ if (element instanceof ILaunchConfiguration) {
+ return false;
+ } else {
+ return getChildren(element).length > 0;
+ }
+ }
+
+ /**
+ * Return only the launch configuration types that support the current mode AND
+ * are marked as 'public'.
+ *
+ * @see IStructuredContentProvider#getElements(Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ ILaunchConfigurationType[] allTypes = getLaunchManager().getLaunchConfigurationTypes();
+ ArrayList list = new ArrayList(allTypes.length);
+ String mode = getMode();
+ for (int i = 0; i < allTypes.length; i++) {
+ ILaunchConfigurationType configType = allTypes[i];
+ if (configType.supportsMode(mode) && configType.isPublic()) {
+ list.add(configType);
+ }
+ }
+ return list.toArray();
+ }
+
+ /**
+ * @see IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /**
+ * @see IContentProvider#inputChanged(Viewer, Object, Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ /**
+ * Returns the launch manager.
+ *
+ * @return the launch manager
+ */
+ protected ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ /**
+ * Returns whether this dialog is currently open
+ */
+ protected boolean isVisible() {
+ return getTreeViewer() != null;
+ }
+
+ /**
+ * Notification that selection has changed in the launch configuration tree.
+ * <p>
+ * If the currently displayed configuration is not saved,
+ * prompt for saving before moving on to the new selection.
+ * </p>
+ *
+ * @param event selection changed event
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+
+ // Ignore selectionChange events that occur while saving
+ if (ignoreSelectionChanges()) {
+ return;
+ }
+
+ // Get the new selection
+ IStructuredSelection selection = (IStructuredSelection)event.getSelection();
+ if (selection.isEmpty()) {
+ getEditArea().setVisible(false);
+ setWorkingCopy(null);
+ setSelectedTreeObject(null);
+ setDefaultMessage();
+ updateButtons();
+ return;
+ }
+
+ // Get details of the new selection
+ Object firstSelectedElement = selection.getFirstElement();
+ boolean singleSelection = selection.size() == 1;
+ boolean configSelected = firstSelectedElement instanceof ILaunchConfiguration;
+
+ // If selection is the same, don't bother
+ Object lastSelectedTreeObj = getSelectedTreeObject();
+ if (singleSelection && (lastSelectedTreeObj != null) && lastSelectedTreeObj.equals(firstSelectedElement)) {
+ getEditArea().setVisible(lastSelectedTreeObj instanceof ILaunchConfiguration);
+ return;
+ }
+
+ // Take care of any unsaved changes. If the user aborts, reset selection
+ // to whatever it was previously selected
+ boolean canReplaceConfig = canDiscardCurrentConfig();
+ if (!canReplaceConfig) {
+ StructuredSelection prevSelection;
+ if (lastSelectedTreeObj == null) {
+ prevSelection = StructuredSelection.EMPTY;
+ } else {
+ prevSelection = new StructuredSelection(lastSelectedTreeObj);
+ }
+ setTreeViewerSelection(prevSelection);
+ return;
+ }
+
+ // If a config is selected, update the edit area for it, if a config type is
+ // selected, clear the edit area
+ if (singleSelection && configSelected) {
+ ILaunchConfiguration config = (ILaunchConfiguration) firstSelectedElement;
+ setLastSavedName(config.getName());
+ setLaunchConfiguration(config, false);
+ } else if (singleSelection && firstSelectedElement instanceof ILaunchConfigurationType) {
+ if (canReplaceConfig) {
+ clearLaunchConfiguration();
+ getEditArea().setVisible(false);
+ disposeExistingTabs();
+ }
+ } else {
+ // multi-selection
+ clearLaunchConfiguration();
+ getEditArea().setVisible(false);
+ }
+
+ updateButtons();
+ if (singleSelection) {
+ setSelectedTreeObject(firstSelectedElement);
+ } else {
+ setSelectedTreeObject(null);
+ }
+ }
+
+ protected void setProgressMonitorPart(ProgressMonitorPart part) {
+ fProgressMonitorPart = part;
+ }
+
+ protected ProgressMonitorPart getProgressMonitorPart() {
+ return fProgressMonitorPart;
+ }
+
+ protected void setProgressMonitorCancelButton(Button button) {
+ fProgressMonitorCancelButton = button;
+ }
+
+ protected Button getProgressMonitorCancelButton() {
+ return fProgressMonitorCancelButton;
+ }
+
+ /**
+ * Sets the configuration to display/edit.
+ * Updates the tab folder to contain the appropriate pages.
+ * Sets all configuration-related state appropriately.
+ *
+ * @param config the launch configuration to display/edit
+ * @param init whether to initialize the config with default values
+ */
+ protected void setLaunchConfiguration(ILaunchConfiguration config, boolean init) {
+ try {
+
+ // turn on initializing flag to ignore message updates
+ setInitializingTabs(true);
+
+ getEditArea().setVisible(true);
+ showTabsForConfigType(config.getType());
+
+ if (config.isWorkingCopy()) {
+ setWorkingCopy((ILaunchConfigurationWorkingCopy)config);
+ } else {
+ setWorkingCopy(config.getWorkingCopy());
+ }
+ fUnderlyingConfig = getLaunchConfiguration().getOriginal();
+
+ // update the name field before to avoid verify error
+ getNameTextWidget().setText(config.getName());
+
+ // Set the defaults for all tabs before any are initialized
+ // so that every tab can see ALL the default values
+ if (init) {
+ getTabGroup().setDefaults(getLaunchConfiguration());
+ }
+
+ // update the tabs with the new working copy
+ getTabGroup().initializeFrom(getLaunchConfiguration());
+
+ // update the name field after in case client changed it
+ getNameTextWidget().setText(config.getName());
+
+ // turn off initializing flag to update message
+ setInitializingTabs(false);
+
+ refreshStatus();
+
+ } catch (CoreException ce) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_setting_launch_configuration_24"), ce); //$NON-NLS-1$ //$NON-NLS-2$
+ clearLaunchConfiguration();
+ return;
+ }
+ }
+
+ /**
+ * Clears the configuration being shown/edited.
+ * Resets all configuration-related state.
+ */
+ protected void clearLaunchConfiguration() {
+ setWorkingCopy(null);
+ fUnderlyingConfig = null;
+ setLastSavedName(null);
+ getNameTextWidget().setText(""); //$NON-NLS-1$
+ refreshStatus();
+ }
+
+ /**
+ * Populate the tabs in the configuration edit area to be appropriate to the current
+ * launch configuration type.
+ */
+ protected void showTabsForConfigType(ILaunchConfigurationType configType) {
+
+ // Don't do any work if the current tabs are for the current config type
+ if (getTabType() != null && getTabType().equals(configType)) {
+ return;
+ }
+
+ // Avoid flicker
+ getEditArea().setVisible(false);
+
+ // Dispose the current tabs
+ disposeExistingTabs();
+
+ // Build the new tabs
+ ILaunchConfigurationTabGroup group = null;
+ try {
+ group = createGroup(configType);
+ } catch (CoreException ce) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_creating_launch_configuration_tabs_27"),ce); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+
+ // Create the Control for each tab, and determine the maximum tab dimensions
+ PixelConverter pixelConverter = new PixelConverter(getTabFolder());
+ int runningTabWidth = 0;
+ ILaunchConfigurationTab[] tabs = group.getTabs();
+ Point contentSize = new Point(0, 0);
+ for (int i = 0; i < tabs.length; i++) {
+ TabItem tab = new TabItem(getTabFolder(), SWT.NONE);
+ String name = tabs[i].getName();
+ if (name == null) {
+ name = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.unspecified_28"); //$NON-NLS-1$
+ }
+ tab.setText(name);
+ Image image = tabs[i].getImage();
+ tab.setImage(image);
+ runningTabWidth += pixelConverter.convertWidthInCharsToPixels(name.length() + 5);
+ if (image != null) {
+ runningTabWidth += image.getBounds().width;
+ }
+ tabs[i].createControl(tab.getParent());
+ Control control = tabs[i].getControl();
+ if (control != null) {
+ tab.setControl(control);
+ Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ if (size.x > contentSize.x) {
+ contentSize.x = size.x;
+ }
+ if (size.y > contentSize.y) {
+ contentSize.y = size.y;
+ }
+ }
+ }
+
+ // Determine if more space is needed to show all tab labels across the top of the
+ // tab folder. If so, only increase size of dialog to some percent of the available
+ // screen real estate.
+ if (runningTabWidth > contentSize.x) {
+ int maxAllowedWidth = (int) (getDisplay().getBounds().width * MAX_DIALOG_WIDTH_PERCENT);
+ int otherWidth = getSashForm().SASH_WIDTH + getSelectionArea().getBounds().width;
+ int totalWidth = runningTabWidth + otherWidth;
+ if (totalWidth > maxAllowedWidth) {
+ contentSize.x = maxAllowedWidth - otherWidth;
+ } else {
+ contentSize.x = runningTabWidth;
+ }
+ }
+
+ // Adjust the maximum tab dimensions to account for the extra space required for the tab labels
+ Rectangle tabFolderBoundingBox = getTabFolder().computeTrim(0, 0, contentSize.x, contentSize.y);
+ contentSize.x = tabFolderBoundingBox.width;
+ contentSize.y = tabFolderBoundingBox.height;
+
+ // Force recalculation of sizes
+ getTabFolder().layout(true);
+
+ // Calculate difference between required space for tab folder and current size,
+ // then increase size of this dialog's Shell by that amount
+ Rectangle rect = fTabComposite.getClientArea();
+ Point containerSize= new Point(rect.width, rect.height);
+ int hdiff= contentSize.x - containerSize.x;
+ int vdiff= contentSize.y - containerSize.y;
+ // Only increase size of dialog, never shrink it
+ if (hdiff > 0 || vdiff > 0) {
+ int[] newSashWeights = null;
+ if (hdiff > 0) {
+ newSashWeights = calculateNewSashWeights(hdiff);
+ }
+ hdiff= Math.max(0, hdiff);
+ vdiff= Math.max(0, vdiff);
+ Shell shell= getShell();
+ Point shellSize= shell.getSize();
+ setShellSize(shellSize.x + hdiff, shellSize.y + vdiff);
+ // Adjust the sash weights so that all of the increase in width
+ // is given to the tab area
+ if (newSashWeights != null) {
+ getSashForm().setWeights(newSashWeights);
+ }
+ }
+
+ setTabGroup(group);
+ setTabType(configType);
+ getEditArea().setVisible(true);
+ }
+
+ /**
+ * Calculate & return a 2 element integer array that specifies the relative
+ * weights of the selection area and the edit area, based on the specified
+ * increase in width of the owning shell. The point of this method is calculate
+ * sash weights such that when the shell gets wider, all of the increase in width
+ * is given to the edit area (tab folder), and the selection area (tree) stays
+ * the same width.
+ */
+ protected int[] calculateNewSashWeights(int widthIncrease) {
+ int[] newWeights = new int[2];
+ newWeights[0] = getSelectionArea().getBounds().width;
+ newWeights[1] = getEditArea().getBounds().width + widthIncrease;
+ return newWeights;
+ }
+
+ /**
+ * Increase the size of this dialog's <code>Shell</code> by the specified amounts.
+ * Do not increase the size of the Shell beyond the bounds of the Display.
+ */
+ private void setShellSize(int width, int height) {
+ Rectangle bounds = getShell().getDisplay().getBounds();
+ getShell().setSize(Math.min(width, bounds.width), Math.min(height, bounds.height));
+ }
+
+ protected void disposeExistingTabs() {
+ setDisposingTabs(true);
+ TabItem[] oldTabs = getTabFolder().getItems();
+ for (int i = 0; i < oldTabs.length; i++) {
+ oldTabs[i].dispose();
+ }
+ if (getTabGroup() != null) {
+ getTabGroup().dispose();
+ }
+ setTabGroup(null);
+ setTabType(null);
+ setDisposingTabs(false);
+ }
+
+ /**
+ * Sets the current launch configuration that is being
+ * displayed/edited.
+ */
+ protected void setWorkingCopy(ILaunchConfigurationWorkingCopy workingCopy) {
+ fWorkingCopy = workingCopy;
+ }
+
+ protected boolean isWorkingCopyDirty() {
+ ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
+ if (workingCopy == null) {
+ return false;
+ }
+
+ // Working copy hasn't been saved
+ if (workingCopy.getOriginal() == null) {
+ return true;
+ }
+
+ // Name has changed. Normally, this would be caught in the 'contentsEqual'
+ // check below, however there are some circumstances where this fails, such as
+ // when the name is invalid
+ if (isNameDirty()) {
+ return true;
+ }
+
+ updateWorkingCopyFromPages();
+ ILaunchConfiguration original = workingCopy.getOriginal();
+ return !original.contentsEqual(workingCopy);
+ }
+
+ /**
+ * Return <code>true</code> if the name has been modified since the last time it was saved.
+ */
+ protected boolean isNameDirty() {
+ String currentName = getNameTextWidget().getText().trim();
+ return !currentName.equals(getLastSavedName());
+ }
+
+ protected void setContext(Object context) {
+ fContext = context;
+ }
+
+ protected Object getContext() {
+ return fContext;
+ }
+
+ protected void setMode(String mode) {
+ fMode = mode;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#getMode()
+ */
+ public String getMode() {
+ return fMode;
+ }
+
+ /**
+ * Sets the text widget used to display the name
+ * of the configuration being displayed/edited
+ *
+ * @param widget the text widget used to display the name
+ * of the configuration being displayed/edited
+ */
+ private void setNameTextWidget(Text widget) {
+ fNameText = widget;
+ }
+
+ /**
+ * Returns the text widget used to display the name
+ * of the configuration being displayed/edited
+ *
+ * @return the text widget used to display the name
+ * of the configuration being displayed/edited
+ */
+ protected Text getNameTextWidget() {
+ return fNameText;
+ }
+
+ /**
+ * Sets the 'apply' button.
+ *
+ * @param button the 'apply' button.
+ */
+ private void setApplyButton(Button button) {
+ fApplyButton = button;
+ }
+
+ /**
+ * Returns the 'apply' button
+ *
+ * @return the 'apply' button
+ */
+ protected Button getApplyButton() {
+ return fApplyButton;
+ }
+
+ /**
+ * Sets the 'revert' button.
+ *
+ * @param button the 'revert' button.
+ */
+ private void setRevertButton(Button button) {
+ fRevertButton = button;
+ }
+
+ /**
+ * Returns the 'revert' button
+ *
+ * @return the 'revert' button
+ */
+ protected Button getRevertButton() {
+ return fRevertButton;
+ }
+
+ private void setDisposingTabs(boolean disposing) {
+ fDisposingTabs = disposing;
+ }
+
+ private boolean isDisposingTabs() {
+ return fDisposingTabs;
+ }
+
+ /**
+ * Sets the tab folder
+ *
+ * @param folder the tab folder
+ */
+ private void setTabFolder(TabFolder folder) {
+ fTabFolder = folder;
+ }
+
+ /**
+ * Returns the tab folder
+ *
+ * @return the tab folder
+ */
+ protected TabFolder getTabFolder() {
+ return fTabFolder;
+ }
+
+ /**
+ * Sets the current tab group being displayed
+ *
+ * @param group the current tab group being displayed
+ */
+ private void setTabGroup(ILaunchConfigurationTabGroup group) {
+ fTabGroup = group;
+ }
+
+ /**
+ * Returns the current tab group
+ *
+ * @return the current tab group, or <code>null</code> if none
+ */
+ public ILaunchConfigurationTabGroup getTabGroup() {
+ return fTabGroup;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#getTabs()
+ */
+ public ILaunchConfigurationTab[] getTabs() {
+ if (getTabGroup() == null) {
+ return null;
+ } else {
+ return getTabGroup().getTabs();
+ }
+ }
+
+ /**
+ * @see ILaunchConfigurationListener#launchConfigurationAdded(ILaunchConfiguration)
+ */
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {
+ setIgnoreSelectionChanges(true);
+ try {
+ setWorkingCopy(configuration.getWorkingCopy());
+ fUnderlyingConfig = configuration;
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ getTreeViewer().refresh();
+ updateButtons();
+ setIgnoreSelectionChanges(false);
+ }
+
+ /**
+ * @see ILaunchConfigurationListener#launchConfigurationChanged(ILaunchConfiguration)
+ */
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ }
+
+ /**
+ * @see ILaunchConfigurationListener#launchConfigurationRemoved(ILaunchConfiguration)
+ */
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ getTreeViewer().remove(configuration);
+ }
+
+ protected void setIgnoreSelectionChanges(boolean ignore) {
+ fIgnoreSelectionChanges = ignore;
+ }
+
+ protected boolean ignoreSelectionChanges() {
+ return fIgnoreSelectionChanges;
+ }
+
+ /**
+ * Return whether the current configuration can be discarded. This involves determining
+ * if it is dirty, and if it is, asking the user what to do.
+ */
+ protected boolean canDiscardCurrentConfig() {
+ // If there is no working copy, there's no problem, return true
+ ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
+ if (workingCopy == null) {
+ return true;
+ }
+
+ if (isWorkingCopyDirty()) {
+ return showUnsavedChangesDialog();
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Show the user a dialog appropriate to whether the unsaved changes in the current config
+ * can be saved or not. Return <code>true</code> if the user indicated that they wish to replace
+ * the current config, either by saving changes or by discarding the, return <code>false</code>
+ * otherwise.
+ */
+ protected boolean showUnsavedChangesDialog() {
+ if (canSaveConfig()) {
+ return showSaveChangesDialog();
+ } else {
+ return showDiscardChangesDialog();
+ }
+ }
+
+ /**
+ * Create and return a dialog that asks the user whether they want to save
+ * unsaved changes. Return <code>true </code> if they chose to save changes,
+ * <code>false</code> otherwise.
+ */
+ protected boolean showSaveChangesDialog() {
+ StringBuffer buffer = new StringBuffer(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.The_configuration___29")); //$NON-NLS-1$
+ buffer.append(getLaunchConfiguration().getName());
+ buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.__has_unsaved_changes.__Do_you_wish_to_save_them__30")); //$NON-NLS-1$
+ MessageDialog dialog = new MessageDialog(getShell(),
+ LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Save_changes__31"), //$NON-NLS-1$
+ null,
+ buffer.toString(),
+ MessageDialog.QUESTION,
+ new String[] {LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Yes_32"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_33"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Cancel_34")}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ 0);
+ // If user clicked 'Cancel' or closed dialog, return false
+ int selectedButton = dialog.open();
+ if ((selectedButton < 0) || (selectedButton == 2)) {
+ return false;
+ }
+
+ // If they hit 'Yes', save the working copy
+ if (selectedButton == 0) {
+ saveConfig();
+ }
+
+ return true;
+ }
+
+ /**
+ * Create and return a dialog that asks the user whether they want to discard
+ * unsaved changes. Return <code>true</code> if they chose to discard changes,
+ * <code>false</code> otherwise.
+ */
+ protected boolean showDiscardChangesDialog() {
+ StringBuffer buffer = new StringBuffer(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.The_configuration___35")); //$NON-NLS-1$
+ buffer.append(getNameTextWidget().getText());
+ buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.__has_unsaved_changes_that_CANNOT_be_saved_because_of_the_following_error_36")); //$NON-NLS-1$
+ buffer.append(fCantSaveErrorMessage);
+ buffer.append(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_discard_changes_37")); //$NON-NLS-1$
+ MessageDialog dialog = new MessageDialog(getShell(),
+ LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Discard_changes__38"), //$NON-NLS-1$
+ null,
+ buffer.toString(),
+ MessageDialog.QUESTION,
+ new String[] {LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Yes_32"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_33")}, //$NON-NLS-1$ //$NON-NLS-2$
+ 1);
+ // If user clicked 'Yes', return true
+ int selectedButton = dialog.open();
+ if (selectedButton == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return <code>true</code> if the current configuration can be saved, <code>false</code>
+ * otherwise. Note this is NOT the same thing as the config simply being valid. It is
+ * possible to save a config that does not validate. This method determines whether the
+ * config can be saved without causing a serious error. For example, a shared config that
+ * has no specified location would cause this method to return <code>false</code>.
+ */
+ protected boolean canSaveConfig() {
+
+ fCantSaveErrorMessage = null;
+
+ // First make sure that name doesn't prevent saving the config
+ try {
+ verifyName();
+ } catch (CoreException ce) {
+ fCantSaveErrorMessage = ce.getStatus().getMessage();
+ return false;
+ }
+
+ // Next, make sure none of the tabs object to saving the config
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (tabs == null) {
+ fCantSaveErrorMessage = LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.No_tabs_found_41"); //$NON-NLS-1$
+ return false;
+ }
+ for (int i = 0; i < tabs.length; i++) {
+ if (!tabs[i].canSave()) {
+ fCantSaveErrorMessage = tabs[i].getErrorMessage();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Notification the 'New' action has been activated.
+ */
+ protected void handleNewAction() {
+
+ // Take care of any unsaved changes
+ if (!canDiscardCurrentConfig()) {
+ return;
+ }
+
+ // The 'New' action should only be enabled if a single config type is selected
+ Object selectedElement = getTreeViewerFirstSelectedElement();
+ if (!(selectedElement instanceof ILaunchConfigurationType)) {
+ return;
+ }
+
+ // Construct a new config of the selected type and select the result in the tree
+ ILaunchConfigurationType configType = (ILaunchConfigurationType) selectedElement;
+ constructNewConfig(configType);
+ getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
+ }
+
+ /**
+ * Notification the 'Duplicate' action has been activated.
+ */
+ protected void handleDuplicateAction() {
+
+ // Take care of any unsaved changes
+ if (!canDiscardCurrentConfig()) {
+ return;
+ }
+
+ // The 'Duplicate' action should only be enabled if a single config is selected
+ Object selectedElement = getTreeViewerFirstSelectedElement();
+ if (!(selectedElement instanceof ILaunchConfiguration)) {
+ return;
+ }
+
+ // Duplicate the selected config and select the dupe in the tree
+ ILaunchConfiguration copyFromConfig = (ILaunchConfiguration) selectedElement;
+ String newName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(copyFromConfig.getName());
+ try {
+ ILaunchConfigurationWorkingCopy newWorkingCopy = copyFromConfig.copy(newName);
+ setLaunchConfiguration(newWorkingCopy, false);
+ doSave();
+ getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
+ } catch (CoreException ce) {
+ DebugUIPlugin.log(ce);
+ }
+ }
+
+ /**
+ * Create a new configuration of the specified type and select it in the tree.
+ */
+ protected void doHandleNewConfiguration(ILaunchConfigurationType configType) {
+ constructNewConfig(configType);
+ getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
+ }
+
+ /**
+ * Make a copy of the specified configuration and select it in the tree.
+ */
+ protected void doHandleCopyConfiguration(ILaunchConfiguration copyFromConfig) {
+ String newName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(copyFromConfig.getName());
+ try {
+ ILaunchConfigurationWorkingCopy newWorkingCopy = copyFromConfig.copy(newName);
+ setLaunchConfiguration(newWorkingCopy, false);
+ doSave();
+ getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
+ } catch (CoreException ce) {
+ DebugUIPlugin.log(ce);
+ }
+ }
+
+ /**
+ * If a config type is selected, create a new config of that type initialized to
+ * fWorkbenchSelection. If a config is selected, create of new config of the
+ * same type as the selected config.
+ * protected void constructNewConfig() {
+ */
+ protected void constructNewConfig(ILaunchConfigurationType configType) {
+ try {
+ ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(DEFAULT_NEW_CONFIG_NAME));
+ setLastSavedName(null);
+ setLaunchConfiguration(wc, true);
+ doSave();
+ } catch (CoreException ce) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Error_19"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_creating_new_launch_configuration_45"), ce); //$NON-NLS-1$ //$NON-NLS-2$
+ clearLaunchConfiguration();
+ return;
+ }
+ }
+
+ /**
+ * Notification the 'Delete' action has been activated
+ */
+ protected void handleDeleteAction() {
+ IStructuredSelection selection = getTreeViewerSelection();
+
+ // The 'Delete' button is disabled if the selection contains anything other than configurations (no types)
+ ILaunchConfiguration firstSelectedConfig = (ILaunchConfiguration) selection.getFirstElement();
+ ILaunchConfigurationType firstSelectedConfigType = null;
+ try {
+ firstSelectedConfigType = firstSelectedConfig.getType();
+ } catch (CoreException ce) {
+ DebugUIPlugin.log(ce);
+ }
+
+ // Initialize data used to set the selection after deletion
+ int typeIndex= -1; // The index of the deleted configuration's type
+ int configIndex= -1; // The index of the deleted configuration
+ TreeItem[] items= getTreeViewer().getTree().getItems();
+ TreeItem typeItem;
+ for (int i= 0, numTypes= items.length; i < numTypes; i++) {
+ typeItem= items[i];
+ if (typeItem.getData() == firstSelectedConfigType) {
+ typeIndex= i;
+ TreeItem[] configs= typeItem.getItems();
+ for (int j= 0, numConfigs= configs.length; j < numConfigs; j++) {
+ if (configs[j].getData() == firstSelectedConfig) {
+ configIndex= j;
+ break;
+ }
+ }
+ }
+
+ }
+
+ // Make the user confirm the deletion
+ String dialogMessage = selection.size() > 1 ? LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configurations__1") : LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configuration__2"); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean ok = MessageDialog.openQuestion(this.getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Confirm_Launch_Configuration_Deletion_3"), dialogMessage); //$NON-NLS-1$
+ if (!ok) {
+ return;
+ }
+
+
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ clearLaunchConfiguration();
+ Object selectedElement = iterator.next();
+ if (selectedElement instanceof ILaunchConfiguration) {
+ try {
+ ((ILaunchConfiguration)selectedElement).delete();
+ } catch (CoreException ce) {
+ DebugUIPlugin.log(ce);
+ }
+ }
+ }
+
+ IStructuredSelection newSelection= null;
+ if (typeIndex != -1 && configIndex != -1) {
+ // Reset selection to the next config
+ TreeItem[] configItems= getTreeViewer().getTree().getItems()[typeIndex].getItems();
+ int numItems= configItems.length;
+ if (numItems > configIndex) { // Select the item at the same index as the deleted
+ newSelection= new StructuredSelection(configItems[configIndex].getData());
+ } else if (numItems > 0) { // Deleted the last item(s). Select the last item
+ newSelection= new StructuredSelection(configItems[numItems - 1].getData());
+ }
+ }
+ if (newSelection == null) {
+ // Reset selection to the config type of the first selected configuration
+ newSelection = new StructuredSelection(firstSelectedConfigType);
+ }
+ getTreeViewer().setSelection(newSelection);
+ }
+
+ /**
+ * Notification the 'Close' button has been pressed.
+ */
+ protected void handleClosePressed() {
+ if (canDiscardCurrentConfig()) {
+ disposeExistingTabs();
+ cancelPressed();
+ }
+ }
+
+ /**
+ * Notification that the 'Apply' button has been pressed
+ */
+ protected void handleApplyPressed() {
+ saveConfig();
+ getTreeViewer().setSelection(new StructuredSelection(fUnderlyingConfig));
+ }
+
+ /**
+ * Notification that the 'Revert' button has been pressed
+ */
+ protected void handleRevertPressed() {
+ setLaunchConfiguration(getLaunchConfiguration().getOriginal(), false);
+ }
+
+ protected void saveConfig() {
+ try {
+ // trim name
+ Text widget = getNameTextWidget();
+ widget.setText(widget.getText().trim());
+ doSave();
+ } catch (CoreException e) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_46"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_saving_launch_configuration_47"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+
+ updateButtons();
+ }
+
+ /**
+ * Notification that a tab has been selected
+ *
+ * Disallow tab changing when the current tab is invalid.
+ * Update the config from the tab being left, and refresh
+ * the tab being entered.
+ */
+ protected void handleTabSelected() {
+ if (isDisposingTabs()) {
+ return;
+ }
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (fCurrentTabIndex == getTabFolder().getSelectionIndex() || tabs == null || tabs.length == 0 || fCurrentTabIndex > (tabs.length - 1)) {
+ return;
+ }
+ if (fCurrentTabIndex != -1) {
+ ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
+ ILaunchConfigurationWorkingCopy wc = getLaunchConfiguration();
+ if (wc != null) {
+ // apply changes when leaving a tab
+ tab.performApply(getLaunchConfiguration());
+ // re-initialize a tab when entering it
+ getActiveTab().initializeFrom(wc);
+ }
+ }
+ fCurrentTabIndex = getTabFolder().getSelectionIndex();
+ refreshStatus();
+ }
+
+ /**
+ * Iterate over the pages to update the working copy
+ */
+ protected void updateWorkingCopyFromPages() {
+ ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
+ if (getTabGroup() != null) {
+ getTabGroup().performApply(workingCopy);
+ }
+ }
+
+ /**
+ * Do the save
+ */
+ protected void doSave() throws CoreException {
+ ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfiguration();
+ updateWorkingCopyFromPages();
+ if (isWorkingCopyDirty()) {
+ fUnderlyingConfig = workingCopy.doSave();
+ setWorkingCopy(fUnderlyingConfig.getWorkingCopy());
+ setLastSavedName(fUnderlyingConfig.getName());
+ }
+ }
+
+ /**
+ * Notification the 'launch' button has been pressed.
+ * Save and launch.
+ */
+ protected void handleLaunchPressed() {
+ int result = CANCEL;
+ try {
+ doSave();
+ result = doLaunch(getLaunchConfiguration());
+ } catch (CoreException e) {
+ DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_6"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_launching_configuration._See_log_for_more_information_49"), e); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ if (result == OK) {
+ if (fUnderlyingConfig != null) {
+ try {
+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_LAST_LAUNCH_CONFIGURATION_SELECTION, fUnderlyingConfig.getMemento());
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ disposeExistingTabs();
+ close();
+ } else {
+ getShell().setFocus();
+ }
+ }
+
+ /**
+ * Save the working copy if necessary, then launch the underlying configuration.
+ *
+ * @return one of CANCEL or OK
+ */
+ protected int doLaunch(ILaunchConfiguration config) throws CoreException {
+
+ if (!DebugUITools.saveAndBuildBeforeLaunch()) {
+ return CANCEL;
+ }
+
+ // If the configuration is a working copy and is dirty or doesn't yet exist, save it
+ if (config instanceof ILaunchConfigurationWorkingCopy) {
+ ILaunchConfigurationWorkingCopy workingCopy = (ILaunchConfigurationWorkingCopy) config;
+ if (isWorkingCopyDirty() || !workingCopy.exists()) {
+ fUnderlyingConfig = workingCopy.doSave();
+ }
+ }
+
+ // liftoff
+ ILaunch launch = launchWithProgress();
+
+ // If the launch was cancelled, get out. Otherwise, notify the tabs of the successful launch.
+ if (cancelButtonPressed()) {
+ launch.terminate();
+ return CANCEL;
+ } else if (launch != null) {
+ ILaunchConfigurationTabGroup group = getTabGroup();
+ boolean disposeTabs = false;
+ if (group == null) {
+ // when launching without realizing this dialog, the tabs
+ // may not exist - create and then dispose so we can notify them of a launch
+ disposeTabs = true;
+ group = createGroup(config.getType());
+ }
+ group.launched(launch);
+ if (disposeTabs) {
+ group.dispose();
+ }
+ }
+
+ return OK;
+ }
+
+ /**
+ * @return the resulting launch, or <code>null</code> if cancelled.
+ * @exception CoreException if an exception occurrs launching
+ */
+ private ILaunch launchWithProgress() throws CoreException {
+ final ILaunch[] launchResult = new ILaunch[1];
+ // Do the launch
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ launchResult[0] = fUnderlyingConfig.launch(getMode(), monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ };
+ try {
+ run(true, true, runnable);
+ } catch (InterruptedException e) {
+ return null;
+ } catch (InvocationTargetException e) {
+ Throwable t = e.getTargetException();
+ if (t instanceof CoreException) {
+ throw (CoreException)t;
+ } else {
+ IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, DebugException.INTERNAL_ERROR, LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_launching_50"), t); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ } finally {
+ //remove any "error" launch
+ ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager();
+ ILaunch[] launches= manager.getLaunches();
for (int i = 0; i < launches.length; i++) {
ILaunch iLaunch = launches[i];
- if (!iLaunch.hasChildren()) {
- manager.removeLaunch(iLaunch);
+ if (!iLaunch.hasChildren()) {
+ manager.removeLaunch(iLaunch);
+ }
+ }
+ }
+
+ return launchResult[0];
+ }
+
+ protected IPreferenceStore getPreferenceStore() {
+ return DebugUIPlugin.getDefault().getPreferenceStore();
+ }
+
+ /***************************************************************************************
+ *
+ * ProgressMonitor & IRunnableContext related methods
+ *
+ ***************************************************************************************/
+
+ /**
+ * @see IRunnableContext#run(boolean, boolean, IRunnableWithProgress)
+ */
+ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
+ if (isVisible()) {
+ // The operation can only be canceled if it is executed in a separate thread.
+ // Otherwise the UI is blocked anyway.
+ Object state = aboutToStart();
+ fActiveRunningOperations++;
+ try {
+ ModalContext.run(runnable, fork, fProgressMonitorPart, getShell().getDisplay());
+ } finally {
+ fActiveRunningOperations--;
+ stopped(state);
+ }
+ } else {
+ ProgressMonitorDialog dialog = new ProgressMonitorDialog(DebugUIPlugin.getShell());
+ dialog.run(fork, cancelable, runnable);
+ }
+ }
+
+ /**
+ * About to start a long running operation triggered through
+ * the dialog. Shows the progress monitor and disables the dialog's
+ * buttons and controls.
+ *
+ * @return the saved UI state
+ */
+ private Object aboutToStart() {
+ Map savedState = null;
+ if (getShell() != null) {
+ // Save focus control
+ Control focusControl = getShell().getDisplay().getFocusControl();
+ if (focusControl != null && focusControl.getShell() != getShell()) {
+ focusControl = null;
+ }
+
+ // Set the busy cursor to all shells.
+ Display d = getShell().getDisplay();
+ waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
+ setDisplayCursor(waitCursor);
+
+ // Set the arrow cursor to the cancel component.
+ arrowCursor= new Cursor(d, SWT.CURSOR_ARROW);
+ getProgressMonitorCancelButton().setCursor(arrowCursor);
+
+ // Deactivate shell
+ savedState = saveUIState();
+ if (focusControl != null) {
+ savedState.put(FOCUS_CONTROL, focusControl);
+ }
+
+ // Attach the progress monitor part to the cancel button
+ getProgressMonitorCancelButton().setEnabled(true);
+ setCancelButtonPressed(false);
+ getProgressMonitorPart().attachToCancelComponent(getProgressMonitorCancelButton());
+ getProgressMonitorPart().setVisible(true);
+ getProgressMonitorCancelButton().setFocus();
+ }
+ return savedState;
+ }
+
+ /**
+ * A long running operation triggered through the dialog
+ * was stopped either by user input or by normal end.
+ * Hides the progress monitor and restores the enable state
+ * of the dialog's buttons and controls.
+ *
+ * @param savedState the saved UI state as returned by <code>aboutToStart</code>
+ * @see #aboutToStart
+ */
+ private void stopped(Object savedState) {
+ if (getShell() != null) {
+ getProgressMonitorPart().setVisible(false);
+ getProgressMonitorPart().removeFromCancelComponent(getProgressMonitorCancelButton());
+ Map state = (Map)savedState;
+ restoreUIState(state);
+
+ setDisplayCursor(null);
+ waitCursor.dispose();
+ waitCursor = null;
+ arrowCursor.dispose();
+ arrowCursor = null;
+ Control focusControl = (Control)state.get(FOCUS_CONTROL);
+ if (focusControl != null) {
+ focusControl.setFocus();
+ }
+ }
+ }
+
+ /**
+ * Captures and returns the enabled/disabled state of the wizard dialog's
+ * buttons and the tree of controls for the currently showing page. All
+ * these controls are disabled in the process, with the possible excepton of
+ * the Cancel button.
+ *
+ * @return a map containing the saved state suitable for restoring later
+ * with <code>restoreUIState</code>
+ * @see #restoreUIState
+ */
+ private Map saveUIState() {
+ Map savedState= new HashMap(10);
+ saveEnableStateAndSet(getButtonActionNew().getButton(), savedState, "new", false);//$NON-NLS-1$
+ saveEnableStateAndSet(getButtonActionDelete().getButton(), savedState, "delete", false);//$NON-NLS-1$
+ saveEnableStateAndSet(getApplyButton(), savedState, "apply", false);//$NON-NLS-1$
+ saveEnableStateAndSet(getRevertButton(), savedState, "revert", false);//$NON-NLS-1$
+ saveEnableStateAndSet(getButton(ID_LAUNCH_BUTTON), savedState, "launch", false);//$NON-NLS-1$
+ saveEnableStateAndSet(getButton(ID_CLOSE_BUTTON), savedState, "close", false);//$NON-NLS-1$
+ savedState.put("editarea", ControlEnableState.disable(getEditArea()));//$NON-NLS-1$
+ savedState.put("tree", ControlEnableState.disable(getTreeViewer().getControl()));//$NON-NLS-1$
+ return savedState;
+ }
+
+ /**
+ * Saves the enabled/disabled state of the given control in the
+ * given map, which must be modifiable.
+ *
+ * @param w the control, or <code>null</code> if none
+ * @param h the map (key type: <code>String</code>, element type:
+ * <code>Boolean</code>)
+ * @param key the key
+ * @param enabled <code>true</code> to enable the control,
+ * and <code>false</code> to disable it
+ * @see #restoreEnableStateAndSet
+ */
+ private void saveEnableStateAndSet(Control w, Map h, String key, boolean enabled) {
+ if (w != null) {
+ h.put(key, new Boolean(w.isEnabled()));
+ w.setEnabled(enabled);
+ }
+ }
+
+ /**
+ * Restores the enabled/disabled state of the wizard dialog's
+ * buttons and the tree of controls for the currently showing page.
+ *
+ * @param state a map containing the saved state as returned by
+ * <code>saveUIState</code>
+ * @see #saveUIState
+ */
+ private void restoreUIState(Map state) {
+ restoreEnableState(getButtonActionNew().getButton(), state, "new");//$NON-NLS-1$
+ restoreEnableState(getButtonActionDelete().getButton(), state, "delete");//$NON-NLS-1$
+ restoreEnableState(getApplyButton(), state, "apply");//$NON-NLS-1$
+ restoreEnableState(getRevertButton(), state, "revert");//$NON-NLS-1$
+ restoreEnableState(getButton(ID_LAUNCH_BUTTON), state, "launch");//$NON-NLS-1$
+ restoreEnableState(getButton(ID_CLOSE_BUTTON), state, "close");//$NON-NLS-1$
+ ControlEnableState tabState = (ControlEnableState) state.get("editarea");//$NON-NLS-1$
+ tabState.restore();
+ ControlEnableState treeState = (ControlEnableState) state.get("tree");//$NON-NLS-1$
+ treeState.restore();
+ }
+
+ /**
+ * Restores the enabled/disabled state of the given control.
+ *
+ * @param w the control
+ * @param h the map (key type: <code>String</code>, element type:
+ * <code>Boolean</code>)
+ * @param key the key
+ * @see #saveEnableStateAndSet
+ */
+ private void restoreEnableState(Control w, Map h, String key) {
+ if (w != null) {
+ Boolean b = (Boolean) h.get(key);
+ if (b != null)
+ w.setEnabled(b.booleanValue());
+ }
+ }
+
+ protected void setCancelButtonPressed(boolean pressed) {
+ fCancelButtonPressed = pressed;
+ }
+
+ protected boolean cancelButtonPressed() {
+ return fCancelButtonPressed;
+ }
+
+ /**
+ * Sets the given cursor for all shells currently active
+ * for this window's display.
+ *
+ * @param cursor the cursor
+ */
+ private void setDisplayCursor(Cursor cursor) {
+ Shell[] shells = getShell().getDisplay().getShells();
+ for (int i = 0; i < shells.length; i++)
+ shells[i].setCursor(cursor);
+ }
+
+ /**
+ * Checks whether it is alright to close this dialog
+ * and performed standard cancel processing. If there is a
+ * long running operation in progress, this method posts an
+ * alert message saying that the dialog cannot be closed.
+ *
+ * @return <code>true</code> if it is alright to close this dialog, and
+ * <code>false</code> if it is not
+ */
+ private boolean okToClose() {
+ if (fActiveRunningOperations > 0) {
+ synchronized (this) {
+ fWindowClosingDialog = createDialogClosingDialog();
+ }
+ fWindowClosingDialog.open();
+ synchronized (this) {
+ fWindowClosingDialog = null;
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Creates and return a new wizard closing dialog without opening it.
+ */
+ private MessageDialog createDialogClosingDialog() {
+ MessageDialog result= new MessageDialog(
+ getShell(),
+ JFaceResources.getString("WizardClosingDialog.title"),//$NON-NLS-1$
+ null,
+ JFaceResources.getString("WizardClosingDialog.message"),//$NON-NLS-1$
+ MessageDialog.QUESTION,
+ new String[] {IDialogConstants.OK_LABEL},
+ 0 );
+ return result;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#canLaunch()
+ */
+ public boolean canLaunch() {
+ try {
+ verifyStandardAttributes();
+ } catch (CoreException e) {
+ return false;
+ }
+
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (tabs == null) {
+ return false;
+ }
+ for (int i = 0; i < tabs.length; i++) {
+ if (!tabs[i].isValid(getLaunchConfiguration())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected ILaunchConfigurationWorkingCopy getLaunchConfiguration() {
+ return fWorkingCopy;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#updateButtons()
+ */
+ public void updateButtons() {
+ if (isInitializingTabs()) {
+ return;
+ }
+
+ // Get the current selection
+ IStructuredSelection sel = (IStructuredSelection)getTreeViewer().getSelection();
+ boolean singleSelection = sel.size() == 1;
+ boolean firstItemLaunchConfig = sel.getFirstElement() instanceof ILaunchConfiguration;
+ boolean firstItemLaunchConfigType = sel.getFirstElement() instanceof ILaunchConfigurationType;
+
+ // New action
+ getButtonActionNew().setEnabled(singleSelection && firstItemLaunchConfigType);
+
+ // Duplicate action
+ getButtonActionDuplicate().setEnabled(singleSelection && firstItemLaunchConfig);
+
+ // Delete action
+ if (sel.isEmpty()) {
+ getButtonActionDelete().setEnabled(false);
+ } else {
+ Iterator iter = sel.iterator();
+ boolean enable = true;
+ while (iter.hasNext()) {
+ if (iter.next() instanceof ILaunchConfigurationType) {
+ enable = false;
+ break;
+ }
+ }
+ getButtonActionDelete().setEnabled(enable);
+ }
+
+
+ // Apply & Launch buttons
+ if (sel.isEmpty()) {
+ getApplyButton().setEnabled(false);
+ getButton(ID_LAUNCH_BUTTON).setEnabled(false);
+ } else {
+ boolean canLaunch = canLaunch();
+ getApplyButton().setEnabled(canLaunch);
+ getButton(ID_LAUNCH_BUTTON).setEnabled(canLaunch);
+ }
+
+ // Revert button
+ if (sel.isEmpty() || sel.size() > 1) {
+ getRevertButton().setEnabled(false);
+ } else {
+ if (firstItemLaunchConfig && isWorkingCopyDirty()) {
+ getRevertButton().setEnabled(true);
+ } else {
+ getRevertButton().setEnabled(false);
+ }
+ }
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#getActiveTab()
+ */
+ public ILaunchConfigurationTab getActiveTab() {
+ TabFolder folder = getTabFolder();
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (folder != null && tabs != null) {
+ int pageIndex = folder.getSelectionIndex();
+ if (pageIndex >= 0) {
+ return tabs[pageIndex];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the currently active TabItem
+ *
+ * @return launch configuration tab item
+ */
+ protected TabItem getActiveTabItem() {
+ TabFolder folder = getTabFolder();
+ TabItem tabItem = null;
+ int selectedIndex = folder.getSelectionIndex();
+ if (selectedIndex >= 0) {
+ tabItem = folder.getItem(selectedIndex);
+ }
+ return tabItem;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#updateMessage()
+ */
+ public void updateMessage() {
+ if (isInitializingTabs()) {
+ return;
+ }
+
+ // If there is no current working copy, clear the error message
+ if (getLaunchConfiguration() == null) {
+ setErrorMessage(null);
+ setMessage(null);
+ return;
+ }
+
+ try {
+ verifyStandardAttributes();
+ } catch (CoreException ce) {
+ setErrorMessage(ce.getMessage());
+ return;
+ }
+
+ // Get the active tab. If there isn't one, clear the informational & error messages
+ ILaunchConfigurationTab activeTab = getActiveTab();
+ if (activeTab == null) {
+ setMessage(null);
+ setErrorMessage(null);
+ return;
+ }
+
+ // Always set the informational (non-error) message based on the active tab
+ setMessage(activeTab.getMessage());
+
+ // The bias is to show the active page's error message, but if there isn't one,
+ // show the error message for one of the other tabs that has an error. Set the icon
+ // for all tabs according to whether they contain errors.
+ String errorMessage = checkTabForError(activeTab);
+ boolean errorOnActiveTab = errorMessage != null;
+ setTabIcon(getActiveTabItem(), errorOnActiveTab, activeTab);
+
+ ILaunchConfigurationTab[] allTabs = getTabs();
+ for (int i = 0; i < allTabs.length; i++) {
+ if (getTabFolder().getSelectionIndex() == i) {
+ continue;
+ }
+ String tabError = checkTabForError(allTabs[i]);
+ TabItem tabItem = getTabFolder().getItem(i);
+ boolean errorOnTab = tabError != null;
+ setTabIcon(tabItem, errorOnTab, allTabs[i]);
+ if (errorOnTab && !errorOnActiveTab) {
+ errorMessage = '[' + removeAmpersandsFrom(tabItem.getText()) + "]: " + tabError; //$NON-NLS-1$
+ }
+ }
+ setErrorMessage(errorMessage);
+ }
+
+ /**
+ * Show the default informational message that explains how to create a new configuration.
+ */
+ protected void setDefaultMessage() {
+ setMessage(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Select_a_type_of_configuration_to_create,_and_press___new__51")); //$NON-NLS-1$
+ }
+
+ /**
+ * Force the tab to update it's error state and return any error message.
+ */
+ protected String checkTabForError(ILaunchConfigurationTab tab) {
+ tab.isValid(getLaunchConfiguration());
+ return tab.getErrorMessage();
+ }
+
+ /**
+ * Set the specified tab item's icon to an error icon if <code>error</code> is true,
+ * or a transparent icon of the same size otherwise.
+ */
+ protected void setTabIcon(TabItem tabItem, boolean error, ILaunchConfigurationTab tab) {
+ Image image = null;
+ if (error) {
+ image = LaunchConfigurationManager.getDefault().getErrorTabImage(tab);
+ } else {
+ image = tab.getImage();
+ }
+ tabItem.setImage(image);
+ }
+
+ /**
+ * Return a copy of the specified string
+ */
+ protected String removeAmpersandsFrom(String string) {
+ String newString = new String(string);
+ int index = newString.indexOf('&');
+ while (index != -1) {
+ newString = string.substring(0, index) + newString.substring(index + 1, newString.length());
+ index = newString.indexOf('&');
+ }
+ return newString;
+ }
+
+ /**
+ * Returns the launch configuration selection area control.
+ *
+ * @return control
+ */
+ protected Composite getSelectionArea() {
+ return fSelectionArea;
+ }
+
+ /**
+ * Sets the launch configuration selection area control.
+ *
+ * @param editArea control
+ */
+ private void setSelectionArea(Composite selectionArea) {
+ fSelectionArea = selectionArea;
+ }
+
+ /**
+ * Returns the launch configuration edit area control.
+ *
+ * @return control
+ */
+ protected Composite getEditArea() {
+ return fEditArea;
+ }
+
+ /**
+ * Sets the launch configuration edit area control.
+ *
+ * @param editArea control
+ */
+ private void setEditArea(Composite editArea) {
+ fEditArea = editArea;
+ }
+
+ /**
+ * Returns the type that tabs are currently displayed
+ * for, or <code>null</code> if none.
+ *
+ * @return launch configuration type or <code>null</code>
+ */
+ protected ILaunchConfigurationType getTabType() {
+ return fTabType;
+ }
+
+ /**
+ * Sets the type that tabs are currently displayed
+ * for, or <code>null</code> if none.
+ *
+ * @param tabType launch configuration type
+ */
+ private void setTabType(ILaunchConfigurationType tabType) {
+ fTabType = tabType;
+ }
+
+ protected Object getSelectedTreeObject() {
+ return fSelectedTreeObject;
+ }
+
+ protected void setSelectedTreeObject(Object obj) {
+ fSelectedTreeObject = obj;
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#setName(String)
+ */
+ public void setName(String name) {
+ if (isVisible()) {
+ if (name == null) {
+ name = ""; //$NON-NLS-1$
+ }
+ fNameText.setText(name.trim());
+ refreshStatus();
+ }
+ }
+
+ /**
+ * @see ILaunchConfigurationDialog#generateName(String)
+ */
+ public String generateName(String name) {
+ if (name == null) {
+ name = ""; //$NON-NLS-1$
+ }
+ return getLaunchManager().generateUniqueLaunchConfigurationNameFrom(name);
+ }
+
+ /**
+ * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
+ */
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Object firstSelected = structuredSelection.getFirstElement();
+ if (firstSelected instanceof ILaunchConfigurationType) {
+ if (getButtonActionNew().isEnabled()) {
+ getButtonActionNew().run();
}
- }
- }
-
- return launchResult[0];
- }
-
- protected IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /***************************************************************************************
- *
- * ProgressMonitor & IRunnableContext related methods
- *
- ***************************************************************************************/
-
- /**
- * @see IRunnableContext#run(boolean, boolean, IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- if (isVisible()) {
- // The operation can only be canceled if it is executed in a separate thread.
- // Otherwise the UI is blocked anyway.
- Object state = aboutToStart();
- fActiveRunningOperations++;
- try {
- ModalContext.run(runnable, fork, fProgressMonitorPart, getShell().getDisplay());
- } finally {
- fActiveRunningOperations--;
- stopped(state);
- }
- } else {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(DebugUIPlugin.getShell());
- dialog.run(fork, cancelable, runnable);
- }
- }
-
- /**
- * About to start a long running operation triggered through
- * the dialog. Shows the progress monitor and disables the dialog's
- * buttons and controls.
- *
- * @return the saved UI state
- */
- private Object aboutToStart() {
- Map savedState = null;
- if (getShell() != null) {
- // Save focus control
- Control focusControl = getShell().getDisplay().getFocusControl();
- if (focusControl != null && focusControl.getShell() != getShell()) {
- focusControl = null;
- }
-
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(waitCursor);
-
- // Set the arrow cursor to the cancel component.
- arrowCursor= new Cursor(d, SWT.CURSOR_ARROW);
- getProgressMonitorCancelButton().setCursor(arrowCursor);
-
- // Deactivate shell
- savedState = saveUIState();
- if (focusControl != null) {
- savedState.put(FOCUS_CONTROL, focusControl);
- }
-
- // Attach the progress monitor part to the cancel button
- getProgressMonitorCancelButton().setEnabled(true);
- setCancelButtonPressed(false);
- getProgressMonitorPart().attachToCancelComponent(getProgressMonitorCancelButton());
- getProgressMonitorPart().setVisible(true);
- getProgressMonitorCancelButton().setFocus();
- }
- return savedState;
- }
-
- /**
- * A long running operation triggered through the dialog
- * was stopped either by user input or by normal end.
- * Hides the progress monitor and restores the enable state
- * of the dialog's buttons and controls.
- *
- * @param savedState the saved UI state as returned by <code>aboutToStart</code>
- * @see #aboutToStart
- */
- private void stopped(Object savedState) {
- if (getShell() != null) {
- getProgressMonitorPart().setVisible(false);
- getProgressMonitorPart().removeFromCancelComponent(getProgressMonitorCancelButton());
- Map state = (Map)savedState;
- restoreUIState(state);
-
- setDisplayCursor(null);
- waitCursor.dispose();
- waitCursor = null;
- arrowCursor.dispose();
- arrowCursor = null;
- Control focusControl = (Control)state.get(FOCUS_CONTROL);
- if (focusControl != null) {
- focusControl.setFocus();
- }
- }
- }
-
- /**
- * Captures and returns the enabled/disabled state of the wizard dialog's
- * buttons and the tree of controls for the currently showing page. All
- * these controls are disabled in the process, with the possible excepton of
- * the Cancel button.
- *
- * @return a map containing the saved state suitable for restoring later
- * with <code>restoreUIState</code>
- * @see #restoreUIState
- */
- private Map saveUIState() {
- Map savedState= new HashMap(10);
- saveEnableStateAndSet(getButtonActionNew().getButton(), savedState, "new", false);//$NON-NLS-1$
- saveEnableStateAndSet(getButtonActionDelete().getButton(), savedState, "delete", false);//$NON-NLS-1$
- saveEnableStateAndSet(getApplyButton(), savedState, "apply", false);//$NON-NLS-1$
- saveEnableStateAndSet(getRevertButton(), savedState, "revert", false);//$NON-NLS-1$
- saveEnableStateAndSet(getButton(ID_LAUNCH_BUTTON), savedState, "launch", false);//$NON-NLS-1$
- saveEnableStateAndSet(getButton(ID_CLOSE_BUTTON), savedState, "close", false);//$NON-NLS-1$
- savedState.put("editarea", ControlEnableState.disable(getEditArea()));//$NON-NLS-1$
- savedState.put("tree", ControlEnableState.disable(getTreeViewer().getControl()));//$NON-NLS-1$
- return savedState;
- }
-
- /**
- * Saves the enabled/disabled state of the given control in the
- * given map, which must be modifiable.
- *
- * @param w the control, or <code>null</code> if none
- * @param h the map (key type: <code>String</code>, element type:
- * <code>Boolean</code>)
- * @param key the key
- * @param enabled <code>true</code> to enable the control,
- * and <code>false</code> to disable it
- * @see #restoreEnableStateAndSet
- */
- private void saveEnableStateAndSet(Control w, Map h, String key, boolean enabled) {
- if (w != null) {
- h.put(key, new Boolean(w.isEnabled()));
- w.setEnabled(enabled);
- }
- }
-
- /**
- * Restores the enabled/disabled state of the wizard dialog's
- * buttons and the tree of controls for the currently showing page.
- *
- * @param state a map containing the saved state as returned by
- * <code>saveUIState</code>
- * @see #saveUIState
- */
- private void restoreUIState(Map state) {
- restoreEnableState(getButtonActionNew().getButton(), state, "new");//$NON-NLS-1$
- restoreEnableState(getButtonActionDelete().getButton(), state, "delete");//$NON-NLS-1$
- restoreEnableState(getApplyButton(), state, "apply");//$NON-NLS-1$
- restoreEnableState(getRevertButton(), state, "revert");//$NON-NLS-1$
- restoreEnableState(getButton(ID_LAUNCH_BUTTON), state, "launch");//$NON-NLS-1$
- restoreEnableState(getButton(ID_CLOSE_BUTTON), state, "close");//$NON-NLS-1$
- ControlEnableState tabState = (ControlEnableState) state.get("editarea");//$NON-NLS-1$
- tabState.restore();
- ControlEnableState treeState = (ControlEnableState) state.get("tree");//$NON-NLS-1$
- treeState.restore();
- }
-
- /**
- * Restores the enabled/disabled state of the given control.
- *
- * @param w the control
- * @param h the map (key type: <code>String</code>, element type:
- * <code>Boolean</code>)
- * @param key the key
- * @see #saveEnableStateAndSet
- */
- private void restoreEnableState(Control w, Map h, String key) {
- if (w != null) {
- Boolean b = (Boolean) h.get(key);
- if (b != null)
- w.setEnabled(b.booleanValue());
- }
- }
-
- protected void setCancelButtonPressed(boolean pressed) {
- fCancelButtonPressed = pressed;
- }
-
- protected boolean cancelButtonPressed() {
- return fCancelButtonPressed;
- }
-
- /**
- * Sets the given cursor for all shells currently active
- * for this window's display.
- *
- * @param cursor the cursor
- */
- private void setDisplayCursor(Cursor cursor) {
- Shell[] shells = getShell().getDisplay().getShells();
- for (int i = 0; i < shells.length; i++)
- shells[i].setCursor(cursor);
- }
-
- /**
- * Checks whether it is alright to close this dialog
- * and performed standard cancel processing. If there is a
- * long running operation in progress, this method posts an
- * alert message saying that the dialog cannot be closed.
- *
- * @return <code>true</code> if it is alright to close this dialog, and
- * <code>false</code> if it is not
- */
- private boolean okToClose() {
- if (fActiveRunningOperations > 0) {
- synchronized (this) {
- fWindowClosingDialog = createDialogClosingDialog();
- }
- fWindowClosingDialog.open();
- synchronized (this) {
- fWindowClosingDialog = null;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Creates and return a new wizard closing dialog without opening it.
- */
- private MessageDialog createDialogClosingDialog() {
- MessageDialog result= new MessageDialog(
- getShell(),
- JFaceResources.getString("WizardClosingDialog.title"),//$NON-NLS-1$
- null,
- JFaceResources.getString("WizardClosingDialog.message"),//$NON-NLS-1$
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL},
- 0 );
- return result;
- }
-
- /**
- * @see ILaunchConfigurationDialog#canLaunch()
- */
- public boolean canLaunch() {
- try {
- verifyStandardAttributes();
- } catch (CoreException e) {
- return false;
- }
-
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs == null) {
- return false;
- }
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].isValid(getLaunchConfiguration())) {
- return false;
- }
- }
- return true;
- }
-
- protected ILaunchConfigurationWorkingCopy getLaunchConfiguration() {
- return fWorkingCopy;
- }
-
- /**
- * @see ILaunchConfigurationDialog#updateButtons()
- */
- public void updateButtons() {
- if (isInitializingTabs()) {
- return;
- }
-
- // Get the current selection
- IStructuredSelection sel = (IStructuredSelection)getTreeViewer().getSelection();
- boolean singleSelection = sel.size() == 1;
- boolean firstItemLaunchConfig = sel.getFirstElement() instanceof ILaunchConfiguration;
- boolean firstItemLaunchConfigType = sel.getFirstElement() instanceof ILaunchConfigurationType;
-
- // New action
- getButtonActionNew().setEnabled(singleSelection && firstItemLaunchConfigType);
-
- // Duplicate action
- getButtonActionDuplicate().setEnabled(singleSelection && firstItemLaunchConfig);
-
- // Delete action
- if (sel.isEmpty()) {
- getButtonActionDelete().setEnabled(false);
- } else {
- Iterator iter = sel.iterator();
- boolean enable = true;
- while (iter.hasNext()) {
- if (iter.next() instanceof ILaunchConfigurationType) {
- enable = false;
- break;
- }
- }
- getButtonActionDelete().setEnabled(enable);
- }
-
-
- // Apply & Launch buttons
- if (sel.isEmpty()) {
- getApplyButton().setEnabled(false);
- getButton(ID_LAUNCH_BUTTON).setEnabled(false);
- } else {
- boolean canLaunch = canLaunch();
- getApplyButton().setEnabled(canLaunch);
- getButton(ID_LAUNCH_BUTTON).setEnabled(canLaunch);
- }
-
- // Revert button
- if (sel.isEmpty() || sel.size() > 1) {
- getRevertButton().setEnabled(false);
- } else {
- if (firstItemLaunchConfig && isWorkingCopyDirty()) {
- getRevertButton().setEnabled(true);
- } else {
- getRevertButton().setEnabled(false);
- }
- }
- }
-
- /**
- * @see ILaunchConfigurationDialog#getActiveTab()
- */
- public ILaunchConfigurationTab getActiveTab() {
- TabFolder folder = getTabFolder();
- ILaunchConfigurationTab[] tabs = getTabs();
- if (folder != null && tabs != null) {
- int pageIndex = folder.getSelectionIndex();
- if (pageIndex >= 0) {
- return tabs[pageIndex];
- }
- }
- return null;
- }
-
- /**
- * Returns the currently active TabItem
- *
- * @return launch configuration tab item
- */
- protected TabItem getActiveTabItem() {
- TabFolder folder = getTabFolder();
- TabItem tabItem = null;
- int selectedIndex = folder.getSelectionIndex();
- if (selectedIndex >= 0) {
- tabItem = folder.getItem(selectedIndex);
- }
- return tabItem;
- }
-
- /**
- * @see ILaunchConfigurationDialog#updateMessage()
- */
- public void updateMessage() {
- if (isInitializingTabs()) {
- return;
- }
-
- // If there is no current working copy, clear the error message
- if (getLaunchConfiguration() == null) {
- setErrorMessage(null);
- setMessage(null);
- return;
- }
-
- try {
- verifyStandardAttributes();
- } catch (CoreException ce) {
- setErrorMessage(ce.getMessage());
- return;
- }
-
- // Get the active tab. If there isn't one, clear the informational & error messages
- ILaunchConfigurationTab activeTab = getActiveTab();
- if (activeTab == null) {
- setMessage(null);
- setErrorMessage(null);
- return;
- }
-
- // Always set the informational (non-error) message based on the active tab
- setMessage(activeTab.getMessage());
-
- // The bias is to show the active page's error message, but if there isn't one,
- // show the error message for one of the other tabs that has an error. Set the icon
- // for all tabs according to whether they contain errors.
- String errorMessage = checkTabForError(activeTab);
- boolean errorOnActiveTab = errorMessage != null;
- setTabIcon(getActiveTabItem(), errorOnActiveTab, activeTab);
-
- ILaunchConfigurationTab[] allTabs = getTabs();
- for (int i = 0; i < allTabs.length; i++) {
- if (getTabFolder().getSelectionIndex() == i) {
- continue;
- }
- String tabError = checkTabForError(allTabs[i]);
- TabItem tabItem = getTabFolder().getItem(i);
- boolean errorOnTab = tabError != null;
- setTabIcon(tabItem, errorOnTab, allTabs[i]);
- if (errorOnTab && !errorOnActiveTab) {
- errorMessage = '[' + removeAmpersandsFrom(tabItem.getText()) + "]: " + tabError; //$NON-NLS-1$
- }
- }
- setErrorMessage(errorMessage);
- }
-
- /**
- * Show the default informational message that explains how to create a new configuration.
- */
- protected void setDefaultMessage() {
- setMessage(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Select_a_type_of_configuration_to_create,_and_press___new__51")); //$NON-NLS-1$
- }
-
- /**
- * Force the tab to update it's error state and return any error message.
- */
- protected String checkTabForError(ILaunchConfigurationTab tab) {
- tab.isValid(getLaunchConfiguration());
- return tab.getErrorMessage();
- }
-
- /**
- * Set the specified tab item's icon to an error icon if <code>error</code> is true,
- * or a transparent icon of the same size otherwise.
- */
- protected void setTabIcon(TabItem tabItem, boolean error, ILaunchConfigurationTab tab) {
- Image image = null;
- if (error) {
- image = LaunchConfigurationManager.getDefault().getErrorTabImage(tab);
- } else {
- image = tab.getImage();
- }
- tabItem.setImage(image);
- }
-
- /**
- * Return a copy of the specified string
- */
- protected String removeAmpersandsFrom(String string) {
- String newString = new String(string);
- int index = newString.indexOf('&');
- while (index != -1) {
- newString = string.substring(0, index) + newString.substring(index + 1, newString.length());
- index = newString.indexOf('&');
- }
- return newString;
- }
-
- /**
- * Returns the launch configuration selection area control.
- *
- * @return control
- */
- protected Composite getSelectionArea() {
- return fSelectionArea;
- }
-
- /**
- * Sets the launch configuration selection area control.
- *
- * @param editArea control
- */
- private void setSelectionArea(Composite selectionArea) {
- fSelectionArea = selectionArea;
- }
-
- /**
- * Returns the launch configuration edit area control.
- *
- * @return control
- */
- protected Composite getEditArea() {
- return fEditArea;
- }
-
- /**
- * Sets the launch configuration edit area control.
- *
- * @param editArea control
- */
- private void setEditArea(Composite editArea) {
- fEditArea = editArea;
- }
-
- /**
- * Returns the type that tabs are currently displayed
- * for, or <code>null</code> if none.
- *
- * @return launch configuration type or <code>null</code>
- */
- protected ILaunchConfigurationType getTabType() {
- return fTabType;
- }
-
- /**
- * Sets the type that tabs are currently displayed
- * for, or <code>null</code> if none.
- *
- * @param tabType launch configuration type
- */
- private void setTabType(ILaunchConfigurationType tabType) {
- fTabType = tabType;
- }
-
- protected Object getSelectedTreeObject() {
- return fSelectedTreeObject;
- }
-
- protected void setSelectedTreeObject(Object obj) {
- fSelectedTreeObject = obj;
- }
-
- /**
- * @see ILaunchConfigurationDialog#setName(String)
- */
- public void setName(String name) {
- if (isVisible()) {
- if (name == null) {
- name = ""; //$NON-NLS-1$
- }
- fNameText.setText(name.trim());
- refreshStatus();
- }
- }
-
- /**
- * @see ILaunchConfigurationDialog#generateName(String)
- */
- public String generateName(String name) {
- if (name == null) {
- name = ""; //$NON-NLS-1$
- }
- return getLaunchManager().generateUniqueLaunchConfigurationNameFrom(name);
- }
-
- /**
- * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- Object firstSelected = structuredSelection.getFirstElement();
- if (firstSelected instanceof ILaunchConfigurationType) {
- if (getButtonActionNew().isEnabled()) {
- getButtonActionNew().run();
- }
- } else if (firstSelected instanceof ILaunchConfiguration) {
- if (canLaunch()) {
- handleLaunchPressed();
- }
- }
- }
- }
-
- /**
- * Sets whether this dialog is initializing pages
- * and should not bother to refresh status (butttons
- * and message).
- */
- private void setInitializingTabs(boolean init) {
- fInitializingTabs = init;
- }
-
- /**
- * Returns whether this dialog is initializing pages
- * and should not bother to refresh status (butttons
- * and message).
- */
- protected boolean isInitializingTabs() {
- return fInitializingTabs;
- }
-
- /**
- * Returns the initial launch configuration type, or <code>null</code> if none has been set.
- */
- protected ILaunchConfigurationType getInitialConfigType() {
- return fInitialConfigType;
- }
-
- /**
- * Sets the initial launch configuration type to be used when this dialog is opened.
- */
- public void setInitialConfigType(ILaunchConfigurationType configType) {
- fInitialConfigType = configType;
- }
-
- /**
- * Returns the initial selection shown in this dialog when opened in
- * <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code> mode.
- */
- protected IStructuredSelection getInitialSelection() {
- return fInitialSelection;
- }
-
- /**
- * Sets the initial selection for the dialog when opened in
- * <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code> mode.
- */
- public void setInitialSelection(IStructuredSelection selection) {
- fInitialSelection = selection;
- }
-
- /**
- * Handles key events in the tree viewer. Specifically
- * when the delete key or 'Ctrl-C' for duplicate is pressed.
- */
- protected void handleTreeViewerKeyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- if (getButtonActionDelete().isEnabled()) {
- getButtonActionDelete().run();
- }
- // Treat Ctrl-C as 'duplicate'
- } else if (event.character == '\003' && event.stateMask == SWT.CTRL && event.keyCode == 0) {
- if (getButtonActionDuplicate().isEnabled()) {
- getButtonActionDuplicate().run();
- }
- }
- }
-
- protected void setButtonActionNew(ButtonAction action) {
- fButtonActionNew = action;
- }
-
- protected ButtonAction getButtonActionNew() {
- return fButtonActionNew;
- }
-
- protected void setButtonActionDuplicate(ButtonAction action) {
- fButtonActionDuplicate = action;
- }
-
- protected ButtonAction getButtonActionDuplicate() {
- return fButtonActionDuplicate;
- }
-
- protected void setButtonActionDelete(ButtonAction action) {
- fButtonActionDelete = action;
- }
-
- protected ButtonAction getButtonActionDelete() {
- return fButtonActionDelete;
- }
-
- /**
- * Extension of <code>Action</code> that manages a <code>Button</code>
- * widget. This allows common handling for actions that must appear in
- * a pop-up menu and also as a (non-toolbar) button in the UI.
- */
- private abstract class ButtonAction extends Action {
-
- protected Button fButton;
-
- /**
- * Construct a ButtonAction handler. All details of the specified
- * <code>Button</code>'s layout and appearance should be handled
- * external to this class.
- */
- public ButtonAction(String text, Button button) {
- super(text);
- fButton = button;
- if (fButton != null) {
- fButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- ButtonAction.this.run();
- }
- });
- }
- }
-
- public Button getButton() {
- return fButton;
- }
-
- /**
- * @see IAction#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- super.setEnabled(enabled);
- if (fButton != null) {
- fButton.setEnabled(enabled);
- }
- }
- }
-
- /**
- * Handler for creating a new configuration.
- */
- private class ButtonActionNew extends ButtonAction {
-
- public ButtonActionNew(String text, Button button) {
- super(text, button);
- }
-
- public void run() {
- handleNewAction();
- }
- }
-
- /**
- * Handler for duplicating a configuration.
- */
- private class ButtonActionDuplicate extends ButtonAction {
-
- public ButtonActionDuplicate(String text, Button button) {
- super(text, button);
- }
-
- public void run() {
- handleDuplicateAction();
- }
- }
-
- /**
- * Handler for deleting a configuration.
- */
- private class ButtonActionDelete extends ButtonAction {
-
- public ButtonActionDelete(String text, Button button) {
- super(text, button);
- }
-
- public void run() {
- handleDeleteAction();
- }
- }
-
+ } else if (firstSelected instanceof ILaunchConfiguration) {
+ if (canLaunch()) {
+ handleLaunchPressed();
+ }
+ }
+ }
+ }
+
+ /**
+ * Sets whether this dialog is initializing pages
+ * and should not bother to refresh status (butttons
+ * and message).
+ */
+ private void setInitializingTabs(boolean init) {
+ fInitializingTabs = init;
+ }
+
+ /**
+ * Returns whether this dialog is initializing pages
+ * and should not bother to refresh status (butttons
+ * and message).
+ */
+ protected boolean isInitializingTabs() {
+ return fInitializingTabs;
+ }
+
+ /**
+ * Returns the initial launch configuration type, or <code>null</code> if none has been set.
+ */
+ protected ILaunchConfigurationType getInitialConfigType() {
+ return fInitialConfigType;
+ }
+
+ /**
+ * Sets the initial launch configuration type to be used when this dialog is opened.
+ */
+ public void setInitialConfigType(ILaunchConfigurationType configType) {
+ fInitialConfigType = configType;
+ }
+
+ /**
+ * Returns the initial selection shown in this dialog when opened in
+ * <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code> mode.
+ */
+ protected IStructuredSelection getInitialSelection() {
+ return fInitialSelection;
+ }
+
+ /**
+ * Sets the initial selection for the dialog when opened in
+ * <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code> mode.
+ */
+ public void setInitialSelection(IStructuredSelection selection) {
+ fInitialSelection = selection;
+ }
+
+ /**
+ * Handles key events in the tree viewer. Specifically
+ * when the delete key or 'Ctrl-C' for duplicate is pressed.
+ */
+ protected void handleTreeViewerKeyPressed(KeyEvent event) {
+ if (event.character == SWT.DEL && event.stateMask == 0) {
+ if (getButtonActionDelete().isEnabled()) {
+ getButtonActionDelete().run();
+ }
+ // Treat Ctrl-C as 'duplicate'
+ } else if (event.character == '\003' && event.stateMask == SWT.CTRL && event.keyCode == 0) {
+ if (getButtonActionDuplicate().isEnabled()) {
+ getButtonActionDuplicate().run();
+ }
+ }
+ }
+
+ protected void setButtonActionNew(ButtonAction action) {
+ fButtonActionNew = action;
+ }
+
+ protected ButtonAction getButtonActionNew() {
+ return fButtonActionNew;
+ }
+
+ protected void setButtonActionDuplicate(ButtonAction action) {
+ fButtonActionDuplicate = action;
+ }
+
+ protected ButtonAction getButtonActionDuplicate() {
+ return fButtonActionDuplicate;
+ }
+
+ protected void setButtonActionDelete(ButtonAction action) {
+ fButtonActionDelete = action;
+ }
+
+ protected ButtonAction getButtonActionDelete() {
+ return fButtonActionDelete;
+ }
+
+ /**
+ * Extension of <code>Action</code> that manages a <code>Button</code>
+ * widget. This allows common handling for actions that must appear in
+ * a pop-up menu and also as a (non-toolbar) button in the UI.
+ */
+ private abstract class ButtonAction extends Action {
+
+ protected Button fButton;
+
+ /**
+ * Construct a ButtonAction handler. All details of the specified
+ * <code>Button</code>'s layout and appearance should be handled
+ * external to this class.
+ */
+ public ButtonAction(String text, Button button) {
+ super(text);
+ fButton = button;
+ if (fButton != null) {
+ fButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ ButtonAction.this.run();
+ }
+ });
+ }
+ }
+
+ public Button getButton() {
+ return fButton;
+ }
+
+ /**
+ * @see IAction#setEnabled(boolean)
+ */
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (fButton != null) {
+ fButton.setEnabled(enabled);
+ }
+ }
+ }
+
+ /**
+ * Handler for creating a new configuration.
+ */
+ private class ButtonActionNew extends ButtonAction {
+
+ public ButtonActionNew(String text, Button button) {
+ super(text, button);
+ }
+
+ public void run() {
+ handleNewAction();
+ }
+ }
+
+ /**
+ * Handler for duplicating a configuration.
+ */
+ private class ButtonActionDuplicate extends ButtonAction {
+
+ public ButtonActionDuplicate(String text, Button button) {
+ super(text, button);
+ }
+
+ public void run() {
+ handleDuplicateAction();
+ }
+ }
+
+ /**
+ * Handler for deleting a configuration.
+ */
+ private class ButtonActionDelete extends ButtonAction {
+
+ public ButtonActionDelete(String text, Button button) {
+ super(text, button);
+ }
+
+ public void run() {
+ handleDeleteAction();
+ }
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationHistoryElement.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationHistoryElement.java
index d75891d75..99e510168 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationHistoryElement.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationHistoryElement.java
@@ -1,110 +1,110 @@
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * A wrapper for entries in a launch history list.
- */
-public class LaunchConfigurationHistoryElement {
- /**
- * The launch configuration
- */
- private ILaunchConfiguration fLaunchConfiguration;
-
- /**
- * The mode in which the launch configuration was launched
- */
- private String fMode;
-
- public LaunchConfigurationHistoryElement(ILaunchConfiguration launchConfiguration,
- String mode) {
- setLaunchConfiguration(launchConfiguration);
- setMode(mode);
- }
-
- /**
- * Sets the launch configuration for this history element
- */
- private void setLaunchConfiguration(ILaunchConfiguration launchConfiguration) {
- fLaunchConfiguration = launchConfiguration;
- }
-
- /**
- * Returns the launch configuration for this history element
- */
- public ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- /**
- * Sets the mode for this history element
- */
- private void setMode(String mode) {
- fMode = mode;
- }
-
- /**
- * Returns the mode for this history element
- */
- public String getMode() {
- return fMode;
- }
-
- /**
- * Returns the label for this history element
- */
- public String getLabel() {
- return DebugUIPlugin.getDefaultLabelProvider().getText(getLaunchConfiguration());
- }
-
- /**
- * Returns whether this history element represents
- * a favorite launch configuration.
- *
- * @return whether this history element represents
- * a favorite launch configuration
- */
- public boolean isFavorite() {
- if (getLaunchConfiguration() != null) {
- try {
- if (getMode().equals(ILaunchManager.DEBUG_MODE)) {
- return getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- } else {
- return getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return false;
- }
-
- /**
- * @see Object#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- if (o instanceof LaunchConfigurationHistoryElement) {
- LaunchConfigurationHistoryElement e= (LaunchConfigurationHistoryElement)o;
- return getLaunchConfiguration().equals(e.getLaunchConfiguration()) &&
- getMode().equals(e.getMode());
- }
- return false;
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getLaunchConfiguration().hashCode();
- }
-
-}
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.IDebugUIConstants;
+
+/**
+ * A wrapper for entries in a launch history list.
+ */
+public class LaunchConfigurationHistoryElement {
+ /**
+ * The launch configuration
+ */
+ private ILaunchConfiguration fLaunchConfiguration;
+
+ /**
+ * The mode in which the launch configuration was launched
+ */
+ private String fMode;
+
+ public LaunchConfigurationHistoryElement(ILaunchConfiguration launchConfiguration,
+ String mode) {
+ setLaunchConfiguration(launchConfiguration);
+ setMode(mode);
+ }
+
+ /**
+ * Sets the launch configuration for this history element
+ */
+ private void setLaunchConfiguration(ILaunchConfiguration launchConfiguration) {
+ fLaunchConfiguration = launchConfiguration;
+ }
+
+ /**
+ * Returns the launch configuration for this history element
+ */
+ public ILaunchConfiguration getLaunchConfiguration() {
+ return fLaunchConfiguration;
+ }
+
+ /**
+ * Sets the mode for this history element
+ */
+ private void setMode(String mode) {
+ fMode = mode;
+ }
+
+ /**
+ * Returns the mode for this history element
+ */
+ public String getMode() {
+ return fMode;
+ }
+
+ /**
+ * Returns the label for this history element
+ */
+ public String getLabel() {
+ return DebugUIPlugin.getDefaultLabelProvider().getText(getLaunchConfiguration());
+ }
+
+ /**
+ * Returns whether this history element represents
+ * a favorite launch configuration.
+ *
+ * @return whether this history element represents
+ * a favorite launch configuration
+ */
+ public boolean isFavorite() {
+ if (getLaunchConfiguration() != null) {
+ try {
+ if (getMode().equals(ILaunchManager.DEBUG_MODE)) {
+ return getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
+ } else {
+ return getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
+ }
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object o) {
+ if (o instanceof LaunchConfigurationHistoryElement) {
+ LaunchConfigurationHistoryElement e= (LaunchConfigurationHistoryElement)o;
+ return getLaunchConfiguration().equals(e.getLaunchConfiguration()) &&
+ getMode().equals(e.getMode());
+ }
+ return false;
+ }
+
+ /**
+ * @see Object#hashCode()
+ */
+ public int hashCode() {
+ return getLaunchConfiguration().hashCode();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
index 433119732..595e47d2e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
@@ -1,112 +1,112 @@
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-
-/**
- * Manages contributed launch configuration tabs
- */
-public class LaunchConfigurationPresentationManager {
-
- /**
- * The singleton launch configuration presentation manager
- */
- private static LaunchConfigurationPresentationManager fgDefault;
-
- /**
- * Collection of launch configuration tab group extensions
- * defined in plug-in xml. Entries are keyed by launch
- * configuration type identifier (<code>String</code>),
- * and entires are <code>LaunchConfigurationTabGroupExtension</code>.
- */
- private Hashtable fTabGroupExtensions;
-
- /**
- * Constructs the singleton launch configuration presentation
- * manager.
- */
- private LaunchConfigurationPresentationManager() {
- fgDefault = this;
- initializeTabGroupExtensions();
- }
-
- /**
- * Returns the launch configuration presentation manager
- */
- public static LaunchConfigurationPresentationManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new LaunchConfigurationPresentationManager();
- }
- return fgDefault;
- }
-
- /**
- * Creates launch configuration tab group extensions for each extension
- * defined in XML, and adds them to the table of tab group extensions.
- */
- private void initializeTabGroupExtensions() {
- fTabGroupExtensions = new Hashtable();
- IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
- IExtensionPoint extensionPoint= descriptor.getExtensionPoint(IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
- IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
- for (int i = 0; i < groups.length; i++) {
- LaunchConfigurationTabGroupExtension group = new LaunchConfigurationTabGroupExtension(groups[i]);
- String typeId = group.getTypeIdentifier();
- if (typeId == null) {
- IExtension ext = groups[i].getDeclaringExtension();
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
- MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_does_not_specify_launch_configuration_type_1"), (new String[] {ext.getUniqueIdentifier()})), null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- } else {
- // verify it references a valid launch configuration type
- ILaunchConfigurationType lct = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(typeId);
- if (lct == null) {
- IExtension ext = groups[i].getDeclaringExtension();
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
- MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_refers_to_non-existant_launch_configuration_type_{1}_2"), (new String[] {ext.getUniqueIdentifier(), typeId})), null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- }
- }
- if (typeId != null) {
- fTabGroupExtensions.put(typeId, group);
- }
- }
- }
-
- /**
- * Returns the tab group for the given type of launch configuration.
- *
- * @return the tab group for the given type of launch configuration
- * @exception CoreException if an exception occurrs creating the group
- */
- public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type) throws CoreException {
- LaunchConfigurationTabGroupExtension ext = (LaunchConfigurationTabGroupExtension)fTabGroupExtensions.get(type.getIdentifier());
- if (ext == null) {
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR,
- MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.No_tab_group_defined_for_launch_configuration_type_{0}_3"), (new String[] {type.getIdentifier()})), null); ; //$NON-NLS-1$
- throw new CoreException(status);
- } else {
- return ext.newTabGroup();
- }
-
- }
-}
-
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+
+/**
+ * Manages contributed launch configuration tabs
+ */
+public class LaunchConfigurationPresentationManager {
+
+ /**
+ * The singleton launch configuration presentation manager
+ */
+ private static LaunchConfigurationPresentationManager fgDefault;
+
+ /**
+ * Collection of launch configuration tab group extensions
+ * defined in plug-in xml. Entries are keyed by launch
+ * configuration type identifier (<code>String</code>),
+ * and entires are <code>LaunchConfigurationTabGroupExtension</code>.
+ */
+ private Hashtable fTabGroupExtensions;
+
+ /**
+ * Constructs the singleton launch configuration presentation
+ * manager.
+ */
+ private LaunchConfigurationPresentationManager() {
+ fgDefault = this;
+ initializeTabGroupExtensions();
+ }
+
+ /**
+ * Returns the launch configuration presentation manager
+ */
+ public static LaunchConfigurationPresentationManager getDefault() {
+ if (fgDefault == null) {
+ fgDefault = new LaunchConfigurationPresentationManager();
+ }
+ return fgDefault;
+ }
+
+ /**
+ * Creates launch configuration tab group extensions for each extension
+ * defined in XML, and adds them to the table of tab group extensions.
+ */
+ private void initializeTabGroupExtensions() {
+ fTabGroupExtensions = new Hashtable();
+ IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
+ IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
+ for (int i = 0; i < groups.length; i++) {
+ LaunchConfigurationTabGroupExtension group = new LaunchConfigurationTabGroupExtension(groups[i]);
+ String typeId = group.getTypeIdentifier();
+ if (typeId == null) {
+ IExtension ext = groups[i].getDeclaringExtension();
+ IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
+ MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_does_not_specify_launch_configuration_type_1"), (new String[] {ext.getUniqueIdentifier()})), null); //$NON-NLS-1$
+ DebugUIPlugin.log(status);
+ } else {
+ // verify it references a valid launch configuration type
+ ILaunchConfigurationType lct = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(typeId);
+ if (lct == null) {
+ IExtension ext = groups[i].getDeclaringExtension();
+ IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
+ MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_refers_to_non-existant_launch_configuration_type_{1}_2"), (new String[] {ext.getUniqueIdentifier(), typeId})), null); //$NON-NLS-1$
+ DebugUIPlugin.log(status);
+ }
+ }
+ if (typeId != null) {
+ fTabGroupExtensions.put(typeId, group);
+ }
+ }
+ }
+
+ /**
+ * Returns the tab group for the given type of launch configuration.
+ *
+ * @return the tab group for the given type of launch configuration
+ * @exception CoreException if an exception occurrs creating the group
+ */
+ public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type) throws CoreException {
+ LaunchConfigurationTabGroupExtension ext = (LaunchConfigurationTabGroupExtension)fTabGroupExtensions.get(type.getIdentifier());
+ if (ext == null) {
+ IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR,
+ MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationPresentationManager.No_tab_group_defined_for_launch_configuration_type_{0}_3"), (new String[] {type.getIdentifier()})), null); ; //$NON-NLS-1$
+ throw new CoreException(status);
+ } else {
+ return ext.newTabGroup();
+ }
+
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index a665e39c5..39d97feb4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -1,29 +1,29 @@
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class LaunchConfigurationsMessages {
-
- private static final String BUNDLE_NAME =
- "org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- private LaunchConfigurationsMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class LaunchConfigurationsMessages {
+
+ private static final String BUNDLE_NAME =
+ "org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE =
+ ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private LaunchConfigurationsMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index a48bbfde6..33827490b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -1,87 +1,87 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-CommonTab.&Browse_6=&Browse...
-CommonTab.&Common_15=&Common
-CommonTab.&Run_11=&Run
-CommonTab.Debu&g_12=Debu&g
-CommonTab.Debug_mode_9=D&ebug mode
-CommonTab.Display_in_favorites_menu__10=Display in favorites menu:
-CommonTab.Invalid_shared_configuration_location_14=Invalid shared configuration location
-CommonTab.L&ocal_3=L&ocal
-CommonTab.Location_of_shared_confi&guration__5=&Location of shared configuration:
-CommonTab.Run_mode_8=Run mo&de
-CommonTab.S&hared_4=S&hared
-CommonTab.Select_a_location_for_the_launch_configuration_13=Select a location for the launch configuration
-CommonTab.Switch_to/Open_perspective_when_launched_in__7=Perspective to switch to or open when launched in:
-CommonTab.Type_of_launch_configuration__2=Type of launch configuration:
-CommonTab.None=None
-CommonTab.Default=Default
-
-LaunchConfigurationDialog.&Apply_17=Appl&y
-LaunchConfigurationDialog.&Name__16=&Name:
-LaunchConfigurationDialog.__has_unsaved_changes.__Do_you_wish_to_save_them__30=" has unsaved changes. Do you wish to save them?
-LaunchConfigurationDialog.__has_unsaved_changes_that_CANNOT_be_saved_because_of_the_following_error_36=" has unsaved changes that CANNOT be saved because of the following error:\n
-LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
-LaunchConfigurationDialog.Cancel_34=Cancel
-LaunchConfigurationDialog.Create,_manage,_and_run_launch_configurations_8=Create, manage, and run launch configurations
-LaunchConfigurationDialog.Deb&ug_4=Deb&ug
-LaunchConfigurationDialog.Dele&te_14=Dele&te
-LaunchConfigurationDialog.Discard_changes__38=Discard changes?
-LaunchConfigurationDialog.Do_you_wish_to_discard_changes_37=\nDo you wish to discard changes?\n
-LaunchConfigurationDialog.Error_19=Error
-LaunchConfigurationDialog.Exception_creating_new_launch_configuration_45=Exception creating new launch configuration
-LaunchConfigurationDialog.Exception_occurred_creating_launch_configuration_tabs_27=Exception occurred creating launch configuration tabs
-LaunchConfigurationDialog.Exception_occurred_processing_launch_configuration._See_log_for_more_information_7=Exception occurred processing launch configuration. See log for more information
-LaunchConfigurationDialog.Exception_occurred_setting_launch_configuration_24=Exception occurred setting launch configuration
-LaunchConfigurationDialog.Exception_occurred_while_launching_50=Exception occurred while launching
-LaunchConfigurationDialog.Exception_occurred_while_launching_configuration._See_log_for_more_information_49=Exception occurred while launching configuration. See log for more information
-LaunchConfigurationDialog.Exception_occurred_while_saving_launch_configuration_47=Exception occurred while saving launch configuration
-LaunchConfigurationDialog.Launch_configuration_already_exists_with_this_name_12=Launch configuration already exists with this name
-LaunchConfigurationDialog.Launch_Configuration_Error_46=Launch Configuration Error
-LaunchConfigurationDialog.Launch_Configuration_Error_6=Launch Configuration Error
-LaunchConfigurationDialog.Launch_Configurations_18=Launch Configurations
-LaunchConfigurationDialog.Name_required_for_launch_configuration_11=Name required for launch configuration
-LaunchConfigurationDialog.Ne&w_13=Ne&w
-LaunchConfigurationDialog.New_configuration_1=New_configuration
-LaunchConfigurationDialog.No_33=No
-LaunchConfigurationDialog.No_tabs_found_41=No tabs found
-LaunchConfigurationDialog.R&un_5=R&un
-LaunchConfigurationDialog.Ready_to_launch_2=Ready to launch
-LaunchConfigurationDialog.Save_changes__31=Save changes?
-LaunchConfigurationDialog.Select_a_configuration_to_launch_or_a_config_type_to_create_a_new_configuration_3=Select a configuration to launch or a config type to create a new configuration
-LaunchConfigurationDialog.Select_a_type_of_configuration_to_create,_and_press___new__51=Select a type of configuration to create, and press the \'New' button
-LaunchConfigurationDialog.The_configuration___29=The configuration "
-LaunchConfigurationDialog.The_configuration___35=The configuration "
-LaunchConfigurationDialog.unspecified_28=unspecified
-LaunchConfigurationDialog.Yes_32=Yes
-LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configurations__1=Do you wish to delete the selected launch configurations?
-LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configuration__2=Do you wish to delete the selected launch configuration?
-LaunchConfigurationDialog.Confirm_Launch_Configuration_Deletion_3=Confirm Launch Configuration Deletion
-LaunchConfigurationDialog.Close_1=Close
-LaunchConfigurationDialog.Revert_2=Re&vert
-LaunchConfigurationDialog.Cancel_3=Cance&l
-LaunchConfigurationDialog.Cannot_relaunch_1=Cannot relaunch
-LaunchConfigurationDialog.Cannot_relaunch_[{1}]_because_it_does_not_support_{2}_mode_2=Cannot relaunch [{0}] because it does not support {1} mode
-LaunchConfigurationDialog.Duplicate_1=&Duplicate
-LaunchConfigurationDialog.Launch_Con&figurations__1=Launch Con&figurations:
-
-LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_does_not_specify_launch_configuration_type_1=Launch configuration tab group extension {0} does not specify launch configuration type
-LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_refers_to_non-existant_launch_configuration_type_{1}_2=Launch configuration tab group extension {0} refers to non-existent launch configuration type {1}
-LaunchConfigurationPresentationManager.No_tab_group_defined_for_launch_configuration_type_{0}_3=No tab group defined for launch configuration type {0}
-
-PerspectiveManager.Error_1=Error
-PerspectiveManager.Unable_to_switch_perpsectives_as_specified_by_launch__{0}_4=Unable to switch perspectives as specified by launch: {0}
-PerspectiveManager.Unable_to_switch_to_perspective__{0}_2=Unable to switch to perspective: {0}
-LaunchShortcutExtension.Error_4=Error
-LaunchShortcutExtension.Unable_to_use_launch_shortcut_5=Unable to use launch shortcut
-CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1=Cannot save launch configuration in a closed project.
-
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+CommonTab.&Browse_6=&Browse...
+CommonTab.&Common_15=&Common
+CommonTab.&Run_11=&Run
+CommonTab.Debu&g_12=Debu&g
+CommonTab.Debug_mode_9=D&ebug mode
+CommonTab.Display_in_favorites_menu__10=Display in favorites menu:
+CommonTab.Invalid_shared_configuration_location_14=Invalid shared configuration location
+CommonTab.L&ocal_3=L&ocal
+CommonTab.Location_of_shared_confi&guration__5=&Location of shared configuration:
+CommonTab.Run_mode_8=Run mo&de
+CommonTab.S&hared_4=S&hared
+CommonTab.Select_a_location_for_the_launch_configuration_13=Select a location for the launch configuration
+CommonTab.Switch_to/Open_perspective_when_launched_in__7=Perspective to switch to or open when launched in:
+CommonTab.Type_of_launch_configuration__2=Type of launch configuration:
+CommonTab.None=None
+CommonTab.Default=Default
+
+LaunchConfigurationDialog.&Apply_17=Appl&y
+LaunchConfigurationDialog.&Name__16=&Name:
+LaunchConfigurationDialog.__has_unsaved_changes.__Do_you_wish_to_save_them__30=" has unsaved changes. Do you wish to save them?
+LaunchConfigurationDialog.__has_unsaved_changes_that_CANNOT_be_saved_because_of_the_following_error_36=" has unsaved changes that CANNOT be saved because of the following error:\n
+LaunchConfigurationDialog.An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
+LaunchConfigurationDialog.Cancel_34=Cancel
+LaunchConfigurationDialog.Create,_manage,_and_run_launch_configurations_8=Create, manage, and run launch configurations
+LaunchConfigurationDialog.Deb&ug_4=Deb&ug
+LaunchConfigurationDialog.Dele&te_14=Dele&te
+LaunchConfigurationDialog.Discard_changes__38=Discard changes?
+LaunchConfigurationDialog.Do_you_wish_to_discard_changes_37=\nDo you wish to discard changes?\n
+LaunchConfigurationDialog.Error_19=Error
+LaunchConfigurationDialog.Exception_creating_new_launch_configuration_45=Exception creating new launch configuration
+LaunchConfigurationDialog.Exception_occurred_creating_launch_configuration_tabs_27=Exception occurred creating launch configuration tabs
+LaunchConfigurationDialog.Exception_occurred_processing_launch_configuration._See_log_for_more_information_7=Exception occurred processing launch configuration. See log for more information
+LaunchConfigurationDialog.Exception_occurred_setting_launch_configuration_24=Exception occurred setting launch configuration
+LaunchConfigurationDialog.Exception_occurred_while_launching_50=Exception occurred while launching
+LaunchConfigurationDialog.Exception_occurred_while_launching_configuration._See_log_for_more_information_49=Exception occurred while launching configuration. See log for more information
+LaunchConfigurationDialog.Exception_occurred_while_saving_launch_configuration_47=Exception occurred while saving launch configuration
+LaunchConfigurationDialog.Launch_configuration_already_exists_with_this_name_12=Launch configuration already exists with this name
+LaunchConfigurationDialog.Launch_Configuration_Error_46=Launch Configuration Error
+LaunchConfigurationDialog.Launch_Configuration_Error_6=Launch Configuration Error
+LaunchConfigurationDialog.Launch_Configurations_18=Launch Configurations
+LaunchConfigurationDialog.Name_required_for_launch_configuration_11=Name required for launch configuration
+LaunchConfigurationDialog.Ne&w_13=Ne&w
+LaunchConfigurationDialog.New_configuration_1=New_configuration
+LaunchConfigurationDialog.No_33=No
+LaunchConfigurationDialog.No_tabs_found_41=No tabs found
+LaunchConfigurationDialog.R&un_5=R&un
+LaunchConfigurationDialog.Ready_to_launch_2=Ready to launch
+LaunchConfigurationDialog.Save_changes__31=Save changes?
+LaunchConfigurationDialog.Select_a_configuration_to_launch_or_a_config_type_to_create_a_new_configuration_3=Select a configuration to launch or a config type to create a new configuration
+LaunchConfigurationDialog.Select_a_type_of_configuration_to_create,_and_press___new__51=Select a type of configuration to create, and press the \'New' button
+LaunchConfigurationDialog.The_configuration___29=The configuration "
+LaunchConfigurationDialog.The_configuration___35=The configuration "
+LaunchConfigurationDialog.unspecified_28=unspecified
+LaunchConfigurationDialog.Yes_32=Yes
+LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configurations__1=Do you wish to delete the selected launch configurations?
+LaunchConfigurationDialog.Do_you_wish_to_delete_the_selected_launch_configuration__2=Do you wish to delete the selected launch configuration?
+LaunchConfigurationDialog.Confirm_Launch_Configuration_Deletion_3=Confirm Launch Configuration Deletion
+LaunchConfigurationDialog.Close_1=Close
+LaunchConfigurationDialog.Revert_2=Re&vert
+LaunchConfigurationDialog.Cancel_3=Cance&l
+LaunchConfigurationDialog.Cannot_relaunch_1=Cannot relaunch
+LaunchConfigurationDialog.Cannot_relaunch_[{1}]_because_it_does_not_support_{2}_mode_2=Cannot relaunch [{0}] because it does not support {1} mode
+LaunchConfigurationDialog.Duplicate_1=&Duplicate
+LaunchConfigurationDialog.Launch_Con&figurations__1=Launch Con&figurations:
+
+LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_does_not_specify_launch_configuration_type_1=Launch configuration tab group extension {0} does not specify launch configuration type
+LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_refers_to_non-existant_launch_configuration_type_{1}_2=Launch configuration tab group extension {0} refers to non-existent launch configuration type {1}
+LaunchConfigurationPresentationManager.No_tab_group_defined_for_launch_configuration_type_{0}_3=No tab group defined for launch configuration type {0}
+
+PerspectiveManager.Error_1=Error
+PerspectiveManager.Unable_to_switch_perpsectives_as_specified_by_launch__{0}_4=Unable to switch perspectives as specified by launch: {0}
+PerspectiveManager.Unable_to_switch_to_perspective__{0}_2=Unable to switch to perspective: {0}
+LaunchShortcutExtension.Error_4=Error
+LaunchShortcutExtension.Unable_to_use_launch_shortcut_5=Unable to use launch shortcut
+CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1=Cannot save launch configuration in a closed project.
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 47461420d..1d3fb38bb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -1,281 +1,281 @@
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.WorkbenchException;
-
-/**
- * The perspective manager manages the 'perspective' settings
- * defined by launch configurations. Specifically it: <ul>
- * <li>changes perspectives as launches are registered</li>
- * <li>change perspective when a thread suspends</li>
- * </ul>
- *
- * @see IDebugUIContants.ATTR_RUN_PERSPECTIVE
- * @see IDebugUIContants.ATTR_DEBUG_PERSPECTIVE
- */
-public class PerspectiveManager implements ILaunchListener, IDebugEventSetListener {
-
- /**
- * Singleton perspective manager
- */
- private static PerspectiveManager fgManager;
-
- /**
- * Constructs the perspective manager
- */
- private PerspectiveManager() {
- }
-
- /**
- * Returns the perspective manager
- */
- public static PerspectiveManager getDefault() {
- if (fgManager == null) {
- fgManager = new PerspectiveManager();
- }
- return fgManager;
- }
-
- /**
- * Called by the debug ui plug-in on startup.
- * The perspective manager starts listening for
- * launches to be registered.
- */
- public void startup() {
- DebugPlugin plugin = DebugPlugin.getDefault();
- plugin.getLaunchManager().addLaunchListener(this);
- plugin.addDebugEventListener(this);
- }
-
- /**
- * Called by the debug ui plug-in on shutdown.
- * The perspective manager de-registers as a
- * launch listener.
- */
- public void shutdown() {
- DebugPlugin plugin = DebugPlugin.getDefault();
- plugin.getLaunchManager().removeLaunchListener(this);
- plugin.removeDebugEventListener(this);
- }
-
- /**
- * Do nothing.
- *
- * @see ILaunchListener#launchRemoved(ILaunch)
- */
- public void launchRemoved(ILaunch launch) {
- }
-
- /**
- * Do nothing.
- *
- * @see ILaunchListener#launchChanged(ILaunch)
- */
- public void launchChanged(ILaunch launch) {
- }
-
- /**
- * Switch to the perspective specified by the
- * launch configuration.
- *
- * @see ILaunchListener#launchAdded(ILaunch)
- */
- public void launchAdded(ILaunch launch) {
- String perspectiveId = null;
- // check event filters
- try {
- perspectiveId = getPerspectiveId(launch);
- } catch (CoreException e) {
- String name = DebugUIPlugin.getDefault().getModelPresentation().getText(launch);
- switchFailed(e, name);
- }
- if (perspectiveId != null) {
- switchToPerspective(perspectiveId);
- }
- }
-
-
- /**
- * Switches to the specified perspective
- *
- * @param id perspective identifier
- */
- protected void switchToPerspective(final String id) {
- async(new Runnable() {
- public void run() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- try {
- window.getWorkbench().showPerspective(id, window);
- } catch (WorkbenchException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
- LaunchConfigurationsMessages.getString("PerspectiveManager.Error_1"), //$NON-NLS-1$
- MessageFormat.format(LaunchConfigurationsMessages.getString("PerspectiveManager.Unable_to_switch_to_perspective__{0}_2"), new String[]{id}), //$NON-NLS-1$
- e);
- }
- }
- }
- });
- }
-
- /**
- * Utility method to submit an asnychronous runnable to the UI
- */
- protected void async(Runnable r) {
- Display d = DebugUIPlugin.getDefault().getStandardDisplay();
- if (d != null && !d.isDisposed()) {
- d.asyncExec(r);
- }
- }
-
- /**
- * Utility method to submit a synchronous runnable to the UI
- */
- protected void sync(Runnable r) {
- Display d = DebugUIPlugin.getDefault().getStandardDisplay();
- if (d != null && !d.isDisposed()) {
- d.syncExec(r);
- }
- }
-
- /**
- * Reports failure to switch perspectives to the user
- *
- * @param status exception status describing failure
- * @param launchName the name of the launch that the
- * failure is associated with
- */
- protected void switchFailed(final Throwable t, final String launchName) {
- sync(new Runnable() {
- public void run() {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.getString("PerspectiveManager.Error_1"), //$NON-NLS-1$
- MessageFormat.format(LaunchConfigurationsMessages.getString("PerspectiveManager.Unable_to_switch_perpsectives_as_specified_by_launch__{0}_4"), new String[] {launchName}), //$NON-NLS-1$
- t);
- }});
- }
-
- /**
- * On a SUSPEND event, show the debug view. If no debug view is open,
- * switch to the perspective specified by the launcher.
- *
- * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- // open the debugger if this is a suspend event and the debug view is not yet open
- // and the preferences are set to switch
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getKind() == DebugEvent.SUSPEND && event.getDetail() == event.BREAKPOINT) {
- // apply event filters
- ILaunch launch = null;
- Object source = event.getSource();
- if (source instanceof IDebugElement) {
- launch = ((IDebugElement)source).getLaunch();
- } else if (source instanceof IProcess) {
- launch = ((IProcess)source).getLaunch();
- }
- String perspectiveId = null;
- try {
- perspectiveId = getPerspectiveId(launch);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- // if no perspective specified, always switch to debug
- // perspective
-
- // this has to be done in an asynch, such that the workbench
- // window can be accessed
- final String id = perspectiveId;
- Runnable r = new Runnable() {
- public void run() {
- String targetId = id;
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- if (targetId == null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IViewPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
- if (part == null) {
- targetId = IDebugUIConstants.ID_DEBUG_PERSPECTIVE;
- }
- }
- }
- if (targetId != null) {
- // re-open the window if minimized
- Shell shell= window.getShell();
- if (shell != null) {
- if (shell.getMinimized()) {
- shell.setMinimized(false);
- }
- if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH)) {
- shell.forceActive();
- }
- }
- switchToPerspective(targetId);
- }
- }
- };
- async(r);
- }
- }
- }
-
- /**
- * Returns the perspective associated with the
- * given launch, or <code>null</code> if none.
- *
- * @param launch a launch
- * @return the perspective associated with the launch,
- * or <code>null</code>
- * @exception CoreException if unable to retrieve a required
- * launch configuration attribute
- */
- protected String getPerspectiveId(ILaunch launch) throws CoreException {
- if (launch == null) {
- return null;
- }
- ILaunchConfiguration config = launch.getLaunchConfiguration();
- String perspectiveId = null;
- String mode = launch.getLaunchMode();
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- perspectiveId = config.getAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, (String)null);
- if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
- perspectiveId = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT);
- }
- } else {
- perspectiveId = config.getAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, (String)null);
- if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
- perspectiveId = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SHOW_RUN_PERSPECTIVE_DEFAULT);
- }
- }
- if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_NONE)) {
- perspectiveId = null;
- }
- return perspectiveId;
- }
-}
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.WorkbenchException;
+
+/**
+ * The perspective manager manages the 'perspective' settings
+ * defined by launch configurations. Specifically it: <ul>
+ * <li>changes perspectives as launches are registered</li>
+ * <li>change perspective when a thread suspends</li>
+ * </ul>
+ *
+ * @see IDebugUIContants.ATTR_RUN_PERSPECTIVE
+ * @see IDebugUIContants.ATTR_DEBUG_PERSPECTIVE
+ */
+public class PerspectiveManager implements ILaunchListener, IDebugEventSetListener {
+
+ /**
+ * Singleton perspective manager
+ */
+ private static PerspectiveManager fgManager;
+
+ /**
+ * Constructs the perspective manager
+ */
+ private PerspectiveManager() {
+ }
+
+ /**
+ * Returns the perspective manager
+ */
+ public static PerspectiveManager getDefault() {
+ if (fgManager == null) {
+ fgManager = new PerspectiveManager();
+ }
+ return fgManager;
+ }
+
+ /**
+ * Called by the debug ui plug-in on startup.
+ * The perspective manager starts listening for
+ * launches to be registered.
+ */
+ public void startup() {
+ DebugPlugin plugin = DebugPlugin.getDefault();
+ plugin.getLaunchManager().addLaunchListener(this);
+ plugin.addDebugEventListener(this);
+ }
+
+ /**
+ * Called by the debug ui plug-in on shutdown.
+ * The perspective manager de-registers as a
+ * launch listener.
+ */
+ public void shutdown() {
+ DebugPlugin plugin = DebugPlugin.getDefault();
+ plugin.getLaunchManager().removeLaunchListener(this);
+ plugin.removeDebugEventListener(this);
+ }
+
+ /**
+ * Do nothing.
+ *
+ * @see ILaunchListener#launchRemoved(ILaunch)
+ */
+ public void launchRemoved(ILaunch launch) {
+ }
+
+ /**
+ * Do nothing.
+ *
+ * @see ILaunchListener#launchChanged(ILaunch)
+ */
+ public void launchChanged(ILaunch launch) {
+ }
+
+ /**
+ * Switch to the perspective specified by the
+ * launch configuration.
+ *
+ * @see ILaunchListener#launchAdded(ILaunch)
+ */
+ public void launchAdded(ILaunch launch) {
+ String perspectiveId = null;
+ // check event filters
+ try {
+ perspectiveId = getPerspectiveId(launch);
+ } catch (CoreException e) {
+ String name = DebugUIPlugin.getDefault().getModelPresentation().getText(launch);
+ switchFailed(e, name);
+ }
+ if (perspectiveId != null) {
+ switchToPerspective(perspectiveId);
+ }
+ }
+
+
+ /**
+ * Switches to the specified perspective
+ *
+ * @param id perspective identifier
+ */
+ protected void switchToPerspective(final String id) {
+ async(new Runnable() {
+ public void run() {
+ IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window != null) {
+ try {
+ window.getWorkbench().showPerspective(id, window);
+ } catch (WorkbenchException e) {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
+ LaunchConfigurationsMessages.getString("PerspectiveManager.Error_1"), //$NON-NLS-1$
+ MessageFormat.format(LaunchConfigurationsMessages.getString("PerspectiveManager.Unable_to_switch_to_perspective__{0}_2"), new String[]{id}), //$NON-NLS-1$
+ e);
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Utility method to submit an asnychronous runnable to the UI
+ */
+ protected void async(Runnable r) {
+ Display d = DebugUIPlugin.getDefault().getStandardDisplay();
+ if (d != null && !d.isDisposed()) {
+ d.asyncExec(r);
+ }
+ }
+
+ /**
+ * Utility method to submit a synchronous runnable to the UI
+ */
+ protected void sync(Runnable r) {
+ Display d = DebugUIPlugin.getDefault().getStandardDisplay();
+ if (d != null && !d.isDisposed()) {
+ d.syncExec(r);
+ }
+ }
+
+ /**
+ * Reports failure to switch perspectives to the user
+ *
+ * @param status exception status describing failure
+ * @param launchName the name of the launch that the
+ * failure is associated with
+ */
+ protected void switchFailed(final Throwable t, final String launchName) {
+ sync(new Runnable() {
+ public void run() {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.getString("PerspectiveManager.Error_1"), //$NON-NLS-1$
+ MessageFormat.format(LaunchConfigurationsMessages.getString("PerspectiveManager.Unable_to_switch_perpsectives_as_specified_by_launch__{0}_4"), new String[] {launchName}), //$NON-NLS-1$
+ t);
+ }});
+ }
+
+ /**
+ * On a SUSPEND event, show the debug view. If no debug view is open,
+ * switch to the perspective specified by the launcher.
+ *
+ * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
+ */
+ public void handleDebugEvents(DebugEvent[] events) {
+ // open the debugger if this is a suspend event and the debug view is not yet open
+ // and the preferences are set to switch
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getKind() == DebugEvent.SUSPEND && event.getDetail() == event.BREAKPOINT) {
+ // apply event filters
+ ILaunch launch = null;
+ Object source = event.getSource();
+ if (source instanceof IDebugElement) {
+ launch = ((IDebugElement)source).getLaunch();
+ } else if (source instanceof IProcess) {
+ launch = ((IProcess)source).getLaunch();
+ }
+ String perspectiveId = null;
+ try {
+ perspectiveId = getPerspectiveId(launch);
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ // if no perspective specified, always switch to debug
+ // perspective
+
+ // this has to be done in an asynch, such that the workbench
+ // window can be accessed
+ final String id = perspectiveId;
+ Runnable r = new Runnable() {
+ public void run() {
+ String targetId = id;
+ IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
+ if (window == null) {
+ return;
+ }
+ if (targetId == null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ IViewPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
+ if (part == null) {
+ targetId = IDebugUIConstants.ID_DEBUG_PERSPECTIVE;
+ }
+ }
+ }
+ if (targetId != null) {
+ // re-open the window if minimized
+ Shell shell= window.getShell();
+ if (shell != null) {
+ if (shell.getMinimized()) {
+ shell.setMinimized(false);
+ }
+ if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH)) {
+ shell.forceActive();
+ }
+ }
+ switchToPerspective(targetId);
+ }
+ }
+ };
+ async(r);
+ }
+ }
+ }
+
+ /**
+ * Returns the perspective associated with the
+ * given launch, or <code>null</code> if none.
+ *
+ * @param launch a launch
+ * @return the perspective associated with the launch,
+ * or <code>null</code>
+ * @exception CoreException if unable to retrieve a required
+ * launch configuration attribute
+ */
+ protected String getPerspectiveId(ILaunch launch) throws CoreException {
+ if (launch == null) {
+ return null;
+ }
+ ILaunchConfiguration config = launch.getLaunchConfiguration();
+ String perspectiveId = null;
+ String mode = launch.getLaunchMode();
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ perspectiveId = config.getAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, (String)null);
+ if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
+ perspectiveId = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT);
+ }
+ } else {
+ perspectiveId = config.getAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, (String)null);
+ if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
+ perspectiveId = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_SHOW_RUN_PERSPECTIVE_DEFAULT);
+ }
+ }
+ if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_NONE)) {
+ perspectiveId = null;
+ }
+ return perspectiveId;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandler.java
index d678cca70..2af152dc7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandler.java
@@ -1,190 +1,190 @@
-package org.eclipse.debug.internal.ui.views;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Handles debug events, updating a view and viewer.
- */
-public abstract class AbstractDebugEventHandler implements IDebugEventSetListener {
-
- /**
- * This event handler's view
- */
- private AbstractDebugView fView;
-
- /**
- * Constructs an event handler for the given view.
- *
- * @param view debug view
- */
- public AbstractDebugEventHandler(AbstractDebugView view) {
- setView(view);
- DebugPlugin plugin= DebugPlugin.getDefault();
- plugin.addDebugEventListener(this);
- }
-
- /**
- * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
- */
- public void handleDebugEvents(final DebugEvent[] events) {
- if (!isAvailable()) {
- return;
- }
- Runnable r= new Runnable() {
- public void run() {
- if (isAvailable()) {
- doHandleDebugEvents(events);
- }
- }
- };
-
- getView().asyncExec(r);
- }
-
-
- /**
- * Implementation specific handling of debug events.
- * Subclasses should override.
- */
- protected abstract void doHandleDebugEvents(DebugEvent[] events);
-
- /**
- * Helper method for inserting the given element - must be called in UI thread
- */
- protected void insert(Object element) {
- if (isAvailable()) {
- final Object parent= ((ITreeContentProvider)getTreeViewer().getContentProvider()).getParent(element);
- // a parent can be null for a debug target or process that has not yet been associated
- // with a launch
- if (parent != null) {
- getView().showViewer();
- getTreeViewer().add(parent, element);
- }
- }
- }
-
- /**
- * Helper method to remove the given element - must be called in UI thread.
- */
- protected void remove(Object element) {
- if (isAvailable()) {
- getView().showViewer();
- getTreeViewer().remove(element);
- }
- }
-
- /**
- * Helper method to update the label of the given element - must be called in UI thread
- */
- protected void labelChanged(Object element) {
- if (isAvailable()) {
- getView().showViewer();
- getTreeViewer().update(element, new String[] {IBasicPropertyConstants.P_TEXT});
- }
- }
-
- /**
- * Refresh the given element in the viewer - must be called in UI thread.
- */
- protected void refresh(Object element) {
- if (isAvailable()) {
- getView().showViewer();
- getTreeViewer().refresh(element);
- }
- }
-
- /**
- * Refresh the viewer - must be called in UI thread.
- */
- public void refresh() {
- if (isAvailable()) {
- getView().showViewer();
- getTreeViewer().refresh();
- }
- }
-
- /**
- * Helper method to select and reveal the given element - must be called in UI thread
- */
- protected void selectAndReveal(Object element) {
- if (isAvailable()) {
- getViewer().setSelection(new StructuredSelection(element), true);
- }
- }
-
- /**
- * De-registers this event handler from the debug model.
- */
- public void dispose() {
- DebugPlugin plugin= DebugPlugin.getDefault();
- plugin.removeDebugEventListener(this);
- }
-
- /**
- * Returns the view this event handler is
- * updating.
- *
- * @return debug view
- */
- protected AbstractDebugView getView() {
- return fView;
- }
-
- /**
- * Sets the view this event handler is updating.
- *
- * @param view debug view
- */
- private void setView(AbstractDebugView view) {
- fView = view;
- }
-
- /**
- * Returns the viewer this event handler is
- * updating.
- *
- * @return viewer
- */
- protected Viewer getViewer() {
- return getView().getViewer();
- }
-
- /**
- * Returns this event handler's viewer as a tree
- * viewer or <code>null</code> if none.
- *
- * @return this event handler's viewer as a tree
- * viewer or <code>null</code> if none
- */
- protected TreeViewer getTreeViewer() {
- if (getViewer() instanceof TreeViewer) {
- return (TreeViewer)getViewer();
- }
- return null;
- }
-
- /**
- * Returns whether this event handler's viewer is
- * currently available.
- *
- * @return whether this event handler's viewer is
- * currently available
- */
- protected boolean isAvailable() {
- return getView().isAvailable();
- }
-}
-
+package org.eclipse.debug.internal.ui.views;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.ui.AbstractDebugView;
+import org.eclipse.jface.viewers.IBasicPropertyConstants;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Handles debug events, updating a view and viewer.
+ */
+public abstract class AbstractDebugEventHandler implements IDebugEventSetListener {
+
+ /**
+ * This event handler's view
+ */
+ private AbstractDebugView fView;
+
+ /**
+ * Constructs an event handler for the given view.
+ *
+ * @param view debug view
+ */
+ public AbstractDebugEventHandler(AbstractDebugView view) {
+ setView(view);
+ DebugPlugin plugin= DebugPlugin.getDefault();
+ plugin.addDebugEventListener(this);
+ }
+
+ /**
+ * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
+ */
+ public void handleDebugEvents(final DebugEvent[] events) {
+ if (!isAvailable()) {
+ return;
+ }
+ Runnable r= new Runnable() {
+ public void run() {
+ if (isAvailable()) {
+ doHandleDebugEvents(events);
+ }
+ }
+ };
+
+ getView().asyncExec(r);
+ }
+
+
+ /**
+ * Implementation specific handling of debug events.
+ * Subclasses should override.
+ */
+ protected abstract void doHandleDebugEvents(DebugEvent[] events);
+
+ /**
+ * Helper method for inserting the given element - must be called in UI thread
+ */
+ protected void insert(Object element) {
+ if (isAvailable()) {
+ final Object parent= ((ITreeContentProvider)getTreeViewer().getContentProvider()).getParent(element);
+ // a parent can be null for a debug target or process that has not yet been associated
+ // with a launch
+ if (parent != null) {
+ getView().showViewer();
+ getTreeViewer().add(parent, element);
+ }
+ }
+ }
+
+ /**
+ * Helper method to remove the given element - must be called in UI thread.
+ */
+ protected void remove(Object element) {
+ if (isAvailable()) {
+ getView().showViewer();
+ getTreeViewer().remove(element);
+ }
+ }
+
+ /**
+ * Helper method to update the label of the given element - must be called in UI thread
+ */
+ protected void labelChanged(Object element) {
+ if (isAvailable()) {
+ getView().showViewer();
+ getTreeViewer().update(element, new String[] {IBasicPropertyConstants.P_TEXT});
+ }
+ }
+
+ /**
+ * Refresh the given element in the viewer - must be called in UI thread.
+ */
+ protected void refresh(Object element) {
+ if (isAvailable()) {
+ getView().showViewer();
+ getTreeViewer().refresh(element);
+ }
+ }
+
+ /**
+ * Refresh the viewer - must be called in UI thread.
+ */
+ public void refresh() {
+ if (isAvailable()) {
+ getView().showViewer();
+ getTreeViewer().refresh();
+ }
+ }
+
+ /**
+ * Helper method to select and reveal the given element - must be called in UI thread
+ */
+ protected void selectAndReveal(Object element) {
+ if (isAvailable()) {
+ getViewer().setSelection(new StructuredSelection(element), true);
+ }
+ }
+
+ /**
+ * De-registers this event handler from the debug model.
+ */
+ public void dispose() {
+ DebugPlugin plugin= DebugPlugin.getDefault();
+ plugin.removeDebugEventListener(this);
+ }
+
+ /**
+ * Returns the view this event handler is
+ * updating.
+ *
+ * @return debug view
+ */
+ protected AbstractDebugView getView() {
+ return fView;
+ }
+
+ /**
+ * Sets the view this event handler is updating.
+ *
+ * @param view debug view
+ */
+ private void setView(AbstractDebugView view) {
+ fView = view;
+ }
+
+ /**
+ * Returns the viewer this event handler is
+ * updating.
+ *
+ * @return viewer
+ */
+ protected Viewer getViewer() {
+ return getView().getViewer();
+ }
+
+ /**
+ * Returns this event handler's viewer as a tree
+ * viewer or <code>null</code> if none.
+ *
+ * @return this event handler's viewer as a tree
+ * viewer or <code>null</code> if none
+ */
+ protected TreeViewer getTreeViewer() {
+ if (getViewer() instanceof TreeViewer) {
+ return (TreeViewer)getViewer();
+ }
+ return null;
+ }
+
+ /**
+ * Returns whether this event handler's viewer is
+ * currently available.
+ *
+ * @return whether this event handler's viewer is
+ * currently available
+ */
+ protected boolean isAvailable() {
+ return getView().isAvailable();
+ }
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandlerView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandlerView.java
index 9437e9c53..d7941b869 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandlerView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/AbstractDebugEventHandlerView.java
@@ -1,48 +1,48 @@
-package org.eclipse.debug.internal.ui.views;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.ui.AbstractDebugView;
-
-/**
- * A debug view that uses an event handler to update its
- * view/viewer.
- */
-public abstract class AbstractDebugEventHandlerView extends AbstractDebugView {
-
- /**
- * Event handler for this view
- */
- private AbstractDebugEventHandler fEventHandler;
-
- /**
- * Sets the event handler for this view
- *
- * @param eventHandler event handler
- */
- protected void setEventHandler(AbstractDebugEventHandler eventHandler) {
- fEventHandler = eventHandler;
- }
-
- /**
- * Returns the event handler for this view
- *
- * @return The event handler for this view
- */
- protected AbstractDebugEventHandler getEventHandler() {
- return fEventHandler;
- }
-
- /**
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- super.dispose();
- if (getEventHandler() != null) {
- getEventHandler().dispose();
- }
- }
-}
+package org.eclipse.debug.internal.ui.views;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.ui.AbstractDebugView;
+
+/**
+ * A debug view that uses an event handler to update its
+ * view/viewer.
+ */
+public abstract class AbstractDebugEventHandlerView extends AbstractDebugView {
+
+ /**
+ * Event handler for this view
+ */
+ private AbstractDebugEventHandler fEventHandler;
+
+ /**
+ * Sets the event handler for this view
+ *
+ * @param eventHandler event handler
+ */
+ protected void setEventHandler(AbstractDebugEventHandler eventHandler) {
+ fEventHandler = eventHandler;
+ }
+
+ /**
+ * Returns the event handler for this view
+ *
+ * @return The event handler for this view
+ */
+ protected AbstractDebugEventHandler getEventHandler() {
+ return fEventHandler;
+ }
+
+ /**
+ * @see IWorkbenchPart#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ if (getEventHandler() != null) {
+ getEventHandler().dispose();
+ }
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java
index 009fd408d..d8ee1e91c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java
@@ -1,35 +1,35 @@
-package org.eclipse.debug.internal.ui.views;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Common Public License v0.5
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v05.html
-
-Contributors:
- IBM Corporation - Initial implementation
-**********************************************************************/
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class DebugUIViewsMessages {
-
- private static final String BUNDLE_NAME =
- "org.eclipse.debug.internal.ui.views.DebugUIViewsMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- private DebugUIViewsMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
+package org.eclipse.debug.internal.ui.views;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v0.5
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v05.html
+
+Contributors:
+ IBM Corporation - Initial implementation
+**********************************************************************/
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class DebugUIViewsMessages {
+
+ private static final String BUNDLE_NAME =
+ "org.eclipse.debug.internal.ui.views.DebugUIViewsMessages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE =
+ ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private DebugUIViewsMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties
index 9703f516b..ffd462f43 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties
@@ -1,38 +1,38 @@
-######################################################################
-# Copyright (c) 2000, 2002 IBM Corp. and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v0.5
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v05.html
-#
-# Contributors:
-# IBM Corporation - Initial implementation
-######################################################################
-
-find_replace_action.label=&Find/Replace...@Ctrl+F
-find_replace_action.tooltip=Find/Replace
-find_replace_action.image=
-find_replace_action.description=Find/Replace
-
-ConsoleView.&Copy@Ctrl+C_6=&Copy@Ctrl+C
-ConsoleView.&Paste@Ctrl+V_9=&Paste@Ctrl+V
-ConsoleView.Console_1=Console
-ConsoleView.Copy_7=Copy
-ConsoleView.Cu&t@Ctrl+X_3=Cu&t@Ctrl+X
-ConsoleView.Cut_4=Cut
-ConsoleView.Paste_10=Paste
-ConsoleView.Paste_Clipboard_Text_11=Paste Clipboard Text
-ConsoleView.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
-ConsoleView.Select_All=Select All
-
-LaunchView.Error_1=Error
-LaunchView.Exception_occurred_opening_editor_for_debugger._2=Exception occurred opening editor for debugger.
-
-VariablesView.&Copy_8=&Copy
-VariablesView.&Paste_14=&Paste
-VariablesView.<error_occurred_retrieving_value>_18=<error occurred retrieving value>
-VariablesView.Co&ntent_Assist_3=Co&ntent Assist
-VariablesView.Cu&t_11=Cu&t
-VariablesView.Error_1=Error
-VariablesView.Select_&All_5=Select &All
+######################################################################
+# Copyright (c) 2000, 2002 IBM Corp. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v0.5
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v05.html
+#
+# Contributors:
+# IBM Corporation - Initial implementation
+######################################################################
+
+find_replace_action.label=&Find/Replace...@Ctrl+F
+find_replace_action.tooltip=Find/Replace
+find_replace_action.image=
+find_replace_action.description=Find/Replace
+
+ConsoleView.&Copy@Ctrl+C_6=&Copy@Ctrl+C
+ConsoleView.&Paste@Ctrl+V_9=&Paste@Ctrl+V
+ConsoleView.Console_1=Console
+ConsoleView.Copy_7=Copy
+ConsoleView.Cu&t@Ctrl+X_3=Cu&t@Ctrl+X
+ConsoleView.Cut_4=Cut
+ConsoleView.Paste_10=Paste
+ConsoleView.Paste_Clipboard_Text_11=Paste Clipboard Text
+ConsoleView.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
+ConsoleView.Select_All=Select All
+
+LaunchView.Error_1=Error
+LaunchView.Exception_occurred_opening_editor_for_debugger._2=Exception occurred opening editor for debugger.
+
+VariablesView.&Copy_8=&Copy
+VariablesView.&Paste_14=&Paste
+VariablesView.<error_occurred_retrieving_value>_18=<error occurred retrieving value>
+VariablesView.Co&ntent_Assist_3=Co&ntent Assist
+VariablesView.Cu&t_11=Cu&t
+VariablesView.Error_1=Error
+VariablesView.Select_&All_5=Select &All
VariablesView.Unable_to_configure_variable_details_area._2=Unable to configure variable details area. \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java
index 3b040ef30..08ad5cf6f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java
@@ -1,22 +1,22 @@
-package org.eclipse.debug.internal.ui.views;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A plugable exception handler.
- */
-public interface IDebugExceptionHandler {
-
- /**
- * Handles the given debug exception.
- *
- * @param e debug exception
- */
- public abstract void handleException(DebugException e);
-
-}
+package org.eclipse.debug.internal.ui.views;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * A plugable exception handler.
+ */
+public interface IDebugExceptionHandler {
+
+ /**
+ * Handles the given debug exception.
+ *
+ * @param e debug exception
+ */
+ public abstract void handleException(DebugException e);
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
index c07ee21bc..85495064e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
@@ -1,746 +1,746 @@
-package org.eclipse.debug.ui;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.preferences.DebugActionGroupsManager;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for debug related views:<ul>
- * <li>Debug view adpater implementation - <code>IDebugView</code></li>
- * <li>Action registry - actions can be stored in this view
- * with a key. Actions that implement <code>IUpdate</code>
- * are updated when <code>updateActions()</code> is
- * called.</li>
- * <li>Hooks the context menu associated with this view's
- * underlying viewer and registers the menu with this
- * view's site, such that other plug-ins may contribute.</li>
- * <li>Hooks a key press listener, and invokes the
- * <code>REMOVE_ACTION</code> when the delete key
- * is pressed.</li>
- * <li>Hooks a double-click listener, and invokes the
- * <code>DOUBLE_CLICK_ACTION</code> when the mouse
- * is double-clicked.</li>
- * <li>Provides a mechanism for displaying an error message
- * in the view, via the <code>PageBookView</code> mechanism.
- * By default, a page book is created with a page showing
- * this view's viewer. A message page is also created
- * and shown when <code>showMessage(String)</code> is
- * called.</li>
- * </ul>
- * <p>
- * This class may be subclassed.
- * </p>
- * @since 2.0
- */
-
-public abstract class AbstractDebugView extends PageBookView implements IDebugView, IDoubleClickListener {
-
- /**
- * Underlying viewer that displays the contents of
- * this view.
- */
- private Viewer fViewer = null;
-
- /**
- * This view's message page.
- */
- private MessagePage fMessagePage = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private Map fActionMap = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private List fUpdateables = null;
-
- /**
- * The context menu manager for this view
- */
- private IMenuManager fContextMenuManager;
-
- /**
- * The memento that was used to persist the state of this view.
- * May be <code>null</code>.
- */
- private IMemento fMemento;
-
- /**
- * Constructs a new debug view.
- */
- public AbstractDebugView() {
- fActionMap = new HashMap(5);
- fUpdateables= new ArrayList(3);
- }
-
- /**
- * Debug views implement the debug view adapter which
- * provides access to a view's underlying viewer and
- * debug model presentation for a specific debug model.
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- * @see IDebugView
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IDebugView.class) {
- return this;
- }
- return super.getAdapter(adapter);
- }
-
- /**
- * A page in this view's page book that contains this
- * view's viewer.
- */
- class ViewerPage extends Page {
- /**
- * @see IPage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Viewer viewer = createViewer(parent);
- setViewer(viewer);
- }
-
- /**
- * @see IPage#getControl()
- */
- public Control getControl() {
- return getDefaultControl();
- }
-
- /**
- * @see IPage#setFocus()
- */
- public void setFocus() {
- Viewer viewer= getViewer();
- if (viewer != null) {
- Control c = viewer.getControl();
- if (!c.isFocusControl()) {
- c.setFocus();
- }
- }
- }
-
-}
-
- /**
- * Creates this view's underlying viewer and actions.
- * Hooks a pop-up menu to the underlying viewer's control,
- * as well as a key listener. When the delete key is pressed,
- * the <code>REMOVE_ACTION</code> is invoked. Hooks help to
- * this view. Subclasses must implement the following methods
- * which are called in the following order when a view is
- * created:<ul>
- * <li><code>createViewer(Composite)</code> - the context
- * menu is hooked to the viewer's control.</li>
- * <li><code>createActions()</code></li>
- * <li><code>configureToolBar(IToolBarManager)</code></li>
- * <li><code>getHelpContextId()</code></li>
- * </ul>
- * @see IWorkbenchPart#createPartControl(Composite)
- * @see AbstractDebugView#createPartControl(Composite)
- * @see AbstractDebugView#createActions()
- * @see AbstractDebugView#configureToolBar(IToolBarManager)
- * @see AbstractDebugView#getHelpContextId()
- * @see AbstractDebugView#fillContextMenu(IMenuManager)
- */
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- createActions();
- initializeToolBar();
- createContextMenu(getViewer().getControl());
- WorkbenchHelp.setHelp(parent, getHelpContextId());
- getViewer().getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).addDoubleClickListener(this);
- }
- // create the message page
- setMessagePage(new MessagePage());
- getMessagePage().createControl(getPageBook());
- initPage(getMessagePage());
-
- DebugActionGroupsManager.getDefault().registerView(this);
- }
-
- /**
- * The default page for a debug view is its viewer.
- *
- * @see PageBookView#createDefaultPage(PageBook)
- */
- protected IPage createDefaultPage(PageBook book) {
- ViewerPage page = new ViewerPage();
- page.createControl(book);
- initPage(page);
- return page;
- }
-
- /**
- * Creates and returns this view's underlying viewer.
- * The viewer's control will automatically be hooked
- * to display a pop-up menu that other plug-ins may
- * contribute to. Subclasses must override this method.
- *
- * @param parent the parent control
- */
- protected abstract Viewer createViewer(Composite parent);
-
- /**
- * Creates this view's actions. Subclasses must
- * override this method, which is called after
- * <code>createViewer(Composite)</code>
- */
- protected abstract void createActions();
-
- /**
- * Returns this view's help context id, which is hooked
- * to this view on creation.
- *
- * @return help context id
- */
- protected abstract String getHelpContextId();
-
- /**
- * IWorkbenchPart#dispose()
- */
- public void dispose() {
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).removeDoubleClickListener(this);
- }
- setViewer(null);
- fActionMap.clear();
- DebugActionGroupsManager.getDefault().deregisterView(this);
- super.dispose();
- }
-
- /**
- * @see IDebugView#getViewer()
- */
- public Viewer getViewer() {
- return fViewer;
- }
-
- /**
- * Returns this view's viewer as a structured viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a structured viewer
- * or <code>null</code>
- */
- protected StructuredViewer getStructuredViewer() {
- if (getViewer() instanceof StructuredViewer) {
- return (StructuredViewer)getViewer();
- }
- return null;
- }
-
- /**
- * Returns this view's viewer as a text viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a text viewer
- * or <code>null</code>
- */
- protected TextViewer getTextViewer() {
- if (getViewer() instanceof TextViewer) {
- return (TextViewer)getViewer();
- }
- return null;
- }
-
- /**
- * @see IDebugView#getPresentation(String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- if (getViewer() instanceof StructuredViewer) {
- IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
- if (lp instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)lp).getPresentation(id);
- }
- if (lp instanceof LazyModelPresentation) {
- if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
- return (IDebugModelPresentation)lp;
- }
- }
- }
- return null;
- }
-
- /**
- * Creates a pop-up menu on the given control. The menu
- * is registered with this view's site, such that other
- * plug-ins may contribute to the menu. Subclasses should
- * call this method, specifying the menu control as the
- * control used in their viewer (for example, tree viewer).
- * Subclasses must implement the method
- * <code>#fillContextMenu(IMenuManager)</code> which will
- * be called each time the context menu is realized.
- *
- * @param menuControl the control with which the pop-up
- * menu will be associated with.
- */
- protected void createContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- // register the context menu such that other plugins may contribute to it
- getSite().registerContextMenu(menuMgr, getViewer());
- fContextMenuManager= menuMgr;
- }
-
- /**
- * @see IDebugView#getContextMenuManager()
- */
- public IMenuManager getContextMenuManager() {
- return fContextMenuManager;
- }
-
- /**
- * Subclasses must override this method to fill the context
- * menu each time it is realized.
- *
- * @param menu the context menu
- */
- protected abstract void fillContextMenu(IMenuManager menu);
-
- /**
- * Configures this view's toolbar. Subclasses implement
- * <code>#configureToolBar(IToolBarManager)</code> to
- * contribute actions to the toolbar.
- * <p>
- * To properly initialize toggle actions that are contributed
- * to this view, state is restored for toggle actions that have
- * a persisted state in the view's memento. As well, any toggle
- * actions that have an initial state of 'checked' are invoked.
- * The actions' states are restored and the actions are invoked
- * in a runnable, after the view is created.
- * </p>
- */
- protected void initializeToolBar() {
- final IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- configureToolBar(tbm);
- getViewSite().getActionBars().updateActionBars();
- // this is in a runnable to be run after this view's pane
- // is created
- if (getMemento() != null) {
- Runnable r = new Runnable() {
- public void run() {
- if (!isAvailable()) {
- return;
- }
- IContributionItem[] items = tbm.getItems();
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)items[i]).getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX) {
- initActionState(getMemento(), action);
- if (action.isChecked()) {
- action.run();
- }
- }
- }
- }
- }
- setMemento(null);
- }
- };
- asyncExec(r);
- }
- }
-
- /**
- * Sets the viewer for this view.
- *
- * @param viewer viewer
- */
- private void setViewer(Viewer viewer) {
- fViewer = viewer;
- }
-
- /**
- * Subclasses implement this menu to contribute actions
- * to the toolbar. This method is called after
- * <code>createActions()</code>.
- *
- * @param tbm the tool bar manager for this view's site
- * @see #createViewer(Composite)
- */
- protected abstract void configureToolBar(IToolBarManager tbm);
-
- /**
- * @see IDebugView#setAction(String, IAction)
- */
- public void setAction(String actionID, IAction action) {
- if (action == null) {
- Object removedAction= fActionMap.remove(actionID);
- fUpdateables.remove(removedAction);
- } else {
- fActionMap.put(actionID, action);
- if (action instanceof IUpdate) {
- fUpdateables.add(action);
- }
- }
- if (actionID.equals(SELECT_ALL_ACTION)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- } else if (actionID.equals(COPY_ACTION)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- } else if (actionID.equals(CUT_ACTION)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- } else if (actionID.equals(PASTE_ACTION)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- } else if (actionID.equals(FIND_ACTION)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- }
- }
-
- /**
- * @see IDebugView#getAction(String)
- */
- public IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
- }
-
- /**
- * Updates all the registered updatables.
- */
- public void updateObjects() {
- Iterator actions = fUpdateables.iterator();
- while (actions.hasNext()) {
- ((IUpdate)actions.next()).update();
- }
- }
-
- /**
- * Handles key events in viewer. Invokes
- * <ol>
- * <li><code>REMOVE_ACTION</code> when the delete
- * key is pressed</li>
- */
- protected void handleKeyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- IAction action = getAction(REMOVE_ACTION);
- if (action != null && action.isEnabled()) {
- action.run();
- }
- }
- }
-
- /**
- * Delegate to the <code>DOUBLE_CLICK_ACTION</code>,
- * if any.
- *
- * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IAction action = getAction(DOUBLE_CLICK_ACTION);
- if (action != null && action.isEnabled()) {
- action.run();
- }
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#asyncExec(java.lang.Runnable)
- */
- public void asyncExec(Runnable r) {
- if (isAvailable()) {
- getViewer().getControl().getDisplay().asyncExec(r);
- }
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#syncExec(java.lang.Runnable)
- */
- public void syncExec(Runnable r) {
- if (isAvailable()) {
- getViewer().getControl().getDisplay().syncExec(r);
- }
- }
-
- /**
- * @see IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- //store the memento to be used when this view is created.
- setMemento(memento);
- }
-
- /**
- * Returns the memento that contains the persisted state of
- * the view. May be <code>null</code>.
- */
- protected IMemento getMemento() {
- return fMemento;
- }
-
- /**
- * Sets the memento that contains the persisted state of the
- * view.
- */
- protected void setMemento(IMemento memento) {
- fMemento = memento;
- }
-
- /**
- * Persists the state of the enabled check box actions contributed
- * to this view.
- *
- * @see IViewPart#saveState(IMemento)
- */
- public void saveState(IMemento memento) {
- if (getMemento() != null) {
- //this view was never fully created
- //persist the old values.
- memento.putMemento(getMemento());
- return;
- }
- IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- IContributionItem[] items= tbm.getItems();
- for (int i = 0; i < items.length; i++) {
- IContributionItem iContributionItem = items[i];
- if (iContributionItem instanceof ActionContributionItem) {
- ActionContributionItem item= (ActionContributionItem)iContributionItem;
- IAction action= item.getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX && action.isEnabled()) {
- saveActionState(memento, action);
- }
- }
- }
- }
-
- /**
- * Persists the checked state of the action in the memento.
- * The state is persisted as an <code>Integer</code>: <code>1</code>
- * meaning the action is checked; <code>0</code> representing unchecked.
- */
- protected void saveActionState(IMemento memento, IAction action) {
- String id= action.getId();
- if (id != null) {
- int state= action.isChecked() ? 1 : 0;
- memento.putInteger(id, state);
- }
- }
-
- /**
- * Restores the persisted checked state of the action as stored
- * in the memento.
- * <p>
- * The state was persisted as an <code>Integer</code>: <code>1</code>
- * meaning the action is checked; <code>0</code> representing unchecked.
- *
- * @param memento the memento used to persist the actions state
- * @param action the action that needs its state restored.
- */
- protected void initActionState(IMemento memento, IAction action) {
- String id= action.getId();
- if (id != null) {
- Integer state= memento.getInteger(id);
- if (state != null) {
- if (action.isEnabled()) {
- action.setChecked(state.intValue() == 1);
- }
- }
- }
- }
-
- /**
- * Returns the specified view in this view's page
- * or <code>null</code> if none.
- *
- * @param id view identifier
- * @return view part
- */
- protected IViewPart findView(String id) {
- IWorkbenchPage page = getSite().getPage();
- IViewPart view = null;
- if (page != null) {
- view = page.findView(id);
- }
- return view;
- }
-
- /**
- * @see PageBookView#isImportant(IWorkbenchPart)
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return false;
- }
-
- /**
- * @see PageBookView#doCreatePage(IWorkbenchPart)
- */
- protected PageRec doCreatePage(IWorkbenchPart part) {
- return null;
- }
-
- /**
- * @see PageBookView#doDestroyPage(IWorkbenchPart, PageRec)
- */
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- }
-
- /**
- * @see PageBookView#getBootstrapPart()
- */
- protected IWorkbenchPart getBootstrapPart() {
- return null;
- }
-
- /**
- * Returns the default control for this view. By default,
- * this view's viewer's control is returned. Subclasses
- * should override if required - for example, if this
- * view has its viewer nested inside other controls.
- *
- * @return this view's default control.
- */
- protected Control getDefaultControl() {
- Viewer viewer = getViewer();
- if (viewer != null) {
- return viewer.getControl();
- }
- return null;
- }
-
- /**
- * Sets this view's message page
- *
- * @param page message page
- */
- private void setMessagePage(MessagePage page) {
- fMessagePage = page;
- }
-
- /**
- * Returns this view's message page
- *
- * @return message page
- */
- protected MessagePage getMessagePage() {
- return fMessagePage;
- }
-
- /**
- * Shows the given message in this view's message'
- * page. Makes the message page the visible page.
- *
- * @param message the message to display
- */
- public void showMessage(String message) {
- if (getPageBook().isDisposed()) {
- return;
- }
- getMessagePage().setMessage(message);
- getPageBook().showPage(getMessagePage().getControl());
- }
-
- /**
- * Shows this view's viewer page.
- */
- public void showViewer() {
- if (getPageBook().isDisposed()) {
- return;
- }
- getPageBook().showPage(getDefaultPage().getControl());
- }
-
- /**
- * Returns whether this view's viewer is
- * currently available.
- *
- * @return whether this view's viewer is
- * currently available
- */
- public boolean isAvailable() {
- return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());
- }
- /**
- * @see IDebugView#add(IUpdate)
- */
- public void add(IUpdate updatable) {
- if (!fUpdateables.contains(updatable)) {
- fUpdateables.add(updatable);
- }
- }
-
- /**
- * @see IDebugView#remove(IUpdate)
- */
- public void remove(IUpdate updatable) {
- fUpdateables.remove(updatable);
- }
-}
-
-
+package org.eclipse.debug.ui;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
+import org.eclipse.debug.internal.ui.LazyModelPresentation;
+import org.eclipse.debug.internal.ui.preferences.DebugActionGroupsManager;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.ui.part.MessagePage;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageBookView;
+import org.eclipse.ui.texteditor.IUpdate;
+
+/**
+ * Common function for debug related views:<ul>
+ * <li>Debug view adpater implementation - <code>IDebugView</code></li>
+ * <li>Action registry - actions can be stored in this view
+ * with a key. Actions that implement <code>IUpdate</code>
+ * are updated when <code>updateActions()</code> is
+ * called.</li>
+ * <li>Hooks the context menu associated with this view's
+ * underlying viewer and registers the menu with this
+ * view's site, such that other plug-ins may contribute.</li>
+ * <li>Hooks a key press listener, and invokes the
+ * <code>REMOVE_ACTION</code> when the delete key
+ * is pressed.</li>
+ * <li>Hooks a double-click listener, and invokes the
+ * <code>DOUBLE_CLICK_ACTION</code> when the mouse
+ * is double-clicked.</li>
+ * <li>Provides a mechanism for displaying an error message
+ * in the view, via the <code>PageBookView</code> mechanism.
+ * By default, a page book is created with a page showing
+ * this view's viewer. A message page is also created
+ * and shown when <code>showMessage(String)</code> is
+ * called.</li>
+ * </ul>
+ * <p>
+ * This class may be subclassed.
+ * </p>
+ * @since 2.0
+ */
+
+public abstract class AbstractDebugView extends PageBookView implements IDebugView, IDoubleClickListener {
+
+ /**
+ * Underlying viewer that displays the contents of
+ * this view.
+ */
+ private Viewer fViewer = null;
+
+ /**
+ * This view's message page.
+ */
+ private MessagePage fMessagePage = null;
+
+ /**
+ * Map of actions. Keys are strings, values
+ * are <code>IAction</code>.
+ */
+ private Map fActionMap = null;
+
+ /**
+ * Map of actions. Keys are strings, values
+ * are <code>IAction</code>.
+ */
+ private List fUpdateables = null;
+
+ /**
+ * The context menu manager for this view
+ */
+ private IMenuManager fContextMenuManager;
+
+ /**
+ * The memento that was used to persist the state of this view.
+ * May be <code>null</code>.
+ */
+ private IMemento fMemento;
+
+ /**
+ * Constructs a new debug view.
+ */
+ public AbstractDebugView() {
+ fActionMap = new HashMap(5);
+ fUpdateables= new ArrayList(3);
+ }
+
+ /**
+ * Debug views implement the debug view adapter which
+ * provides access to a view's underlying viewer and
+ * debug model presentation for a specific debug model.
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ * @see IDebugView
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == IDebugView.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * A page in this view's page book that contains this
+ * view's viewer.
+ */
+ class ViewerPage extends Page {
+ /**
+ * @see IPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ Viewer viewer = createViewer(parent);
+ setViewer(viewer);
+ }
+
+ /**
+ * @see IPage#getControl()
+ */
+ public Control getControl() {
+ return getDefaultControl();
+ }
+
+ /**
+ * @see IPage#setFocus()
+ */
+ public void setFocus() {
+ Viewer viewer= getViewer();
+ if (viewer != null) {
+ Control c = viewer.getControl();
+ if (!c.isFocusControl()) {
+ c.setFocus();
+ }
+ }
+ }
+
+}
+
+ /**
+ * Creates this view's underlying viewer and actions.
+ * Hooks a pop-up menu to the underlying viewer's control,
+ * as well as a key listener. When the delete key is pressed,
+ * the <code>REMOVE_ACTION</code> is invoked. Hooks help to
+ * this view. Subclasses must implement the following methods
+ * which are called in the following order when a view is
+ * created:<ul>
+ * <li><code>createViewer(Composite)</code> - the context
+ * menu is hooked to the viewer's control.</li>
+ * <li><code>createActions()</code></li>
+ * <li><code>configureToolBar(IToolBarManager)</code></li>
+ * <li><code>getHelpContextId()</code></li>
+ * </ul>
+ * @see IWorkbenchPart#createPartControl(Composite)
+ * @see AbstractDebugView#createPartControl(Composite)
+ * @see AbstractDebugView#createActions()
+ * @see AbstractDebugView#configureToolBar(IToolBarManager)
+ * @see AbstractDebugView#getHelpContextId()
+ * @see AbstractDebugView#fillContextMenu(IMenuManager)
+ */
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+ createActions();
+ initializeToolBar();
+ createContextMenu(getViewer().getControl());
+ WorkbenchHelp.setHelp(parent, getHelpContextId());
+ getViewer().getControl().addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ handleKeyPressed(e);
+ }
+ });
+ if (getViewer() instanceof StructuredViewer) {
+ ((StructuredViewer)getViewer()).addDoubleClickListener(this);
+ }
+ // create the message page
+ setMessagePage(new MessagePage());
+ getMessagePage().createControl(getPageBook());
+ initPage(getMessagePage());
+
+ DebugActionGroupsManager.getDefault().registerView(this);
+ }
+
+ /**
+ * The default page for a debug view is its viewer.
+ *
+ * @see PageBookView#createDefaultPage(PageBook)
+ */
+ protected IPage createDefaultPage(PageBook book) {
+ ViewerPage page = new ViewerPage();
+ page.createControl(book);
+ initPage(page);
+ return page;
+ }
+
+ /**
+ * Creates and returns this view's underlying viewer.
+ * The viewer's control will automatically be hooked
+ * to display a pop-up menu that other plug-ins may
+ * contribute to. Subclasses must override this method.
+ *
+ * @param parent the parent control
+ */
+ protected abstract Viewer createViewer(Composite parent);
+
+ /**
+ * Creates this view's actions. Subclasses must
+ * override this method, which is called after
+ * <code>createViewer(Composite)</code>
+ */
+ protected abstract void createActions();
+
+ /**
+ * Returns this view's help context id, which is hooked
+ * to this view on creation.
+ *
+ * @return help context id
+ */
+ protected abstract String getHelpContextId();
+
+ /**
+ * IWorkbenchPart#dispose()
+ */
+ public void dispose() {
+ if (getViewer() instanceof StructuredViewer) {
+ ((StructuredViewer)getViewer()).removeDoubleClickListener(this);
+ }
+ setViewer(null);
+ fActionMap.clear();
+ DebugActionGroupsManager.getDefault().deregisterView(this);
+ super.dispose();
+ }
+
+ /**
+ * @see IDebugView#getViewer()
+ */
+ public Viewer getViewer() {
+ return fViewer;
+ }
+
+ /**
+ * Returns this view's viewer as a structured viewer,
+ * or <code>null</code> if none.
+ *
+ * @return this view's viewer as a structured viewer
+ * or <code>null</code>
+ */
+ protected StructuredViewer getStructuredViewer() {
+ if (getViewer() instanceof StructuredViewer) {
+ return (StructuredViewer)getViewer();
+ }
+ return null;
+ }
+
+ /**
+ * Returns this view's viewer as a text viewer,
+ * or <code>null</code> if none.
+ *
+ * @return this view's viewer as a text viewer
+ * or <code>null</code>
+ */
+ protected TextViewer getTextViewer() {
+ if (getViewer() instanceof TextViewer) {
+ return (TextViewer)getViewer();
+ }
+ return null;
+ }
+
+ /**
+ * @see IDebugView#getPresentation(String)
+ */
+ public IDebugModelPresentation getPresentation(String id) {
+ if (getViewer() instanceof StructuredViewer) {
+ IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
+ if (lp instanceof DelegatingModelPresentation) {
+ return ((DelegatingModelPresentation)lp).getPresentation(id);
+ }
+ if (lp instanceof LazyModelPresentation) {
+ if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
+ return (IDebugModelPresentation)lp;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Creates a pop-up menu on the given control. The menu
+ * is registered with this view's site, such that other
+ * plug-ins may contribute to the menu. Subclasses should
+ * call this method, specifying the menu control as the
+ * control used in their viewer (for example, tree viewer).
+ * Subclasses must implement the method
+ * <code>#fillContextMenu(IMenuManager)</code> which will
+ * be called each time the context menu is realized.
+ *
+ * @param menuControl the control with which the pop-up
+ * menu will be associated with.
+ */
+ protected void createContextMenu(Control menuControl) {
+ MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager mgr) {
+ fillContextMenu(mgr);
+ }
+ });
+ Menu menu= menuMgr.createContextMenu(menuControl);
+ menuControl.setMenu(menu);
+
+ // register the context menu such that other plugins may contribute to it
+ getSite().registerContextMenu(menuMgr, getViewer());
+ fContextMenuManager= menuMgr;
+ }
+
+ /**
+ * @see IDebugView#getContextMenuManager()
+ */
+ public IMenuManager getContextMenuManager() {
+ return fContextMenuManager;
+ }
+
+ /**
+ * Subclasses must override this method to fill the context
+ * menu each time it is realized.
+ *
+ * @param menu the context menu
+ */
+ protected abstract void fillContextMenu(IMenuManager menu);
+
+ /**
+ * Configures this view's toolbar. Subclasses implement
+ * <code>#configureToolBar(IToolBarManager)</code> to
+ * contribute actions to the toolbar.
+ * <p>
+ * To properly initialize toggle actions that are contributed
+ * to this view, state is restored for toggle actions that have
+ * a persisted state in the view's memento. As well, any toggle
+ * actions that have an initial state of 'checked' are invoked.
+ * The actions' states are restored and the actions are invoked
+ * in a runnable, after the view is created.
+ * </p>
+ */
+ protected void initializeToolBar() {
+ final IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
+ configureToolBar(tbm);
+ getViewSite().getActionBars().updateActionBars();
+ // this is in a runnable to be run after this view's pane
+ // is created
+ if (getMemento() != null) {
+ Runnable r = new Runnable() {
+ public void run() {
+ if (!isAvailable()) {
+ return;
+ }
+ IContributionItem[] items = tbm.getItems();
+ if (items != null) {
+ for (int i = 0; i < items.length; i++) {
+ if (items[i] instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)items[i]).getAction();
+ if (action.getStyle() == IAction.AS_CHECK_BOX) {
+ initActionState(getMemento(), action);
+ if (action.isChecked()) {
+ action.run();
+ }
+ }
+ }
+ }
+ }
+ setMemento(null);
+ }
+ };
+ asyncExec(r);
+ }
+ }
+
+ /**
+ * Sets the viewer for this view.
+ *
+ * @param viewer viewer
+ */
+ private void setViewer(Viewer viewer) {
+ fViewer = viewer;
+ }
+
+ /**
+ * Subclasses implement this menu to contribute actions
+ * to the toolbar. This method is called after
+ * <code>createActions()</code>.
+ *
+ * @param tbm the tool bar manager for this view's site
+ * @see #createViewer(Composite)
+ */
+ protected abstract void configureToolBar(IToolBarManager tbm);
+
+ /**
+ * @see IDebugView#setAction(String, IAction)
+ */
+ public void setAction(String actionID, IAction action) {
+ if (action == null) {
+ Object removedAction= fActionMap.remove(actionID);
+ fUpdateables.remove(removedAction);
+ } else {
+ fActionMap.put(actionID, action);
+ if (action instanceof IUpdate) {
+ fUpdateables.add(action);
+ }
+ }
+ if (actionID.equals(SELECT_ALL_ACTION)) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ actionBars.setGlobalActionHandler(actionID, action);
+ } else if (actionID.equals(COPY_ACTION)) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ actionBars.setGlobalActionHandler(actionID, action);
+ } else if (actionID.equals(CUT_ACTION)) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ actionBars.setGlobalActionHandler(actionID, action);
+ } else if (actionID.equals(PASTE_ACTION)) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ actionBars.setGlobalActionHandler(actionID, action);
+ } else if (actionID.equals(FIND_ACTION)) {
+ IActionBars actionBars = getViewSite().getActionBars();
+ actionBars.setGlobalActionHandler(actionID, action);
+ }
+ }
+
+ /**
+ * @see IDebugView#getAction(String)
+ */
+ public IAction getAction(String actionID) {
+ return (IAction) fActionMap.get(actionID);
+ }
+
+ /**
+ * Updates all the registered updatables.
+ */
+ public void updateObjects() {
+ Iterator actions = fUpdateables.iterator();
+ while (actions.hasNext()) {
+ ((IUpdate)actions.next()).update();
+ }
+ }
+
+ /**
+ * Handles key events in viewer. Invokes
+ * <ol>
+ * <li><code>REMOVE_ACTION</code> when the delete
+ * key is pressed</li>
+ */
+ protected void handleKeyPressed(KeyEvent event) {
+ if (event.character == SWT.DEL && event.stateMask == 0) {
+ IAction action = getAction(REMOVE_ACTION);
+ if (action != null && action.isEnabled()) {
+ action.run();
+ }
+ }
+ }
+
+ /**
+ * Delegate to the <code>DOUBLE_CLICK_ACTION</code>,
+ * if any.
+ *
+ * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
+ */
+ public void doubleClick(DoubleClickEvent event) {
+ IAction action = getAction(DOUBLE_CLICK_ACTION);
+ if (action != null && action.isEnabled()) {
+ action.run();
+ }
+ }
+
+ /**
+ * Registers the given runnable with the display
+ * associated with this view's control, if any.
+ *
+ * @see org.eclipse.swt.widgets.Display#asyncExec(java.lang.Runnable)
+ */
+ public void asyncExec(Runnable r) {
+ if (isAvailable()) {
+ getViewer().getControl().getDisplay().asyncExec(r);
+ }
+ }
+
+ /**
+ * Registers the given runnable with the display
+ * associated with this view's control, if any.
+ *
+ * @see org.eclipse.swt.widgets.Display#syncExec(java.lang.Runnable)
+ */
+ public void syncExec(Runnable r) {
+ if (isAvailable()) {
+ getViewer().getControl().getDisplay().syncExec(r);
+ }
+ }
+
+ /**
+ * @see IViewPart#init(IViewSite, IMemento)
+ */
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ super.init(site, memento);
+ //store the memento to be used when this view is created.
+ setMemento(memento);
+ }
+
+ /**
+ * Returns the memento that contains the persisted state of
+ * the view. May be <code>null</code>.
+ */
+ protected IMemento getMemento() {
+ return fMemento;
+ }
+
+ /**
+ * Sets the memento that contains the persisted state of the
+ * view.
+ */
+ protected void setMemento(IMemento memento) {
+ fMemento = memento;
+ }
+
+ /**
+ * Persists the state of the enabled check box actions contributed
+ * to this view.
+ *
+ * @see IViewPart#saveState(IMemento)
+ */
+ public void saveState(IMemento memento) {
+ if (getMemento() != null) {
+ //this view was never fully created
+ //persist the old values.
+ memento.putMemento(getMemento());
+ return;
+ }
+ IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
+ IContributionItem[] items= tbm.getItems();
+ for (int i = 0; i < items.length; i++) {
+ IContributionItem iContributionItem = items[i];
+ if (iContributionItem instanceof ActionContributionItem) {
+ ActionContributionItem item= (ActionContributionItem)iContributionItem;
+ IAction action= item.getAction();
+ if (action.getStyle() == IAction.AS_CHECK_BOX && action.isEnabled()) {
+ saveActionState(memento, action);
+ }
+ }
+ }
+ }
+
+ /**
+ * Persists the checked state of the action in the memento.
+ * The state is persisted as an <code>Integer</code>: <code>1</code>
+ * meaning the action is checked; <code>0</code> representing unchecked.
+ */
+ protected void saveActionState(IMemento memento, IAction action) {
+ String id= action.getId();
+ if (id != null) {
+ int state= action.isChecked() ? 1 : 0;
+ memento.putInteger(id, state);
+ }
+ }
+
+ /**
+ * Restores the persisted checked state of the action as stored
+ * in the memento.
+ * <p>
+ * The state was persisted as an <code>Integer</code>: <code>1</code>
+ * meaning the action is checked; <code>0</code> representing unchecked.
+ *
+ * @param memento the memento used to persist the actions state
+ * @param action the action that needs its state restored.
+ */
+ protected void initActionState(IMemento memento, IAction action) {
+ String id= action.getId();
+ if (id != null) {
+ Integer state= memento.getInteger(id);
+ if (state != null) {
+ if (action.isEnabled()) {
+ action.setChecked(state.intValue() == 1);
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the specified view in this view's page
+ * or <code>null</code> if none.
+ *
+ * @param id view identifier
+ * @return view part
+ */
+ protected IViewPart findView(String id) {
+ IWorkbenchPage page = getSite().getPage();
+ IViewPart view = null;
+ if (page != null) {
+ view = page.findView(id);
+ }
+ return view;
+ }
+
+ /**
+ * @see PageBookView#isImportant(IWorkbenchPart)
+ */
+ protected boolean isImportant(IWorkbenchPart part) {
+ return false;
+ }
+
+ /**
+ * @see PageBookView#doCreatePage(IWorkbenchPart)
+ */
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ return null;
+ }
+
+ /**
+ * @see PageBookView#doDestroyPage(IWorkbenchPart, PageRec)
+ */
+ protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
+ }
+
+ /**
+ * @see PageBookView#getBootstrapPart()
+ */
+ protected IWorkbenchPart getBootstrapPart() {
+ return null;
+ }
+
+ /**
+ * Returns the default control for this view. By default,
+ * this view's viewer's control is returned. Subclasses
+ * should override if required - for example, if this
+ * view has its viewer nested inside other controls.
+ *
+ * @return this view's default control.
+ */
+ protected Control getDefaultControl() {
+ Viewer viewer = getViewer();
+ if (viewer != null) {
+ return viewer.getControl();
+ }
+ return null;
+ }
+
+ /**
+ * Sets this view's message page
+ *
+ * @param page message page
+ */
+ private void setMessagePage(MessagePage page) {
+ fMessagePage = page;
+ }
+
+ /**
+ * Returns this view's message page
+ *
+ * @return message page
+ */
+ protected MessagePage getMessagePage() {
+ return fMessagePage;
+ }
+
+ /**
+ * Shows the given message in this view's message'
+ * page. Makes the message page the visible page.
+ *
+ * @param message the message to display
+ */
+ public void showMessage(String message) {
+ if (getPageBook().isDisposed()) {
+ return;
+ }
+ getMessagePage().setMessage(message);
+ getPageBook().showPage(getMessagePage().getControl());
+ }
+
+ /**
+ * Shows this view's viewer page.
+ */
+ public void showViewer() {
+ if (getPageBook().isDisposed()) {
+ return;
+ }
+ getPageBook().showPage(getDefaultPage().getControl());
+ }
+
+ /**
+ * Returns whether this view's viewer is
+ * currently available.
+ *
+ * @return whether this view's viewer is
+ * currently available
+ */
+ public boolean isAvailable() {
+ return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());
+ }
+ /**
+ * @see IDebugView#add(IUpdate)
+ */
+ public void add(IUpdate updatable) {
+ if (!fUpdateables.contains(updatable)) {
+ fUpdateables.add(updatable);
+ }
+ }
+
+ /**
+ * @see IDebugView#remove(IUpdate)
+ */
+ public void remove(IUpdate updatable) {
+ fUpdateables.remove(updatable);
+ }
+}
+
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
index 2834aac90..e994a1f26 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
@@ -1,738 +1,738 @@
-package org.eclipse.debug.ui;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Common launch configuration tab to specify the location a launch configuration
- * is stored, whether it should appear in the favorites list, and perspective
- * switching for an associated launch.
- * <p>
- * Clients may instantiate this class. This class is not intended to be subclassed.
- * </p>
- * @since 2.0
- */
-public class CommonTab extends AbstractLaunchConfigurationTab {
-
- // Local/shared UI widgets
- private Label fLocalSharedLabel;
- private Button fLocalRadioButton;
- private Button fSharedRadioButton;
-
- // Shared location UI widgets
- private Label fSharedLocationLabel;
- private Text fSharedLocationText;
- private Button fSharedLocationButton;
-
- /**
- * The combo box specifying the run perspective
- */
- private Combo fRunPerspectiveCombo;
-
- /**
- * Label for the run perspective combo box
- */
- private Label fRunPerspectiveLabel;
-
- /**
- * The combo box specifying the debug perspective
- */
- private Combo fDebugPerspectiveCombo;
-
- /**
- * Label for the debug perspective combo box
- */
- private Label fDebugPerspectiveLabel;
-
- /**
- * The label that acts as header for the 'switch to perspective' widgets
- */
- private Label fSwitchToLabel;
-
- /**
- * The check box specifying run favoite
- */
- private Button fRunFavoriteButton;
-
- /**
- * The check box specifying debug favoite
- */
- private Button fDebugFavoriteButton;
-
- /**
- * Constant for the name of the drop-down choice 'None' for perspectives.
- */
- private static final String PERSPECTIVE_NONE_NAME = LaunchConfigurationsMessages.getString("CommonTab.None"); //$NON-NLS-1$
-
- /**
- * Constant for the name of the drop-down choice 'Default' for perspectives.
- */
- private static final String PERSPECTIVE_DEFAULT_NAME = LaunchConfigurationsMessages.getString("CommonTab.Default"); //$NON-NLS-1$
-
- /**
- * Modify listener that simply updates the owning launch configuration dialog.
- */
- private ModifyListener fBasicModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- };
-
- /**
- * Selection listener that simply updates the owning launch configuration dialog.
- */
- private SelectionAdapter fBasicSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- updateLaunchConfigurationDialog();
- }
- };
-
- /**
- * @see ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
-
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- WorkbenchHelp.setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
- GridLayout topLayout = new GridLayout();
- comp.setLayout(topLayout);
-
- createVerticalSpacer(comp, 1);
-
- Composite radioComp = new Composite(comp, SWT.NONE);
- GridLayout radioLayout = new GridLayout();
- radioLayout.marginHeight = 0;
- radioLayout.marginWidth = 0;
- radioComp.setLayout(radioLayout);
-
- setLocalSharedLabel(new Label(radioComp, SWT.NONE));
- getLocalSharedLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Type_of_launch_configuration__2")); //$NON-NLS-1$
-
- setLocalRadioButton(new Button(radioComp, SWT.RADIO));
- getLocalRadioButton().setText(LaunchConfigurationsMessages.getString("CommonTab.L&ocal_3")); //$NON-NLS-1$
- setSharedRadioButton(new Button(radioComp, SWT.RADIO));
- getSharedRadioButton().setText(LaunchConfigurationsMessages.getString("CommonTab.S&hared_4")); //$NON-NLS-1$
- getSharedRadioButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedRadioButtonSelected();
- }
- });
-
- Composite locationComp = new Composite(comp, SWT.NONE);
- GridLayout locationLayout = new GridLayout();
- locationLayout.numColumns = 2;
- locationLayout.marginHeight = 0;
- locationLayout.marginWidth = 0;
- locationComp.setLayout(locationLayout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- locationComp.setLayoutData(gd);
-
- setSharedLocationLabel(new Label(locationComp, SWT.NONE));
- getSharedLocationLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Location_of_shared_confi&guration__5")); //$NON-NLS-1$
- gd = new GridData();
- gd.horizontalSpan = 2;
- getSharedLocationLabel().setLayoutData(gd);
-
- setSharedLocationText(new Text(locationComp, SWT.SINGLE | SWT.BORDER));
- gd = new GridData(GridData.FILL_HORIZONTAL);
- getSharedLocationText().setLayoutData(gd);
- getSharedLocationText().addModifyListener(fBasicModifyListener);
-
- setSharedLocationButton(createPushButton(locationComp, LaunchConfigurationsMessages.getString("CommonTab.&Browse_6"), null)); //$NON-NLS-1$
- getSharedLocationButton().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedLocationButtonSelected();
- }
- });
-
- getLocalRadioButton().setSelection(true);
- setSharedEnabled(false);
-
- createVerticalSpacer(comp, 1);
-
- setSwitchToLabel(new Label(comp, SWT.HORIZONTAL | SWT.LEFT));
- getSwitchToLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Switch_to/Open_perspective_when_launched_in__7")); //$NON-NLS-1$
- gd = new GridData();
- gd.horizontalAlignment = GridData.BEGINNING;
- gd.horizontalSpan = 3;
- getSwitchToLabel().setLayoutData(gd);
-
- Composite perspComp = new Composite(comp, SWT.NONE);
- GridLayout perspLayout = new GridLayout();
- perspLayout.marginHeight = 0;
- perspLayout.marginWidth = 0;
- perspLayout.numColumns = 2;
- perspComp.setLayout(perspLayout);
-
- setRunPerspectiveLabel(new Label(perspComp, SWT.NONE));
- getRunPerspectiveLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Run_mode_8")); //$NON-NLS-1$
-
- setRunPerspectiveCombo(new Combo(perspComp, SWT.DROP_DOWN | SWT.READ_ONLY));
- gd = new GridData(GridData.GRAB_HORIZONTAL);
- getRunPerspectiveCombo().setLayoutData(gd);
- fillWithPerspectives(getRunPerspectiveCombo());
- getRunPerspectiveCombo().addModifyListener(fBasicModifyListener);
-
- setDebugPerspectiveLabel(new Label(perspComp, SWT.NONE));
- getDebugPerspectiveLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Debug_mode_9")); //$NON-NLS-1$
-
- setDebugPerspectiveCombo(new Combo(perspComp, SWT.DROP_DOWN |SWT.READ_ONLY));
- gd = new GridData(GridData.GRAB_HORIZONTAL);
- getDebugPerspectiveCombo().setLayoutData(gd);
- fillWithPerspectives(getDebugPerspectiveCombo());
- getDebugPerspectiveCombo().addModifyListener(fBasicModifyListener);
-
- createVerticalSpacer(comp, 1);
-
- Composite favComp = new Composite(comp, SWT.NONE);
- GridLayout favLayout = new GridLayout();
- favLayout.marginHeight = 0;
- favLayout.marginWidth = 0;
- favLayout.numColumns = 1;
- favComp.setLayout(favLayout);
-
- Label favLabel = new Label(favComp, SWT.HORIZONTAL | SWT.LEFT);
- favLabel.setText(LaunchConfigurationsMessages.getString("CommonTab.Display_in_favorites_menu__10")); //$NON-NLS-1$
-
- setRunFavoriteButton(new Button(favComp, SWT.CHECK));
- getRunFavoriteButton().setText(LaunchConfigurationsMessages.getString("CommonTab.&Run_11")); //$NON-NLS-1$
- getRunFavoriteButton().addSelectionListener(fBasicSelectionListener);
-
- setDebugFavoriteButton(new Button(favComp, SWT.CHECK));
- getDebugFavoriteButton().setText(LaunchConfigurationsMessages.getString("CommonTab.Debu&g_12")); //$NON-NLS-1$
- getDebugFavoriteButton().addSelectionListener(fBasicSelectionListener);
- }
-
-
- private void setSharedLocationButton(Button sharedLocationButton) {
- this.fSharedLocationButton = sharedLocationButton;
- }
-
- private Button getSharedLocationButton() {
- return fSharedLocationButton;
- }
-
- private void setSharedLocationText(Text sharedLocationText) {
- this.fSharedLocationText = sharedLocationText;
- }
-
- private Text getSharedLocationText() {
- return fSharedLocationText;
- }
-
- private void setSharedLocationLabel(Label sharedLocationLabel) {
- this.fSharedLocationLabel = sharedLocationLabel;
- }
-
- private Label getSharedLocationLabel() {
- return fSharedLocationLabel;
- }
-
- private void setLocalSharedLabel(Label localSharedLabel) {
- fLocalSharedLabel = localSharedLabel;
- }
-
- private Label getLocalSharedLabel() {
- return fLocalSharedLabel;
- }
-
- private void setLocalRadioButton(Button button) {
- fLocalRadioButton = button;
- }
-
- private Button getLocalRadioButton() {
- return fLocalRadioButton;
- }
-
- private void setSharedRadioButton(Button button) {
- fSharedRadioButton = button;
- }
-
- private Button getSharedRadioButton() {
- return fSharedRadioButton;
- }
-
- /**
- * Returns the perspective combo assoicated with the
- * debug perspective button.
- *
- * @return a combo box
- */
- private Combo getDebugPerspectiveCombo() {
- return fDebugPerspectiveCombo;
- }
-
- /**
- * Sets the perspective combo assoicated with the
- * debug perspective button.
- *
- * @param combo a combo box
- */
- private void setDebugPerspectiveCombo(Combo combo) {
- fDebugPerspectiveCombo = combo;
- }
-
- /**
- * Returns the perspective combo assoicated with the
- * run perspective button.
- *
- * @return a combo box
- */
- private Combo getRunPerspectiveCombo() {
- return fRunPerspectiveCombo;
- }
-
- /**
- * Sets the perspective combo assoicated with the
- * run perspective button.
- *
- * @param combo a combo box
- */
- private void setRunPerspectiveCombo(Combo combo) {
- fRunPerspectiveCombo = combo;
- }
-
- private void setRunPerspectiveLabel(Label fRunPerspectiveLabel) {
- this.fRunPerspectiveLabel = fRunPerspectiveLabel;
- }
-
- private Label getRunPerspectiveLabel() {
- return fRunPerspectiveLabel;
- }
-
- private void setDebugPerspectiveLabel(Label fDebugPerspectiveLabel) {
- this.fDebugPerspectiveLabel = fDebugPerspectiveLabel;
- }
-
- private Label getDebugPerspectiveLabel() {
- return fDebugPerspectiveLabel;
- }
-
- private void setSwitchToLabel(Label switchToLabel) {
- fSwitchToLabel = switchToLabel;
- }
-
- private Label getSwitchToLabel() {
- return fSwitchToLabel;
- }
-
- private void handleSharedRadioButtonSelected() {
- setSharedEnabled(isShared());
- updateLaunchConfigurationDialog();
- }
-
- private void setSharedEnabled(boolean enable) {
- getSharedLocationLabel().setEnabled(enable);
- getSharedLocationText().setEnabled(enable);
- getSharedLocationButton().setEnabled(enable);
- }
-
- private boolean isShared() {
- return getSharedRadioButton().getSelection();
- }
-
- private void handleSharedLocationButtonSelected() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
- getWorkspaceRoot(),
- false,
- LaunchConfigurationsMessages.getString("CommonTab.Select_a_location_for_the_launch_configuration_13")); //$NON-NLS-1$
-
- String currentContainerString = getSharedLocationText().getText();
- IContainer currentContainer = getContainer(currentContainerString);
- if (currentContainer != null) {
- IPath path = currentContainer.getFullPath();
- dialog.setInitialSelections(new Object[] {path});
- }
-
- dialog.showClosedProjects(false);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.toOSString();
- getSharedLocationText().setText(containerName);
- }
- }
-
- private IContainer getContainer(String path) {
- Path containerPath = new Path(path);
- return (IContainer) getWorkspaceRoot().findMember(containerPath);
- }
-
- /**
- * Returns the perspective with the given label, or
- * <code>null</code> if none is found.
- *
- * @param label perspective label
- * @return perspective descriptor
- */
- private IPerspectiveDescriptor getPerspectiveWithLabel(String label) {
- return PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithLabel(label);
- }
-
- /**
- * Returns the perspective with the given id, or
- * <code>null</code> if none is found.
- *
- * @param id perspective identifier
- * @return perspective descriptor
- */
- private IPerspectiveDescriptor getPerspectiveWithId(String id) {
- return PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id);
- }
-
- /**
- * Fills the given combo box with the labels of all existing
- * perspectives and one to indicate 'none'.
- *
- * @param combo combo box
- */
- private void fillWithPerspectives(Combo combo) {
- combo.add(PERSPECTIVE_NONE_NAME);
- combo.add(PERSPECTIVE_DEFAULT_NAME);
- IPerspectiveRegistry reg = PlatformUI.getWorkbench().getPerspectiveRegistry();
- IPerspectiveDescriptor[] persps = reg.getPerspectives();
- for (int i = 0; i < persps.length; i++) {
- combo.add(persps[i].getLabel());
- }
- }
-
- /**
- * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- updateLocalSharedFromConfig(configuration);
- updateSharedLocationFromConfig(configuration);
- updateRunPerspectiveFromConfig(configuration);
- updateDebugPerspectiveFromConfig(configuration);
- updateFavoritesFromConfig(configuration);
- }
-
- private void updateLocalSharedFromConfig(ILaunchConfiguration config) {
- boolean isShared = !config.isLocal();
- getSharedRadioButton().setSelection(isShared);
- getLocalRadioButton().setSelection(!isShared);
- setSharedEnabled(isShared);
- }
-
- private void updateSharedLocationFromConfig(ILaunchConfiguration config) {
- IFile file = config.getFile();
- if (file != null) {
- IContainer parent = file.getParent();
- if (parent != null) {
- String containerName = parent.getFullPath().toOSString();
- getSharedLocationText().setText(containerName);
- }
- }
- }
-
- private void updateRunPerspectiveFromConfig(ILaunchConfiguration config) {
- ILaunchConfigurationType type = null;
- String runPerspID = null;
- try {
- runPerspID = config.getAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, (String)null);
- type = config.getType();
- } catch (CoreException ce) {
- updatePerspectiveCombo(getRunPerspectiveCombo(), null);
- getRunPerspectiveCombo().setEnabled(false);
- getRunPerspectiveLabel().setEnabled(false);
- return;
- }
- updatePerspectiveCombo(getRunPerspectiveCombo(), runPerspID);
- boolean enable = type.supportsMode(ILaunchManager.RUN_MODE);
- getRunPerspectiveCombo().setEnabled(enable);
- getRunPerspectiveLabel().setEnabled(enable);
- }
-
- private void updateDebugPerspectiveFromConfig(ILaunchConfiguration config) {
- ILaunchConfigurationType type = null;
- String debugPerspID = null;
- try {
- debugPerspID = config.getAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, (String)null);
- type = config.getType();
- } catch (CoreException ce) {
- updatePerspectiveCombo(getDebugPerspectiveCombo(), null);
- getDebugPerspectiveCombo().setEnabled(false);
- getDebugPerspectiveLabel().setEnabled(false);
- return;
- }
- updatePerspectiveCombo(getDebugPerspectiveCombo(), debugPerspID);
- boolean enable = type.supportsMode(ILaunchManager.DEBUG_MODE);
- getDebugPerspectiveCombo().setEnabled(enable);
- getDebugPerspectiveLabel().setEnabled(enable);
- }
-
- private void updateFavoritesFromConfig(ILaunchConfiguration config) {
- ILaunchConfigurationType type = null;
- boolean isDebug = false;
- boolean isRun = false;
- try {
- type = config.getType();
- isDebug = config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- isRun = config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- } catch (CoreException ce) {
- getDebugFavoriteButton().setEnabled(false);
- getRunFavoriteButton().setEnabled(false);
- return;
- }
- getDebugFavoriteButton().setEnabled(type.supportsMode(ILaunchManager.DEBUG_MODE));
- getRunFavoriteButton().setEnabled(type.supportsMode(ILaunchManager.RUN_MODE));
- getDebugFavoriteButton().setSelection(isDebug);
- getRunFavoriteButton().setSelection(isRun);
-
- }
-
- /**
- * Based on the given perspective identifier, update the settings
- * of the button and associated combo box. The check box is selected
- * when there is a valid perspective, and the combo box is set to
- * display the label of the associated perspective. The check box is
- * deselected, and the combo box is set to the default value (debug
- * perspective) when the identfier is <code>null</code>.
- *
- * @param button check box button
- * @param combo combo box with perspective labels
- * @param id perspective identifier or <code>null</code>
- */
- private void updatePerspectiveCombo(Combo combo, String id) {
- if ((id == null) || (id.equals(IDebugUIConstants.PERSPECTIVE_NONE))) {
- combo.setText(PERSPECTIVE_NONE_NAME);
- } else if (id.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
- combo.setText(PERSPECTIVE_DEFAULT_NAME);
- } else {
- IPerspectiveDescriptor pd = getPerspectiveWithId(id);
- if (pd == null) {
- // perpective does not exist - reset
- updatePerspectiveCombo(combo, null);
- } else {
- combo.setText(pd.getLabel());
- }
- }
- }
-
- private void updateConfigFromLocalShared(ILaunchConfigurationWorkingCopy config) {
- if (isShared()) {
- String containerPathString = getSharedLocationText().getText();
- IContainer container = (IContainer) getContainer(containerPathString);
- config.setContainer(container);
- } else {
- config.setContainer(null);
- }
- }
-
- /**
- * Update the run perspective attribute based on current
- * UI settings.
- */
- private void updateConfigFromRunPerspective(ILaunchConfigurationWorkingCopy config) {
- String selectedText = getRunPerspectiveCombo().getText();
- String perspID = null;
- if (selectedText.equals(PERSPECTIVE_NONE_NAME)) {
- perspID = IDebugUIConstants.PERSPECTIVE_NONE;
- }
- else if (selectedText.equals(PERSPECTIVE_DEFAULT_NAME)) {
- perspID = IDebugUIConstants.PERSPECTIVE_DEFAULT;
- } else {
- IPerspectiveDescriptor descriptor = getPerspectiveWithLabel(selectedText);
- if (descriptor != null) {
- perspID = descriptor.getId();
- }
- }
- config.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, perspID);
- }
-
- /**
- * Update the debug perspective attribute based on current
- * UI settings.
- */
- private void updateConfigFromDebugPerspective(ILaunchConfigurationWorkingCopy config) {
- String selectedText = getDebugPerspectiveCombo().getText();
- String perspID = null;
- if (selectedText.equals(PERSPECTIVE_NONE_NAME)) {
- perspID = IDebugUIConstants.PERSPECTIVE_NONE;
- }
- else if (selectedText.equals(PERSPECTIVE_DEFAULT_NAME)) {
- perspID = IDebugUIConstants.PERSPECTIVE_DEFAULT;
- } else {
- IPerspectiveDescriptor descriptor = getPerspectiveWithLabel(selectedText);
- if (descriptor != null) {
- perspID = descriptor.getId();
- }
- }
- config.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, perspID);
- }
-
- /**
- * Update the favorite settings.
- *
- * NOTE: set to NULL instead of false for backwards compatibility
- * when comparing if content is equal, since 'false' is default
- * and will be missing for older configs.
- */
- private void updateConfigFromFavorites(ILaunchConfigurationWorkingCopy config) {
- if (getDebugFavoriteButton().getSelection()) {
- config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, true);
- } else {
- config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- }
- if (getRunFavoriteButton().getSelection()) {
- config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, true);
- } else {
- config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
- }
- }
-
- /**
- * Convenience method for getting the workspace root.
- */
- private IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- setMessage(null);
- setErrorMessage(null);
-
- return validateLocalShared();
- }
-
- private boolean validateLocalShared() {
- if (isShared()) {
- String path = fSharedLocationText.getText().trim();
- IContainer container = getContainer(path);
- if (container == null || container.equals(ResourcesPlugin.getWorkspace().getRoot())) {
- setErrorMessage(LaunchConfigurationsMessages.getString("CommonTab.Invalid_shared_configuration_location_14")); //$NON-NLS-1$
- return false;
- } else if (!container.getProject().isOpen()) {
- setErrorMessage(LaunchConfigurationsMessages.getString("CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1")); //$NON-NLS-1$
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setContainer(null);
-
- config.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
-
- config.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
- }
-
- /**
- * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- updateConfigFromDebugPerspective(configuration);
- updateConfigFromRunPerspective(configuration);
- updateConfigFromLocalShared(configuration);
- updateConfigFromFavorites(configuration);
- }
-
- /**
- * Returns the check box used to specify a config
- * as a debug favorite.
- *
- * @return check box
- */
- private Button getDebugFavoriteButton() {
- return fDebugFavoriteButton;
- }
-
- /**
- * Sets the check box used to specify a config
- * as a debug favorite.
- *
- * @param button check box
- */
- private void setDebugFavoriteButton(Button button) {
- fDebugFavoriteButton = button;
- }
-
- /**
- * Returns the check box used to specify a config
- * as a run favorite.
- *
- * @return check box
- */
- private Button getRunFavoriteButton() {
- return fRunFavoriteButton;
- }
-
- /**
- * Sets the check box used to specify a config
- * as a run favorite.
- *
- * @param button check box
- */
- private void setRunFavoriteButton(Button button) {
- fRunFavoriteButton = button;
- }
-
- /**
- * @see ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return LaunchConfigurationsMessages.getString("CommonTab.&Common_15"); //$NON-NLS-1$
- }
-
- /**
- * @see ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return validateLocalShared();
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IDebugUIConstants.IMG_PERSPECTIVE_DEBUG);
- }
-
-}
-
+package org.eclipse.debug.ui;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+/**
+ * Common launch configuration tab to specify the location a launch configuration
+ * is stored, whether it should appear in the favorites list, and perspective
+ * switching for an associated launch.
+ * <p>
+ * Clients may instantiate this class. This class is not intended to be subclassed.
+ * </p>
+ * @since 2.0
+ */
+public class CommonTab extends AbstractLaunchConfigurationTab {
+
+ // Local/shared UI widgets
+ private Label fLocalSharedLabel;
+ private Button fLocalRadioButton;
+ private Button fSharedRadioButton;
+
+ // Shared location UI widgets
+ private Label fSharedLocationLabel;
+ private Text fSharedLocationText;
+ private Button fSharedLocationButton;
+
+ /**
+ * The combo box specifying the run perspective
+ */
+ private Combo fRunPerspectiveCombo;
+
+ /**
+ * Label for the run perspective combo box
+ */
+ private Label fRunPerspectiveLabel;
+
+ /**
+ * The combo box specifying the debug perspective
+ */
+ private Combo fDebugPerspectiveCombo;
+
+ /**
+ * Label for the debug perspective combo box
+ */
+ private Label fDebugPerspectiveLabel;
+
+ /**
+ * The label that acts as header for the 'switch to perspective' widgets
+ */
+ private Label fSwitchToLabel;
+
+ /**
+ * The check box specifying run favoite
+ */
+ private Button fRunFavoriteButton;
+
+ /**
+ * The check box specifying debug favoite
+ */
+ private Button fDebugFavoriteButton;
+
+ /**
+ * Constant for the name of the drop-down choice 'None' for perspectives.
+ */
+ private static final String PERSPECTIVE_NONE_NAME = LaunchConfigurationsMessages.getString("CommonTab.None"); //$NON-NLS-1$
+
+ /**
+ * Constant for the name of the drop-down choice 'Default' for perspectives.
+ */
+ private static final String PERSPECTIVE_DEFAULT_NAME = LaunchConfigurationsMessages.getString("CommonTab.Default"); //$NON-NLS-1$
+
+ /**
+ * Modify listener that simply updates the owning launch configuration dialog.
+ */
+ private ModifyListener fBasicModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+
+ /**
+ * Selection listener that simply updates the owning launch configuration dialog.
+ */
+ private SelectionAdapter fBasicSelectionListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+
+ /**
+ * @see ILaunchConfigurationTab#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ setControl(comp);
+ WorkbenchHelp.setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
+ GridLayout topLayout = new GridLayout();
+ comp.setLayout(topLayout);
+
+ createVerticalSpacer(comp, 1);
+
+ Composite radioComp = new Composite(comp, SWT.NONE);
+ GridLayout radioLayout = new GridLayout();
+ radioLayout.marginHeight = 0;
+ radioLayout.marginWidth = 0;
+ radioComp.setLayout(radioLayout);
+
+ setLocalSharedLabel(new Label(radioComp, SWT.NONE));
+ getLocalSharedLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Type_of_launch_configuration__2")); //$NON-NLS-1$
+
+ setLocalRadioButton(new Button(radioComp, SWT.RADIO));
+ getLocalRadioButton().setText(LaunchConfigurationsMessages.getString("CommonTab.L&ocal_3")); //$NON-NLS-1$
+ setSharedRadioButton(new Button(radioComp, SWT.RADIO));
+ getSharedRadioButton().setText(LaunchConfigurationsMessages.getString("CommonTab.S&hared_4")); //$NON-NLS-1$
+ getSharedRadioButton().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ handleSharedRadioButtonSelected();
+ }
+ });
+
+ Composite locationComp = new Composite(comp, SWT.NONE);
+ GridLayout locationLayout = new GridLayout();
+ locationLayout.numColumns = 2;
+ locationLayout.marginHeight = 0;
+ locationLayout.marginWidth = 0;
+ locationComp.setLayout(locationLayout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ locationComp.setLayoutData(gd);
+
+ setSharedLocationLabel(new Label(locationComp, SWT.NONE));
+ getSharedLocationLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Location_of_shared_confi&guration__5")); //$NON-NLS-1$
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ getSharedLocationLabel().setLayoutData(gd);
+
+ setSharedLocationText(new Text(locationComp, SWT.SINGLE | SWT.BORDER));
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ getSharedLocationText().setLayoutData(gd);
+ getSharedLocationText().addModifyListener(fBasicModifyListener);
+
+ setSharedLocationButton(createPushButton(locationComp, LaunchConfigurationsMessages.getString("CommonTab.&Browse_6"), null)); //$NON-NLS-1$
+ getSharedLocationButton().addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ handleSharedLocationButtonSelected();
+ }
+ });
+
+ getLocalRadioButton().setSelection(true);
+ setSharedEnabled(false);
+
+ createVerticalSpacer(comp, 1);
+
+ setSwitchToLabel(new Label(comp, SWT.HORIZONTAL | SWT.LEFT));
+ getSwitchToLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Switch_to/Open_perspective_when_launched_in__7")); //$NON-NLS-1$
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.horizontalSpan = 3;
+ getSwitchToLabel().setLayoutData(gd);
+
+ Composite perspComp = new Composite(comp, SWT.NONE);
+ GridLayout perspLayout = new GridLayout();
+ perspLayout.marginHeight = 0;
+ perspLayout.marginWidth = 0;
+ perspLayout.numColumns = 2;
+ perspComp.setLayout(perspLayout);
+
+ setRunPerspectiveLabel(new Label(perspComp, SWT.NONE));
+ getRunPerspectiveLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Run_mode_8")); //$NON-NLS-1$
+
+ setRunPerspectiveCombo(new Combo(perspComp, SWT.DROP_DOWN | SWT.READ_ONLY));
+ gd = new GridData(GridData.GRAB_HORIZONTAL);
+ getRunPerspectiveCombo().setLayoutData(gd);
+ fillWithPerspectives(getRunPerspectiveCombo());
+ getRunPerspectiveCombo().addModifyListener(fBasicModifyListener);
+
+ setDebugPerspectiveLabel(new Label(perspComp, SWT.NONE));
+ getDebugPerspectiveLabel().setText(LaunchConfigurationsMessages.getString("CommonTab.Debug_mode_9")); //$NON-NLS-1$
+
+ setDebugPerspectiveCombo(new Combo(perspComp, SWT.DROP_DOWN |SWT.READ_ONLY));
+ gd = new GridData(GridData.GRAB_HORIZONTAL);
+ getDebugPerspectiveCombo().setLayoutData(gd);
+ fillWithPerspectives(getDebugPerspectiveCombo());
+ getDebugPerspectiveCombo().addModifyListener(fBasicModifyListener);
+
+ createVerticalSpacer(comp, 1);
+
+ Composite favComp = new Composite(comp, SWT.NONE);
+ GridLayout favLayout = new GridLayout();
+ favLayout.marginHeight = 0;
+ favLayout.marginWidth = 0;
+ favLayout.numColumns = 1;
+ favComp.setLayout(favLayout);
+
+ Label favLabel = new Label(favComp, SWT.HORIZONTAL | SWT.LEFT);
+ favLabel.setText(LaunchConfigurationsMessages.getString("CommonTab.Display_in_favorites_menu__10")); //$NON-NLS-1$
+
+ setRunFavoriteButton(new Button(favComp, SWT.CHECK));
+ getRunFavoriteButton().setText(LaunchConfigurationsMessages.getString("CommonTab.&Run_11")); //$NON-NLS-1$
+ getRunFavoriteButton().addSelectionListener(fBasicSelectionListener);
+
+ setDebugFavoriteButton(new Button(favComp, SWT.CHECK));
+ getDebugFavoriteButton().setText(LaunchConfigurationsMessages.getString("CommonTab.Debu&g_12")); //$NON-NLS-1$
+ getDebugFavoriteButton().addSelectionListener(fBasicSelectionListener);
+ }
+
+
+ private void setSharedLocationButton(Button sharedLocationButton) {
+ this.fSharedLocationButton = sharedLocationButton;
+ }
+
+ private Button getSharedLocationButton() {
+ return fSharedLocationButton;
+ }
+
+ private void setSharedLocationText(Text sharedLocationText) {
+ this.fSharedLocationText = sharedLocationText;
+ }
+
+ private Text getSharedLocationText() {
+ return fSharedLocationText;
+ }
+
+ private void setSharedLocationLabel(Label sharedLocationLabel) {
+ this.fSharedLocationLabel = sharedLocationLabel;
+ }
+
+ private Label getSharedLocationLabel() {
+ return fSharedLocationLabel;
+ }
+
+ private void setLocalSharedLabel(Label localSharedLabel) {
+ fLocalSharedLabel = localSharedLabel;
+ }
+
+ private Label getLocalSharedLabel() {
+ return fLocalSharedLabel;
+ }
+
+ private void setLocalRadioButton(Button button) {
+ fLocalRadioButton = button;
+ }
+
+ private Button getLocalRadioButton() {
+ return fLocalRadioButton;
+ }
+
+ private void setSharedRadioButton(Button button) {
+ fSharedRadioButton = button;
+ }
+
+ private Button getSharedRadioButton() {
+ return fSharedRadioButton;
+ }
+
+ /**
+ * Returns the perspective combo assoicated with the
+ * debug perspective button.
+ *
+ * @return a combo box
+ */
+ private Combo getDebugPerspectiveCombo() {
+ return fDebugPerspectiveCombo;
+ }
+
+ /**
+ * Sets the perspective combo assoicated with the
+ * debug perspective button.
+ *
+ * @param combo a combo box
+ */
+ private void setDebugPerspectiveCombo(Combo combo) {
+ fDebugPerspectiveCombo = combo;
+ }
+
+ /**
+ * Returns the perspective combo assoicated with the
+ * run perspective button.
+ *
+ * @return a combo box
+ */
+ private Combo getRunPerspectiveCombo() {
+ return fRunPerspectiveCombo;
+ }
+
+ /**
+ * Sets the perspective combo assoicated with the
+ * run perspective button.
+ *
+ * @param combo a combo box
+ */
+ private void setRunPerspectiveCombo(Combo combo) {
+ fRunPerspectiveCombo = combo;
+ }
+
+ private void setRunPerspectiveLabel(Label fRunPerspectiveLabel) {
+ this.fRunPerspectiveLabel = fRunPerspectiveLabel;
+ }
+
+ private Label getRunPerspectiveLabel() {
+ return fRunPerspectiveLabel;
+ }
+
+ private void setDebugPerspectiveLabel(Label fDebugPerspectiveLabel) {
+ this.fDebugPerspectiveLabel = fDebugPerspectiveLabel;
+ }
+
+ private Label getDebugPerspectiveLabel() {
+ return fDebugPerspectiveLabel;
+ }
+
+ private void setSwitchToLabel(Label switchToLabel) {
+ fSwitchToLabel = switchToLabel;
+ }
+
+ private Label getSwitchToLabel() {
+ return fSwitchToLabel;
+ }
+
+ private void handleSharedRadioButtonSelected() {
+ setSharedEnabled(isShared());
+ updateLaunchConfigurationDialog();
+ }
+
+ private void setSharedEnabled(boolean enable) {
+ getSharedLocationLabel().setEnabled(enable);
+ getSharedLocationText().setEnabled(enable);
+ getSharedLocationButton().setEnabled(enable);
+ }
+
+ private boolean isShared() {
+ return getSharedRadioButton().getSelection();
+ }
+
+ private void handleSharedLocationButtonSelected() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
+ getWorkspaceRoot(),
+ false,
+ LaunchConfigurationsMessages.getString("CommonTab.Select_a_location_for_the_launch_configuration_13")); //$NON-NLS-1$
+
+ String currentContainerString = getSharedLocationText().getText();
+ IContainer currentContainer = getContainer(currentContainerString);
+ if (currentContainer != null) {
+ IPath path = currentContainer.getFullPath();
+ dialog.setInitialSelections(new Object[] {path});
+ }
+
+ dialog.showClosedProjects(false);
+ dialog.open();
+ Object[] results = dialog.getResult();
+ if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
+ IPath path = (IPath)results[0];
+ String containerName = path.toOSString();
+ getSharedLocationText().setText(containerName);
+ }
+ }
+
+ private IContainer getContainer(String path) {
+ Path containerPath = new Path(path);
+ return (IContainer) getWorkspaceRoot().findMember(containerPath);
+ }
+
+ /**
+ * Returns the perspective with the given label, or
+ * <code>null</code> if none is found.
+ *
+ * @param label perspective label
+ * @return perspective descriptor
+ */
+ private IPerspectiveDescriptor getPerspectiveWithLabel(String label) {
+ return PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithLabel(label);
+ }
+
+ /**
+ * Returns the perspective with the given id, or
+ * <code>null</code> if none is found.
+ *
+ * @param id perspective identifier
+ * @return perspective descriptor
+ */
+ private IPerspectiveDescriptor getPerspectiveWithId(String id) {
+ return PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id);
+ }
+
+ /**
+ * Fills the given combo box with the labels of all existing
+ * perspectives and one to indicate 'none'.
+ *
+ * @param combo combo box
+ */
+ private void fillWithPerspectives(Combo combo) {
+ combo.add(PERSPECTIVE_NONE_NAME);
+ combo.add(PERSPECTIVE_DEFAULT_NAME);
+ IPerspectiveRegistry reg = PlatformUI.getWorkbench().getPerspectiveRegistry();
+ IPerspectiveDescriptor[] persps = reg.getPerspectives();
+ for (int i = 0; i < persps.length; i++) {
+ combo.add(persps[i].getLabel());
+ }
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
+ */
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ updateLocalSharedFromConfig(configuration);
+ updateSharedLocationFromConfig(configuration);
+ updateRunPerspectiveFromConfig(configuration);
+ updateDebugPerspectiveFromConfig(configuration);
+ updateFavoritesFromConfig(configuration);
+ }
+
+ private void updateLocalSharedFromConfig(ILaunchConfiguration config) {
+ boolean isShared = !config.isLocal();
+ getSharedRadioButton().setSelection(isShared);
+ getLocalRadioButton().setSelection(!isShared);
+ setSharedEnabled(isShared);
+ }
+
+ private void updateSharedLocationFromConfig(ILaunchConfiguration config) {
+ IFile file = config.getFile();
+ if (file != null) {
+ IContainer parent = file.getParent();
+ if (parent != null) {
+ String containerName = parent.getFullPath().toOSString();
+ getSharedLocationText().setText(containerName);
+ }
+ }
+ }
+
+ private void updateRunPerspectiveFromConfig(ILaunchConfiguration config) {
+ ILaunchConfigurationType type = null;
+ String runPerspID = null;
+ try {
+ runPerspID = config.getAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, (String)null);
+ type = config.getType();
+ } catch (CoreException ce) {
+ updatePerspectiveCombo(getRunPerspectiveCombo(), null);
+ getRunPerspectiveCombo().setEnabled(false);
+ getRunPerspectiveLabel().setEnabled(false);
+ return;
+ }
+ updatePerspectiveCombo(getRunPerspectiveCombo(), runPerspID);
+ boolean enable = type.supportsMode(ILaunchManager.RUN_MODE);
+ getRunPerspectiveCombo().setEnabled(enable);
+ getRunPerspectiveLabel().setEnabled(enable);
+ }
+
+ private void updateDebugPerspectiveFromConfig(ILaunchConfiguration config) {
+ ILaunchConfigurationType type = null;
+ String debugPerspID = null;
+ try {
+ debugPerspID = config.getAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, (String)null);
+ type = config.getType();
+ } catch (CoreException ce) {
+ updatePerspectiveCombo(getDebugPerspectiveCombo(), null);
+ getDebugPerspectiveCombo().setEnabled(false);
+ getDebugPerspectiveLabel().setEnabled(false);
+ return;
+ }
+ updatePerspectiveCombo(getDebugPerspectiveCombo(), debugPerspID);
+ boolean enable = type.supportsMode(ILaunchManager.DEBUG_MODE);
+ getDebugPerspectiveCombo().setEnabled(enable);
+ getDebugPerspectiveLabel().setEnabled(enable);
+ }
+
+ private void updateFavoritesFromConfig(ILaunchConfiguration config) {
+ ILaunchConfigurationType type = null;
+ boolean isDebug = false;
+ boolean isRun = false;
+ try {
+ type = config.getType();
+ isDebug = config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
+ isRun = config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
+ } catch (CoreException ce) {
+ getDebugFavoriteButton().setEnabled(false);
+ getRunFavoriteButton().setEnabled(false);
+ return;
+ }
+ getDebugFavoriteButton().setEnabled(type.supportsMode(ILaunchManager.DEBUG_MODE));
+ getRunFavoriteButton().setEnabled(type.supportsMode(ILaunchManager.RUN_MODE));
+ getDebugFavoriteButton().setSelection(isDebug);
+ getRunFavoriteButton().setSelection(isRun);
+
+ }
+
+ /**
+ * Based on the given perspective identifier, update the settings
+ * of the button and associated combo box. The check box is selected
+ * when there is a valid perspective, and the combo box is set to
+ * display the label of the associated perspective. The check box is
+ * deselected, and the combo box is set to the default value (debug
+ * perspective) when the identfier is <code>null</code>.
+ *
+ * @param button check box button
+ * @param combo combo box with perspective labels
+ * @param id perspective identifier or <code>null</code>
+ */
+ private void updatePerspectiveCombo(Combo combo, String id) {
+ if ((id == null) || (id.equals(IDebugUIConstants.PERSPECTIVE_NONE))) {
+ combo.setText(PERSPECTIVE_NONE_NAME);
+ } else if (id.equals(IDebugUIConstants.PERSPECTIVE_DEFAULT)) {
+ combo.setText(PERSPECTIVE_DEFAULT_NAME);
+ } else {
+ IPerspectiveDescriptor pd = getPerspectiveWithId(id);
+ if (pd == null) {
+ // perpective does not exist - reset
+ updatePerspectiveCombo(combo, null);
+ } else {
+ combo.setText(pd.getLabel());
+ }
+ }
+ }
+
+ private void updateConfigFromLocalShared(ILaunchConfigurationWorkingCopy config) {
+ if (isShared()) {
+ String containerPathString = getSharedLocationText().getText();
+ IContainer container = (IContainer) getContainer(containerPathString);
+ config.setContainer(container);
+ } else {
+ config.setContainer(null);
+ }
+ }
+
+ /**
+ * Update the run perspective attribute based on current
+ * UI settings.
+ */
+ private void updateConfigFromRunPerspective(ILaunchConfigurationWorkingCopy config) {
+ String selectedText = getRunPerspectiveCombo().getText();
+ String perspID = null;
+ if (selectedText.equals(PERSPECTIVE_NONE_NAME)) {
+ perspID = IDebugUIConstants.PERSPECTIVE_NONE;
+ }
+ else if (selectedText.equals(PERSPECTIVE_DEFAULT_NAME)) {
+ perspID = IDebugUIConstants.PERSPECTIVE_DEFAULT;
+ } else {
+ IPerspectiveDescriptor descriptor = getPerspectiveWithLabel(selectedText);
+ if (descriptor != null) {
+ perspID = descriptor.getId();
+ }
+ }
+ config.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, perspID);
+ }
+
+ /**
+ * Update the debug perspective attribute based on current
+ * UI settings.
+ */
+ private void updateConfigFromDebugPerspective(ILaunchConfigurationWorkingCopy config) {
+ String selectedText = getDebugPerspectiveCombo().getText();
+ String perspID = null;
+ if (selectedText.equals(PERSPECTIVE_NONE_NAME)) {
+ perspID = IDebugUIConstants.PERSPECTIVE_NONE;
+ }
+ else if (selectedText.equals(PERSPECTIVE_DEFAULT_NAME)) {
+ perspID = IDebugUIConstants.PERSPECTIVE_DEFAULT;
+ } else {
+ IPerspectiveDescriptor descriptor = getPerspectiveWithLabel(selectedText);
+ if (descriptor != null) {
+ perspID = descriptor.getId();
+ }
+ }
+ config.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, perspID);
+ }
+
+ /**
+ * Update the favorite settings.
+ *
+ * NOTE: set to NULL instead of false for backwards compatibility
+ * when comparing if content is equal, since 'false' is default
+ * and will be missing for older configs.
+ */
+ private void updateConfigFromFavorites(ILaunchConfigurationWorkingCopy config) {
+ if (getDebugFavoriteButton().getSelection()) {
+ config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, true);
+ } else {
+ config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
+ }
+ if (getRunFavoriteButton().getSelection()) {
+ config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, true);
+ } else {
+ config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
+ }
+ }
+
+ /**
+ * Convenience method for getting the workspace root.
+ */
+ private IWorkspaceRoot getWorkspaceRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
+ */
+ public boolean isValid(ILaunchConfiguration config) {
+ setMessage(null);
+ setErrorMessage(null);
+
+ return validateLocalShared();
+ }
+
+ private boolean validateLocalShared() {
+ if (isShared()) {
+ String path = fSharedLocationText.getText().trim();
+ IContainer container = getContainer(path);
+ if (container == null || container.equals(ResourcesPlugin.getWorkspace().getRoot())) {
+ setErrorMessage(LaunchConfigurationsMessages.getString("CommonTab.Invalid_shared_configuration_location_14")); //$NON-NLS-1$
+ return false;
+ } else if (!container.getProject().isOpen()) {
+ setErrorMessage(LaunchConfigurationsMessages.getString("CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1")); //$NON-NLS-1$
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ config.setContainer(null);
+
+ config.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
+
+ config.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
+ */
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ updateConfigFromDebugPerspective(configuration);
+ updateConfigFromRunPerspective(configuration);
+ updateConfigFromLocalShared(configuration);
+ updateConfigFromFavorites(configuration);
+ }
+
+ /**
+ * Returns the check box used to specify a config
+ * as a debug favorite.
+ *
+ * @return check box
+ */
+ private Button getDebugFavoriteButton() {
+ return fDebugFavoriteButton;
+ }
+
+ /**
+ * Sets the check box used to specify a config
+ * as a debug favorite.
+ *
+ * @param button check box
+ */
+ private void setDebugFavoriteButton(Button button) {
+ fDebugFavoriteButton = button;
+ }
+
+ /**
+ * Returns the check box used to specify a config
+ * as a run favorite.
+ *
+ * @return check box
+ */
+ private Button getRunFavoriteButton() {
+ return fRunFavoriteButton;
+ }
+
+ /**
+ * Sets the check box used to specify a config
+ * as a run favorite.
+ *
+ * @param button check box
+ */
+ private void setRunFavoriteButton(Button button) {
+ fRunFavoriteButton = button;
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#getName()
+ */
+ public String getName() {
+ return LaunchConfigurationsMessages.getString("CommonTab.&Common_15"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#canSave()
+ */
+ public boolean canSave() {
+ return validateLocalShared();
+ }
+
+ /**
+ * @see ILaunchConfigurationTab#getImage()
+ */
+ public Image getImage() {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_PERSPECTIVE_DEBUG);
+ }
+
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
index 28f6b110a..030974706 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
@@ -1,278 +1,278 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class provides utilities for clients of the debug UI.
- * <p>
- * Images retrieved from this facility should not be disposed.
- * The images will be disposed when this plugin is shutdown.
- * </p>
- * <p>
- * This class is not intended to be subclassed or instantiated.
- * </p>
- */
-public class DebugUITools {
-
- /**
- * Returns the shared image managed under the given key, or <code>null</code>
- * if none.
- * <p>
- * Note that clients <b>MUST NOT</b> dispose the image returned by this method.
- * </p>
- * <p>
- * See <code>IDebugUIConstants</code> for available images.
- * </p>
- *
- * @param key the image key
- * @return the image, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static Image getImage(String key) {
- return DebugPluginImages.getImage(key);
- }
-
- /**
- * Returns the shared image descriptor managed under the given key, or
- * <code>null</code> if none.
- * <p>
- * See <code>IDebugUIConstants</code> for available image descriptors.
- * </p>
- *
- * @param key the image descriptor key
- * @return the image descriptor, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return DebugPluginImages.getImageDescriptor(key);
- }
-
- /**
- * Returns the default image descriptor for the given element
- * or <code>null</code> if none is defined.
- */
- public static ImageDescriptor getDefaultImageDescriptor(Object element) {
- String imageKey= getDefaultImageKey(element);
- if (imageKey == null) {
- return null;
- }
- return DebugPluginImages.getImageDescriptor(imageKey);
- }
-
- private static String getDefaultImageKey(Object element) {
- return ((DefaultLabelProvider)DebugUIPlugin.getDefaultLabelProvider()).getImageKey(element);
- }
-
- /**
- * Returns the preference store for the debug UI plugin.
- *
- * @return preference store
- */
- public static IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Returns a new debug model presentation that delegates to
- * appropriate debug models.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation() {
- return new DelegatingModelPresentation();
- }
-
- /**
- * Returns a new debug model presentation for specified
- * debug model, or <code>null</code> if a presentation does
- * not exist.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @param identifier debug model identifier
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation, or <code>null</code>
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation(String identifier) {
- IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
- IExtensionPoint point= descriptor.getExtensionPoint(IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
- if (point != null) {
- IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
- IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
- String id= elt.getAttribute("id"); //$NON-NLS-1$
- if (id != null && id.equals(identifier)) {
- return new LazyModelPresentation(elt);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the currently selected element in the
- * debug view of the current workbench page,
- * or <code>null</code> if there is no current
- * debug context, or if not called from the UI
- * thread.
- *
- * @return the currently selected debug context, or <code>null</code>
- * @since 2.0
- */
- public static IAdaptable getDebugContext() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ;
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
- if (part != null) {
- IDebugView view = (IDebugView)part.getAdapter(IDebugView.class);
- if (view != null) {
- Viewer viewer = view.getViewer();
- if (viewer != null) {
- ISelection s = viewer.getSelection();
- if (s != null) {
- if (s instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)s;
- if (ss.size() == 1) {
- Object element = ss.getFirstElement();
- if (element instanceof IAdaptable) {
- return (IAdaptable)element;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the process associated with the current debug context.
- * If there is no debug context currently, the most recently
- * launched process is returned. If there is no current process
- * <code>null</code> is returned.
- *
- * @return the current process, or <code>null</code>
- * @since 2.0
- */
- public static IProcess getCurrentProcess() {
- IAdaptable context = getDebugContext();
- if (context == null) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- if (launches.length > 0) {
- context = launches[launches.length - 1];
- }
- }
- if (context instanceof IDebugElement) {
- return ((IDebugElement)context).getDebugTarget().getProcess();
- }
- if (context instanceof IProcess) {
- return (IProcess)context;
- }
- if (context instanceof ILaunch) {
- ILaunch launch= (ILaunch)context;
- IDebugTarget target= launch.getDebugTarget();
- if (target != null) {
- IProcess process = target.getProcess();
- if (process != null) {
- return process;
- }
- }
- IProcess[] ps = launch.getProcesses();
- if (ps.length > 0) {
- return ps[ps.length - 1];
- }
- }
- return null;
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param mode the mode (run or debug) in which to open the launch configuration dialog.
- * This should be one of the constants defined in <code>ILaunchManager</code>.
- * @return the return code from opening the launch configuration dialog
- * @since 2.0
- */
- public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
- LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(shell, null, mode);
- dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
- dialog.setInitialSelection(selection);
- return dialog.open();
- }
-
- /**
- * Saves all dirty editors and builds the workspace according to current
- * preference settings, and returns whether a launch should proceed.
- * <p>
- * The following preferences effect whether dirty editors are saved,
- * and/or if the user is prompted to save dirty edtiors:<ul>
- * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * </ul>
- * The following preference effects whether a build is performed before
- * launching (if required):<ul>
- * <li>PREF_BUILD_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @return whether a launch should proceed
- * @since 2.0
- */
- public static boolean saveAndBuildBeforeLaunch() {
- return DebugUIPlugin.saveAndBuild();
- }
-
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.DefaultLabelProvider;
+import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
+import org.eclipse.debug.internal.ui.LazyModelPresentation;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class provides utilities for clients of the debug UI.
+ * <p>
+ * Images retrieved from this facility should not be disposed.
+ * The images will be disposed when this plugin is shutdown.
+ * </p>
+ * <p>
+ * This class is not intended to be subclassed or instantiated.
+ * </p>
+ */
+public class DebugUITools {
+
+ /**
+ * Returns the shared image managed under the given key, or <code>null</code>
+ * if none.
+ * <p>
+ * Note that clients <b>MUST NOT</b> dispose the image returned by this method.
+ * </p>
+ * <p>
+ * See <code>IDebugUIConstants</code> for available images.
+ * </p>
+ *
+ * @param key the image key
+ * @return the image, or <code>null</code> if none
+ * @see IDebugUIConstants
+ */
+ public static Image getImage(String key) {
+ return DebugPluginImages.getImage(key);
+ }
+
+ /**
+ * Returns the shared image descriptor managed under the given key, or
+ * <code>null</code> if none.
+ * <p>
+ * See <code>IDebugUIConstants</code> for available image descriptors.
+ * </p>
+ *
+ * @param key the image descriptor key
+ * @return the image descriptor, or <code>null</code> if none
+ * @see IDebugUIConstants
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return DebugPluginImages.getImageDescriptor(key);
+ }
+
+ /**
+ * Returns the default image descriptor for the given element
+ * or <code>null</code> if none is defined.
+ */
+ public static ImageDescriptor getDefaultImageDescriptor(Object element) {
+ String imageKey= getDefaultImageKey(element);
+ if (imageKey == null) {
+ return null;
+ }
+ return DebugPluginImages.getImageDescriptor(imageKey);
+ }
+
+ private static String getDefaultImageKey(Object element) {
+ return ((DefaultLabelProvider)DebugUIPlugin.getDefaultLabelProvider()).getImageKey(element);
+ }
+
+ /**
+ * Returns the preference store for the debug UI plugin.
+ *
+ * @return preference store
+ */
+ public static IPreferenceStore getPreferenceStore() {
+ return DebugUIPlugin.getDefault().getPreferenceStore();
+ }
+
+ /**
+ * Returns a new debug model presentation that delegates to
+ * appropriate debug models.
+ * <p>
+ * It is the client's responsibility dispose the presentation.
+ * </p>
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ * @return a debug model presentation
+ * @since 2.0
+ */
+ public static IDebugModelPresentation newDebugModelPresentation() {
+ return new DelegatingModelPresentation();
+ }
+
+ /**
+ * Returns a new debug model presentation for specified
+ * debug model, or <code>null</code> if a presentation does
+ * not exist.
+ * <p>
+ * It is the client's responsibility dispose the presentation.
+ * </p>
+ *
+ * @param identifier debug model identifier
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ * @return a debug model presentation, or <code>null</code>
+ * @since 2.0
+ */
+ public static IDebugModelPresentation newDebugModelPresentation(String identifier) {
+ IPluginDescriptor descriptor= DebugUIPlugin.getDefault().getDescriptor();
+ IExtensionPoint point= descriptor.getExtensionPoint(IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
+ if (point != null) {
+ IExtension[] extensions= point.getExtensions();
+ for (int i= 0; i < extensions.length; i++) {
+ IExtension extension= extensions[i];
+ IConfigurationElement[] configElements= extension.getConfigurationElements();
+ for (int j= 0; j < configElements.length; j++) {
+ IConfigurationElement elt= configElements[j];
+ String id= elt.getAttribute("id"); //$NON-NLS-1$
+ if (id != null && id.equals(identifier)) {
+ return new LazyModelPresentation(elt);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the currently selected element in the
+ * debug view of the current workbench page,
+ * or <code>null</code> if there is no current
+ * debug context, or if not called from the UI
+ * thread.
+ *
+ * @return the currently selected debug context, or <code>null</code>
+ * @since 2.0
+ */
+ public static IAdaptable getDebugContext() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ;
+ if (window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
+ if (part != null) {
+ IDebugView view = (IDebugView)part.getAdapter(IDebugView.class);
+ if (view != null) {
+ Viewer viewer = view.getViewer();
+ if (viewer != null) {
+ ISelection s = viewer.getSelection();
+ if (s != null) {
+ if (s instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)s;
+ if (ss.size() == 1) {
+ Object element = ss.getFirstElement();
+ if (element instanceof IAdaptable) {
+ return (IAdaptable)element;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the process associated with the current debug context.
+ * If there is no debug context currently, the most recently
+ * launched process is returned. If there is no current process
+ * <code>null</code> is returned.
+ *
+ * @return the current process, or <code>null</code>
+ * @since 2.0
+ */
+ public static IProcess getCurrentProcess() {
+ IAdaptable context = getDebugContext();
+ if (context == null) {
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
+ if (launches.length > 0) {
+ context = launches[launches.length - 1];
+ }
+ }
+ if (context instanceof IDebugElement) {
+ return ((IDebugElement)context).getDebugTarget().getProcess();
+ }
+ if (context instanceof IProcess) {
+ return (IProcess)context;
+ }
+ if (context instanceof ILaunch) {
+ ILaunch launch= (ILaunch)context;
+ IDebugTarget target= launch.getDebugTarget();
+ if (target != null) {
+ IProcess process = target.getProcess();
+ if (process != null) {
+ return process;
+ }
+ }
+ IProcess[] ps = launch.getProcesses();
+ if (ps.length > 0) {
+ return ps[ps.length - 1];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Open the launch configuration dialog with the specified initial selection.
+ * The selection may be <code>null</code>, or contain any mix of
+ * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
+ * elements.
+ *
+ * @param shell the parent shell for the launch configuration dialog
+ * @param selection the initial selection for the dialog
+ * @param mode the mode (run or debug) in which to open the launch configuration dialog.
+ * This should be one of the constants defined in <code>ILaunchManager</code>.
+ * @return the return code from opening the launch configuration dialog
+ * @since 2.0
+ */
+ public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
+ LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(shell, null, mode);
+ dialog.setOpenMode(LaunchConfigurationDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
+ dialog.setInitialSelection(selection);
+ return dialog.open();
+ }
+
+ /**
+ * Saves all dirty editors and builds the workspace according to current
+ * preference settings, and returns whether a launch should proceed.
+ * <p>
+ * The following preferences effect whether dirty editors are saved,
+ * and/or if the user is prompted to save dirty edtiors:<ul>
+ * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
+ * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
+ * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
+ * </ul>
+ * The following preference effects whether a build is performed before
+ * launching (if required):<ul>
+ * <li>PREF_BUILD_BEFORE_LAUNCH</li>
+ * </ul>
+ * </p>
+ *
+ * @return whether a launch should proceed
+ * @since 2.0
+ */
+ public static boolean saveAndBuildBeforeLaunch() {
+ return DebugUIPlugin.saveAndBuild();
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
index 9bf654765..84358a43e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
@@ -1,133 +1,133 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A debug model presentation is responsible for providing labels, images,
- * and editors associated with debug elements in a specific debug model.
- * Extensions of type <code>org.eclipse.debug.ui.debugModelPresentations</code> implement
- * this interface. Generally, a debug model implementation will also provide a
- * debug model presentation extension to render and display its elements. A debug
- * model presentation is registered for a specific debug model, and is responsible
- * for the presentation elements defined/implemented by that model.
- * <p>
- * A debug model presentation extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a debug model presentation extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.debugModelPresentations"&gt;
- * &lt;debugModelPresentation
- * id="com.example.debugModelIdentifier"
- * class="com.example.ExamplePresentation"
- * detailsViewerConfiguration="com.example.ExampleSourceViewerConfiguration"&gt;
- * &lt;/debugModelPresentation&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies the identifier of the debug model this presentation
- * is responsible for. Corresponds to the model identifier returned from a debug
- * element - see <code>IDebugElement.getModelIndentifier</code></li>
- * <li><code>class</code> specifies the fully qualified name of the Java class
- * that implements this interface.</li>
- * <li><code>detailsViewerConfiguration</code> optionally specifies the fully qualified name of the Java class
- * that is an instance of <code>org.eclipse.jface.text.source.SourceViewerConfiguration</code>.
- * When specified, the source viewer configuration will be used in the "details" area of the
- * variables and expressions view when displaying the details of an element from the
- * debug model associated with this debug model presentation. When unspecified,
- * a default configuration is used.</li>
- * </ul>
- * </p>
- * <p>
- * To allow for an extensible configuration, this interface defines
- * a <code>setAttribute</code> method. The debug UI plug-in defines
- * one presentation attribute:
- * <ul>
- * <li><code>DISPLAY_VARIABLE_TYPE_NAMES</code> - This is a boolean attribute
- * indicating whether variable elements should be rendered with the declared
- * type of a variable. For example, a Java debug model presentation would render
- * an integer as <code>"int x = 3"</code> when true, and <code>"x = 3"</code>
- * when false.</li>
- * </ul>
- * </p>
- * <p>
- * Clients may define new presentation attributes. For example, a client may wish
- * to define a "hexadecimal" property to display numeric values in hexadecimal. Implementations
- * should honor the presentation attributes defined by this interface where possible,
- * but do not need to honor presentation attributes defined by other clients.
- * To access the debug model presentation for a debug view, clients should use
- * <code>IDebugView#getPresentation(String)</code>.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.core.model.IDebugElement
- * @see org.eclipse.jface.viewers.ILabelProvider
- * @see org.eclipse.debug.ui.IDebugView
- */
-
-public interface IDebugModelPresentation extends ILabelProvider, ISourcePresentation {
- /**
- * Variable type names presentation property (value <code>"org.eclipse.debug.ui.displayVariableTypeNames"</code>).
- * When <code>DISPLAY_VARIABLE_TYPE_NAMES</code> is set to <code>true</code>,
- * this label provider should include the reference type of a variable when rendering
- * variables. When set to <code>false</code>, this label provider
- * should not include the reference type of a variable when rendering
- * variables.
- * @see #setAttribute(String, Object)
- */
- public final static String DISPLAY_VARIABLE_TYPE_NAMES= IDebugUIConstants.PLUGIN_ID + ".displayVariableTypeNames"; //$NON-NLS-1$
- /**
- * Sets a presentation attribute of this label provider. For example,
- * see the presentation attribute <code>DISPLAY_VARIABLE_TYPE_NAMES</code>
- * defined by this interface.
- *
- * @param attribute the presentation attribute identifier
- * @param value the value of the attribute
- */
- void setAttribute(String attribute, Object value);
- /**
- * Returns an image for the element, or <code>null</code> if a default
- * image should be used.
- *
- * @param element the debug model element
- * @return an image for the element, or <code>null</code> if a default
- * image should be used
- * @see ILabelProvider
- */
- public Image getImage(Object element);
- /**
- * Returns a label for the element, or <code>null</code> if a default
- * label should be used.
- *
- * @param element the debug model element
- * @return a label for the element, or <code>null</code> if a default
- * label should be used
- * @see ILabelProvider
- */
- public String getText(Object element);
-
- /**
- * Computes a detailed description of the given value, reporting
- * the result to the specified listener. This allows a presentation
- * to provide extra details about a selected value in the variable detail
- * portion of the variables view. Since this can be a long-running operation,
- * the details are reported back to the specified listener asynchronously.
- * If <code>null</code> is reported, the value's value string is displayed
- * (<code>IValue.getValueString()</code>).
- *
- * @param value the value for which a detailed description
- * is required
- * @param listener the listener to report the details to
- * asynchronously
- * @since 2.0
- */
- void computeDetail(IValue value, IValueDetailListener listener);
-
-}
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A debug model presentation is responsible for providing labels, images,
+ * and editors associated with debug elements in a specific debug model.
+ * Extensions of type <code>org.eclipse.debug.ui.debugModelPresentations</code> implement
+ * this interface. Generally, a debug model implementation will also provide a
+ * debug model presentation extension to render and display its elements. A debug
+ * model presentation is registered for a specific debug model, and is responsible
+ * for the presentation elements defined/implemented by that model.
+ * <p>
+ * A debug model presentation extension is defined in <code>plugin.xml</code>.
+ * Following is an example definition of a debug model presentation extension.
+ * <pre>
+ * &lt;extension point="org.eclipse.debug.ui.debugModelPresentations"&gt;
+ * &lt;debugModelPresentation
+ * id="com.example.debugModelIdentifier"
+ * class="com.example.ExamplePresentation"
+ * detailsViewerConfiguration="com.example.ExampleSourceViewerConfiguration"&gt;
+ * &lt;/debugModelPresentation&gt;
+ * &lt;/extension&gt;
+ * </pre>
+ * The attributes are specified as follows:
+ * <ul>
+ * <li><code>id</code> specifies the identifier of the debug model this presentation
+ * is responsible for. Corresponds to the model identifier returned from a debug
+ * element - see <code>IDebugElement.getModelIndentifier</code></li>
+ * <li><code>class</code> specifies the fully qualified name of the Java class
+ * that implements this interface.</li>
+ * <li><code>detailsViewerConfiguration</code> optionally specifies the fully qualified name of the Java class
+ * that is an instance of <code>org.eclipse.jface.text.source.SourceViewerConfiguration</code>.
+ * When specified, the source viewer configuration will be used in the "details" area of the
+ * variables and expressions view when displaying the details of an element from the
+ * debug model associated with this debug model presentation. When unspecified,
+ * a default configuration is used.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * To allow for an extensible configuration, this interface defines
+ * a <code>setAttribute</code> method. The debug UI plug-in defines
+ * one presentation attribute:
+ * <ul>
+ * <li><code>DISPLAY_VARIABLE_TYPE_NAMES</code> - This is a boolean attribute
+ * indicating whether variable elements should be rendered with the declared
+ * type of a variable. For example, a Java debug model presentation would render
+ * an integer as <code>"int x = 3"</code> when true, and <code>"x = 3"</code>
+ * when false.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * Clients may define new presentation attributes. For example, a client may wish
+ * to define a "hexadecimal" property to display numeric values in hexadecimal. Implementations
+ * should honor the presentation attributes defined by this interface where possible,
+ * but do not need to honor presentation attributes defined by other clients.
+ * To access the debug model presentation for a debug view, clients should use
+ * <code>IDebugView#getPresentation(String)</code>.
+ * </p>
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * @see org.eclipse.debug.core.model.IDebugElement
+ * @see org.eclipse.jface.viewers.ILabelProvider
+ * @see org.eclipse.debug.ui.IDebugView
+ */
+
+public interface IDebugModelPresentation extends ILabelProvider, ISourcePresentation {
+ /**
+ * Variable type names presentation property (value <code>"org.eclipse.debug.ui.displayVariableTypeNames"</code>).
+ * When <code>DISPLAY_VARIABLE_TYPE_NAMES</code> is set to <code>true</code>,
+ * this label provider should include the reference type of a variable when rendering
+ * variables. When set to <code>false</code>, this label provider
+ * should not include the reference type of a variable when rendering
+ * variables.
+ * @see #setAttribute(String, Object)
+ */
+ public final static String DISPLAY_VARIABLE_TYPE_NAMES= IDebugUIConstants.PLUGIN_ID + ".displayVariableTypeNames"; //$NON-NLS-1$
+ /**
+ * Sets a presentation attribute of this label provider. For example,
+ * see the presentation attribute <code>DISPLAY_VARIABLE_TYPE_NAMES</code>
+ * defined by this interface.
+ *
+ * @param attribute the presentation attribute identifier
+ * @param value the value of the attribute
+ */
+ void setAttribute(String attribute, Object value);
+ /**
+ * Returns an image for the element, or <code>null</code> if a default
+ * image should be used.
+ *
+ * @param element the debug model element
+ * @return an image for the element, or <code>null</code> if a default
+ * image should be used
+ * @see ILabelProvider
+ */
+ public Image getImage(Object element);
+ /**
+ * Returns a label for the element, or <code>null</code> if a default
+ * label should be used.
+ *
+ * @param element the debug model element
+ * @return a label for the element, or <code>null</code> if a default
+ * label should be used
+ * @see ILabelProvider
+ */
+ public String getText(Object element);
+
+ /**
+ * Computes a detailed description of the given value, reporting
+ * the result to the specified listener. This allows a presentation
+ * to provide extra details about a selected value in the variable detail
+ * portion of the variables view. Since this can be a long-running operation,
+ * the details are reported back to the specified listener asynchronously.
+ * If <code>null</code> is reported, the value's value string is displayed
+ * (<code>IValue.getValueString()</code>).
+ *
+ * @param value the value for which a detailed description
+ * is required
+ * @param listener the listener to report the details to
+ * asynchronously
+ * @since 2.0
+ */
+ void computeDetail(IValue value, IValueDetailListener listener);
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index 90715d669..3fd1545e0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -1,643 +1,643 @@
-package org.eclipse.debug.ui;
-
-/**********************************************************************
-Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-**********************************************************************/
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * Constant definitions for debug UI plug-in.
- * <p>
- * Popup menus in the debug UI support action contribution via the
- * <code>org.eclipse.ui.popupMenus</code> extension. Actions may be
- * contributed to any group on the menu. To facilitate insertion of actions
- * inbetween existing groups, empty groups have been defined
- * in the menu. Each group prefixed by "empty" indicates an empty group.
- * </p>
- * <h3>Debug View Popup Menu</h3>
- * <ul>
- * <li>Empty edit group</li>
- * <li>Edit group</li>
- * <li>Copy stack action</li>
- * <li>Empty step group</li>
- * <li>Step group</li>
- * <li>Step into group</li>
- * <li>Step into action</li>
- * <li>Step over group</li>
- * <li>Step over action</li>
- * <li>Step return group</li>
- * <li>Step return action</li>
- * <li>Empty thread group</li>
- * <li>Thread group</li>
- * <li>Resume action</li>
- * <li>Suspend action</li>
- * <li>Terminate action</li>
- * <li>Disconnect action</li>
- * <li>Empty launch group</li>
- * <li>Launch group</li>
- * <li>Remove all terminated action</li>
- * <li>Terminate and Remove action</li>
- * <li>Relaunch action</li>
- * <li>Terminate all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Property group</li>
- * <li>Property dialog action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Variables View Popup Menus</h3>
- * <ul>
- * <li>Empty variable group</li>
- * <li>Variable group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Change value action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Breakpoints View Popup Menu</h3>
- * <ul>
- * <li>Empty Navigation group</li>
- * <li>Navigation group</li>
- * <li>Open action</li>
- * <li>Empty Breakpoint goup</li>
- * <li>Breakpoint group</li>
- * <li>Enable action</li>
- * <li>Disable action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show breakpoints for model action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Expressions View Popup Menu</h3>
- * <ul>
- * <li>Empty Expression group</li>
- * <li>Expression group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Change variable value action</li>
- * <li>Empty Render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <p>
- * Constants only; not intended to be implemented or extended.
- * </p>
- */
-
-public interface IDebugUIConstants {
-
- /**
- * Debug UI plug-in identifier (value <code>"org.eclipse.debug.ui"</code>).
- */
- public static final String PLUGIN_ID = DebugUIPlugin.getUniqueIdentifier();
-
- /**
- * Debug perspective identifier (value <code>"org.eclipse.debug.ui.DebugPerspective"</code>).
- */
- public static final String ID_DEBUG_PERSPECTIVE = PLUGIN_ID + ".DebugPerspective"; //$NON-NLS-1$
-
- /**
- * Debug model presentation simple extension point identifier (value <code>"debugModelPresentations"</code>).
- */
- public static final String ID_DEBUG_MODEL_PRESENTATION= "debugModelPresentations"; //$NON-NLS-1$
-
- /**
- * Constant for referring to no perspective.
- */
- public static final String PERSPECTIVE_NONE = "perspective_none"; //$NON-NLS-1$
-
- /**
- * Constant for referring to a default perspective.
- */
- public static final String PERSPECTIVE_DEFAULT = "perspective_default"; //$NON-NLS-1$
-
- // Preferences
-
- /**
- * String preference that identifies the default 'switch to perspective id' when running a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in run mode' attribute with something else.
- */
- public static final String PREF_SHOW_RUN_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_run_perspective_default"; //$NON-NLS-1$
-
- /**
- * String preference that identifies the default 'switch to perspective id' when debugging a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in debug mode' attribute with something else.
- */
- public static final String PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_debug_perspective_default"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether a build is done before
- * launching a program (if one is needed).
- */
- public static final String PREF_BUILD_BEFORE_LAUNCH= PLUGIN_ID + ".build_before_launch"; //$NON-NLS-1$
- /**
- * Identifier for the radio button group that consists of the following three preferences.
- */
- public static final String PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADIO= PLUGIN_ID + ".save_dirty_editors_before_launch_radio"; //$NON-NLS-1$
- /**
- * Radio button preference specifying that dirty editors should be autosaved (no prompting)
- * before launching.
- */
- public static final String PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".auto_save_dirty_editors_before_launch"; //$NON-NLS-1$
- /**
- * Radio button preference specifying that dirty editors should cause a prompt to appear to the
- * user asking if they wish to save.
- */
- public static final String PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".prompt_save_dirty_editors_before_launch"; //$NON-NLS-1$
- /**
- * Radio button preference specifying that dirty editors should never be saved before launching.
- */
- public static final String PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".never_save_dirty_editors_before_launch"; //$NON-NLS-1$
- /**
- * Boolean preference controlling automatic removal of terminated launches
- * when a new launch is registered.
- * @since 2.0
- */
- public static final String PREF_AUTO_REMOVE_OLD_LAUNCHES= PLUGIN_ID + ".auto_remove_old_launches"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger re-uses non-dirty editors
- * that it opens when displaying source. When <code>true</code> the debugger
- * re-uses the same editor when showing source for a selected stack frame (unless
- * the editor is dirty).
- *
- * @since 2.0
- */
- public static final String PREF_REUSE_EDITOR = PLUGIN_ID + ".reuse_editor"; //$NON-NLS-1$
-
- /**
- * Integer preference that specifies the length of the Run & Debug launch history lists.
- *
- * @since 2.0
- */
- public static final String PREF_MAX_HISTORY_SIZE = PLUGIN_ID + ".max_history_size"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows types names
- * in its variable view. When <code>true</code> the debugger
- * will display type names in new variable views.
- *
- * @since 2.0
- */
- public static final String PREF_SHOW_TYPE_NAMES = PLUGIN_ID + ".show_type_names"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows the detail pane
- * in its variable view. When <code>true</code> the debugger
- * will show the detail panes in new variable views.
- *
- * @since 2.0
- */
- public static final String PREF_SHOW_DETAIL_PANE = PLUGIN_ID + ".show_detail_pane"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger will force activate the active
- * shell/window of the Eclipse workbench when a breakpoint is hit.
- *
- * @since 2.1
- */
- public static final String PREF_ACTIVATE_WORKBENCH= PLUGIN_ID + ".activate_workbench"; //$NON-NLS-1$
-
-
- // Debug views
-
- /**
- * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
- */
- public static final String ID_DEBUG_VIEW= "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
-
- /**
- * Breakpoint view identifier (value <code>"org.eclipse.debug.ui.BreakpointView"</code>).
- */
- public static final String ID_BREAKPOINT_VIEW= "org.eclipse.debug.ui.BreakpointView"; //$NON-NLS-1$
-
- /**
- * Variable view identifier (value <code>"org.eclipse.debug.ui.VariableView"</code>).
- */
- public static final String ID_VARIABLE_VIEW= "org.eclipse.debug.ui.VariableView"; //$NON-NLS-1$
-
- /**
- * Expression view identifier (value <code>"org.eclipse.debug.ui.ExpressionView"</code>).
- * @since 2.0
- */
- public static final String ID_EXPRESSION_VIEW= "org.eclipse.debug.ui.ExpressionView"; //$NON-NLS-1$
-
- /**
- * Console view identifier (value <code>"org.eclipse.debug.ui.ConsoleView"</code>).
- */
- public static final String ID_CONSOLE_VIEW= "org.eclipse.debug.ui.ConsoleView"; //$NON-NLS-1$
-
- // Extension points
-
- /**
- * Extension point for launch configuration type images.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES = "launchConfigurationTypeImages"; //$NON-NLS-1$
-
- // Debug Action images
-
- /**
- * Debug action image identifier.
- */
- public static final String IMG_ACT_DEBUG= "IMG_ACT_DEBUG"; //$NON-NLS-1$
-
- /**
- * Run action image identifier.
- */
- public static final String IMG_ACT_RUN= "IMG_ACT_RUN"; //$NON-NLS-1$
-
- /** Clear action image identifier. */
- public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
-
- /** Display variable type names action image identifier. */
- public static final String IMG_LCL_TYPE_NAMES= "IMG_LCL_TYPE_NAMES"; //$NON-NLS-1$
-
- /** Toggle detail pane action image identifier.*/
- public static final String IMG_LCL_DETAIL_PANE= "IMG_LCL_DETAIL_PANE"; //$NON-NLS-1$
-
- /** Change variable value action image identifier.*/
- public static final String IMG_LCL_CHANGE_VARIABLE_VALUE= "IMG_LCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
-
- /**
- * Disconnect action image identifier
- *
- * @since 2.0
- */
- public static final String IMG_LCL_DISCONNECT= "IMG_LCL_DISCONNECT"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_CONTENT_ASSIST= "IMG_LCL_CONTENT_ASSIST"; //$NON-NLS-1$
- public static final String IMG_ELCL_CONTENT_ASSIST= "IMG_ELCL_CONTENT_ASSIST"; //$NON-NLS-1$
- public static final String IMG_DLCL_CONTENT_ASSIST= "IMG_DLCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- // Debug element images
-
- /** Debug mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_DEBUG= "IMG_OBJS_LAUNCH_DEBUG"; //$NON-NLS-1$
-
- /** Run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN= "IMG_OBJS_LAUNCH_RUN"; //$NON-NLS-1$
-
- /** Terminated run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN_TERMINATED= "IMG_OBJS_LAUNCH_RUN_TERMINATED"; //$NON-NLS-1$
-
- /** Running debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET= "IMG_OBJS_DEBUG_TARGET"; //$NON-NLS-1$
-
- /** Terminated debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET_TERMINATED= "IMG_OBJS_DEBUG_TARGET_TERMINATED"; //$NON-NLS-1$
-
- /** Running thread image identifier. */
- public static final String IMG_OBJS_THREAD_RUNNING= "IMG_OBJS_THREAD_RUNNING"; //$NON-NLS-1$
-
- /** Suspended thread image identifier. */
- public static final String IMG_OBJS_THREAD_SUSPENDED= "IMG_OBJS_THREAD_SUSPENDED"; //$NON-NLS-1$
-
- /** Terminated thread image identifier. */
- public static final String IMG_OBJS_THREAD_TERMINATED= "IMG_OBJS_THREAD_TERMINATED"; //$NON-NLS-1$
-
- /** Stack frame (suspended) image identifier. */
- public static final String IMG_OBJS_STACKFRAME= "IMG_OBJS_STACKFRAME"; //$NON-NLS-1$
-
- /** Stack frame (running) image identifier. */
- public static final String IMG_OBJS_STACKFRAME_RUNNING= "IMG_OBJS_STACKFRAME_RUNNING"; //$NON-NLS-1$
-
- /** Enabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT= "IMG_OBJS_BREAKPOINT"; //$NON-NLS-1$
-
- /** Disabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT_DISABLED= "IMG_OBJS_BREAKPOINT_DISABLED"; //$NON-NLS-1$
-
- /** Running system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS= "IMG_OBJS_OS_PROCESS"; //$NON-NLS-1$
-
- /** Terminated system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS_TERMINATED= "IMG_OBJS_OS_PROCESS_TERMINATED"; //$NON-NLS-1$
-
- /**
- * Expression image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_EXPRESSION= "IMG_OBJS_EXPRESSION"; //$NON-NLS-1$
-
- /**
- * Generic variable image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_VARIABLE= "IMG_OBJS_VARIABLE"; //$NON-NLS-1$
-
- // views
-
- /**
- * Launches view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_LAUNCHES= "IMG_VIEW_LAUNCHES"; //$NON-NLS-1$
-
- /**
- * Breakpoints view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_BREAKPOINTS= "IMG_VIEW_BREAKPOINTS"; //$NON-NLS-1$
-
- /**
- * Variables view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_VARIABLES= "IMG_VIEW_VARIABLES"; //$NON-NLS-1$
-
- /**
- * Expressions view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_EXPRESSIONS= "IMG_VIEW_EXPRESSIONS"; //$NON-NLS-1$
-
- /**
- * Console view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$
-
- // perspective
- /**
- * Debug perspective image identifier
- *
- * @since 2.0
- */
- public static final String IMG_PERSPECTIVE_DEBUG= "IMG_PERSPECTIVE_DEBUG"; //$NON-NLS-1$
-
- // wizard banners
- /** Debug wizard banner image identifier. */
- public static final String IMG_WIZBAN_DEBUG= "IMG_WIZBAN_DEBUG"; //$NON-NLS-1$
-
- /** Run wizard banner image identifier. */
- public static final String IMG_WIZBAN_RUN= "IMG_WIZBAN_RUN"; //$NON-NLS-1$
-
- // overlays
- /** Error overlay image identifier. */
- public static final String IMG_OVR_ERROR = "IMG_OVR_ERROR"; //$NON-NLS-1$
-
- /**
- * Debug action set identifier (value <code>"org.eclipse.debug.ui.debugActionSet"</code>).
- */
- public static final String DEBUG_ACTION_SET= PLUGIN_ID + ".debugActionSet"; //$NON-NLS-1$
-
- /**
- * Launch action set identifier (value <code>"org.eclipse.debug.ui.LaunchActionSet"</code>).
- */
- public static final String LAUNCH_ACTION_SET= PLUGIN_ID + ".launchActionSet"; //$NON-NLS-1$
-
- // menus
-
- /**
- * Identifier for an empty group preceding an
- * edit group in a menu (value <code>"emptyEditGroup"</code>).
- */
- public static final String EMPTY_EDIT_GROUP = "emptyEditGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an edit group in a menu (value <code>"editGroup"</code>).
- */
- public static final String EDIT_GROUP = "editGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * step group in a menu (value <code>"emptyStepGroup"</code>).
- */
- public static final String EMPTY_STEP_GROUP = "emptyStepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step group in a menu or toolbar (value <code>"stepGroup"</code>).
- */
- public static final String STEP_GROUP = "stepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step into group in a menu or toolbar (value <code>"stepIntoGroup"</code>).
- */
- public static final String STEP_INTO_GROUP = "stepIntoGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step over group in a menu or toolbar (value <code>"stepOverGroup"</code>).
- */
- public static final String STEP_OVER_GROUP = "stepOverGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step return group in a menu or toolbar (value <code>"stepReturnGroup"</code>).
- */
- public static final String STEP_RETURN_GROUP = "stepReturnGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * thread group in a menu (value <code>"emptyThreadGroup"</code>).
- */
- public static final String EMPTY_THREAD_GROUP = "emptyThreadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a thread group in a menu or toolbar(value <code>"threadGroup"</code>).
- */
- public static final String THREAD_GROUP = "threadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * launch group in a menu (value <code>"emptyLaunchGroup"</code>).
- */
- public static final String EMPTY_LAUNCH_GROUP = "emptyLaunchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a launch group in a menu (value <code>"launchGroup"</code>).
- */
- public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * variable group in a menu (value <code>"emptyVariableGroup"</code>).
- */
- public static final String EMPTY_VARIABLE_GROUP = "emptyVariableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a variable group in a menu (value <code>"variableGroup"</code>).
- */
- public static final String VARIABLE_GROUP = "variableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * navigation group in a menu (value <code>"emptyNavigationGroup"</code>).
- */
- public static final String EMPTY_NAVIGATION_GROUP = "emptyNavigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a navigation group in a menu (value <code>"navigationGroup"</code>).
- */
- public static final String NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * breakpoint group in a menu (value <code>"emptyBreakpointGroup"</code>).
- */
- public static final String EMPTY_BREAKPOINT_GROUP = "emptyBreakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a breakpoint group in a menu (value <code>"breakpointGroup"</code>).
- */
- public static final String BREAKPOINT_GROUP = "breakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding an
- * expression group in a menu (value <code>"emptyExpressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EMPTY_EXPRESSION_GROUP = "emptyExpressionGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an expression group in a menu (value <code>"expressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EXPRESSION_GROUP = "expressionGroup"; //$NON-NLS-1$
- /**
- * Identifier for an empty group preceding a
- * render group in a menu (value <code>"emptyRenderGroup"</code>).
- */
- public static final String EMPTY_RENDER_GROUP = "emptyRenderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a render group in a menu or toolbar(value <code>"renderGroup"</code>).
- */
- public static final String RENDER_GROUP = "renderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a property group in a menu (value <code>"propertyGroup"</code>).
- */
- public static final String PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the variables (tree viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_VARIABLE_ID = "org.eclipse.debug.ui.VariableView.variables"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the detail (text viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_DETAIL_ID = "org.eclipse.debug.ui.VariableView.detail"; //$NON-NLS-1$
-
- // status codes
- /**
- * Status indicating an invalid extension definition.
- */
- public static final int STATUS_INVALID_EXTENSION_DEFINITION = 100;
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- // launch configuration attribute keys
- /**
- * Launch configuartion attribute - the perspective to
- * switch to when a launch configuration is launched in
- * run mode (value <code>org.eclipse.debug.ui.target_run_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- */
- public static final String ATTR_TARGET_RUN_PERSPECTIVE = PLUGIN_ID + ".target_run_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuartion attribute - the perspective to
- * switch to when a launch configuration is launched in
- * debug mode (value <code>org.eclipse.debug.ui.target_debug_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- */
- public static final String ATTR_TARGET_DEBUG_PERSPECTIVE = PLUGIN_ID + ".target_debug_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - the container where the configuration file
- * is stored. The container is set via the 'setContainer()' call on ILaunchConfigurationWorkingCopy.
- * This constant is only needed for persisting and reading the default value of the
- * container value for individual resources.
- *
- * @since 2.0
- */
- public static final String ATTR_CONTAINER = PLUGIN_ID + ".container"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is 'private'. A private configuration is one that does not appear to the user in the launch
- * history or the launch configuration dialog.
- *
- * @since 2.0
- */
- public static final String ATTR_PRIVATE = PLUGIN_ID + ".private"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the debug favorites menu. Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- */
- public static final String ATTR_DEBUG_FAVORITE = PLUGIN_ID + ".debugFavorite"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the run favorites menu.Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- */
- public static final String ATTR_RUN_FAVORITE = PLUGIN_ID + ".runFavorite"; //$NON-NLS-1$
-
- /**
- * Debug action groups extension point identifier
- * (value <code>"debugActionGroups"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_DEBUG_ACTION_GROUPS= "debugActionGroups"; //$NON-NLS-1$
-
- /**
- * Launch configuration tab groups extension point identifier
- * (value <code>"launchConfigurationTabGroups"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$
-
- /**
- * Launch shortcuts extension point identifier
- * (value <code>"launchShortcuts"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_SHORTCUTS= "launchShortcuts"; //$NON-NLS-1$
+package org.eclipse.debug.ui;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
+This file is made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+**********************************************************************/
+
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+
+/**
+ * Constant definitions for debug UI plug-in.
+ * <p>
+ * Popup menus in the debug UI support action contribution via the
+ * <code>org.eclipse.ui.popupMenus</code> extension. Actions may be
+ * contributed to any group on the menu. To facilitate insertion of actions
+ * inbetween existing groups, empty groups have been defined
+ * in the menu. Each group prefixed by "empty" indicates an empty group.
+ * </p>
+ * <h3>Debug View Popup Menu</h3>
+ * <ul>
+ * <li>Empty edit group</li>
+ * <li>Edit group</li>
+ * <li>Copy stack action</li>
+ * <li>Empty step group</li>
+ * <li>Step group</li>
+ * <li>Step into group</li>
+ * <li>Step into action</li>
+ * <li>Step over group</li>
+ * <li>Step over action</li>
+ * <li>Step return group</li>
+ * <li>Step return action</li>
+ * <li>Empty thread group</li>
+ * <li>Thread group</li>
+ * <li>Resume action</li>
+ * <li>Suspend action</li>
+ * <li>Terminate action</li>
+ * <li>Disconnect action</li>
+ * <li>Empty launch group</li>
+ * <li>Launch group</li>
+ * <li>Remove all terminated action</li>
+ * <li>Terminate and Remove action</li>
+ * <li>Relaunch action</li>
+ * <li>Terminate all action</li>
+ * <li>Empty render group</li>
+ * <li>Render group</li>
+ * <li>Property group</li>
+ * <li>Property dialog action</li>
+ * <li>Additions group</li>
+ * </ul>
+ * <h3>Variables View Popup Menus</h3>
+ * <ul>
+ * <li>Empty variable group</li>
+ * <li>Variable group</li>
+ * <li>Select all action</li>
+ * <li>Copy to clipboard action</li>
+ * <li>Change value action</li>
+ * <li>Empty render group</li>
+ * <li>Render group</li>
+ * <li>Show type names action</li>
+ * <li>Additions group</li>
+ * </ul>
+ * <h3>Breakpoints View Popup Menu</h3>
+ * <ul>
+ * <li>Empty Navigation group</li>
+ * <li>Navigation group</li>
+ * <li>Open action</li>
+ * <li>Empty Breakpoint goup</li>
+ * <li>Breakpoint group</li>
+ * <li>Enable action</li>
+ * <li>Disable action</li>
+ * <li>Remove action</li>
+ * <li>Remove all action</li>
+ * <li>Empty render group</li>
+ * <li>Render group</li>
+ * <li>Show breakpoints for model action</li>
+ * <li>Additions group</li>
+ * </ul>
+ * <h3>Expressions View Popup Menu</h3>
+ * <ul>
+ * <li>Empty Expression group</li>
+ * <li>Expression group</li>
+ * <li>Select all action</li>
+ * <li>Copy to clipboard action</li>
+ * <li>Remove action</li>
+ * <li>Remove all action</li>
+ * <li>Change variable value action</li>
+ * <li>Empty Render group</li>
+ * <li>Render group</li>
+ * <li>Show type names action</li>
+ * <li>Additions group</li>
+ * </ul>
+ * <p>
+ * Constants only; not intended to be implemented or extended.
+ * </p>
+ */
+
+public interface IDebugUIConstants {
+
+ /**
+ * Debug UI plug-in identifier (value <code>"org.eclipse.debug.ui"</code>).
+ */
+ public static final String PLUGIN_ID = DebugUIPlugin.getUniqueIdentifier();
+
+ /**
+ * Debug perspective identifier (value <code>"org.eclipse.debug.ui.DebugPerspective"</code>).
+ */
+ public static final String ID_DEBUG_PERSPECTIVE = PLUGIN_ID + ".DebugPerspective"; //$NON-NLS-1$
+
+ /**
+ * Debug model presentation simple extension point identifier (value <code>"debugModelPresentations"</code>).
+ */
+ public static final String ID_DEBUG_MODEL_PRESENTATION= "debugModelPresentations"; //$NON-NLS-1$
+
+ /**
+ * Constant for referring to no perspective.
+ */
+ public static final String PERSPECTIVE_NONE = "perspective_none"; //$NON-NLS-1$
+
+ /**
+ * Constant for referring to a default perspective.
+ */
+ public static final String PERSPECTIVE_DEFAULT = "perspective_default"; //$NON-NLS-1$
+
+ // Preferences
+
+ /**
+ * String preference that identifies the default 'switch to perspective id' when running a
+ * launch configuration. This default is used if a particular launch configuration does not
+ * override the 'switch to perspective when in run mode' attribute with something else.
+ */
+ public static final String PREF_SHOW_RUN_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_run_perspective_default"; //$NON-NLS-1$
+
+ /**
+ * String preference that identifies the default 'switch to perspective id' when debugging a
+ * launch configuration. This default is used if a particular launch configuration does not
+ * override the 'switch to perspective when in debug mode' attribute with something else.
+ */
+ public static final String PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_debug_perspective_default"; //$NON-NLS-1$
+
+ /**
+ * Boolean preference controlling whether a build is done before
+ * launching a program (if one is needed).
+ */
+ public static final String PREF_BUILD_BEFORE_LAUNCH= PLUGIN_ID + ".build_before_launch"; //$NON-NLS-1$
+ /**
+ * Identifier for the radio button group that consists of the following three preferences.
+ */
+ public static final String PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADIO= PLUGIN_ID + ".save_dirty_editors_before_launch_radio"; //$NON-NLS-1$
+ /**
+ * Radio button preference specifying that dirty editors should be autosaved (no prompting)
+ * before launching.
+ */
+ public static final String PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".auto_save_dirty_editors_before_launch"; //$NON-NLS-1$
+ /**
+ * Radio button preference specifying that dirty editors should cause a prompt to appear to the
+ * user asking if they wish to save.
+ */
+ public static final String PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".prompt_save_dirty_editors_before_launch"; //$NON-NLS-1$
+ /**
+ * Radio button preference specifying that dirty editors should never be saved before launching.
+ */
+ public static final String PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH= PLUGIN_ID + ".never_save_dirty_editors_before_launch"; //$NON-NLS-1$
+ /**
+ * Boolean preference controlling automatic removal of terminated launches
+ * when a new launch is registered.
+ * @since 2.0
+ */
+ public static final String PREF_AUTO_REMOVE_OLD_LAUNCHES= PLUGIN_ID + ".auto_remove_old_launches"; //$NON-NLS-1$
+
+ /**
+ * Boolean preference controlling whether the debugger re-uses non-dirty editors
+ * that it opens when displaying source. When <code>true</code> the debugger
+ * re-uses the same editor when showing source for a selected stack frame (unless
+ * the editor is dirty).
+ *
+ * @since 2.0
+ */
+ public static final String PREF_REUSE_EDITOR = PLUGIN_ID + ".reuse_editor"; //$NON-NLS-1$
+
+ /**
+ * Integer preference that specifies the length of the Run & Debug launch history lists.
+ *
+ * @since 2.0
+ */
+ public static final String PREF_MAX_HISTORY_SIZE = PLUGIN_ID + ".max_history_size"; //$NON-NLS-1$
+
+ /**
+ * Boolean preference controlling whether the debugger shows types names
+ * in its variable view. When <code>true</code> the debugger
+ * will display type names in new variable views.
+ *
+ * @since 2.0
+ */
+ public static final String PREF_SHOW_TYPE_NAMES = PLUGIN_ID + ".show_type_names"; //$NON-NLS-1$
+
+ /**
+ * Boolean preference controlling whether the debugger shows the detail pane
+ * in its variable view. When <code>true</code> the debugger
+ * will show the detail panes in new variable views.
+ *
+ * @since 2.0
+ */
+ public static final String PREF_SHOW_DETAIL_PANE = PLUGIN_ID + ".show_detail_pane"; //$NON-NLS-1$
+
+ /**
+ * Boolean preference controlling whether the debugger will force activate the active
+ * shell/window of the Eclipse workbench when a breakpoint is hit.
+ *
+ * @since 2.1
+ */
+ public static final String PREF_ACTIVATE_WORKBENCH= PLUGIN_ID + ".activate_workbench"; //$NON-NLS-1$
+
+
+ // Debug views
+
+ /**
+ * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
+ */
+ public static final String ID_DEBUG_VIEW= "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint view identifier (value <code>"org.eclipse.debug.ui.BreakpointView"</code>).
+ */
+ public static final String ID_BREAKPOINT_VIEW= "org.eclipse.debug.ui.BreakpointView"; //$NON-NLS-1$
+
+ /**
+ * Variable view identifier (value <code>"org.eclipse.debug.ui.VariableView"</code>).
+ */
+ public static final String ID_VARIABLE_VIEW= "org.eclipse.debug.ui.VariableView"; //$NON-NLS-1$
+
+ /**
+ * Expression view identifier (value <code>"org.eclipse.debug.ui.ExpressionView"</code>).
+ * @since 2.0
+ */
+ public static final String ID_EXPRESSION_VIEW= "org.eclipse.debug.ui.ExpressionView"; //$NON-NLS-1$
+
+ /**
+ * Console view identifier (value <code>"org.eclipse.debug.ui.ConsoleView"</code>).
+ */
+ public static final String ID_CONSOLE_VIEW= "org.eclipse.debug.ui.ConsoleView"; //$NON-NLS-1$
+
+ // Extension points
+
+ /**
+ * Extension point for launch configuration type images.
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES = "launchConfigurationTypeImages"; //$NON-NLS-1$
+
+ // Debug Action images
+
+ /**
+ * Debug action image identifier.
+ */
+ public static final String IMG_ACT_DEBUG= "IMG_ACT_DEBUG"; //$NON-NLS-1$
+
+ /**
+ * Run action image identifier.
+ */
+ public static final String IMG_ACT_RUN= "IMG_ACT_RUN"; //$NON-NLS-1$
+
+ /** Clear action image identifier. */
+ public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
+
+ /** Display variable type names action image identifier. */
+ public static final String IMG_LCL_TYPE_NAMES= "IMG_LCL_TYPE_NAMES"; //$NON-NLS-1$
+
+ /** Toggle detail pane action image identifier.*/
+ public static final String IMG_LCL_DETAIL_PANE= "IMG_LCL_DETAIL_PANE"; //$NON-NLS-1$
+
+ /** Change variable value action image identifier.*/
+ public static final String IMG_LCL_CHANGE_VARIABLE_VALUE= "IMG_LCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
+
+ /**
+ * Disconnect action image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_LCL_DISCONNECT= "IMG_LCL_DISCONNECT"; //$NON-NLS-1$
+
+ /**
+ * Content assist action image identifier.
+ */
+ public static final String IMG_LCL_CONTENT_ASSIST= "IMG_LCL_CONTENT_ASSIST"; //$NON-NLS-1$
+ public static final String IMG_ELCL_CONTENT_ASSIST= "IMG_ELCL_CONTENT_ASSIST"; //$NON-NLS-1$
+ public static final String IMG_DLCL_CONTENT_ASSIST= "IMG_DLCL_CONTENT_ASSIST"; //$NON-NLS-1$
+
+ // Debug element images
+
+ /** Debug mode launch image identifier. */
+ public static final String IMG_OBJS_LAUNCH_DEBUG= "IMG_OBJS_LAUNCH_DEBUG"; //$NON-NLS-1$
+
+ /** Run mode launch image identifier. */
+ public static final String IMG_OBJS_LAUNCH_RUN= "IMG_OBJS_LAUNCH_RUN"; //$NON-NLS-1$
+
+ /** Terminated run mode launch image identifier. */
+ public static final String IMG_OBJS_LAUNCH_RUN_TERMINATED= "IMG_OBJS_LAUNCH_RUN_TERMINATED"; //$NON-NLS-1$
+
+ /** Running debug target image identifier. */
+ public static final String IMG_OBJS_DEBUG_TARGET= "IMG_OBJS_DEBUG_TARGET"; //$NON-NLS-1$
+
+ /** Terminated debug target image identifier. */
+ public static final String IMG_OBJS_DEBUG_TARGET_TERMINATED= "IMG_OBJS_DEBUG_TARGET_TERMINATED"; //$NON-NLS-1$
+
+ /** Running thread image identifier. */
+ public static final String IMG_OBJS_THREAD_RUNNING= "IMG_OBJS_THREAD_RUNNING"; //$NON-NLS-1$
+
+ /** Suspended thread image identifier. */
+ public static final String IMG_OBJS_THREAD_SUSPENDED= "IMG_OBJS_THREAD_SUSPENDED"; //$NON-NLS-1$
+
+ /** Terminated thread image identifier. */
+ public static final String IMG_OBJS_THREAD_TERMINATED= "IMG_OBJS_THREAD_TERMINATED"; //$NON-NLS-1$
+
+ /** Stack frame (suspended) image identifier. */
+ public static final String IMG_OBJS_STACKFRAME= "IMG_OBJS_STACKFRAME"; //$NON-NLS-1$
+
+ /** Stack frame (running) image identifier. */
+ public static final String IMG_OBJS_STACKFRAME_RUNNING= "IMG_OBJS_STACKFRAME_RUNNING"; //$NON-NLS-1$
+
+ /** Enabled breakpoint image identifier. */
+ public static final String IMG_OBJS_BREAKPOINT= "IMG_OBJS_BREAKPOINT"; //$NON-NLS-1$
+
+ /** Disabled breakpoint image identifier. */
+ public static final String IMG_OBJS_BREAKPOINT_DISABLED= "IMG_OBJS_BREAKPOINT_DISABLED"; //$NON-NLS-1$
+
+ /** Running system process image identifier. */
+ public static final String IMG_OBJS_OS_PROCESS= "IMG_OBJS_OS_PROCESS"; //$NON-NLS-1$
+
+ /** Terminated system process image identifier. */
+ public static final String IMG_OBJS_OS_PROCESS_TERMINATED= "IMG_OBJS_OS_PROCESS_TERMINATED"; //$NON-NLS-1$
+
+ /**
+ * Expression image identifier.
+ *
+ * @since 2.0
+ */
+ public static final String IMG_OBJS_EXPRESSION= "IMG_OBJS_EXPRESSION"; //$NON-NLS-1$
+
+ /**
+ * Generic variable image identifier.
+ *
+ * @since 2.0
+ */
+ public static final String IMG_OBJS_VARIABLE= "IMG_OBJS_VARIABLE"; //$NON-NLS-1$
+
+ // views
+
+ /**
+ * Launches view image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_VIEW_LAUNCHES= "IMG_VIEW_LAUNCHES"; //$NON-NLS-1$
+
+ /**
+ * Breakpoints view image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_VIEW_BREAKPOINTS= "IMG_VIEW_BREAKPOINTS"; //$NON-NLS-1$
+
+ /**
+ * Variables view image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_VIEW_VARIABLES= "IMG_VIEW_VARIABLES"; //$NON-NLS-1$
+
+ /**
+ * Expressions view image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_VIEW_EXPRESSIONS= "IMG_VIEW_EXPRESSIONS"; //$NON-NLS-1$
+
+ /**
+ * Console view image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$
+
+ // perspective
+ /**
+ * Debug perspective image identifier
+ *
+ * @since 2.0
+ */
+ public static final String IMG_PERSPECTIVE_DEBUG= "IMG_PERSPECTIVE_DEBUG"; //$NON-NLS-1$
+
+ // wizard banners
+ /** Debug wizard banner image identifier. */
+ public static final String IMG_WIZBAN_DEBUG= "IMG_WIZBAN_DEBUG"; //$NON-NLS-1$
+
+ /** Run wizard banner image identifier. */
+ public static final String IMG_WIZBAN_RUN= "IMG_WIZBAN_RUN"; //$NON-NLS-1$
+
+ // overlays
+ /** Error overlay image identifier. */
+ public static final String IMG_OVR_ERROR = "IMG_OVR_ERROR"; //$NON-NLS-1$
+
+ /**
+ * Debug action set identifier (value <code>"org.eclipse.debug.ui.debugActionSet"</code>).
+ */
+ public static final String DEBUG_ACTION_SET= PLUGIN_ID + ".debugActionSet"; //$NON-NLS-1$
+
+ /**
+ * Launch action set identifier (value <code>"org.eclipse.debug.ui.LaunchActionSet"</code>).
+ */
+ public static final String LAUNCH_ACTION_SET= PLUGIN_ID + ".launchActionSet"; //$NON-NLS-1$
+
+ // menus
+
+ /**
+ * Identifier for an empty group preceding an
+ * edit group in a menu (value <code>"emptyEditGroup"</code>).
+ */
+ public static final String EMPTY_EDIT_GROUP = "emptyEditGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an edit group in a menu (value <code>"editGroup"</code>).
+ */
+ public static final String EDIT_GROUP = "editGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * step group in a menu (value <code>"emptyStepGroup"</code>).
+ */
+ public static final String EMPTY_STEP_GROUP = "emptyStepGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a step group in a menu or toolbar (value <code>"stepGroup"</code>).
+ */
+ public static final String STEP_GROUP = "stepGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a step into group in a menu or toolbar (value <code>"stepIntoGroup"</code>).
+ */
+ public static final String STEP_INTO_GROUP = "stepIntoGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a step over group in a menu or toolbar (value <code>"stepOverGroup"</code>).
+ */
+ public static final String STEP_OVER_GROUP = "stepOverGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a step return group in a menu or toolbar (value <code>"stepReturnGroup"</code>).
+ */
+ public static final String STEP_RETURN_GROUP = "stepReturnGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * thread group in a menu (value <code>"emptyThreadGroup"</code>).
+ */
+ public static final String EMPTY_THREAD_GROUP = "emptyThreadGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a thread group in a menu or toolbar(value <code>"threadGroup"</code>).
+ */
+ public static final String THREAD_GROUP = "threadGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * launch group in a menu (value <code>"emptyLaunchGroup"</code>).
+ */
+ public static final String EMPTY_LAUNCH_GROUP = "emptyLaunchGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a launch group in a menu (value <code>"launchGroup"</code>).
+ */
+ public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * variable group in a menu (value <code>"emptyVariableGroup"</code>).
+ */
+ public static final String EMPTY_VARIABLE_GROUP = "emptyVariableGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a variable group in a menu (value <code>"variableGroup"</code>).
+ */
+ public static final String VARIABLE_GROUP = "variableGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * navigation group in a menu (value <code>"emptyNavigationGroup"</code>).
+ */
+ public static final String EMPTY_NAVIGATION_GROUP = "emptyNavigationGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a navigation group in a menu (value <code>"navigationGroup"</code>).
+ */
+ public static final String NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding a
+ * breakpoint group in a menu (value <code>"emptyBreakpointGroup"</code>).
+ */
+ public static final String EMPTY_BREAKPOINT_GROUP = "emptyBreakpointGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a breakpoint group in a menu (value <code>"breakpointGroup"</code>).
+ */
+ public static final String BREAKPOINT_GROUP = "breakpointGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group preceding an
+ * expression group in a menu (value <code>"emptyExpressionGroup"</code>).
+ *
+ * @since 2.0
+ */
+ public static final String EMPTY_EXPRESSION_GROUP = "emptyExpressionGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an expression group in a menu (value <code>"expressionGroup"</code>).
+ *
+ * @since 2.0
+ */
+ public static final String EXPRESSION_GROUP = "expressionGroup"; //$NON-NLS-1$
+ /**
+ * Identifier for an empty group preceding a
+ * render group in a menu (value <code>"emptyRenderGroup"</code>).
+ */
+ public static final String EMPTY_RENDER_GROUP = "emptyRenderGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a render group in a menu or toolbar(value <code>"renderGroup"</code>).
+ */
+ public static final String RENDER_GROUP = "renderGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for a property group in a menu (value <code>"propertyGroup"</code>).
+ */
+ public static final String PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
+
+ /**
+ * Id for the popup menu associated with the variables (tree viewer) part of the VariableView
+ */
+ public static final String VARIABLE_VIEW_VARIABLE_ID = "org.eclipse.debug.ui.VariableView.variables"; //$NON-NLS-1$
+
+ /**
+ * Id for the popup menu associated with the detail (text viewer) part of the VariableView
+ */
+ public static final String VARIABLE_VIEW_DETAIL_ID = "org.eclipse.debug.ui.VariableView.detail"; //$NON-NLS-1$
+
+ // status codes
+ /**
+ * Status indicating an invalid extension definition.
+ */
+ public static final int STATUS_INVALID_EXTENSION_DEFINITION = 100;
+
+ /**
+ * Status code indicating an unexpected internal error.
+ */
+ public static final int INTERNAL_ERROR = 120;
+
+ // launch configuration attribute keys
+ /**
+ * Launch configuartion attribute - the perspective to
+ * switch to when a launch configuration is launched in
+ * run mode (value <code>org.eclipse.debug.ui.target_run_perspective</code>).
+ * Value is a string corresponding to a perspective identifier,
+ * or <code>null</code> indicating no perspective change.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_TARGET_RUN_PERSPECTIVE = PLUGIN_ID + ".target_run_perspective"; //$NON-NLS-1$
+
+ /**
+ * Launch configuartion attribute - the perspective to
+ * switch to when a launch configuration is launched in
+ * debug mode (value <code>org.eclipse.debug.ui.target_debug_perspective</code>).
+ * Value is a string corresponding to a perspective identifier,
+ * or <code>null</code> indicating no perspective change.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_TARGET_DEBUG_PERSPECTIVE = PLUGIN_ID + ".target_debug_perspective"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute - the container where the configuration file
+ * is stored. The container is set via the 'setContainer()' call on ILaunchConfigurationWorkingCopy.
+ * This constant is only needed for persisting and reading the default value of the
+ * container value for individual resources.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_CONTAINER = PLUGIN_ID + ".container"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute - a boolean value that indicates if the launch configuration
+ * is 'private'. A private configuration is one that does not appear to the user in the launch
+ * history or the launch configuration dialog.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_PRIVATE = PLUGIN_ID + ".private"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute - a boolean value that indicates if the launch configuration
+ * is displayed in the debug favorites menu. Default value is
+ * <code>false</code> if absent.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_DEBUG_FAVORITE = PLUGIN_ID + ".debugFavorite"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute - a boolean value that indicates if the launch configuration
+ * is displayed in the run favorites menu.Default value is
+ * <code>false</code> if absent.
+ *
+ * @since 2.0
+ */
+ public static final String ATTR_RUN_FAVORITE = PLUGIN_ID + ".runFavorite"; //$NON-NLS-1$
+
+ /**
+ * Debug action groups extension point identifier
+ * (value <code>"debugActionGroups"</code>).
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_DEBUG_ACTION_GROUPS= "debugActionGroups"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration tab groups extension point identifier
+ * (value <code>"launchConfigurationTabGroups"</code>).
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$
+
+ /**
+ * Launch shortcuts extension point identifier
+ * (value <code>"launchShortcuts"</code>).
+ *
+ * @since 2.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_SHORTCUTS= "launchShortcuts"; //$NON-NLS-1$
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
index 405b17fe5..68062ad4a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
@@ -1,170 +1,170 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for debug views. Provides access to the underlying viewer and
- * debug model presentation being used by a viewer. This allows clients to do
- * such things as add and remove filters to a viewer, and configure a debug
- * model presentation.
- * <p>
- * Clients may implement this interface. Generally, clients should subclass
- * <code>AbstractDebugView</code> when creating a new debug view.
- * </p>
- * @see org.eclipse.core.runtime.IAdaptable
- * @see org.eclipse.debug.ui.IDebugModelPresentation
- * @see org.eclipse.debug.ui.AbstractDebugView
- * @since 2.0
- */
-
-public interface IDebugView extends IViewPart {
-
- /**
- * Action id for a view's copy action. Any view
- * with a copy action that should be invoked when
- * ctrl+c is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String COPY_ACTION = ITextEditorActionConstants.COPY;
-
- /**
- * Action id for a view's cut action. Any view
- * with a cut action that should be invoked when
- * ctrl+x is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String CUT_ACTION = ITextEditorActionConstants.CUT;
-
- /**
- * Action id for a view's double-click action. Any view
- * with an action that should be invoked when
- * the mouse is double-clicked should store their
- * action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String DOUBLE_CLICK_ACTION = "Double_Click_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's find action. Any view
- * with a find action that should be invoked when
- * ctrl+f is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String FIND_ACTION = ITextEditorActionConstants.FIND;
-
- /**
- * Action id for a view's paste action. Any view
- * with a paste action that should be invoked when
- * ctrl+v is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String PASTE_ACTION = ITextEditorActionConstants.PASTE;
-
- /**
- * Action id for a view's remove action. Any view
- * with a remove action that should be invoked when
- * the delete key is pressed should store their
- * remove action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String REMOVE_ACTION = "Remove_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's select all action. Any view
- * with a select all action that should be invoked when
- * ctrl+a is pressed should store their
- * select all action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String SELECT_ALL_ACTION = ITextEditorActionConstants.SELECT_ALL;
-
- /**
- * Returns the viewer contained in this debug view.
- *
- * @return viewer
- */
- public Viewer getViewer();
-
- /**
- * Returns the debug model presentation for this view specified
- * by the debug model identifier.
- *
- * @param id the debug model identifier that corresponds to the <code>id</code>
- * attribute of a debug model presentation extension
- * @return the debug model presentation, or <code>null</code> if no
- * presentation is registered for the specified id
- */
- public IDebugModelPresentation getPresentation(String id);
-
- /**
- * Installs the given action under the given action id.
- *
- * If the action has an id that maps to one of the global
- * action ids defined by this interface, the action is registered
- * as a global action handler.
- *
- * If the action is an instance of <code>IUpdate</code> it is added/remove
- * from the collection of updateables associated with this view.
- *
- * @param actionId the action id
- * @param action the action, or <code>null</code> to clear it
- * @see #getAction
- */
- public void setAction(String actionID, IAction action);
-
- /**
- * Adds the given IUpdate to this view's collection of updatable
- * objects. Allows the view to periodically update these registered
- * objects.
- * Has no effect if an identical IUpdate is already registered.
- *
- * @param updatable The IUpdate instance to be added
- */
- public void add(IUpdate updatable);
-
- /**
- * Removes the given IUpdate from this view's collection of updatable
- * objects.
- * Has no effect if an identical IUpdate was not already registered.
- *
- * @param updatable The IUpdate instance to be removed
- */
- public void remove(IUpdate updatable);
-
- /**
- * Returns the action installed under the given action id.
- *
- * @param actionId the action id
- * @return the action, or <code>null</code> if none
- * @see #setAction
- */
- public IAction getAction(String actionID);
-
- /**
- * Returns the context menu manager for this view.
- *
- * @return the context menu manager for this view, or <code>null</code> if none
- */
- public IMenuManager getContextMenuManager();
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+import org.eclipse.ui.texteditor.IUpdate;
+
+/**
+ * Common function for debug views. Provides access to the underlying viewer and
+ * debug model presentation being used by a viewer. This allows clients to do
+ * such things as add and remove filters to a viewer, and configure a debug
+ * model presentation.
+ * <p>
+ * Clients may implement this interface. Generally, clients should subclass
+ * <code>AbstractDebugView</code> when creating a new debug view.
+ * </p>
+ * @see org.eclipse.core.runtime.IAdaptable
+ * @see org.eclipse.debug.ui.IDebugModelPresentation
+ * @see org.eclipse.debug.ui.AbstractDebugView
+ * @since 2.0
+ */
+
+public interface IDebugView extends IViewPart {
+
+ /**
+ * Action id for a view's copy action. Any view
+ * with a copy action that should be invoked when
+ * ctrl+c is pressed should store their
+ * copy action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String COPY_ACTION = ITextEditorActionConstants.COPY;
+
+ /**
+ * Action id for a view's cut action. Any view
+ * with a cut action that should be invoked when
+ * ctrl+x is pressed should store their
+ * copy action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String CUT_ACTION = ITextEditorActionConstants.CUT;
+
+ /**
+ * Action id for a view's double-click action. Any view
+ * with an action that should be invoked when
+ * the mouse is double-clicked should store their
+ * action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String DOUBLE_CLICK_ACTION = "Double_Click_ActionId"; //$NON-NLS-1$
+
+ /**
+ * Action id for a view's find action. Any view
+ * with a find action that should be invoked when
+ * ctrl+f is pressed should store their
+ * copy action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String FIND_ACTION = ITextEditorActionConstants.FIND;
+
+ /**
+ * Action id for a view's paste action. Any view
+ * with a paste action that should be invoked when
+ * ctrl+v is pressed should store their
+ * copy action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String PASTE_ACTION = ITextEditorActionConstants.PASTE;
+
+ /**
+ * Action id for a view's remove action. Any view
+ * with a remove action that should be invoked when
+ * the delete key is pressed should store their
+ * remove action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String REMOVE_ACTION = "Remove_ActionId"; //$NON-NLS-1$
+
+ /**
+ * Action id for a view's select all action. Any view
+ * with a select all action that should be invoked when
+ * ctrl+a is pressed should store their
+ * select all action with this key.
+ *
+ * @see #setAction(String, IAction)
+ */
+ public static final String SELECT_ALL_ACTION = ITextEditorActionConstants.SELECT_ALL;
+
+ /**
+ * Returns the viewer contained in this debug view.
+ *
+ * @return viewer
+ */
+ public Viewer getViewer();
+
+ /**
+ * Returns the debug model presentation for this view specified
+ * by the debug model identifier.
+ *
+ * @param id the debug model identifier that corresponds to the <code>id</code>
+ * attribute of a debug model presentation extension
+ * @return the debug model presentation, or <code>null</code> if no
+ * presentation is registered for the specified id
+ */
+ public IDebugModelPresentation getPresentation(String id);
+
+ /**
+ * Installs the given action under the given action id.
+ *
+ * If the action has an id that maps to one of the global
+ * action ids defined by this interface, the action is registered
+ * as a global action handler.
+ *
+ * If the action is an instance of <code>IUpdate</code> it is added/remove
+ * from the collection of updateables associated with this view.
+ *
+ * @param actionId the action id
+ * @param action the action, or <code>null</code> to clear it
+ * @see #getAction
+ */
+ public void setAction(String actionID, IAction action);
+
+ /**
+ * Adds the given IUpdate to this view's collection of updatable
+ * objects. Allows the view to periodically update these registered
+ * objects.
+ * Has no effect if an identical IUpdate is already registered.
+ *
+ * @param updatable The IUpdate instance to be added
+ */
+ public void add(IUpdate updatable);
+
+ /**
+ * Removes the given IUpdate from this view's collection of updatable
+ * objects.
+ * Has no effect if an identical IUpdate was not already registered.
+ *
+ * @param updatable The IUpdate instance to be removed
+ */
+ public void remove(IUpdate updatable);
+
+ /**
+ * Returns the action installed under the given action id.
+ *
+ * @param actionId the action id
+ * @return the action, or <code>null</code> if none
+ * @see #setAction
+ */
+ public IAction getAction(String actionID);
+
+ /**
+ * Returns the context menu manager for this view.
+ *
+ * @return the context menu manager for this view, or <code>null</code> if none
+ */
+ public IMenuManager getContextMenuManager();
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
index 2db887824..071f9d513 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
@@ -1,91 +1,91 @@
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.operation.IRunnableContext;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
- /**
- * A launch configuration dialog is used to edit and launch
- * launch configurations. It contains a launch configuration
- * tab group.
- *
- * @see ILaunchConfigurationTabGroup
- * @see ILaunchConfigurationTab
- * @since 2.0
- */
-
-public interface ILaunchConfigurationDialog extends IRunnableContext {
-
- /**
- * Return value from <code>open()</code> method of a
- * launch configuration dialog when a launch completed
- * successfully with a single click (i.e. without opening a
- * launch configuration dialog).
- */
- public static final int LAUNCHED_BEFORE_OPENING = 2;
-
- /**
- * Adjusts the enable state of this dialog's buttons
- * to reflect the state of the active tab group.
- * <p>
- * This may be called by to force a button state
- * update.
- * </p>
- */
- public void updateButtons();
-
- /**
- * Updates the message (or error message) shown in the message line to
- * reflect the state of the currently active tab in this launch
- * configuration dialog.
- * <p>
- * This method may be called to force a message
- * update.
- * </p>
- */
- public void updateMessage();
-
- /**
- * Sets the contents of the name field to the given name.
- *
- * @param name new name value
- */
- public void setName(String name);
-
- /**
- * Returns a unique launch configuration name, using the given name
- * as a seed.
- *
- * @param name seed from which to generate a new unique name
- */
- public String generateName(String name);
-
- /**
- * Returns the tabs currently being displayed, or
- * <code>null</code> if none.
- *
- * @return currently displayed tabs, or <code>null</code>
- */
- public ILaunchConfigurationTab[] getTabs();
-
- /**
- * Returns the currently active <code>ILaunchConfigurationTab</code>
- * being displayed, or <code>null</code> if there is none.
- *
- * @return currently active <code>ILaunchConfigurationTab</code>, or <code>null</code>.
- */
- public ILaunchConfigurationTab getActiveTab();
-
- /**
- * Returns the mode in which this dialog was opened -
- * run or debug.
- *
- * @return one of <code>RUN_MODE</code> or <code>DEBUG_MODE</code> defined in <code>ILaunchManager</code>
- * @see ILaunchManager
- */
- public String getMode();
-
-}
+package org.eclipse.debug.ui;
+
+import org.eclipse.jface.operation.IRunnableContext;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+ /**
+ * A launch configuration dialog is used to edit and launch
+ * launch configurations. It contains a launch configuration
+ * tab group.
+ *
+ * @see ILaunchConfigurationTabGroup
+ * @see ILaunchConfigurationTab
+ * @since 2.0
+ */
+
+public interface ILaunchConfigurationDialog extends IRunnableContext {
+
+ /**
+ * Return value from <code>open()</code> method of a
+ * launch configuration dialog when a launch completed
+ * successfully with a single click (i.e. without opening a
+ * launch configuration dialog).
+ */
+ public static final int LAUNCHED_BEFORE_OPENING = 2;
+
+ /**
+ * Adjusts the enable state of this dialog's buttons
+ * to reflect the state of the active tab group.
+ * <p>
+ * This may be called by to force a button state
+ * update.
+ * </p>
+ */
+ public void updateButtons();
+
+ /**
+ * Updates the message (or error message) shown in the message line to
+ * reflect the state of the currently active tab in this launch
+ * configuration dialog.
+ * <p>
+ * This method may be called to force a message
+ * update.
+ * </p>
+ */
+ public void updateMessage();
+
+ /**
+ * Sets the contents of the name field to the given name.
+ *
+ * @param name new name value
+ */
+ public void setName(String name);
+
+ /**
+ * Returns a unique launch configuration name, using the given name
+ * as a seed.
+ *
+ * @param name seed from which to generate a new unique name
+ */
+ public String generateName(String name);
+
+ /**
+ * Returns the tabs currently being displayed, or
+ * <code>null</code> if none.
+ *
+ * @return currently displayed tabs, or <code>null</code>
+ */
+ public ILaunchConfigurationTab[] getTabs();
+
+ /**
+ * Returns the currently active <code>ILaunchConfigurationTab</code>
+ * being displayed, or <code>null</code> if there is none.
+ *
+ * @return currently active <code>ILaunchConfigurationTab</code>, or <code>null</code>.
+ */
+ public ILaunchConfigurationTab getActiveTab();
+
+ /**
+ * Returns the mode in which this dialog was opened -
+ * run or debug.
+ *
+ * @return one of <code>RUN_MODE</code> or <code>DEBUG_MODE</code> defined in <code>ILaunchManager</code>
+ * @see ILaunchManager
+ */
+ public String getMode();
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
index ab2e77e41..751eed716 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
@@ -1,202 +1,202 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A launch configuration tab is used to edit/view attributes
- * of a specific type of launch configuration. Launch
- * configurations are presented in a dialog, with a tab folder.
- * Each tab manipulates one ore more attributes of a launch
- * configuration.
- * <p>
- * The tab's lifecycle begins when <code>setLaunchConfigurationDialog(ILaunchConfigurationDialog)</code>
- * is called. A tab may then be asked repeatedly to initialize its
- * controls to display values for a launch configuration (see
- * <code>initializeFrom(ILaunchConfiguration)</code>), and to
- * apply its current settings to a launch configuration (see
- * <code>performApply(ILaunchConfigurationWorkingCopy)</code>).
- * While a user manipulates a tab's controls, the tab is not
- * intended to update a launch configuration. Updating a launch
- * configuration should only be performed when <code>performApply</code>
- * is called. To end a tab's lifecyle, <code>dispose()</code> will
- * be called. Note that a tab can be disposed before its control
- * has been created.
- * </p>
- * <p>
- * To support single-click launching, tabs are required to initialize
- * default values into launch configurations (possibly when their controls
- * have not been created). See <code>setDefault(ILaunchConfigurationWorkingCopy)</code>.
- * As well, the method <code>launched</code> can be called when the tab's
- * control does not exist.
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see org.eclipse.debug.core.ILaunchConfiguration
- * @since 2.0
- */
-public interface ILaunchConfigurationTab {
-
- /**
- * Creates the top level control for this launch configuration
- * tab under the given parent composite. This method is called once on
- * tab creation, after <code>setLaunchConfigurationDialog</code>
- * is called.
- * <p>
- * Implementors are responsible for ensuring that
- * the created control can be accessed via <code>getControl</code>
- * </p>
- *
- * @param parent the parent composite
- */
- public void createControl(Composite parent);
-
- /**
- * Returns the top level control for this tab.
- * <p>
- * May return <code>null</code> if the control
- * has not been created yet.
- * </p>
- *
- * @return the top level control or <code>null</code>
- */
- public Control getControl();
-
- /**
- * Initializes the given launch configuration with
- * default values for this tab. This method
- * is called when a new launch configuration is created
- * such that the configuration can be initialized with
- * meaningful values. This method may be called before this
- * tab's control is created, to support single-click launching.
- *
- * @param configuration launch configuration
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Initializes this tab's controls with values from the given
- * launch configuration. This method is called when
- * a configuration is selected to view or edit, after this
- * tab's control has been created.
- *
- * @param configuration launch configuration
- */
- public void initializeFrom(ILaunchConfiguration configuration);
-
- /**
- * Notifies this launch configuration tab that it has
- * been disposed. Marks the end of this tab's lifecycle,
- * allowing this tab to perform any cleanup required.
- */
- public void dispose();
-
- /**
- * Copies values from this tab into the given
- * launch configuration.
- *
- * @param configuration launch configuration
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Returns the current error message for this tab.
- * May be <code>null</code> to indicate no error message.
- * <p>
- * An error message should describe some error state,
- * as opposed to a message which may simply provide instruction
- * or information to the user.
- * </p>
- *
- * @return the error message, or <code>null</code> if none
- */
- public String getErrorMessage();
-
- /**
- * Returns the current message for this tab.
- * <p>
- * A message provides instruction or information to the
- * user, as opposed to an error message which should
- * describe some error state.
- * </p>
- *
- * @return the message, or <code>null</code> if none
- */
- public String getMessage();
-
- /**
- * Returns whether this tab is in a valid state in the context of the specified launch configuration.
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to launch.
- * </p>
- *
- * @param launchConfig launch configuration which provides context for validating this tab.
- * This value must not be <code>null</code>.
- *
- * @return whether this tab is in a valid state
- */
- public boolean isValid(ILaunchConfiguration launchConfig);
-
- /**
- * Returns whether this tab is in a state that allows the launch configuration whose values
- * this tab is showing to be saved. This differs from <code>isValid()</code> in that <code>canSave()</code>
- * determines if this tab prevents the current launch configuration from being saved, whereas
- * <code>isValid()</code> determines if this tab prevents the current launch configuration from
- * being launched.
- *
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to save a launch configuration.
- * </p>
- *
- * @return whether this tab is in a state that allows the current launch configuration to be saved
- */
- public boolean canSave();
-
- /**
- * Sets the launch configuration dialog that hosts this tab.
- * This is the first method called on a launch configuration
- * tab, and marks the beginning of this tab's lifecycle.
- *
- * @param dialog launch configuration dialog
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog);
-
- /**
- * Notifies this tab that the specified configuration has been
- * launched, resulting in the given launch. This method can be
- * called when a tab's control does not exist, to support single-click
- * launching.
- *
- * @param launch the result of launching the current
- * launch configuration
- */
- public void launched(ILaunch launch);
-
- /**
- * Returns the name of this tab.
- *
- * @return the name of this tab
- */
- public String getName();
-
- /**
- * Returns the image for this tab, or <code>null</code> if none
- *
- * @return the image for this tab, or <code>null</code> if none
- */
- public Image getImage();
-}
-
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * A launch configuration tab is used to edit/view attributes
+ * of a specific type of launch configuration. Launch
+ * configurations are presented in a dialog, with a tab folder.
+ * Each tab manipulates one ore more attributes of a launch
+ * configuration.
+ * <p>
+ * The tab's lifecycle begins when <code>setLaunchConfigurationDialog(ILaunchConfigurationDialog)</code>
+ * is called. A tab may then be asked repeatedly to initialize its
+ * controls to display values for a launch configuration (see
+ * <code>initializeFrom(ILaunchConfiguration)</code>), and to
+ * apply its current settings to a launch configuration (see
+ * <code>performApply(ILaunchConfigurationWorkingCopy)</code>).
+ * While a user manipulates a tab's controls, the tab is not
+ * intended to update a launch configuration. Updating a launch
+ * configuration should only be performed when <code>performApply</code>
+ * is called. To end a tab's lifecyle, <code>dispose()</code> will
+ * be called. Note that a tab can be disposed before its control
+ * has been created.
+ * </p>
+ * <p>
+ * To support single-click launching, tabs are required to initialize
+ * default values into launch configurations (possibly when their controls
+ * have not been created). See <code>setDefault(ILaunchConfigurationWorkingCopy)</code>.
+ * As well, the method <code>launched</code> can be called when the tab's
+ * control does not exist.
+ * </p>
+ * <p>
+ * This interface is intended to be implemented by clients.
+ * </p>
+ * @see org.eclipse.debug.core.ILaunchConfigurationType
+ * @see org.eclipse.debug.core.ILaunchConfiguration
+ * @since 2.0
+ */
+public interface ILaunchConfigurationTab {
+
+ /**
+ * Creates the top level control for this launch configuration
+ * tab under the given parent composite. This method is called once on
+ * tab creation, after <code>setLaunchConfigurationDialog</code>
+ * is called.
+ * <p>
+ * Implementors are responsible for ensuring that
+ * the created control can be accessed via <code>getControl</code>
+ * </p>
+ *
+ * @param parent the parent composite
+ */
+ public void createControl(Composite parent);
+
+ /**
+ * Returns the top level control for this tab.
+ * <p>
+ * May return <code>null</code> if the control
+ * has not been created yet.
+ * </p>
+ *
+ * @return the top level control or <code>null</code>
+ */
+ public Control getControl();
+
+ /**
+ * Initializes the given launch configuration with
+ * default values for this tab. This method
+ * is called when a new launch configuration is created
+ * such that the configuration can be initialized with
+ * meaningful values. This method may be called before this
+ * tab's control is created, to support single-click launching.
+ *
+ * @param configuration launch configuration
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
+
+ /**
+ * Initializes this tab's controls with values from the given
+ * launch configuration. This method is called when
+ * a configuration is selected to view or edit, after this
+ * tab's control has been created.
+ *
+ * @param configuration launch configuration
+ */
+ public void initializeFrom(ILaunchConfiguration configuration);
+
+ /**
+ * Notifies this launch configuration tab that it has
+ * been disposed. Marks the end of this tab's lifecycle,
+ * allowing this tab to perform any cleanup required.
+ */
+ public void dispose();
+
+ /**
+ * Copies values from this tab into the given
+ * launch configuration.
+ *
+ * @param configuration launch configuration
+ */
+ public void performApply(ILaunchConfigurationWorkingCopy configuration);
+
+ /**
+ * Returns the current error message for this tab.
+ * May be <code>null</code> to indicate no error message.
+ * <p>
+ * An error message should describe some error state,
+ * as opposed to a message which may simply provide instruction
+ * or information to the user.
+ * </p>
+ *
+ * @return the error message, or <code>null</code> if none
+ */
+ public String getErrorMessage();
+
+ /**
+ * Returns the current message for this tab.
+ * <p>
+ * A message provides instruction or information to the
+ * user, as opposed to an error message which should
+ * describe some error state.
+ * </p>
+ *
+ * @return the message, or <code>null</code> if none
+ */
+ public String getMessage();
+
+ /**
+ * Returns whether this tab is in a valid state in the context of the specified launch configuration.
+ * <p>
+ * This information is typically used by the launch configuration
+ * dialog to decide when it is okay to launch.
+ * </p>
+ *
+ * @param launchConfig launch configuration which provides context for validating this tab.
+ * This value must not be <code>null</code>.
+ *
+ * @return whether this tab is in a valid state
+ */
+ public boolean isValid(ILaunchConfiguration launchConfig);
+
+ /**
+ * Returns whether this tab is in a state that allows the launch configuration whose values
+ * this tab is showing to be saved. This differs from <code>isValid()</code> in that <code>canSave()</code>
+ * determines if this tab prevents the current launch configuration from being saved, whereas
+ * <code>isValid()</code> determines if this tab prevents the current launch configuration from
+ * being launched.
+ *
+ * <p>
+ * This information is typically used by the launch configuration
+ * dialog to decide when it is okay to save a launch configuration.
+ * </p>
+ *
+ * @return whether this tab is in a state that allows the current launch configuration to be saved
+ */
+ public boolean canSave();
+
+ /**
+ * Sets the launch configuration dialog that hosts this tab.
+ * This is the first method called on a launch configuration
+ * tab, and marks the beginning of this tab's lifecycle.
+ *
+ * @param dialog launch configuration dialog
+ */
+ public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog);
+
+ /**
+ * Notifies this tab that the specified configuration has been
+ * launched, resulting in the given launch. This method can be
+ * called when a tab's control does not exist, to support single-click
+ * launching.
+ *
+ * @param launch the result of launching the current
+ * launch configuration
+ */
+ public void launched(ILaunch launch);
+
+ /**
+ * Returns the name of this tab.
+ *
+ * @return the name of this tab
+ */
+ public String getName();
+
+ /**
+ * Returns the image for this tab, or <code>null</code> if none
+ *
+ * @return the image for this tab, or <code>null</code> if none
+ */
+ public Image getImage();
+}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
index 94b8e841e..121be89ad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
@@ -1,63 +1,63 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.ui.IEditorInput;
-
-/**
- * A source presentation is used to resolve an editor in
- * which to display a debug model element, breakpoint, or
- * source element. By default, a debug model presentation
- * (which implements this interface) is used to resolve
- * editors when performing source lookup. However, a source
- * locator may override default editor resolution by implementing
- * this interface.
- * <p>
- * Source lookup consists of the following steps:<ol>
- * <li>Locating a source element - the source locator associated
- * with a launch is queried for the source element associated
- * with a stack frame.</li>
- * <li>Resolving an editor in which to display a source element -
- * by default, the debug model presentation associated with the
- * debug model being debugged is queried for an editor input
- * and editor id in which to display a source element. However,
- * clients may override editor resolution by specifying a source
- * locator that is an instance of <code>ISourcePresentation</code>.
- * When a source presentation is specified as a source locator,
- * the source presentation is used to resolve an editor, rather
- * than the default debug model presentation.</li>
- * </ol>
- * </p>
- * @since 2.0
- */
-public interface ISourcePresentation {
-
- /**
- * Returns an editor input that should be used to display the given object
- * in an editor or <code>null</code> if unable to provide an editor input
- * for the given object.
- *
- * @param element a debug model element, breakpoint, or a source element
- * that was returned by a source locator's <code>getSourceElement(IStackFrame)</code>
- * method
- * @return an editor input, or <code>null</code> if none
- */
- public IEditorInput getEditorInput(Object element);
-
- /**
- * Returns the id of the editor to use to display the
- * given editor input and object, or <code>null</code> if
- * unable to provide an editor id.
- *
- * @param input an editor input that was previously retrieved from this
- * source presentation's <code>getEditorInput</code> method
- * @param element the object that was used in the call to
- * <code>getEditorInput</code>, that corresponds to the given editor
- * input
- * @return an editor id, or <code>null</code> if none
- */
- public String getEditorId(IEditorInput input, Object element);
-}
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * A source presentation is used to resolve an editor in
+ * which to display a debug model element, breakpoint, or
+ * source element. By default, a debug model presentation
+ * (which implements this interface) is used to resolve
+ * editors when performing source lookup. However, a source
+ * locator may override default editor resolution by implementing
+ * this interface.
+ * <p>
+ * Source lookup consists of the following steps:<ol>
+ * <li>Locating a source element - the source locator associated
+ * with a launch is queried for the source element associated
+ * with a stack frame.</li>
+ * <li>Resolving an editor in which to display a source element -
+ * by default, the debug model presentation associated with the
+ * debug model being debugged is queried for an editor input
+ * and editor id in which to display a source element. However,
+ * clients may override editor resolution by specifying a source
+ * locator that is an instance of <code>ISourcePresentation</code>.
+ * When a source presentation is specified as a source locator,
+ * the source presentation is used to resolve an editor, rather
+ * than the default debug model presentation.</li>
+ * </ol>
+ * </p>
+ * @since 2.0
+ */
+public interface ISourcePresentation {
+
+ /**
+ * Returns an editor input that should be used to display the given object
+ * in an editor or <code>null</code> if unable to provide an editor input
+ * for the given object.
+ *
+ * @param element a debug model element, breakpoint, or a source element
+ * that was returned by a source locator's <code>getSourceElement(IStackFrame)</code>
+ * method
+ * @return an editor input, or <code>null</code> if none
+ */
+ public IEditorInput getEditorInput(Object element);
+
+ /**
+ * Returns the id of the editor to use to display the
+ * given editor input and object, or <code>null</code> if
+ * unable to provide an editor id.
+ *
+ * @param input an editor input that was previously retrieved from this
+ * source presentation's <code>getEditorInput</code> method
+ * @param element the object that was used in the call to
+ * <code>getEditorInput</code>, that corresponds to the given editor
+ * input
+ * @return an editor id, or <code>null</code> if none
+ */
+ public String getEditorId(IEditorInput input, Object element);
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
index f76f4da1d..e12cc7b9a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
@@ -1,26 +1,26 @@
-package org.eclipse.debug.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.model.IValue;
-
-/**
- * Notified of detailed value descriptions.
- *
- * @see IDebugModelPresentation
- * @since 2.0
- */
-
-public interface IValueDetailListener {
- /**
- * Notifies this listener that the details for the given
- * value have been computed as the specified result.
- *
- * @param value the value for which the detail is provided
- * @param result the detailed description of the given value
- */
- public void detailComputed(IValue value, String result);
+package org.eclipse.debug.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.model.IValue;
+
+/**
+ * Notified of detailed value descriptions.
+ *
+ * @see IDebugModelPresentation
+ * @since 2.0
+ */
+
+public interface IValueDetailListener {
+ /**
+ * Notifies this listener that the details for the given
+ * value have been computed as the specified result.
+ *
+ * @param value the value for which the detail is provided
+ * @param result the detailed description of the given value
+ */
+ public void detailComputed(IValue value, String result);
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
index b40c1391a..dd8a9c355 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
@@ -1,34 +1,34 @@
-package org.eclipse.debug.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-
-/**
- * Action to launch the last launch configuration that was succuessfully
- * launched, in debug mode. If no configurations have been launched,
- * the launch configuration dialog is opened.
- * <p>
- * This class is not intended to be subclassed. This class may
- * be instantiated.
- * </p>
- * @since 2.0
- */
-public final class DebugAction extends ExecutionAction /*implements IViewActionDelegate*/ {
-
- public DebugAction() {
- //only used as a delegate
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-
+package org.eclipse.debug.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.actions.ExecutionAction;
+
+/**
+ * Action to launch the last launch configuration that was succuessfully
+ * launched, in debug mode. If no configurations have been launched,
+ * the launch configuration dialog is opened.
+ * <p>
+ * This class is not intended to be subclassed. This class may
+ * be instantiated.
+ * </p>
+ * @since 2.0
+ */
+public final class DebugAction extends ExecutionAction /*implements IViewActionDelegate*/ {
+
+ public DebugAction() {
+ //only used as a delegate
+ }
+
+ /**
+ * @see ExecutionAction#getMode()
+ */
+ protected String getMode() {
+ return ILaunchManager.DEBUG_MODE;
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
index 7a510ea62..eba4ee148 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
@@ -1,35 +1,35 @@
-package org.eclipse.debug.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-
-/**
- * Action to launch the last launch configuration that was succuessfully
- * launched, in run mode. If no configurations have been launched,
- * the launch configuration dialog is opened.
- * </p>
- * <p>
- * This class is not intended to be subclassed. This class may
- * be instantiated.
- * </p>
- * @since 2.0
- */
-public final class RunAction extends ExecutionAction /*implements IViewActionDelegate*/ {
-
- public RunAction() {
- //only used as a delegate
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.RUN_MODE;
- }
-
+package org.eclipse.debug.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.actions.ExecutionAction;
+
+/**
+ * Action to launch the last launch configuration that was succuessfully
+ * launched, in run mode. If no configurations have been launched,
+ * the launch configuration dialog is opened.
+ * </p>
+ * <p>
+ * This class is not intended to be subclassed. This class may
+ * be instantiated.
+ * </p>
+ * @since 2.0
+ */
+public final class RunAction extends ExecutionAction /*implements IViewActionDelegate*/ {
+
+ public RunAction() {
+ //only used as a delegate
+ }
+
+ /**
+ * @see ExecutionAction#getMode()
+ */
+ protected String getMode() {
+ return ILaunchManager.RUN_MODE;
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html
index 5b239004e..6950f14a2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html
@@ -1,72 +1,72 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Tools</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides a generic debugger user interface that clients may customize via standard
-workbench extension points.</p>
-
-<h2>Package Specification</h2>
-
-<p>The Eclipse platform debug UI plug-in provides a set of classes and interfaces to
-support a language independent debugger user interface. A generic debug perspective is provided with a common
-set of views. Clients contribute actions to the debug views via the
-standard workbench extension points.</p>
-
-<h4>The Debug View</h4>
-
-<p>The debug view presents a tree of launched programs in debug and non-debug (run) mode.
-The view provides support for standard interactions such as terminating, stepping, suspending, and resuming
-threads, debug targets, and processes. The debug view is linked to an editor view, variable view, and
-console. The editor view is used to display source code for stack frames. A selection in
-the debug view causes the line of code being executed to be highlighted in the editor
-view. The variable view shows the visible variables in the selected stack frame, and the
-console view handles I/O for the debuggable process.</p>
-
-<h4>The Variables View</h4>
-
-<p>The variables view presents a tree of variables for the currently selected stack frame.
-A "details" area may be hidden/shown which provides a detailed description of
-the selected variable. For example, the Java debugger displays the result of
-invoking 'toString()' on the selected variable in this area.</p>
-
-<h4>The Breakpoints View</h4>
-
-<p>The breakpoints view presents a list of all breakpoints currently defined in the
-workspace. It supports enabling/disabling and breakpoint removal.</p>
-
-<h4>The Expression View</h4>
-
-<p>The expression view presents a tree of expressions and their corresponding values.</p>
-
-<h4>Debug Model Presentation</h4>
-
-<p>The debug UI plug-in defines an extension (<b>org.eclipse.debug.ui.debugModelPresentations</b>)
-point to allow implementations of debug models to provide custom rendering and
-presentation of its debug elements. Extensions are registered for a specific debug
-model. It is intended that an implementation of a debug model will also provide an
-implementation of a debug model presentation. The presentation provides:
-
-<ul>
- <li>an image for a debug element or breakpoint</li>
- <li>a label for a debug element or breakpoint</li>
- <li>an editor input and editor id used to display a debug element, breakpoint, or source element</li>
- <li>a detailed description of a variable value, used to display
- in the "details" section of the variables view</li>
-</ul>
-
-<h4>Launch Configuration Dialog</h4>
-
-<p>The debug UI plug-in provides a lanuch configuration dialog for
-creating and editing launch configurations. Clients may contribute
-tabs to the launch configuration dialog via the launchConfigurationTabGroup
-extension point.</p>
-
-
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Eclipse Debug Tools</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+
+<p>Provides a generic debugger user interface that clients may customize via standard
+workbench extension points.</p>
+
+<h2>Package Specification</h2>
+
+<p>The Eclipse platform debug UI plug-in provides a set of classes and interfaces to
+support a language independent debugger user interface. A generic debug perspective is provided with a common
+set of views. Clients contribute actions to the debug views via the
+standard workbench extension points.</p>
+
+<h4>The Debug View</h4>
+
+<p>The debug view presents a tree of launched programs in debug and non-debug (run) mode.
+The view provides support for standard interactions such as terminating, stepping, suspending, and resuming
+threads, debug targets, and processes. The debug view is linked to an editor view, variable view, and
+console. The editor view is used to display source code for stack frames. A selection in
+the debug view causes the line of code being executed to be highlighted in the editor
+view. The variable view shows the visible variables in the selected stack frame, and the
+console view handles I/O for the debuggable process.</p>
+
+<h4>The Variables View</h4>
+
+<p>The variables view presents a tree of variables for the currently selected stack frame.
+A "details" area may be hidden/shown which provides a detailed description of
+the selected variable. For example, the Java debugger displays the result of
+invoking 'toString()' on the selected variable in this area.</p>
+
+<h4>The Breakpoints View</h4>
+
+<p>The breakpoints view presents a list of all breakpoints currently defined in the
+workspace. It supports enabling/disabling and breakpoint removal.</p>
+
+<h4>The Expression View</h4>
+
+<p>The expression view presents a tree of expressions and their corresponding values.</p>
+
+<h4>Debug Model Presentation</h4>
+
+<p>The debug UI plug-in defines an extension (<b>org.eclipse.debug.ui.debugModelPresentations</b>)
+point to allow implementations of debug models to provide custom rendering and
+presentation of its debug elements. Extensions are registered for a specific debug
+model. It is intended that an implementation of a debug model will also provide an
+implementation of a debug model presentation. The presentation provides:
+
+<ul>
+ <li>an image for a debug element or breakpoint</li>
+ <li>a label for a debug element or breakpoint</li>
+ <li>an editor input and editor id used to display a debug element, breakpoint, or source element</li>
+ <li>a detailed description of a variable value, used to display
+ in the "details" section of the variables view</li>
+</ul>
+
+<h4>Launch Configuration Dialog</h4>
+
+<p>The debug UI plug-in provides a lanuch configuration dialog for
+creating and editing launch configurations. Clients may contribute
+tabs to the launch configuration dialog via the launchConfigurationTabGroup
+extension point.</p>
+
+
+</body>
+</html>

Back to the top