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 /org.eclipse.debug.ui
parent19dde7bbedba3a357349ab300ced8148b63fc4af (diff)
downloadeclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.tar.gz
eclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.tar.xz
eclipse.platform.debug-fe6dcd2945361ddd1cf8014753bf0d04f2a8ea1c.zip
*** keyword substitution change ***
Diffstat (limited to 'org.eclipse.debug.ui')
-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
85 files changed, 13602 insertions, 13602 deletions
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