Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-10-16 14:47:27 -0400
committerDarin Wright2006-10-16 14:47:27 -0400
commit4fe8f08266ae4b63ac800d5af4c1c274fba9e8d4 (patch)
tree33bd47021ca5dd820eb613f6047370c4e280ee1e
parentadab4b6fdaa1dd4ef8cca75eb6deacb581ca9e1f (diff)
downloadeclipse.platform.debug-4fe8f08266ae4b63ac800d5af4c1c274fba9e8d4.tar.gz
eclipse.platform.debug-4fe8f08266ae4b63ac800d5af4c1c274fba9e8d4.tar.xz
eclipse.platform.debug-4fe8f08266ae4b63ac800d5af4c1c274fba9e8d4.zip
Bug 160932 API for debug context and debug commands
-rw-r--r--org.eclipse.debug.ui/.options1
-rw-r--r--org.eclipse.debug.ui/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.debug.ui/plugin.xml38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/StepFilterManager.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionAdapterFactory.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAction.java133
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectActionDelegate.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAdapter.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAction.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAdapter.java81
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeAction.java172
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StandardActionAdapter.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAction.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAdapter.java197
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepFiltersAdapter.java145
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoAction.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverAction.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendAction.java89
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendResumeAdapter.java142
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAdapter.java138
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAllAction.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRelaunchAction.java141
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveActionDelegate.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersAction.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersActionDelegate.java94
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDisconnectAdapter.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDropToFrameAdapter.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepAdapter.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepFiltersAdapter.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousSuspendResumeAdapter.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousTerminateAdapter.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DebugCommand.java147
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DisconnectCommand.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DropToFrameCommand.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/ResumeCommand.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepCommand.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepFiltersCommand.java81
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepIntoCommand.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepOverCommand.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepReturnCommand.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/SuspendCommand.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/TerminateCommand.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractRequestMonitor.java)4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionAdapterFactory.java131
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionRequestMonitor.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionRequestMonitor.java)4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/BooleanRequestMonitor.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanRequestMonitor.java)8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/CommandMonitor.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanOrWiseRequestMonitor.java)32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextAction.java)203
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java)26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java205
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ProxyBooleanRequestMonitor.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateActionDelegate.java)13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendActionDelegate.java)14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnActionDelegate.java)14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnAction.java)47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeActionDelegate.java)17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java111
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveAction.java)56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAction.java)48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoActionDelegate.java)14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IBooleanRequestMonitor.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IBooleanRequestMonitor.java)4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDebugCommand.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDisconnectCommand.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverActionDelegate.java)18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDropToFrameCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IResumeCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepFiltersCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepIntoCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepOverCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepReturnCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ISuspendCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ITerminateCommand.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java81
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/AbstractDebugContextProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/DebugContextEvent.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextEventListener.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameActionDelegate.java)26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextManager.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextService.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java)44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java205
94 files changed, 2539 insertions, 3085 deletions
diff --git a/org.eclipse.debug.ui/.options b/org.eclipse.debug.ui/.options
index d5fdd2ddb..5c01ca7a5 100644
--- a/org.eclipse.debug.ui/.options
+++ b/org.eclipse.debug.ui/.options
@@ -2,3 +2,4 @@ org.eclipse.debug.ui/debug = false
org.eclipse.debug.ui/debug/viewers/model = false
org.eclipse.debug.ui/debug/viewers/viewer = false
org.eclipse.debug.ui/debug/viewers/deltas = false
+org.eclipse.debug.ui/debug/commands = false
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index 31d230098..945e8d682 100644
--- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -10,10 +10,11 @@ Export-Package: org.eclipse.debug.internal.ui;x-internal:=true,
org.eclipse.debug.internal.ui.actions;x-internal:=true,
org.eclipse.debug.internal.ui.actions.breakpointGroups;x-internal:=true,
org.eclipse.debug.internal.ui.actions.breakpoints;x-internal:=true,
- org.eclipse.debug.internal.ui.actions.context;x-internal:=true,
org.eclipse.debug.internal.ui.actions.expressions;x-internal:=true,
- org.eclipse.debug.internal.ui.actions.provisional;x-internal:=true,
org.eclipse.debug.internal.ui.actions.variables;x-internal:=true,
+ org.eclipse.debug.internal.ui.commands;x-internal:=true,
+ org.eclipse.debug.internal.ui.commands.actions;x-internal:=true,
+ org.eclipse.debug.internal.ui.commands.provisional;x-internal:=true,
org.eclipse.debug.internal.ui.contexts;x-internal:=true,
org.eclipse.debug.internal.ui.contexts.provisional;x-internal:=true,
org.eclipse.debug.internal.ui.elements.adapters;x-internal:=true,
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 5ed0073a6..b1488d345 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -174,7 +174,7 @@
<action
id="org.eclipse.debug.ui.actions.ToggleStepFilters"
hoverIcon="$nl$/icons/full/elcl16/stepbystep_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.ToggleStepFiltersActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.ToggleStepFiltersCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.ToggleStepFilters"
disabledIcon="$nl$/icons/full/dlcl16/stepbystep_co.gif"
icon="$nl$/icons/full/elcl16/stepbystep_co.gif"
@@ -197,7 +197,7 @@
<action
id="org.eclipse.debug.ui.actions.StepReturn"
hoverIcon="$nl$/icons/full/elcl16/stepreturn_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.StepReturnActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.StepReturn"
disabledIcon="$nl$/icons/full/dlcl16/stepreturn_co.gif"
icon="$nl$/icons/full/elcl16/stepreturn_co.gif"
@@ -208,7 +208,7 @@
<action
id="org.eclipse.debug.ui.actions.StepOver"
hoverIcon="$nl$/icons/full/elcl16/stepover_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.StepOverActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.StepOverCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.StepOver"
disabledIcon="$nl$/icons/full/dlcl16/stepover_co.gif"
icon="$nl$/icons/full/elcl16/stepover_co.gif"
@@ -219,7 +219,7 @@
<action
id="org.eclipse.debug.ui.actions.StepInto"
hoverIcon="$nl$/icons/full/elcl16/stepinto_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.StepIntoActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.StepIntoCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.StepInto"
disabledIcon="$nl$/icons/full/dlcl16/stepinto_co.gif"
icon="$nl$/icons/full/elcl16/stepinto_co.gif"
@@ -230,7 +230,7 @@
<action
id="org.eclipse.debug.ui.actions.Terminate"
hoverIcon="$nl$/icons/full/elcl16/terminate_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.TerminateActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.TerminateCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.Terminate"
disabledIcon="$nl$/icons/full/dlcl16/terminate_co.gif"
icon="$nl$/icons/full/elcl16/terminate_co.gif"
@@ -241,7 +241,7 @@
<action
id="org.eclipse.debug.ui.actions.Suspend"
hoverIcon="$nl$/icons/full/elcl16/suspend_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.SuspendActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.SuspendCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.Suspend"
disabledIcon="$nl$/icons/full/dlcl16/suspend_co.gif"
icon="$nl$/icons/full/elcl16/suspend_co.gif"
@@ -252,7 +252,7 @@
<action
id="org.eclipse.debug.ui.actions.Resume"
hoverIcon="$nl$/icons/full/elcl16/resume_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.ResumeActionDelegate"
+ class="org.eclipse.debug.internal.ui.commands.actions.ResumeCommandActionDelegate"
definitionId="org.eclipse.debug.ui.commands.Resume"
disabledIcon="$nl$/icons/full/dlcl16/resume_co.gif"
icon="$nl$/icons/full/elcl16/resume_co.gif"
@@ -553,19 +553,6 @@
label="%RemoveAllTerminatedAction.label"
tooltip="%RemoveAllTerminatedAction.tooltip">
</action>
- <action
- id="org.eclipse.debug.ui.debugview.toolbar.toggleStepFilters"
- toolbarPath="renderGroup"
- hoverIcon="$nl$/icons/full/elcl16/stepbystep_co.gif"
- class="org.eclipse.debug.internal.ui.actions.context.ToggleStepFiltersActionDelegate"
- disabledIcon="$nl$/icons/full/dlcl16/stepbystep_co.gif"
- icon="$nl$/icons/full/elcl16/stepbystep_co.gif"
- label="%StepWithFiltersAction.label"
- helpContextId="step_with_filters_action_context"
- tooltip="%StepWithFiltersAction.tooltip"
- style="toggle"
- state="false">
- </action>
</viewContribution>
<!-- Contributions to Breakpoints View Toolbar -->
@@ -985,17 +972,6 @@
menubarPath="launchGroup"
id="org.eclipse.debug.ui.debugview.popupMenu.removeAllTerminated">
</action>
- <action
- label="%StepWithFiltersAction.label"
- icon="$nl$/icons/full/elcl16/stepbystep_co.gif"
- helpContextId="step_with_filters_action_context"
- definitionId="org.eclipse.debug.ui.commands.ToggleStepFilters"
- class="org.eclipse.debug.internal.ui.actions.context.ToggleStepFiltersActionDelegate"
- menubarPath="renderGroup"
- id="org.eclipse.debug.ui.debugview.popupMenu.stepWithFilters"
- style="toggle"
- state="false">
- </action>
</viewerContribution>
<!-- Contributions to Breakpoints View Popup Menu -->
<viewerContribution
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 0d72bf67a..1e574c4c7 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
@@ -69,7 +69,7 @@ import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.debug.core.model.ITerminate;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.actions.context.ActionAdapterFactory;
+import org.eclipse.debug.internal.ui.commands.actions.ActionAdapterFactory;
import org.eclipse.debug.internal.ui.contexts.SuspendTriggerAdapterFactory;
import org.eclipse.debug.internal.ui.launchConfigurations.ClosedProjectFilter;
import org.eclipse.debug.internal.ui.launchConfigurations.DeletedProjectFilter;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/StepFilterManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/StepFilterManager.java
index e8b8a0b03..b599e1ad4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/StepFilterManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/StepFilterManager.java
@@ -13,8 +13,8 @@ package org.eclipse.debug.internal.ui;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.internal.ui.actions.context.ActionRequestMonitor;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter;
+import org.eclipse.debug.internal.ui.commands.actions.ActionRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepFiltersCommand;
/**
* As targets are launched, this manager sets its step filter
@@ -49,11 +49,9 @@ public class StepFilterManager implements ILaunchListener {
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
public void launchChanged(ILaunch launch) {
- boolean useStepFilters = isUseStepFilters();
- IAsynchronousStepFiltersAdapter stepFilterAdapter = (IAsynchronousStepFiltersAdapter)launch.getAdapter(IAsynchronousStepFiltersAdapter.class);
- if (stepFilterAdapter != null)
- {
- stepFilterAdapter.setStepFiltersEnabled(launch, useStepFilters, new ActionRequestMonitor());
+ IStepFiltersCommand command = (IStepFiltersCommand)launch.getAdapter(IStepFiltersCommand.class);
+ if (command != null) {
+ command.execute(launch, new ActionRequestMonitor());
}
}
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 a48bc3d6f..03d8aa257 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
@@ -112,6 +112,8 @@ public class ActionMessages extends NLS {
public static String ToggleBreakpointAction_1;
public static String ToggleBreakpointAction_2;
+ public static String ToggleStepFiltersAction_0;
+
public static String WatchExpressionDialog_0;
public static String WatchExpressionDialog_1;
public static String WatchExpressionDialog_2;
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 bd894fac3..15ae76a7a 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
@@ -123,6 +123,8 @@ ToggleBreakpointAction_0=Toggle Brea&kpoint
ToggleBreakpointAction_1=Error
ToggleBreakpointAction_2=Unable to toggle breakpoint
+ToggleStepFiltersAction_0=Toggle Step Filters
+
WatchExpressionDialog_0=Edit Watch Expression
WatchExpressionDialog_1=Add Watch Expression
WatchExpressionDialog_2=E&xpression:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionAdapterFactory.java
deleted file mode 100644
index 46a35494e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionAdapterFactory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDisconnect;
-import org.eclipse.debug.core.model.IDropToFrame;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStep;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDropToFrameAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousSuspendResumeAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-
-/**
- * Adapter factory for debug capabilities.
- *
- * @since 3.2
- *
- */
-public class ActionAdapterFactory implements IAdapterFactory {
-
- private static IAsynchronousDisconnectAdapter fgDisconnectAdapter = new DisconnectAdapter();
- private static IAsynchronousDropToFrameAdapter fgDropToFrameAdapter = new DropToFrameAdapter();
- private static IAsynchronousStepAdapter fgStepAdapter = new StepAdapter();
- private static IAsynchronousStepFiltersAdapter fgStepFiltersAdapter = new StepFiltersAdapter();
- private static IAsynchronousSuspendResumeAdapter fgSuspendResumeAdapter = new SuspendResumeAdapter();
- private static IAsynchronousTerminateAdapter fgTerminateAdapter = new TerminateAdapter();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (IAsynchronousDisconnectAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof IDisconnect) {
- return fgDisconnectAdapter;
- }
- }
- if (IAsynchronousDropToFrameAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof IDropToFrame) {
- return fgDropToFrameAdapter;
- }
- }
- if (IAsynchronousStepAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof IStep) {
- return fgStepAdapter;
- }
- }
- if (IAsynchronousStepFiltersAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof IDebugElement ||
- adaptableObject instanceof ILaunch ||
- adaptableObject instanceof IProcess) {
- return fgStepFiltersAdapter;
- }
- }
- if (IAsynchronousSuspendResumeAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof ISuspendResume) {
- return fgSuspendResumeAdapter;
- }
- }
- if (IAsynchronousTerminateAdapter.class.equals(adapterType)) {
- if (adaptableObject instanceof ITerminate) {
- return fgTerminateAdapter;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[]{IAsynchronousDisconnectAdapter.class,
- IAsynchronousDropToFrameAdapter.class,
- IAsynchronousStepAdapter.class,
- IAsynchronousStepFiltersAdapter.class,
- IAsynchronousSuspendResumeAdapter.class,
- IAsynchronousTerminateAdapter.class};
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAction.java
deleted file mode 100644
index 29b7174d0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAction.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class DisconnectAction extends AbstractDebugContextAction {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousDisconnectAdapter disconnect = (IAsynchronousDisconnectAdapter) adaptable.getAdapter(IAsynchronousDisconnectAdapter.class);
- if (disconnect != null)
- disconnect.disconnect(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousDisconnectAdapter disconnect = (IAsynchronousDisconnectAdapter) adaptable.getAdapter(IAsynchronousDisconnectAdapter.class);
- if (disconnect != null) {
- disconnect.canDisconnect(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.DisconnectActionDelegate_Exceptions_occurred_attempting_to_disconnect__2;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.DisconnectActionDelegate_Disconnect_failed_1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.DisconnectAction_0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "disconnect_action_context"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.disconnect"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.DisconnectAction_3;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DISCONNECT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectActionDelegate.java
deleted file mode 100644
index 088d9ddde..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectActionDelegate.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-public class DisconnectActionDelegate extends AbstractDebugContextActionDelegate {
- public DisconnectActionDelegate() {
- super();
- setAction(new DisconnectAction());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAdapter.java
deleted file mode 100644
index 5ea371e3b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DisconnectAdapter.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDisconnect;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default disconnect adapter for standard debug model.
- *
- * @since 3.2
- */
-public class DisconnectAdapter extends StandardActionAdapter implements IAsynchronousDisconnectAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter#canDisconnect(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void canDisconnect(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("canDisconnect") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IDisconnect disconnect = getTarget(element);
- if (disconnect != null)
- requestMonitor.setResult(disconnect.canDisconnect());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter#isDisconnected(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void isDisconnected(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("isDisconnected") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IDisconnect disconnect = getTarget(element);
- if (disconnect != null) {
- requestMonitor.setResult(disconnect.isDisconnected());
- } else {
- requestMonitor.setResult(false);
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDisconnectAdapter#disconnect(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void disconnect(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("isDisconnected") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IDisconnect disconnect = getTarget(element);
-
- if (disconnect == null) {
- requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to IDisconnect", //$NON-NLS-1$
- null));
- } else {
- try {
- disconnect.disconnect();
- } catch (DebugException e) {
- requestMonitor.setStatus(e.getStatus());
- }
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private IDisconnect getTarget(Object element) {
- if (element instanceof IDisconnect) {
- return (IDisconnect) element;
- } else if (element instanceof IAdaptable) {
- return (IDisconnect) ((IAdaptable) element).getAdapter(IDisconnect.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAction.java
deleted file mode 100644
index 62ec99a20..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAction.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDropToFrameAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Action delegate which performs a drop to frame.
- */
-public class DropToFrameAction extends AbstractDebugContextAction {
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousDropToFrameAdapter dropper = (IAsynchronousDropToFrameAdapter) adaptable.getAdapter(IAsynchronousDropToFrameAdapter.class);
- if (dropper != null)
- dropper.dropToFrame(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousDropToFrameAdapter dropper = (IAsynchronousDropToFrameAdapter) adaptable.getAdapter(IAsynchronousDropToFrameAdapter.class);
- if (dropper != null) {
- dropper.canDropToFrame(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.DropToFrameAction_0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "drop_to_frame_action_context"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.dropToFrame"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.DropToFrameAction_3;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAdapter.java
deleted file mode 100644
index 69fdded8f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameAdapter.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDropToFrame;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDropToFrameAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class DropToFrameAdapter extends StandardActionAdapter implements IAsynchronousDropToFrameAdapter {
-
- public void canDropToFrame(final Object element, final IBooleanRequestMonitor monitor) {
- Job job = new Job("canDropToFrame") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- IDropToFrame dropToFrame = getTarget(element);
- if (dropToFrame != null) {
- monitor.setResult(dropToFrame.canDropToFrame());
- } else {
- monitor.setResult(false);
- }
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- public void dropToFrame(final Object element, final IAsynchronousRequestMonitor monitor) {
- Job job = new Job("dropToFrame") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- IDropToFrame dropToFrame = getTarget(element);
- if (dropToFrame != null) {
- try {
- dropToFrame.dropToFrame();
- } catch (DebugException e) {
- monitor.setStatus(e.getStatus());
- }
- } else {
- monitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to IDropToFrame", //$NON-NLS-1$
- null));
- }
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private IDropToFrame getTarget(Object element) {
- if (element instanceof IDropToFrame) {
- return (IDropToFrame) element;
- } else if (element instanceof IAdaptable) {
- return (IDropToFrame) ((IAdaptable) element).getAdapter(IDropToFrame.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeAction.java
deleted file mode 100644
index 9477b72c1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeAction.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousSuspendResumeAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class ResumeAction extends AbstractDebugContextAction {
-
- public ResumeAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.Resume"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousSuspendResumeAdapter suspendResumer = (IAsynchronousSuspendResumeAdapter) adaptable.getAdapter(IAsynchronousSuspendResumeAdapter.class);
- if (suspendResumer != null)
- suspendResumer.resume(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousSuspendResumeAdapter suspendResumer = (IAsynchronousSuspendResumeAdapter) adaptable.getAdapter(IAsynchronousSuspendResumeAdapter.class);
- if (suspendResumer != null) {
- suspendResumer.canResume(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
-
- /**
- * Resumes all threads in the target associated with the given element
- *
- * @param object
- * debug element
- * @throws DebugException
- * on failure
- */
- protected void doActionForAllThreads(Object object) throws DebugException {
- if (isEnabledForAllThreads(object)) {
- IDebugElement debugElement = (IDebugElement) object;
- IThread[] threads = debugElement.getDebugTarget().getThreads();
- for (int i = 0; i < threads.length; i++) {
- IThread thread = threads[i];
- if (thread.canResume()) {
- thread.resume();
- }
- }
- }
- }
-
- /**
- * Returns whether 'resume all threads' should be enabled for the given
- * element.
- */
- protected boolean isEnabledForAllThreads(Object element) {
- if (element instanceof IDebugElement) {
- IDebugElement debugElement = (IDebugElement) element;
- try {
- IThread[] threads = debugElement.getDebugTarget().getThreads();
- for (int i = 0; i < threads.length; i++) {
- if (threads[i].canResume()) {
- return true;
- }
- }
- } catch (DebugException e) {
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.ResumeActionDelegate_Exceptions_occurred_attempting_to_resume__2;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.ResumeActionDelegate_Resume_failed__1;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.ResumeAction_0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "resume_action_context"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.resume"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.ResumeAction_3;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESUME);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StandardActionAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StandardActionAdapter.java
deleted file mode 100644
index 19dc6d5f7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StandardActionAdapter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
-
-/**
- * Common function for standard debug action adapter implemetnations.
- *
- * @since 3.2
- *
- */
-public class StandardActionAdapter {
-
- /**
- * Scheduling rule for updating action enablement.
- *
- * @return scheduling rule or <code>null</code>
- */
- protected ISchedulingRule createUpdateSchedulingRule() {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialRule();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAction.java
deleted file mode 100644
index fe8d52f88..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - bug 134177
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-
-public abstract class StepAction extends AbstractDebugContextAction {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object object) {
- stepAction(object);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- checkCapability(element, monitor);
- }
-
-
- protected abstract void checkCapability(Object element, IBooleanRequestMonitor monitor);
- /**
- * Performs the specific step action.
- *
- * @exception DebugException if the action fails
- */
- protected abstract void stepAction(Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAdapter.java
deleted file mode 100644
index 2c049c2b7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepAdapter.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStep;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default step adapter for standard debug model.
- *
- * @since 3.2
- */
-public class StepAdapter extends StandardActionAdapter implements IAsynchronousStepAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#canStepInto(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void canStepInto(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("canStepInto") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null)
- requestMonitor.setResult(step.canStepInto());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#canStepOver(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void canStepOver(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("canStepOver") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null)
- requestMonitor.setResult(step.canStepOver());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#canStepReturn(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void canStepReturn(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("canStepReturn") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null)
- requestMonitor.setResult(step.canStepReturn());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#isStepping(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void isStepping(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("isStepping") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null)
- requestMonitor.setResult(step.isStepping());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#stepInto(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void stepInto(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("stepInto") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null) {
- try {
- step.stepInto();
- } catch (DebugException e) {
- requestMonitor.setStatus(e.getStatus());
- }
- } else {
- requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to IStep", //$NON-NLS-1$
- null));
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#stepOver(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void stepOver(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("stepOver") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null) {
- try {
- step.stepOver();
- } catch (DebugException e) {
- requestMonitor.setStatus(e.getStatus());
- }
- } else {
- requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to IStep", //$NON-NLS-1$
- null));
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter#stepReturn(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void stepReturn(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("stepReturn") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IStep step = getTarget(element);
- if (step != null) {
- try {
- step.stepReturn();
- } catch (DebugException e) {
- requestMonitor.setStatus(e.getStatus());
- }
- } else {
- requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to IStep", //$NON-NLS-1$
- null));
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
-
- }
-
- private IStep getTarget(Object element) {
- if (element instanceof IStep) {
- return (IStep) element;
- } else if (element instanceof IAdaptable) {
- return (IStep) ((IAdaptable) element).getAdapter(IStep.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepFiltersAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepFiltersAdapter.java
deleted file mode 100644
index 9012ab04d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepFiltersAdapter.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-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.core.model.IStepFilters;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Default step filters adapter for standard debug model.
- *
- * @since 3.2
- */
-public class StepFiltersAdapter extends StandardActionAdapter implements IAsynchronousStepFiltersAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter#supportsStepFilters(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void supportsStepFilters(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("supportsStepFilters") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- boolean supported = false;
- IDebugTarget[] debugTargets = getDebugTargets(element);
- for (int i=0; i<debugTargets.length; i++)
- {
- IStepFilters filters = getTarget(debugTargets[i]);
-
- if (filters != null)
- {
- if (filters.supportsStepFilters())
- supported = true;
- }
-
- // only one needs to support it
- if (supported)
- break;
-
- }
-
- requestMonitor.setResult(supported);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter#isStepFiltersEnabled(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void isStepFiltersEnabled(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("isStepFiltersEnabled") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- IDebugTarget[] debugTargets = getDebugTargets(element);
-
- for (int i=0; i<debugTargets.length; i++)
- {
- IStepFilters filters = getTarget(element);
-
- if (filters != null)
- requestMonitor.setResult(filters.isStepFiltersEnabled());
- else
- {
- requestMonitor.setResult(false);
- }
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter#setStepFiltersEnabled(java.lang.Object, boolean, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void setStepFiltersEnabled(final Object element, final boolean enabled, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("setStepFiltersEnabled") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
-
- IDebugTarget[] debugTargets = getDebugTargets(element);
- for (int i=0; i<debugTargets.length; i++)
- {
- IStepFilters filters = getTarget(debugTargets[i]);
-
- if (filters != null && filters.isStepFiltersEnabled() != enabled)
- filters.setStepFiltersEnabled(enabled);
-
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private IStepFilters getTarget(Object element)
- {
- if (element instanceof IStepFilters) {
- return (IStepFilters) element;
- } else if (element instanceof IAdaptable) {
- return (IStepFilters) ((IAdaptable)element).getAdapter(IStepFilters.class);
- }
- return null;
- }
-
- private IDebugTarget[] getDebugTargets(Object element) {
- if (element instanceof IDebugElement) {
- IDebugElement debugElement = (IDebugElement) element;
- return new IDebugTarget[] {debugElement.getDebugTarget()};
- } else if (element instanceof ILaunch) {
- ILaunch launch = (ILaunch) element;
- return launch.getDebugTargets();
- } else if (element instanceof IProcess) {
- IProcess process = (IProcess) element;
- return process.getLaunch().getDebugTargets();
- } else {
- return new IDebugTarget[0];
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoAction.java
deleted file mode 100644
index d34a62482..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoAction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - bug 134177
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class StepIntoAction extends StepAction {
-
- public StepIntoAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.StepInto"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepAction#checkCapability(org.eclipse.debug.core.model.IStep, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void checkCapability(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null) {
- steppy.canStepInto(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepAction#stepAction(org.eclipse.debug.core.model.IStep)
- */
- protected void stepAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null)
- steppy.stepInto(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.StepIntoActionDelegate_Exceptions_occurred_attempting_to_step_into_the_frame_2;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.StepIntoActionDelegate_Step_into_failed_1;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.StepIntoAction_0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "step_into_action_context"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.stepInto"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.StepIntoAction_3;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverAction.java
deleted file mode 100644
index 8085a5958..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverAction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - bug 134177
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class StepOverAction extends StepIntoAction {
-
- public StepOverAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.StepOver"); //$NON-NLS-1$
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getText()
- */
- public String getText() {
- return ActionMessages.StepOverAction_0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "step_over_action_context"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.stepOver"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.StepOverAction_3;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#checkCapability(org.eclipse.debug.core.model.IStep, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void checkCapability(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null) {
- steppy.canStepOver(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#stepAction(org.eclipse.debug.core.model.IStep)
- */
- protected void stepAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null)
- steppy.stepOver(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.StepOverActionDelegate_Exceptions_occurred_attempting_to_step_over_the_frame_2;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.StepOverActionDelegate_Step_over_failed_1;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendAction.java
deleted file mode 100644
index cf21c6db0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendAction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousSuspendResumeAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class SuspendAction extends AbstractDebugContextAction {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousSuspendResumeAdapter suspendResumer = (IAsynchronousSuspendResumeAdapter) adaptable.getAdapter(IAsynchronousSuspendResumeAdapter.class);
- if (suspendResumer != null)
- suspendResumer.suspend(element, new ActionRequestMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousSuspendResumeAdapter suspendResumer = (IAsynchronousSuspendResumeAdapter) adaptable.getAdapter(IAsynchronousSuspendResumeAdapter.class);
- if (suspendResumer != null) {
- suspendResumer.canSuspend(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
-
- }
-
-
- protected String getStatusMessage() {
- return ActionMessages.SuspendActionDelegate_Exceptions_occurred_attempting_to_suspend__2;
- }
-
- protected String getErrorDialogMessage() {
- return ActionMessages.SuspendActionDelegate_Suspend_failed_1;
- }
-
- public String getText() {
- return ActionMessages.SuspendAction_0;
- }
-
- public String getHelpContextId() {
- return "suspend_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.suspend"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.SuspendAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SUSPEND);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendResumeAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendResumeAdapter.java
deleted file mode 100644
index 97a124493..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendResumeAdapter.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousSuspendResumeAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class SuspendResumeAdapter extends StandardActionAdapter implements IAsynchronousSuspendResumeAdapter {
-
- public void canResume(final Object element, final IBooleanRequestMonitor monitor) {
- Job job = new Job("canResume") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- ISuspendResume suspendResume = getTarget(element);
- if (suspendResume != null)
- monitor.setResult(suspendResume.canResume());
- else
- monitor.setResult(false);
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- public void canSuspend(final Object element, final IBooleanRequestMonitor monitor) {
- Job job = new Job("canSuspend") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- ISuspendResume suspendResume = getTarget(element);
- if (suspendResume != null)
- monitor.setResult(suspendResume.canSuspend());
- else
- monitor.setResult(false);
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- public void isSuspended(final Object element, final IBooleanRequestMonitor monitor) {
- Job job = new Job("isSuspended") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- ISuspendResume suspendResume = getTarget(element);
- if (suspendResume != null)
- monitor.setResult(suspendResume.isSuspended());
- else
- monitor.setResult(false);
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- public void resume(final Object element, final IAsynchronousRequestMonitor monitor) {
- Job job = new Job("resume") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- ISuspendResume suspendResume = getTarget(element);
- if (suspendResume != null) {
- try {
- suspendResume.resume();
- } catch (DebugException e) {
- monitor.setStatus(e.getStatus());
- }
- } else {
- monitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to ISuspendResume", //$NON-NLS-1$
- null));
- }
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- public void suspend(final Object element, final IAsynchronousRequestMonitor monitor) {
- Job job = new Job("suspend") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- ISuspendResume suspendResume = getTarget(element);
- if (suspendResume != null) {
- try {
- suspendResume.suspend();
- } catch (DebugException e) {
- monitor.setStatus(e.getStatus());
- }
- } else {
- monitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to ISuspendResume", //$NON-NLS-1$
- null));
- }
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private ISuspendResume getTarget(Object element) {
- if (element instanceof ISuspendResume) {
- return (ISuspendResume) element;
- } else if (element instanceof IAdaptable) {
- return (ISuspendResume) ((IAdaptable) element).getAdapter(ISuspendResume.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAdapter.java
deleted file mode 100644
index cae76e711..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAdapter.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-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.core.runtime.jobs.Job;
-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.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default terminate adapter for standard debug model.
- *
- * @since 3.2
- */
-public class TerminateAdapter extends StandardActionAdapter implements IAsynchronousTerminateAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter#canTerminate(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void canTerminate(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("canTerminate") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- ITerminate terminate = getTarget(element);
- if (terminate != null)
- requestMonitor.setResult(terminate.canTerminate());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter#isTerminated(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- public void isTerminated(final Object element, final IBooleanRequestMonitor requestMonitor) {
- Job job = new Job("isTerminated") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- ITerminate terminate = getTarget(element);
- if (terminate != null)
- requestMonitor.setResult(terminate.isTerminated());
- else
- requestMonitor.setResult(false);
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(createUpdateSchedulingRule());
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter#terminate(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void terminate(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
- Job job = new Job("terminate") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- ITerminate terminate = getTarget(element);
- if (terminate != null) {
- try {
- if (element instanceof IProcess) {
- killTargets((IProcess) element);
- }
- ((ITerminate) element).terminate();
- } catch (DebugException e) {
- requestMonitor.setStatus(e.getStatus());
- }
- } else {
- requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element must be an instance of or adapt to ITerminate", //$NON-NLS-1$
- null));
- }
- requestMonitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private void killTargets(IProcess process) throws DebugException {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches = launchManager.getLaunches();
-
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- IProcess[] processes = launch.getProcesses();
- for (int j = 0; j < processes.length; j++) {
- IProcess process2 = processes[j];
- if (process2.equals(process)) {
- IDebugTarget[] debugTargets = launch.getDebugTargets();
- for (int k = 0; k < debugTargets.length; k++) {
- IDebugTarget target = debugTargets[k];
- if (target.canTerminate()) {
- target.terminate();
- }
- }
- return; // all possible targets have been terminated for the
- // launch.
- }
- }
- }
- }
-
- private ITerminate getTarget(Object element) {
- if (element instanceof ITerminate) {
- return (ITerminate) element;
- } else if (element instanceof IAdaptable) {
- return (ITerminate) ((IAdaptable) element).getAdapter(ITerminate.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAllAction.java
deleted file mode 100644
index cb590cc35..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAllAction.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * Terminates all launches.
- */
-public class TerminateAllAction extends AbstractDebugContextAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(final Object element) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable) element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null)
- adapter.terminate(element, new ActionRequestMonitor());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable) element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null) {
- adapter.canTerminate(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#updateEnableStateForContext(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected void updateEnableStateForContext(IStructuredSelection selection) {
- BooleanOrWiseRequestMonitor monitor = new BooleanOrWiseRequestMonitor(this);
- if(selection.size() > 0) {
- Iterator itr = selection.iterator();
- while (itr.hasNext()) {
- Object element = itr.next();
- isEnabledFor(element, monitor);
- }
- } else {
- notSupported(monitor);
- }
- }
-
- /**
- * Update the action enablement based on the launches present in the launch
- * manager.
- */
- protected void update(ISelection selection) {
- super.update(getContext());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getContext()
- */
- protected IStructuredSelection getContext() {
- return new StructuredSelection(DebugPlugin.getDefault()
- .getLaunchManager().getLaunches());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "terminate_all_action_context"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.TerminateAllAction_2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.TerminateAllAction_3;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_ALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRelaunchAction.java
deleted file mode 100644
index 2bae2f2c0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRelaunchAction.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.RelaunchActionDelegate;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Action which terminates a launch and then re-launches it.
- */
-public class TerminateAndRelaunchAction extends AbstractDebugContextAction {
-
- class RequestMonitor extends ActionRequestMonitor {
-
- private ILaunch fLaunch;
-
- public RequestMonitor(ILaunch launch) {
- fLaunch = launch;
- }
-
- public void done() {
- super.done();
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- // Must be run in the UI thread since the launch can require
- // prompting to proceed
- RelaunchActionDelegate.relaunch(fLaunch.getLaunchConfiguration(), fLaunch.getLaunchMode());
- }
- });
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#doAction(java.lang.Object)
- */
- protected void doAction(Object element) {
- ILaunch launch = RelaunchActionDelegate.getLaunch(element);
- if (launch == null || !(element instanceof ITerminate)) {
- // Shouldn't happen because of enablement check.
- return;
- }
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null)
- adapter.terminate(element, new RequestMonitor(launch));
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#isEnabledFor(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
- */
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null) {
- ILaunch launch = RelaunchActionDelegate.getLaunch(element);
- if(launch != null && LaunchConfigurationManager.isVisible(launch.getLaunchConfiguration())) {
- adapter.canTerminate(element, monitor);
- return;
- }
- }
- }
- notSupported(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getActionDefinitionId()
- */
- public String getActionDefinitionId() {
- return ActionMessages.TerminateAndRelaunchAction_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "terminate_and_relaunch_action_context"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.debugview.popupMenu.TerminateAndRelaunch"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
- */
- public String getText() {
- return ActionMessages.TerminateAndRelaunchAction_3;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.TerminateAndRelaunchAction_4;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_RELAUNCH);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveActionDelegate.java
deleted file mode 100644
index 99509b9ac..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveActionDelegate.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions.context;
-
-public class TerminateAndRemoveActionDelegate extends AbstractDebugContextActionDelegate {
-
- public TerminateAndRemoveActionDelegate() {
- super();
- setAction(new TerminateAndRemoveAction());
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersAction.java
deleted file mode 100644
index ba9eeb3b1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersAction.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-public class ToggleStepFiltersAction extends AbstractDebugContextAction {
-
- public ToggleStepFiltersAction()
- {
- super();
- setEnabled(true);
- }
-
- protected void doAction(Object target) {
- // do nothing, the action is done by ToggleStepFiltersActionDelegate instead
- // since this action does not have access to the checked state of the window button
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TOGGLE_STEP_FILTERS);
- }
-
- public String getHelpContextId() {
- return "step_with_filters_action_context"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.actions.ToggleStepFilters"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
- }
-
- public String getText() {
- // TODO: this #getText method is not currently used, putting non-nl string
- // until properties files are opened to be updated again.
- return "Toggle Step Filters"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- // TODO: this #getToolTipText method is not currently used, putting non-nl string
- // until properties files are opened to be updated again.
- return "Toggle Step Filters"; //$NON-NLS-1$
- }
-
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable)
- {
- IAsynchronousStepFiltersAdapter stepFilters = (IAsynchronousStepFiltersAdapter)((IAdaptable)element).getAdapter(IAsynchronousStepFiltersAdapter.class);
- if (stepFilters != null)
- {
- stepFilters.supportsStepFilters(element, monitor);
- }
- else
- {
- notSupported(monitor);
- }
- }
-
- }
-
- protected void updateEnableStateForContext(IStructuredSelection selection) {
-
- int size = selection.size();
- if (size == 1)
- {
- BooleanRequestMonitor monitor = new BooleanRequestMonitor(this, size);
-
- Iterator itr = selection.iterator();
- while (itr.hasNext()) {
- Object element = itr.next();
- isEnabledFor(element, monitor);
- }
- }
- else
- {
- BooleanRequestMonitor monitor = new BooleanRequestMonitor(this, 1);
- monitor.setResult(true);
- monitor.done();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getInitialEnablement()
- */
- protected boolean getInitialEnablement() {
- return true;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersActionDelegate.java
deleted file mode 100644
index 409b450be..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ToggleStepFiltersActionDelegate.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Turns step filters on/off for a selected target.
- */
-public class ToggleStepFiltersActionDelegate extends AbstractDebugContextActionDelegate implements IPropertyChangeListener, IViewActionDelegate {
-
-
- public ToggleStepFiltersActionDelegate() {
- setAction(new ToggleStepFiltersAction());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- super.init(action);
- getWindowAction().setChecked(isUseStepFilters());
- getPreferenceStore().addPropertyChangeListener(this);
- }
-
- private boolean isUseStepFilters() {
- return DebugUIPlugin.getDefault().getStepFilterManager().isUseStepFilters();
- }
-
- private IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IInternalDebugUIConstants.PREF_USE_STEP_FILTERS)) {
- Object newValue = event.getNewValue();
- if (newValue instanceof Boolean) {
- getWindowAction().setChecked(((Boolean)(newValue)).booleanValue());
- } else if (newValue instanceof String) {
- getWindowAction().setChecked(Boolean.valueOf((String)newValue).booleanValue());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- getPreferenceStore().removePropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- //this is to ensure that when the toolbar is initialized and run() gets called for checked items we don't immediately
- //reverse our desired check state.
- if(action instanceof Action) {
- if(action.isChecked() != isUseStepFilters()) {
- DebugUITools.setUseStepFilters(!isUseStepFilters());
- }
- }
- else {
- DebugUITools.setUseStepFilters(!isUseStepFilters());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- init(view.getSite().getWorkbenchWindow());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDisconnectAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDisconnectAdapter.java
deleted file mode 100644
index bb603ca4e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDisconnectAdapter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for disconnecting.
- *
- * @since 3.2
- */
-public interface IAsynchronousDisconnectAdapter {
-
- /**
- * Asynchronously determines whether the given element can be disconnected.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canDisconnect(Object element, IBooleanRequestMonitor monitor);
-
- /**
- * Asynchronously determines whether the given element is disconnected.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void isDisconnected(Object element, IBooleanRequestMonitor monitor);
-
- /**
- * Asynchronously disconnects the given element.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void disconnect(Object element, IAsynchronousRequestMonitor monitor);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDropToFrameAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDropToFrameAdapter.java
deleted file mode 100644
index 513c18ab4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousDropToFrameAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for performing a drop to frame.
- *
- * @since 3.2
- */
-public interface IAsynchronousDropToFrameAdapter {
-
- /**
- * Asynchronously determines whether the given element can perform a drop to frame.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canDropToFrame(Object element, IBooleanRequestMonitor monitor);
-
- /**
- * Asynchronously drops to the given frame.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void dropToFrame(Object element, IAsynchronousRequestMonitor monitor);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepAdapter.java
deleted file mode 100644
index 129c1d018..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for stepping.
- *
- * @since 3.2
- */
-public interface IAsynchronousStepAdapter {
-
- /**
- * Asynchronously determines whether the given element can perform a step into.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canStepInto(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether the given element can perform a step over.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canStepOver(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether the given element can perform a step return.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canStepReturn(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether the given element is stepping.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void isStepping(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously performs a step into.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void stepInto(Object element, IAsynchronousRequestMonitor monitor);
- /**
- * Asynchronously performs a step over.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void stepOver(Object element, IAsynchronousRequestMonitor monitor);
- /**
- * Asynchronously performs a step return.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void stepReturn(Object element, IAsynchronousRequestMonitor monitor);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepFiltersAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepFiltersAdapter.java
deleted file mode 100644
index 410b5306f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousStepFiltersAdapter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for enabling and disabling step filters.
- *
- * @since 3.2
- */
-public interface IAsynchronousStepFiltersAdapter {
-
- /**
- * Asynchronously determines whether the given element supports step filters.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void supportsStepFilters(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether step filters are enabled.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void isStepFiltersEnabled(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously enables or disables step filters on the given element.
- *
- * @param element element
- * @param enabled whether step filters should be enabled
- * @param monitor request monitor
- */
- public void setStepFiltersEnabled(Object element, boolean enabled, IAsynchronousRequestMonitor monitor);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousSuspendResumeAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousSuspendResumeAdapter.java
deleted file mode 100644
index 85c83e34b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousSuspendResumeAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for suspending and resuming.
- *
- * @since 3.2
- */
-public interface IAsynchronousSuspendResumeAdapter {
-
- /**
- * Asynchronously determines whether the given element can perform a resume.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canResume(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether the given element can be suspended.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canSuspend(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously determines whether the given element is suspended.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void isSuspended(Object element, IBooleanRequestMonitor monitor);
- /**
- * Asynchronously resumes the given element.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void resume(Object element, IAsynchronousRequestMonitor monitor);
- /**
- * Asynchronously suspends the given element.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void suspend(Object element, IAsynchronousRequestMonitor monitor);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousTerminateAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousTerminateAdapter.java
deleted file mode 100644
index 2521774d7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IAsynchronousTerminateAdapter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
-
-/**
- * Adapter for terminating.
- *
- * @since 3.2
- */
-public interface IAsynchronousTerminateAdapter {
-
- /**
- * Asynchronously determines whether the given element can be terminated.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void canTerminate(Object element, IBooleanRequestMonitor monitor);
-
- /**
- * Asynchronously determines whether the given element is terminated.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void isTerminated(Object element, IBooleanRequestMonitor monitor);
-
- /**
- * Asynchronously terminates the given element.
- *
- * @param element element
- * @param monitor request monitor
- */
- public void terminate(Object element, IAsynchronousRequestMonitor monitor);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DebugCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DebugCommand.java
new file mode 100644
index 000000000..d838317d7
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DebugCommand.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+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.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.commands.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IDebugCommand;
+import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+import org.eclipse.debug.ui.IDebugUIConstants;
+
+/**
+ * Common function for standard debug commands.
+ *
+ * @since 3.3
+ *
+ */
+public abstract class DebugCommand implements IDebugCommand {
+
+ // debug flag
+ public static boolean DEBUG_COMMANDS = false;
+
+ static {
+ DEBUG_COMMANDS = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.debug.ui/debug/commands")); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.commands.provisional.IDebugCommand#performCapability(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
+ */
+ public void execute(final Object element, final IAsynchronousRequestMonitor requestMonitor) {
+ Job job = new Job("execute command") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (DEBUG_COMMANDS) {
+ System.out.println("execute: " + DebugCommand.this); //$NON-NLS-1$
+ }
+ Object target = getTarget(element);
+ if (target != null) {
+ try {
+ doExecute(target, requestMonitor);
+ } catch (CoreException e) {
+ requestMonitor.setStatus(e.getStatus());
+ if (DEBUG_COMMANDS) {
+ System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$
+ }
+ }
+ } else {
+ requestMonitor.setStatus(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "element did not adapt to capability", //$NON-NLS-1$
+ null));
+ }
+ requestMonitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.commands.provisional.IDebugCommand#checkCapability(java.lang.Object, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
+ */
+ public void canExecute(final Object element, final IBooleanRequestMonitor requestMonitor) {
+ Job job = new Job("check command") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (DEBUG_COMMANDS) {
+ System.out.print("can execute command: " + DebugCommand.this); //$NON-NLS-1$
+ }
+ Object target = getTarget(element);
+ if (target != null) {
+ try {
+ boolean executable = isExecutable(target, requestMonitor);
+ if (DEBUG_COMMANDS) {
+ System.out.println(" >> " + executable); //$NON-NLS-1$
+ }
+ requestMonitor.setResult(executable);
+ } catch (CoreException e) {
+ requestMonitor.setStatus(e.getStatus());
+ if (DEBUG_COMMANDS) {
+ System.out.println(" >> ABORTED"); //$NON-NLS-1$
+ System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$
+ }
+ }
+ } else {
+ requestMonitor.setResult(false);
+ if (DEBUG_COMMANDS) {
+ System.out.println(" >> false (no adapter)"); //$NON-NLS-1$
+ }
+ }
+ requestMonitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.setRule(createUpdateSchedulingRule(element));
+ job.schedule();
+
+ }
+
+ /**
+ * Executes the actual operation.
+ *
+ * @param target object to perform on
+ * @param monitor progress monitor
+ */
+ protected abstract void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException;
+
+ /**
+ * Returns whether this command is executable.
+ *
+ * @param target object to check command for
+ * @param monitor progress monitor
+ * @return whether this command can be executed
+ */
+ protected abstract boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException;
+
+ /**
+ * Returns the appropriate command adapter from the given object.
+ *
+ * @param element object to obtain adapter from
+ * @return adapter
+ */
+ protected abstract Object getTarget(Object element);
+
+ /**
+ * Scheduling rule for checking capability.
+ *
+ * @return scheduling rule or <code>null</code>
+ */
+ protected ISchedulingRule createUpdateSchedulingRule(Object element) {
+ return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(element);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DisconnectCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DisconnectCommand.java
new file mode 100644
index 000000000..cf01524ff
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DisconnectCommand.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.IDisconnect;
+import org.eclipse.debug.internal.ui.commands.provisional.IDisconnectCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default disconnect command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class DisconnectCommand extends DebugCommand implements IDisconnectCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((IDisconnect)target).canDisconnect();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((IDisconnect)target).disconnect();
+ }
+
+ protected Object getTarget(Object element) {
+ if (element instanceof IDisconnect) {
+ return element;
+ } else if (element instanceof IAdaptable) {
+ return ((IAdaptable) element).getAdapter(IDisconnect.class);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DropToFrameCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DropToFrameCommand.java
new file mode 100644
index 000000000..8821a5c74
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/DropToFrameCommand.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.IDropToFrame;
+import org.eclipse.debug.internal.ui.commands.provisional.IDropToFrameCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default drop to frame command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class DropToFrameCommand extends DebugCommand implements IDropToFrameCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((IDropToFrame)target).canDropToFrame();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((IDropToFrame)target).dropToFrame();
+ }
+
+ protected Object getTarget(Object element) {
+ if (element instanceof IDropToFrame) {
+ return element;
+ } else if (element instanceof IAdaptable) {
+ return ((IAdaptable) element).getAdapter(IDropToFrame.class);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/ResumeCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/ResumeCommand.java
new file mode 100644
index 000000000..e75739737
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/ResumeCommand.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.internal.ui.commands.provisional.IResumeCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default resume command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class ResumeCommand extends SuspendCommand implements IResumeCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((ISuspendResume)target).canResume();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((ISuspendResume)target).resume();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepCommand.java
new file mode 100644
index 000000000..6775b53f3
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepCommand.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.IStep;
+
+/**
+ * Common function for step commands.
+ *
+ * @since 3.3
+ */
+public abstract class StepCommand extends DebugCommand {
+
+ protected Object getTarget(Object element) {
+ if (element instanceof IStep) {
+ return element;
+ } else if (element instanceof IAdaptable) {
+ return ((IAdaptable) element).getAdapter(IStep.class);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepFiltersCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepFiltersCommand.java
new file mode 100644
index 000000000..6394850ff
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepFiltersCommand.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+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.core.model.IStepFilters;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepFiltersCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+import org.eclipse.debug.ui.DebugUITools;
+
+/**
+ * Default toggle step filters command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class StepFiltersCommand extends DebugCommand implements IStepFiltersCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ IStepFilters[] filters = (IStepFilters[]) target;
+ for (int i = 0; i < filters.length; i++) {
+ IStepFilters filter = filters[i];
+ if (filter == null || !filter.supportsStepFilters()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ IStepFilters[] filters = (IStepFilters[]) target;
+ for (int i = 0; i < filters.length; i++) {
+ IStepFilters filter = filters[i];
+ filter.setStepFiltersEnabled(DebugUITools.isUseStepFilters());
+ }
+ }
+
+ protected Object getTarget(Object element) {
+ IDebugTarget[] targets = getDebugTargets(element);
+ if (targets.length > 0) {
+ IStepFilters[] filters = new IStepFilters[targets.length];
+ for (int i = 0; i < targets.length; i++) {
+ IDebugTarget target = targets[i];
+ if (target instanceof IStepFilters) {
+ filters[i] = (IStepFilters) target;
+ } else {
+ filters[i] = (IStepFilters) ((IAdaptable)element).getAdapter(IStepFilters.class);
+ }
+ }
+ return filters;
+ }
+ return new IStepFilters[0];
+ }
+
+ private IDebugTarget[] getDebugTargets(Object element) {
+ if (element instanceof IDebugElement) {
+ IDebugElement debugElement = (IDebugElement) element;
+ return new IDebugTarget[] { debugElement.getDebugTarget() };
+ } else if (element instanceof ILaunch) {
+ ILaunch launch = (ILaunch) element;
+ return launch.getDebugTargets();
+ } else if (element instanceof IProcess) {
+ IProcess process = (IProcess) element;
+ return process.getLaunch().getDebugTargets();
+ } else {
+ return new IDebugTarget[0];
+ }
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepIntoCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepIntoCommand.java
new file mode 100644
index 000000000..b419af29a
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepIntoCommand.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IStep;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepIntoCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default step into command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class StepIntoCommand extends StepCommand implements IStepIntoCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((IStep)target).canStepInto();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((IStep)target).stepInto();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepOverCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepOverCommand.java
new file mode 100644
index 000000000..335759a14
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepOverCommand.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IStep;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepOverCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default step over command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class StepOverCommand extends StepCommand implements IStepOverCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((IStep)target).canStepOver();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((IStep)target).stepOver();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepReturnCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepReturnCommand.java
new file mode 100644
index 000000000..2b5f4057d
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/StepReturnCommand.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IStep;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepReturnCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default step return command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class StepReturnCommand extends StepCommand implements IStepReturnCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((IStep)target).canStepReturn();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((IStep)target).stepReturn();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/SuspendCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/SuspendCommand.java
new file mode 100644
index 000000000..6013edfbc
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/SuspendCommand.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.internal.ui.commands.provisional.ISuspendCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default suspend command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class SuspendCommand extends DebugCommand implements ISuspendCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((ISuspendResume)target).canSuspend();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((ISuspendResume)target).suspend();
+ }
+
+ protected Object getTarget(Object element) {
+ if (element instanceof ISuspendResume) {
+ return element;
+ } else if (element instanceof IAdaptable) {
+ return ((IAdaptable) element).getAdapter(ISuspendResume.class);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/TerminateCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/TerminateCommand.java
new file mode 100644
index 000000000..6ca8f73f1
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/TerminateCommand.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.model.ITerminate;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * Default terminate command for the standard debug model.
+ *
+ * @since 3.3
+ */
+public class TerminateCommand extends DebugCommand implements ITerminateCommand {
+
+ protected boolean isExecutable(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ return ((ITerminate)target).canTerminate();
+ }
+
+ protected void doExecute(Object target, IAsynchronousRequestMonitor monitor) throws CoreException {
+ ((ITerminate)target).terminate();
+ }
+
+ protected Object getTarget(Object element) {
+ if (element instanceof ITerminate) {
+ return element;
+ } else if (element instanceof IAdaptable) {
+ return ((IAdaptable) element).getAdapter(ITerminate.class);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
index 09da27eba..bf06bda8a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
@@ -16,7 +16,7 @@ import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMon
/**
* Common function for request monitors
*
- * @since 3.2
+ * @since 3.3
*
*/
public abstract class AbstractRequestMonitor implements IAsynchronousRequestMonitor {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionAdapterFactory.java
new file mode 100644
index 000000000..ca6378ca8
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionAdapterFactory.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDisconnect;
+import org.eclipse.debug.core.model.IDropToFrame;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IStep;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.core.model.ITerminate;
+import org.eclipse.debug.internal.ui.commands.DisconnectCommand;
+import org.eclipse.debug.internal.ui.commands.DropToFrameCommand;
+import org.eclipse.debug.internal.ui.commands.ResumeCommand;
+import org.eclipse.debug.internal.ui.commands.StepFiltersCommand;
+import org.eclipse.debug.internal.ui.commands.StepIntoCommand;
+import org.eclipse.debug.internal.ui.commands.StepOverCommand;
+import org.eclipse.debug.internal.ui.commands.StepReturnCommand;
+import org.eclipse.debug.internal.ui.commands.SuspendCommand;
+import org.eclipse.debug.internal.ui.commands.TerminateCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IDisconnectCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IDropToFrameCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IResumeCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepFiltersCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepIntoCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepOverCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepReturnCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.ISuspendCommand;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
+
+/**
+ * Adapter factory for debug capabilities.
+ *
+ * @since 3.3
+ *
+ */
+public class ActionAdapterFactory implements IAdapterFactory {
+
+
+ private static ITerminateCommand fgTerminateCommand = new TerminateCommand();
+ private static IStepOverCommand fgStepOverCommand = new StepOverCommand();
+ private static IStepIntoCommand fgStepIntoCommand = new StepIntoCommand();
+ private static IStepReturnCommand fgStepReturnCommand = new StepReturnCommand();
+ private static IDropToFrameCommand fgDropToFrameCommand = new DropToFrameCommand();
+ private static IDisconnectCommand fgDisconnectCommand = new DisconnectCommand();
+ private static ISuspendCommand fgSuspendCommand = new SuspendCommand();
+ private static IResumeCommand fgResumeCommand = new ResumeCommand();
+ private static IStepFiltersCommand fgStepFiltersCommand = new StepFiltersCommand();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (IStepFiltersCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IDebugElement ||
+ adaptableObject instanceof ILaunch ||
+ adaptableObject instanceof IProcess) {
+ return fgStepFiltersCommand;
+ }
+ }
+
+ if (ITerminateCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof ITerminate) {
+ return fgTerminateCommand;
+ }
+ }
+ if (IStepOverCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IStep) {
+ return fgStepOverCommand;
+ }
+ }
+ if (IStepIntoCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IStep) {
+ return fgStepIntoCommand;
+ }
+ }
+ if (IStepReturnCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IStep) {
+ return fgStepReturnCommand;
+ }
+ }
+ if (ISuspendCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof ISuspendResume) {
+ return fgSuspendCommand;
+ }
+ }
+ if (IResumeCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof ISuspendResume) {
+ return fgResumeCommand;
+ }
+ }
+ if (IDisconnectCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IDisconnect) {
+ return fgDisconnectCommand;
+ }
+ }
+ if (IDropToFrameCommand.class.equals(adapterType)) {
+ if (adaptableObject instanceof IDropToFrame) {
+ return fgDropToFrameCommand;
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ return new Class[]{
+ ITerminateCommand.class,
+ IStepOverCommand.class,
+ IStepIntoCommand.class,
+ IStepReturnCommand.class,
+ ISuspendCommand.class,
+ IResumeCommand.class,
+ IDropToFrameCommand.class,
+ IDisconnectCommand.class,
+ IStepFiltersCommand.class};
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionRequestMonitor.java
index fb23d53f8..9a9de76d3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ActionRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionRequestMonitor.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.internal.ui.DebugUIMessages;
@@ -18,7 +18,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
/**
* Plain request monitor for actions. Has no result.
*
- * @since 3.2
+ * @since 3.3
*
*/
public class ActionRequestMonitor extends AbstractRequestMonitor {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/BooleanRequestMonitor.java
index 4823ed59e..ae6d99a69 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/BooleanRequestMonitor.java
@@ -8,16 +8,16 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IBooleanRequestMonitor;
import org.eclipse.jface.action.IAction;
/**
* Boolean request monitor that collects boolean results from a number of voters.
* Request is cancelled when one voter votes false.
*
- * @since 3.2
+ * @since 3.3
*
*/
public class BooleanRequestMonitor extends AbstractRequestMonitor implements IBooleanRequestMonitor {
@@ -26,7 +26,7 @@ public class BooleanRequestMonitor extends AbstractRequestMonitor implements IBo
private int fNumVoters;
private int fNumOfVotes = 0;
- BooleanRequestMonitor(IAction action, int numVoters) {
+ public BooleanRequestMonitor(IAction action, int numVoters) {
fAction = action;
fNumVoters = numVoters;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanOrWiseRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/CommandMonitor.java
index ee1403662..c037ff2ed 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/BooleanOrWiseRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/CommandMonitor.java
@@ -4,49 +4,39 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IBooleanRequestMonitor;
import org.eclipse.jface.action.IAction;
/**
- * Boolean Request monitor that collects votes from a number of voters.
- * All participants vote, as each votes the results are or'd together, allowing
- * for the pattern: if at least one of...
+ * Request monitor for a command action.
*
* @since 3.3
*/
-public class BooleanOrWiseRequestMonitor extends AbstractRequestMonitor implements IBooleanRequestMonitor {
-
- private boolean fResult = false;
- private IAction fAction = null;
+public class CommandMonitor extends AbstractRequestMonitor implements IBooleanRequestMonitor {
- /**
- * Constructor
- * @param action the action to set enabled state for after voting completes
- */
- public BooleanOrWiseRequestMonitor(IAction action) {
+ private IAction fAction;
+
+ public CommandMonitor(IAction action) {
fAction = action;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
*/
public void setResult(boolean result) {
- fResult |= result;
+ setCanceled(!result);
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
public void done() {
- if(fAction != null) {
- fAction.setEnabled(fResult);
- }
+ fAction.setEnabled(!isCanceled());
}
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandAction.java
index dd9f6eeb4..230908e5d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandAction.java
@@ -9,39 +9,58 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
import java.util.Iterator;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.internal.ui.commands.provisional.IDebugCommand;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextManager;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
- * Provides an abstract base class for asynchronous debug actions
+ * Abstract base class for actions performing debug commands
*
- * @since 3.2
+ * @since 3.3
*/
-public abstract class AbstractDebugContextAction extends Action implements IDebugContextListener {
+public abstract class DebugCommandAction extends Action implements IDebugContextListener {
- private IStructuredSelection fActiveContext;
+ /**
+ * The window this action is working for.
+ */
private IWorkbenchWindow fWindow;
- private AbstractDebugContextActionDelegate fDelegate;
+
+ /**
+ * The part this action is working for, or <code>null</code> if global to
+ * a window.
+ */
+ private IWorkbenchPart fPart;
+
+ /**
+ * Command service.
+ */
+ private DebugCommandService fUpdateService;
+
+ /**
+ * Delegate this action is working for or <code>null</code> if none.
+ */
+ private DebugCommandActionDelegate fDelegate;
/**
* Constructor
*/
- public AbstractDebugContextAction() {
+ public DebugCommandAction() {
super();
String helpContextId = getHelpContextId();
if (helpContextId != null)
@@ -53,7 +72,7 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
* Set the current delegate
* @param delegate
*/
- public void setDelegate(AbstractDebugContextActionDelegate delegate) {
+ public void setDelegate(DebugCommandActionDelegate delegate) {
fDelegate = delegate;
}
@@ -61,40 +80,41 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
* This method is analagous to the standard 'run' method for an <code>IAction</code>
* @param target the target to perform the action on
*/
- protected abstract void doAction(Object target);
+ protected void execute(Object target) {
+ if (target instanceof IAdaptable) {
+ IAdaptable adaptable = (IAdaptable) target;
+ IDebugCommand capability = (IDebugCommand) adaptable.getAdapter(getCommandType());
+ if (capability != null) {
+ capability.execute(target, createStatusMonitor(target));
+ }
+ }
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextActivated(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
+ /**
+ * Creates and returns the status monitor to execute this action with.
+ *
+ * @param target target of the command
+ * @return status monitor to execute with
*/
+ protected IAsynchronousRequestMonitor createStatusMonitor(Object target) {
+ return new ActionRequestMonitor();
+ }
+
+ /**
+ * Returns the command type this action executes.
+ *
+ * @return command class.
+ */
+ abstract protected Class getCommandType();
+
public void contextActivated(ISelection context, IWorkbenchPart part) {
- fActiveContext = null;
- update(context);
+ fUpdateService.postUpdateCommand(getCommandType(), new CommandMonitor(this));
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextChanged(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
public void contextChanged(ISelection context, IWorkbenchPart part) {
contextActivated(context, part);
}
- /**
- * Updates the enabled state for the current selection
- * @param context the current context to evaluate enablement with
- */
- protected void update(ISelection context) {
- if (context instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) context;
- updateEnableStateForContext(ss);
- fActiveContext = (IStructuredSelection) context;
- } else {
- setEnabled(false);
- fActiveContext = StructuredSelection.EMPTY;
- }
- }
-
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#setEnabled(boolean)
@@ -107,56 +127,37 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
}
/**
- * Return whether the action should be enabled or not based on the given
- * selection.
- * This method uses the default <code>BooleanRequestMonitor</code>, which collects
- * votes, and if not cancelled, sets enablement based on the equality of the number of voters
- * to the total number of voters who could have voted
+ * Initializes this action for a specific part.
+ *
+ * @param part workbench part
*/
- protected void updateEnableStateForContext(IStructuredSelection selection) {
- int size = selection.size();
- BooleanRequestMonitor monitor = new BooleanRequestMonitor(this, size);
- if (size > 0) {
- Iterator itr = selection.iterator();
- while (itr.hasNext()) {
- Object element = itr.next();
- isEnabledFor(element, monitor);
- }
+ public void init(IWorkbenchPart part) {
+ fPart = part;
+ fWindow = part.getSite().getWorkbenchWindow();
+ fUpdateService = DebugCommandService.getService(fWindow);
+ IDebugContextService service = DebugContextManager.getDefault().getContextService(fWindow);
+ String partId = part.getSite().getId();
+ service.addDebugContextListener(this, partId);
+ ISelection activeContext = service.getActiveContext(partId);
+ if (activeContext != null) {
+ fUpdateService.updateCommand(getCommandType(), new CommandMonitor(this));
} else {
- notSupported(monitor);
+ setEnabled(getInitialEnablement());
}
}
-
- /**
- * Calls back to the <code>IBooleanRequestMonitor</code> indicating if the action
- * should be enabled based on the selected element
- * @param element the element to determine enablement for
- * @param monitor the <code>IBooleanRequestMonitor</code> to call back to
- */
- protected abstract void isEnabledFor(Object element, IBooleanRequestMonitor monitor);
/**
- * Updates the monitor with a false result. Action should call this method when
- * updating enablement and the function is not supported.
- *
- * @param monitor
- */
- protected void notSupported(IBooleanRequestMonitor monitor) {
- monitor.setResult(false);
- monitor.done();
- }
-
- /**
* Initializes the context action
* @param window the window
*/
public void init(IWorkbenchWindow window) {
- setWindow(window);
+ fWindow = window;
+ fUpdateService = DebugCommandService.getService(fWindow);
IDebugContextManager manager = DebugContextManager.getDefault();
manager.addDebugContextListener(this, window);
ISelection activeContext = manager.getActiveContext(window);
if (activeContext != null) {
- contextActivated(activeContext, null);
+ fUpdateService.updateCommand(getCommandType(), new BooleanRequestMonitor(this, 1));
} else {
setEnabled(getInitialEnablement());
}
@@ -173,20 +174,15 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
}
/**
- * Set the window this action is contained within
- * @param window the new window
- */
- protected void setWindow(IWorkbenchWindow window) {
- fWindow = window;
- }
-
- /**
* Returns the most recent selection
*
* @return structured selection
*/
- protected IStructuredSelection getContext() {
- return fActiveContext;
+ protected ISelection getContext() {
+ if (fPart != null) {
+ DebugContextManager.getDefault().getContextService(fWindow).getActiveContext(fPart.getSite().getId());
+ }
+ return DebugContextManager.getDefault().getActiveContext(fWindow);
}
/*
@@ -194,14 +190,15 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
- IStructuredSelection selection = getContext();
- if (selection != null && isEnabled()) {
+ ISelection selection = getContext();
+ if (selection instanceof IStructuredSelection && isEnabled()) {
// disable the action so it cannot be run again until an event or
// selection change updates the enablement
setEnabled(false);
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ for (Iterator iter = ss.iterator(); iter.hasNext();) {
Object element = iter.next();
- doAction(element);
+ execute(element);
}
}
}
@@ -218,35 +215,15 @@ public abstract class AbstractDebugContextAction extends Action implements IDebu
* Clean up when removing
*/
public void dispose() {
- IWorkbenchWindow window = getWindow();
- if (getWindow() != null) {
- DebugContextManager.getDefault().removeDebugContextListener(this, window);
+ IDebugContextManager manager = DebugContextManager.getDefault();
+ if (fPart != null) {
+ IDebugContextService service = manager.getContextService(fWindow);
+ service.removeDebugContextListener(this, fPart.getSite().getId());
+ } else {
+ manager.removeDebugContextListener(this, fWindow);
}
- }
-
- /**
- * @return The current window this action is associated with
- */
- protected IWorkbenchWindow getWindow() {
- return fWindow;
- }
-
- /**
- * 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$
+ fWindow = null;
+ fPart = null;
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
index dc672b476..db973418d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -18,12 +18,17 @@ import org.eclipse.ui.IActionDelegate2;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public abstract class AbstractDebugContextActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
+/**
+ * Abstract base class for debug action delegates performing debug commands.
+ *
+ * @since 3.3
+ */
+public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
/**
*The real action for this delegate
*/
- private AbstractDebugContextAction fDebugAction;
+ private DebugCommandAction fDebugAction;
/**
* The underlying action for this delegate
@@ -36,7 +41,7 @@ public abstract class AbstractDebugContextActionDelegate implements IWorkbenchWi
*/
private boolean fInitialized = false;
- public AbstractDebugContextActionDelegate() {
+ public DebugCommandActionDelegate() {
}
/*
@@ -61,7 +66,6 @@ public abstract class AbstractDebugContextActionDelegate implements IWorkbenchWi
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
- setWindow(window);
fDebugAction.init(window);
}
@@ -96,23 +100,15 @@ public abstract class AbstractDebugContextActionDelegate implements IWorkbenchWi
// do nothing
}
- protected AbstractDebugContextAction getAction() {
+ protected DebugCommandAction getAction() {
return fDebugAction;
}
- protected void setAction(AbstractDebugContextAction action) {
+ protected void setAction(DebugCommandAction action) {
fDebugAction = action;
action.setDelegate(this);
}
- protected IWorkbenchWindow getWindow() {
- return fDebugAction.getWindow();
- }
-
- protected void setWindow(IWorkbenchWindow window) {
- fDebugAction.setWindow(window);
- }
-
public synchronized void setEnabled(boolean enabled) {
if (!fInitialized) {
fInitialized = true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
new file mode 100644
index 000000000..2ef382fe7
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.internal.ui.commands.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IDebugCommand;
+import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Updates commands for a window. Coalesces update requests by command type.
+ *
+ * @since 3.3
+ */
+public class DebugCommandService implements IDebugContextListener {
+
+ /**
+ * Maps command types to update monitors
+ */
+ private Map fCommandUpdates = new HashMap();
+
+ /**
+ * Window this service is for.
+ */
+ private IWorkbenchWindow fWindow = null;
+
+ /**
+ * The context service for this command service.
+ */
+ private IDebugContextService fContextService = null;
+
+ /**
+ * Service per window
+ */
+ private static Map fgServices = new HashMap();
+
+ /**
+ * Returns the service for a window.
+ *
+ * @param window
+ * @return service
+ */
+ public synchronized static DebugCommandService getService(IWorkbenchWindow window) {
+ DebugCommandService service = (DebugCommandService) fgServices.get(window);
+ if (service == null) {
+ service = new DebugCommandService(window);
+ fgServices.put(window, service);
+ }
+ return service;
+ }
+
+ public DebugCommandService(IWorkbenchWindow window) {
+ fWindow = window;
+ fContextService = DebugContextManager.getDefault().getContextService(window);
+ fContextService.addPostDebugContextListener(this);
+ PlatformUI.getWorkbench().addWindowListener(new IWindowListener() {
+
+ public void windowOpened(IWorkbenchWindow window) {
+ }
+
+ public void windowDeactivated(IWorkbenchWindow window) {
+ }
+
+ public void windowClosed(IWorkbenchWindow window) {
+ if (fWindow == window) {
+ dispose();
+ }
+ }
+
+ public void windowActivated(IWorkbenchWindow window) {
+ }
+
+ });
+ }
+
+ private void dispose() {
+ fContextService.removeDebugContextListener(this);
+ fgServices.remove(fWindow);
+ fCommandUpdates.clear();
+ fWindow = null;
+ }
+
+ /**
+ * Updates the given command type after the next context change.
+ *
+ * @param commandType
+ * @param monitor
+ */
+ public void postUpdateCommand(Class commandType, IBooleanRequestMonitor monitor) {
+ ProxyBooleanRequestMonitor proxy = (ProxyBooleanRequestMonitor) fCommandUpdates.get(commandType);
+ if (proxy == null) {
+ proxy = new ProxyBooleanRequestMonitor();
+ fCommandUpdates.put(commandType, proxy);
+ }
+ proxy.addMonitor(monitor);
+ }
+
+ /**
+ * Updates the given command type based on the active context.
+ *
+ * @param commandType
+ * @param requestMonitor
+ */
+ public void updateCommand(Class commandType, IBooleanRequestMonitor requestMonitor) {
+ ISelection context = fContextService.getActiveContext();
+ if (context instanceof IStructuredSelection && !context.isEmpty()) {
+ Object[] elements = ((IStructuredSelection)context).toArray();
+ ProxyBooleanRequestMonitor monitor = new ProxyBooleanRequestMonitor();
+ monitor.addMonitor(requestMonitor);
+ updateCommand(commandType, elements, monitor);
+ } else {
+ requestMonitor.setCanceled(true);
+ requestMonitor.done();
+ }
+ }
+
+ private void postUpdate(ISelection context) {
+ if (context instanceof IStructuredSelection && !context.isEmpty()) {
+ Object[] elements = ((IStructuredSelection)context).toArray();
+ Iterator iterator = fCommandUpdates.entrySet().iterator();
+ while (iterator.hasNext()) {
+ Entry entry = (Entry) iterator.next();
+ Class commandType = (Class)entry.getKey();
+ ProxyBooleanRequestMonitor monitor = (ProxyBooleanRequestMonitor) entry.getValue();
+ updateCommand(commandType, elements, monitor);
+ }
+ } else {
+ Iterator iterator = fCommandUpdates.values().iterator();
+ while (iterator.hasNext()) {
+ ProxyBooleanRequestMonitor monitor = (ProxyBooleanRequestMonitor) iterator.next();
+ monitor.setCanceled(true);
+ monitor.done();
+ }
+ }
+ fCommandUpdates.clear();
+ }
+
+ /**
+ * Updates the given command type for the specified elements.
+ *
+ * @param commandType command class to update
+ * @param elements elements to update for
+ * @param monitor status monitor
+ */
+ private void updateCommand(Class commandType, Object[] elements, ProxyBooleanRequestMonitor monitor) {
+ IDebugCommand[] commands = new IDebugCommand[elements.length];
+ int numVoters = 0;
+ for (int i = 0; i < elements.length; i++) {
+ Object element = elements[i];
+ if (element instanceof IAdaptable) {
+ IDebugCommand command = (IDebugCommand) ((IAdaptable)element).getAdapter(commandType);
+ if (command != null) {
+ commands[i] = command;
+ numVoters++;
+ } else {
+ monitor.setCanceled(true);
+ monitor.done();
+ return;
+ }
+ }
+ }
+ if (!monitor.isCanceled()) {
+ monitor.setNumVoters(numVoters);
+ for (int i = 0; i < commands.length; i++) {
+ IDebugCommand command = commands[i];
+ command.canExecute(elements[i], monitor);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextActivated(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart, org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService)
+ */
+ public void contextActivated(ISelection selection, IWorkbenchPart part) {
+ postUpdate(selection);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextChanged(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart, org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService)
+ */
+ public void contextChanged(ISelection selection, IWorkbenchPart part) {
+ postUpdate(selection);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
new file mode 100644
index 000000000..8b3f43f04
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IDisconnectCommand;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.resource.ImageDescriptor;
+/**
+ * Disconnect action.
+ *
+ * @since 3.3
+ */
+public class DisconnectCommandAction extends DebugCommandAction{
+
+ public String getText() {
+ return ActionMessages.DisconnectAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "disconnect_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.disconnect"; //$NON-NLS-1$
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.DisconnectAction_3;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DISCONNECT);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
+ }
+
+ protected Class getCommandType() {
+ return IDisconnectCommand.class;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
new file mode 100644
index 000000000..1f93ed617
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IDropToFrameCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Drop to frame action.
+ *
+ * @since 3.3
+ */
+public class DropToFrameCommandAction extends DebugCommandAction {
+
+ public String getText() {
+ return ActionMessages.DropToFrameAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "drop_to_frame_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.dropToFrame"; //$NON-NLS-1$
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.DropToFrameAction_3;
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return null;
+ }
+
+ protected Class getCommandType() {
+ return IDropToFrameCommand.class;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ProxyBooleanRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ProxyBooleanRequestMonitor.java
new file mode 100644
index 000000000..257744464
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ProxyBooleanRequestMonitor.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.debug.internal.ui.commands.provisional.IBooleanRequestMonitor;
+
+/**
+ * Boolean request monitor that collects boolean results from a number of voters.
+ * Request is cancelled when one voter votes false. Forwards the results to
+ * any number of boolean request monitors.
+ *
+ * @since 3.3
+ *
+ */
+public class ProxyBooleanRequestMonitor extends AbstractRequestMonitor implements IBooleanRequestMonitor {
+
+ private List fMonitors = new ArrayList();
+ private int fNumVoters;
+ private int fNumOfVotes = 0;
+ private boolean fDone = false;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
+ */
+ public synchronized void setResult(boolean result) {
+ fNumOfVotes++;
+ if (!isCanceled()) {
+ if (!result) {
+ setCanceled(true);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IProgressMonitor#done()
+ */
+ public synchronized void done() {
+ if (!fDone) {
+ if (isCanceled() || fNumOfVotes == fNumVoters) {
+ fDone = true;
+ Iterator monitors = fMonitors.iterator();
+ while (monitors.hasNext()) {
+ IBooleanRequestMonitor monitor = (IBooleanRequestMonitor) monitors.next();
+ monitor.setStatus(getStatus());
+ if (isCanceled()) {
+ monitor.setCanceled(true);
+ } else {
+ monitor.setResult(true);
+ }
+ monitor.done();
+ }
+ fMonitors.clear();
+ }
+ }
+ }
+
+ /**
+ * Sets the number of voters required for this capability test.
+ *
+ * @param numVoters
+ */
+ void setNumVoters(int numVoters) {
+ fNumVoters = numVoters;
+ }
+
+ /**
+ * Adds the given monitor to forward the result to when done.
+ *
+ * @param monitor
+ */
+ void addMonitor(IBooleanRequestMonitor monitor) {
+ fMonitors.add(monitor);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
new file mode 100644
index 000000000..5f1cf0cf3
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IResumeCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Resume action.
+ *
+ * @since 3.3
+ */
+public class ResumeCommandAction extends DebugCommandAction{
+
+ public ResumeCommandAction() {
+ setActionDefinitionId("org.eclipse.debug.ui.commands.Resume"); //$NON-NLS-1$
+ }
+
+ public String getText() {
+ return ActionMessages.ResumeAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "resume_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.resume"; //$NON-NLS-1$
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.ResumeAction_3;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESUME);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
+ }
+
+ protected Class getCommandType() {
+ return IResumeCommand.class;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
index b077b59a1..77a6cb6d2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
@@ -9,13 +9,18 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-public class TerminateActionDelegate extends AbstractDebugContextActionDelegate {
+/**
+ * Resume action delegate.
+ *
+ * @since 3.3
+ */
+public class ResumeCommandActionDelegate extends DebugCommandActionDelegate {
- public TerminateActionDelegate() {
+ public ResumeCommandActionDelegate() {
super();
- setAction(new TerminateAction());
+ setAction(new ResumeCommandAction());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
new file mode 100644
index 000000000..45ae8d711
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepIntoCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Step into action
+ *
+ * @since 3.3
+ */
+public class StepIntoCommandAction extends DebugCommandAction {
+
+ public StepIntoCommandAction() {
+ setActionDefinitionId("org.eclipse.debug.ui.commands.StepInto"); //$NON-NLS-1$
+ }
+
+ public String getText() {
+ return ActionMessages.StepIntoAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "step_into_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.stepInto"; //$NON-NLS-1$
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.StepIntoAction_3;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
+ }
+
+ protected Class getCommandType() {
+ return IStepIntoCommand.class;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java
index 6d194cb48..0364de6eb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/SuspendActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java
@@ -9,13 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-public class SuspendActionDelegate extends AbstractDebugContextActionDelegate {
+/**
+ * Step into action delegate.
+ *
+ * @since 3.3
+ */
+public class StepIntoCommandActionDelegate extends DebugCommandActionDelegate {
- public SuspendActionDelegate() {
+ public StepIntoCommandActionDelegate() {
super();
- setAction(new SuspendAction());
+ setAction(new StepIntoCommandAction());
}
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
new file mode 100644
index 000000000..e33e2e407
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepOverCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Step over action.
+ *
+ * @since 3.3
+ */
+public class StepOverCommandAction extends DebugCommandAction {
+
+ public StepOverCommandAction() {
+ setActionDefinitionId("org.eclipse.debug.ui.commands.StepOver"); //$NON-NLS-1$
+ }
+
+ public String getText() {
+ return ActionMessages.StepOverAction_0;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER);
+ }
+
+ public String getHelpContextId() {
+ return "step_over_action_context"; //$NON-NLS-1$
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.stepOver"; //$NON-NLS-1$
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.StepOverAction_3;
+ }
+
+ protected Class getCommandType() {
+ return IStepOverCommand.class;
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
index 8fb617538..71a20406d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
@@ -9,13 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-public class StepReturnActionDelegate extends AbstractDebugContextActionDelegate {
+/**
+ * Step over action delegate.
+ *
+ * @since 3.3
+ */
+public class StepOverCommandActionDelegate extends DebugCommandActionDelegate {
- public StepReturnActionDelegate() {
+ public StepOverCommandActionDelegate() {
super();
- setAction(new StepReturnAction());
+ setAction(new StepOverCommandAction());
}
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
index 0321b8301..7bf961264 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepReturnAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
@@ -7,22 +7,24 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Pawel Piech - bug 134177
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepReturnCommand;
import org.eclipse.jface.resource.ImageDescriptor;
-public class StepReturnAction extends StepIntoAction {
+/**
+ * Step return action.
+ *
+ * @since 3.3
+ */
+public class StepReturnCommandAction extends DebugCommandAction {
- public StepReturnAction() {
+ public StepReturnCommandAction() {
setActionDefinitionId("org.eclipse.debug.ui.commands.StepReturn"); //$NON-NLS-1$
}
@@ -54,33 +56,8 @@ public class StepReturnAction extends StepIntoAction {
return ActionMessages.StepReturnAction_3;
}
-
- protected void checkCapability(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null) {
- steppy.canStepReturn(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- protected void stepAction(Object element) {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
- if (steppy != null)
- steppy.stepReturn(element, new ActionRequestMonitor());
- }
- }
-
- protected String getStatusMessage() {
- return ActionMessages.StepReturnActionDelegate_Exceptions_occurred_attempting_to_run_to_return_of_the_frame__2;
- }
+ protected Class getCommandType() {
+ return IStepReturnCommand.class;
+ }
- protected String getErrorDialogMessage() {
- return ActionMessages.StepReturnActionDelegate_Run_to_return_failed__1;
- }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java
new file mode 100644
index 000000000..2f78cced1
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.internal.ui.commands.actions;
+
+/**
+ * Step return action delegate.
+ *
+ * @since 3.3
+ */
+public class StepReturnCommandActionDelegate extends DebugCommandActionDelegate {
+
+ public StepReturnCommandActionDelegate() {
+ super();
+ setAction(new StepReturnCommandAction());
+ }
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
new file mode 100644
index 000000000..98602fd58
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.ISuspendCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Suspend action.
+ *
+ * @since 3.3
+ */
+public class SuspendCommandAction extends DebugCommandAction {
+
+
+ public String getText() {
+ return ActionMessages.SuspendAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "suspend_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.toolbar.suspend"; //$NON-NLS-1$
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.SuspendAction_3;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SUSPEND);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
+ }
+
+ protected Class getCommandType() {
+ return ISuspendCommand.class;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java
index 447ede46e..9747cdc42 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/ResumeActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java
@@ -8,11 +8,20 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
-public class ResumeActionDelegate extends AbstractDebugContextActionDelegate {
- public ResumeActionDelegate() {
+package org.eclipse.debug.internal.ui.commands.actions;
+
+/**
+ * Suspend action delegate.
+ *
+ * @since 3.3
+ */
+public class SuspendCommandActionDelegate extends DebugCommandActionDelegate {
+
+ public SuspendCommandActionDelegate() {
super();
- setAction(new ResumeAction());
+ setAction(new SuspendCommandAction());
}
+
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
new file mode 100644
index 000000000..777167a50
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.ILaunchesListener2;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Terminates all launches.
+ *
+ * @since 3.3
+ */
+public class TerminateAllAction extends DebugCommandAction implements ILaunchesListener2 {
+
+ protected ISelection getContext() {
+ return new StructuredSelection(getLaunchManager().getLaunches());
+ }
+
+ public void contextActivated(ISelection context, IWorkbenchPart part) {
+ // DO NOTHING
+ }
+
+ public void contextChanged(ISelection context, IWorkbenchPart part) {
+ // DO NOTHING
+ }
+
+ public void dispose() {
+ getLaunchManager().removeLaunchListener(this);
+ super.dispose();
+ }
+
+ public void init(IWorkbenchPart part) {
+ super.init(part);
+ ILaunchManager launchManager = getLaunchManager();
+ launchManager.addLaunchListener(this);
+ // heuristic... rather than updating all the time, just assume there's
+ // something that's not terminated.
+ setEnabled(launchManager.getLaunches().length > 0);
+ }
+
+ private ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ public String getHelpContextId() {
+ return "terminate_all_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"; //$NON-NLS-1$
+ }
+
+ public String getText() {
+ return ActionMessages.TerminateAllAction_2;
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.TerminateAllAction_3;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages
+ .getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_ALL);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages
+ .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages
+ .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
+ }
+
+ protected Class getCommandType() {
+ return ITerminateCommand.class;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesTerminated(ILaunch[] launches) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesAdded(ILaunch[] launches) {
+ setEnabled(true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesChanged(ILaunch[] launches) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesRemoved(ILaunch[] launches) {
+ setEnabled(getLaunchManager().getLaunches().length > 0);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
new file mode 100644
index 000000000..146967d45
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.actions.RelaunchActionDelegate;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Action which terminates a launch and then re-launches it.
+ */
+public class TerminateAndRelaunchAction extends DebugCommandAction {
+
+ class RequestMonitor extends ActionRequestMonitor {
+
+ private ILaunch fLaunch;
+
+ public RequestMonitor(ILaunch launch) {
+ fLaunch = launch;
+ }
+
+ public void done() {
+ super.done();
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ // Must be run in the UI thread since the launch can require
+ // prompting to proceed
+ RelaunchActionDelegate.relaunch(fLaunch.getLaunchConfiguration(), fLaunch.getLaunchMode());
+ }
+ });
+ }
+
+ }
+
+ protected IAsynchronousRequestMonitor createStatusMonitor(Object target) {
+ ILaunch launch = RelaunchActionDelegate.getLaunch(target);
+ return new RequestMonitor(launch);
+ }
+
+ protected Class getCommandType() {
+ return ITerminateCommand.class;
+ }
+
+ public void contextActivated(ISelection context, IWorkbenchPart part) {
+ if (context instanceof IStructuredSelection) {
+ Object[] elements = ((IStructuredSelection)context).toArray();
+ for (int i = 0; i < elements.length; i++) {
+ if (!canRelaunch(elements[i])) {
+ setEnabled(false);
+ return;
+ }
+ }
+ }
+ super.contextActivated(context, part);
+ }
+
+ protected boolean canRelaunch(Object element) {
+ ILaunch launch = RelaunchActionDelegate.getLaunch(element);
+ return launch != null && LaunchConfigurationManager.isVisible(launch.getLaunchConfiguration());
+ }
+
+ public String getActionDefinitionId() {
+ return ActionMessages.TerminateAndRelaunchAction_0;
+ }
+
+ public String getHelpContextId() {
+ return "terminate_and_relaunch_action_context"; //$NON-NLS-1$
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.debugview.popupMenu.TerminateAndRelaunch"; //$NON-NLS-1$
+ }
+
+ public String getText() {
+ return ActionMessages.TerminateAndRelaunchAction_3;
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.TerminateAndRelaunchAction_4;
+ }
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_RELAUNCH);
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
index 25ee97983..19e9c0408 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAndRemoveAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
@@ -8,9 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugElement;
@@ -18,11 +18,16 @@ import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
-public class TerminateAndRemoveAction extends AbstractDebugContextAction {
+/**
+ * Terminate and remove action.
+ *
+ * @since 3.3
+ */
+public class TerminateAndRemoveAction extends DebugCommandAction {
class TerminateAndRemoveMonitor extends ActionRequestMonitor {
@@ -31,9 +36,9 @@ public class TerminateAndRemoveAction extends AbstractDebugContextAction {
fElement = element;
}
public void done() {
- if(getStatus() == null) {
+ IStatus status = getStatus();
+ if(status == null || status.isOK()) {
ILaunch launch= null;
-
if (fElement instanceof ILaunch) {
launch= (ILaunch) fElement;
} else if (fElement instanceof IDebugElement) {
@@ -48,34 +53,6 @@ public class TerminateAndRemoveAction extends AbstractDebugContextAction {
}
}
- protected void doAction(Object element) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null)
- adapter.terminate(element, new TerminateAndRemoveMonitor(element));
- }
- }
-
-
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null) {
- adapter.canTerminate(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
-
- }
-
- protected String getStatusMessage() {
- return ActionMessages.TerminateAndRemoveActionDelegate_Exceptions_occurred_attempting_to_terminate_and_remove_2;
- }
-
- protected String getErrorDialogMessage() {
- return ActionMessages.TerminateAndRemoveActionDelegate_Terminate_and_remove_failed_1;
- }
public String getText() {
return ActionMessages.TerminateAndRemoveAction_0;
@@ -105,4 +82,13 @@ public class TerminateAndRemoveAction extends AbstractDebugContextAction {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE);
}
+ protected Class getCommandType() {
+ return ITerminateCommand.class;
+ }
+
+ protected IAsynchronousRequestMonitor createStatusMonitor(Object target) {
+ return new TerminateAndRemoveMonitor(target);
+ }
+
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
index 092712a48..07528acf4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/TerminateAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
@@ -8,51 +8,25 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousTerminateAdapter;
-import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.provisional.ITerminateCommand;
import org.eclipse.jface.resource.ImageDescriptor;
-public class TerminateAction extends AbstractDebugContextAction {
+/**
+ * Terminate action.
+ *
+ * @since 3.3
+ */
+public class TerminateCommandAction extends DebugCommandAction {
- public TerminateAction() {
+ public TerminateCommandAction() {
setActionDefinitionId("org.eclipse.debug.ui.commands.Terminate"); //$NON-NLS-1$
}
- protected void doAction(final Object element) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null)
- adapter.terminate(element, new ActionRequestMonitor());
- }
- }
-
-
-
- protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) {
- if (element instanceof IAdaptable) {
- IAsynchronousTerminateAdapter adapter = (IAsynchronousTerminateAdapter) ((IAdaptable)element).getAdapter(IAsynchronousTerminateAdapter.class);
- if (adapter != null) {
- adapter.canTerminate(element, monitor);
- } else {
- notSupported(monitor);
- }
- }
- }
-
- protected String getStatusMessage() {
- return ActionMessages.TerminateActionDelegate_Exceptions_occurred_attempting_to_terminate__2;
- }
-
- protected String getErrorDialogMessage() {
- return ActionMessages.TerminateActionDelegate_Terminate_failed__1;
- }
-
public String getText() {
return ActionMessages.TerminateAction_0;
}
@@ -80,4 +54,8 @@ public class TerminateAction extends AbstractDebugContextAction {
public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE);
}
+
+ protected Class getCommandType() {
+ return ITerminateCommand.class;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java
index 95c27173a..a401b2209 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepIntoActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java
@@ -9,13 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.commands.actions;
-public class StepIntoActionDelegate extends AbstractDebugContextActionDelegate {
+/**
+ * Terminate action delegate.
+ *
+ * @since 3.3
+ */
+public class TerminateCommandActionDelegate extends DebugCommandActionDelegate {
- public StepIntoActionDelegate() {
+ public TerminateCommandActionDelegate() {
super();
- setAction(new StepIntoAction());
+ setAction(new TerminateCommandAction());
}
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
new file mode 100644
index 000000000..85de71dea
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.DebugPluginImages;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.commands.provisional.IStepFiltersCommand;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class ToggleStepFiltersAction extends DebugCommandAction {
+
+ public ImageDescriptor getDisabledImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TOGGLE_STEP_FILTERS);
+ }
+
+ public String getHelpContextId() {
+ return "step_with_filters_action_context"; //$NON-NLS-1$
+ }
+
+ public ImageDescriptor getHoverImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
+ }
+
+ public String getId() {
+ return "org.eclipse.debug.ui.actions.ToggleStepFilters"; //$NON-NLS-1$
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
+ }
+
+ public String getText() {
+ return ActionMessages.ToggleStepFiltersAction_0;
+ }
+
+ public String getToolTipText() {
+ return ActionMessages.ToggleStepFiltersAction_0;
+ }
+
+ protected boolean getInitialEnablement() {
+ return true;
+ }
+
+ protected Class getCommandType() {
+ return IStepFiltersCommand.class;
+ }
+
+ public void run() {
+ DebugUITools.setUseStepFilters(!DebugUITools.isUseStepFilters());
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#contextActivated(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart, org.eclipse.debug.internal.ui.contexts.IDebugContextService)
+ */
+ public void contextActivated(ISelection context, IWorkbenchPart part) {
+ if (context.isEmpty()) {
+ setEnabled(true);
+ } else {
+ super.contextActivated(context, part);
+ }
+ }
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
new file mode 100644
index 000000000..ad58f05af
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.internal.ui.commands.actions;
+
+/**
+ * Toggle step filters action delegate.
+ *
+ * @since 3.3
+ */
+public class ToggleStepFiltersCommandActionDelegate extends DebugCommandActionDelegate {
+
+ public ToggleStepFiltersCommandActionDelegate() {
+ super();
+ setAction(new ToggleStepFiltersAction());
+ }
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IBooleanRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IBooleanRequestMonitor.java
index e31dc2bb9..2618d52d6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/provisional/IBooleanRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IBooleanRequestMonitor.java
@@ -8,14 +8,14 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.provisional;
+package org.eclipse.debug.internal.ui.commands.provisional;
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
/**
* Request monitor for obtaining a boolean result asynchronously.
*
- * @since 3.2
+ * @since 3.3
*/
public interface IBooleanRequestMonitor extends IAsynchronousRequestMonitor {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDebugCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDebugCommand.java
new file mode 100644
index 000000000..36598bf9c
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDebugCommand.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
+
+/**
+ * A command that can be enabled or disabled and executed.
+ *
+ * @since 3.3
+ */
+public interface IDebugCommand {
+
+ /**
+ * Determines whether this command can be executed on the specified element.
+ *
+ * @param element element to operate on
+ * @param monitor accepts result
+ */
+ public void canExecute(Object element, IBooleanRequestMonitor monitor);
+
+ /**
+ * Executes this command on the specified element reporting any status
+ * to the given monitor.
+ *
+ * @param element element to perform capability on
+ * @param monitor status monitor
+ */
+ public void execute(Object element, IAsynchronousRequestMonitor monitor);
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDisconnectCommand.java
index e32fba34d..2e0c03d7f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/StepOverActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDisconnectCommand.java
@@ -1,20 +1,20 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
-package org.eclipse.debug.internal.ui.actions.context;
-
-public class StepOverActionDelegate extends AbstractDebugContextActionDelegate {
- public StepOverActionDelegate() {
- super();
- setAction(new StepOverAction());
- }
+/**
+ * Disconnect command.
+ *
+ * @since 3.3
+ */
+public interface IDisconnectCommand extends IDebugCommand {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDropToFrameCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDropToFrameCommand.java
new file mode 100644
index 000000000..5eae61965
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IDropToFrameCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Drop to frame command.
+ *
+ * @since 3.3
+ */
+public interface IDropToFrameCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IResumeCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IResumeCommand.java
new file mode 100644
index 000000000..2838b9101
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IResumeCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Resume command.
+ *
+ * @since 3.3
+ */
+public interface IResumeCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepFiltersCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepFiltersCommand.java
new file mode 100644
index 000000000..f9bd5b39e
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepFiltersCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Step filters command.
+ *
+ * @since 3.3
+ */
+public interface IStepFiltersCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepIntoCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepIntoCommand.java
new file mode 100644
index 000000000..e797e371c
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepIntoCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Step into command.
+ *
+ * @since 3.3
+ */
+public interface IStepIntoCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepOverCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepOverCommand.java
new file mode 100644
index 000000000..b86dc92a8
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepOverCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Step over command.
+ *
+ * @since 3.3
+ */
+public interface IStepOverCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepReturnCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepReturnCommand.java
new file mode 100644
index 000000000..373ef3ca3
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/IStepReturnCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Step return command.
+ *
+ * @since 3.3
+ */
+public interface IStepReturnCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ISuspendCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ISuspendCommand.java
new file mode 100644
index 000000000..3380ba058
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ISuspendCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Suspend command.
+ *
+ * @since 3.3
+ */
+public interface ISuspendCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ITerminateCommand.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ITerminateCommand.java
new file mode 100644
index 000000000..39d0933d8
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/provisional/ITerminateCommand.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.provisional;
+
+/**
+ * Terminate command.
+ *
+ * @since 3.3
+ */
+public interface ITerminateCommand extends IDebugCommand {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index 54350b09d..d9b94e94d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.ListenerList;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextManager;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService;
import org.eclipse.debug.internal.ui.views.ViewContextManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWindowListener;
@@ -215,5 +216,12 @@ public class DebugContextManager implements IDebugContextManager {
Collection sevices = fServices.values();
return (DebugWindowContextService[]) sevices.toArray(new DebugWindowContextService[sevices.size()]);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextManager#getContextService(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public IDebugContextService getContextService(IWorkbenchWindow window) {
+ return createService(window);
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index d78d0d434..19781ca16 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -19,8 +19,11 @@ import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider;
+import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextService;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IPartListener2;
@@ -34,16 +37,14 @@ import org.eclipse.ui.IWorkbenchWindow;
*
* @since 3.2
*/
-public class DebugWindowContextService implements IDebugContextService, IPartListener2, IDebugContextListener {
+public class DebugWindowContextService implements IDebugContextService, IPartListener2, IDebugContextEventListener {
private Map fListenersByPartId = new HashMap();
private Map fProvidersByPartId = new HashMap();
+ private Map fPostListenersByPartId = new HashMap();
private IWorkbenchWindow fWindow;
private List fProviders = new ArrayList();
-
- private static final int ACTIVATED = 1;
- private static final int CHANGED = 2;
public DebugWindowContextService(IWorkbenchWindow window) {
fWindow = window;
@@ -69,9 +70,9 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
active = activePage.getActivePart();
}
if (fProviders.size() == 1 && (part == null || part.equals(active))) {
- notify(ACTIVATED);
+ notify(DebugContextEvent.ACTIVATED);
}
- provider.addDebugContextListener(this);
+ provider.addDebugContextEventListener(this);
}
protected synchronized void removeProvider(IDebugContextProvider provider) {
@@ -85,10 +86,10 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
fProvidersByPartId.remove(id);
fProviders.remove(index);
if (index == 0) {
- notify(ACTIVATED);
+ notify(DebugContextEvent.ACTIVATED);
}
}
- provider.removeDebugContextListener(this);
+ provider.removeDebugContextEventListener(this);
}
/* (non-Javadoc)
@@ -97,6 +98,30 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
public void addDebugContextListener(IDebugContextListener listener) {
addDebugContextListener(listener, null);
}
+
+ public void addPostDebugContextListener(IDebugContextListener listener, String partId) {
+ ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
+ if (list == null) {
+ list = new ListenerList();
+ fPostListenersByPartId.put(partId, list);
+ }
+ list.add(listener);
+ }
+
+ public void addPostDebugContextListener(IDebugContextListener listener) {
+ addPostDebugContextListener(listener, null);
+ }
+
+ public void removePostDebugContextListener(IDebugContextListener listener, String partId) {
+ ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
+ if (list != null) {
+ list.remove(listener);
+ }
+ }
+
+ public void removePostDebugContextListener(IDebugContextListener listener) {
+ removePostDebugContextListener(listener, null);
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
@@ -119,7 +144,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
if (part != null) {
notify(type, getListeners(part), context, part);
}
+ notify(type, getPostListeners(null), context, part);
+ if (part != null) {
+ notify(type, getPostListeners(part), context, part);
+ }
}
+
protected void notify(final int type, ListenerList list, final ISelection context, final IWorkbenchPart part) {
if (list != null) {
Object[] listeners = list.getListeners();
@@ -127,7 +157,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
final IDebugContextListener listener = (IDebugContextListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
public void run() throws Exception {
- if (type == ACTIVATED) {
+ if (type == DebugContextEvent.ACTIVATED) {
listener.contextActivated(context, part);
} else {
listener.contextChanged(context, part);
@@ -148,6 +178,14 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
}
return (ListenerList) fListenersByPartId.get(id);
}
+
+ protected ListenerList getPostListeners(IWorkbenchPart part) {
+ String id = null;
+ if (part != null) {
+ id = part.getSite().getId();
+ }
+ return (ListenerList) fPostListenersByPartId.get(id);
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String)
@@ -202,7 +240,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
if (index > 0) {
fProviders.remove(index);
fProviders.add(0, provider);
- notify(ACTIVATED);
+ notify(DebugContextEvent.ACTIVATED);
}
}
@@ -251,28 +289,15 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
}
/* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#contextActivated(java.lang.Object, org.eclipse.ui.IWorkbenchPart)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
- public synchronized void contextActivated(ISelection context, IWorkbenchPart part) {
+ public void contextEvent(DebugContextEvent event) {
if (!fProviders.isEmpty()) {
IDebugContextProvider provider = (IDebugContextProvider) fProviders.get(0);
- if (provider.getPart() == part) {
- notify(ACTIVATED);
+ if (provider == event.getDebugContextProvider()) {
+ notify(event.getEventType());
}
- }
+ }
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#contextChanged(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- public void contextChanged(ISelection selection, IWorkbenchPart part) {
- if (!fProviders.isEmpty()) {
- IDebugContextProvider provider = (IDebugContextProvider) fProviders.get(0);
- if (provider.getPart() == part) {
- notify(CHANGED);
- }
- }
- }
-
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/AbstractDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/AbstractDebugContextProvider.java
new file mode 100644
index 000000000..5370af0ad
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/AbstractDebugContextProvider.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.contexts.provisional;
+
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Abstract implementation of a debug context provider.
+ * <p>
+ * Clients implementing context providers should subclass this class.
+ * </p>
+ * @since 3.3
+ */
+public abstract class AbstractDebugContextProvider implements IDebugContextProvider {
+
+ /**
+ * Event listeners
+ */
+ private ListenerList fListeners = new ListenerList();
+
+ /**
+ * Part or <code>null</code>
+ */
+ private IWorkbenchPart fPart;
+
+ /**
+ * Constructs a context provider for the specified part, possibly <code>null</code>.
+ *
+ * @param part workbench part or <code>null</code>
+ */
+ public AbstractDebugContextProvider(IWorkbenchPart part) {
+ fPart = part;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#addDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
+ */
+ public void addDebugContextEventListener(IDebugContextEventListener listener) {
+ fListeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#getPart()
+ */
+ public IWorkbenchPart getPart() {
+ return fPart;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#removeDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
+ */
+ public void removeDebugContextEventListener(IDebugContextEventListener listener) {
+ fListeners.remove(listener);
+ }
+
+ /**
+ * Fires the given context event to all listeners.
+ *
+ * @param event debug context event
+ */
+ protected void fire(final DebugContextEvent event) {
+ Object[] listeners = fListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IDebugContextEventListener listener = (IDebugContextEventListener) listeners[i];
+ SafeRunner.run(new ISafeRunnable() {
+ public void run() throws Exception {
+ listener.contextEvent(event);
+ }
+ public void handleException(Throwable exception) {
+ DebugUIPlugin.log(exception);
+ }
+ });
+
+ }
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/DebugContextEvent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/DebugContextEvent.java
new file mode 100644
index 000000000..a1ebea685
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/DebugContextEvent.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.contexts.provisional;
+
+import java.util.EventObject;
+
+import org.eclipse.jface.viewers.ISelection;
+
+/**
+ * A debug context event.
+ *
+ * @since 3.3
+ */
+public class DebugContextEvent extends EventObject {
+
+ /**
+ * The context
+ */
+ private ISelection fContext;
+
+ /**
+ * Type of context event - change or activation
+ */
+ private int fEventType;
+
+ /**
+ * Context activation event type.
+ */
+ public static final int ACTIVATED = 1;
+
+ /**
+ * Context change event type.
+ */
+ public static final int CHANGED = 2;
+
+ /**
+ * Generated serial version UID for this class.
+ */
+ private static final long serialVersionUID = 3395172504615255524L;
+
+ /**
+ * @param source
+ */
+ public DebugContextEvent(IDebugContextProvider source, ISelection context, int eventType) {
+ super(source);
+ fContext = context;
+ fEventType = eventType;
+ }
+
+ /**
+ * Returns the context associated with this event.
+ *
+ * @return
+ */
+ public ISelection getContext() {
+ return fContext;
+ }
+
+ /**
+ * Returns the event type.
+ *
+ * @return event type
+ */
+ public int getEventType() {
+ return fEventType;
+ }
+
+ /**
+ * Returns the context provider that initiated this event.
+ *
+ * @return context provider
+ */
+ public IDebugContextProvider getDebugContextProvider() {
+ return (IDebugContextProvider) getSource();
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextEventListener.java
index 974fbf921..a5238fdee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/DropToFrameActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextEventListener.java
@@ -4,16 +4,28 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
+package org.eclipse.debug.internal.ui.contexts.provisional;
-package org.eclipse.debug.internal.ui.actions.context;
-public class DropToFrameActionDelegate extends AbstractDebugContextActionDelegate {
- public DropToFrameActionDelegate() {
- super();
- setAction(new DropToFrameAction());
- }
+/**
+ * Notified of context events by a debug context provider.
+ * <p>
+ * Clients are not intended to implement this interface.
+ * </p>
+ * @since 3.3
+ * @see IDebugContextManager
+ */
+public interface IDebugContextEventListener {
+
+ /**
+ * Notification of the specified debug context event.
+ *
+ * @param event debug context event
+ */
+ public void contextEvent(DebugContextEvent event);
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextManager.java
index 2c3c90a16..02f41bcee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextManager.java
@@ -109,5 +109,14 @@ public interface IDebugContextManager {
*
* @param listener
*/
- public void removeDebugContextListener(IDebugContextListener listener);
+ public void removeDebugContextListener(IDebugContextListener listener);
+
+ /**
+ * Returns the context service for the specified window.
+ *
+ * @param window
+ * @return context service
+ * @since 3.3
+ */
+ public IDebugContextService getContextService(IWorkbenchWindow window);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextProvider.java
index fde85fec4..b47a43653 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextProvider.java
@@ -32,18 +32,18 @@ public interface IDebugContextProvider {
public IWorkbenchPart getPart();
/**
- * Registers the given listener for context notifications.
+ * Registers the given listener for context events.
*
- * @param listener context listener
+ * @param listener event listener
*/
- public void addDebugContextListener(IDebugContextListener listener);
+ public void addDebugContextEventListener(IDebugContextEventListener listener);
/**
- * Unregisters the given listener for context notifications.
+ * Unregisters the given listener for context events.
*
- * @param listener context listener
+ * @param listener event listener
*/
- public void removeDebugContextListener(IDebugContextListener listener);
+ public void removeDebugContextEventListener(IDebugContextEventListener listener);
/**
* Returns the currently active context, possibly empty or <code>null</code>.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextService.java
index 7f871ca54..a7d7a4706 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextService.java
@@ -8,9 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts.provisional;
-import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
import org.eclipse.jface.viewers.ISelection;
@@ -28,7 +27,7 @@ public interface IDebugContextService {
*/
public void addDebugContextListener(IDebugContextListener listener);
/**
- * Deregisters for context activation notification in this service.
+ * Unregisters for context activation notification in this service.
*
* @param listener
*/
@@ -43,7 +42,7 @@ public interface IDebugContextService {
public void addDebugContextListener(IDebugContextListener listener, String partId);
/**
- * Deregisters for context activation notification in the specified part.
+ * Unregisters for context activation notification in the specified part.
*
* @param listener
* @param partId
@@ -66,4 +65,41 @@ public interface IDebugContextService {
*/
public ISelection getActiveContext(String partId);
+ /**
+ * Registers for post context notification. Post listeners
+ * are notified of context activation and change after all
+ * non-post listeners are notified.
+ *
+ * @param listener
+ * @since 3.3
+ */
+ public void addPostDebugContextListener(IDebugContextListener listener);
+ /**
+ * Unregisters for post context notification.
+ *
+ * @param listener
+ * @since 3.3
+ */
+ public void removePostDebugContextListener(IDebugContextListener listener);
+
+ /**
+ * Registers for post context notification in the specified part. Post listeners
+ * are notified of context activation and change after all
+ * non-post listeners are notified.
+ *
+ * @param listener
+ * @param partId
+ * @since 3.3
+ */
+ public void addPostDebugContextListener(IDebugContextListener listener, String partId);
+
+ /**
+ * Unregisters for post context notification in the specified part.
+ *
+ * @param listener
+ * @param partId
+ * @since 3.3
+ */
+ public void removePostDebugContextListener(IDebugContextListener listener, String partId);
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
index bb40e8634..1a1121da8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
@@ -14,7 +14,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.debug.internal.ui.actions.context.AbstractRequestMonitor;
+import org.eclipse.debug.internal.ui.commands.actions.AbstractRequestMonitor;
import org.eclipse.ui.progress.WorkbenchJob;
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 5755ebe7d..5257fb9e5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -14,10 +14,7 @@ package org.eclipse.debug.internal.ui.views.launch;
import java.util.Iterator;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
@@ -33,21 +30,22 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.actions.AddToFavoritesAction;
import org.eclipse.debug.internal.ui.actions.EditLaunchConfigurationAction;
import org.eclipse.debug.internal.ui.actions.FindElementAction;
-import org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction;
-import org.eclipse.debug.internal.ui.actions.context.DisconnectAction;
-import org.eclipse.debug.internal.ui.actions.context.DropToFrameAction;
-import org.eclipse.debug.internal.ui.actions.context.ResumeAction;
-import org.eclipse.debug.internal.ui.actions.context.StepIntoAction;
-import org.eclipse.debug.internal.ui.actions.context.StepOverAction;
-import org.eclipse.debug.internal.ui.actions.context.StepReturnAction;
-import org.eclipse.debug.internal.ui.actions.context.SuspendAction;
-import org.eclipse.debug.internal.ui.actions.context.TerminateAction;
-import org.eclipse.debug.internal.ui.actions.context.TerminateAllAction;
-import org.eclipse.debug.internal.ui.actions.context.TerminateAndRelaunchAction;
-import org.eclipse.debug.internal.ui.actions.context.TerminateAndRemoveAction;
+import org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.DisconnectCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.StepIntoCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.StepOverCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.SuspendCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.TerminateAllAction;
+import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRelaunchAction;
+import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRemoveAction;
+import org.eclipse.debug.internal.ui.commands.actions.TerminateCommandAction;
+import org.eclipse.debug.internal.ui.commands.actions.ToggleStepFiltersAction;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
-import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
-import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider;
+import org.eclipse.debug.internal.ui.contexts.provisional.AbstractDebugContextProvider;
+import org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent;
import org.eclipse.debug.internal.ui.sourcelookup.EditSourceLookupPathAction;
import org.eclipse.debug.internal.ui.sourcelookup.LookupSourceAction;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
@@ -67,7 +65,6 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
@@ -118,6 +115,8 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
private static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$
private static final String TERMINATE_AND_RELAUNCH = "terminate_relaunch"; //$NON-NLS-1$
+
+ private static final String TOGGLE_STEP_FILTERS = "toggle_step_filters"; //$NON-NLS-1$
/**
* Whether this view is in the active page of a perspective.
@@ -134,64 +133,31 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
private EditSourceLookupPathAction fEditSourceAction = null;
private LookupSourceAction fLookupAction = null;
- class ContextProvider implements IDebugContextProvider {
- /**
- * Context listeners
- */
- private ListenerList fListeners = new ListenerList();
+ class ContextProvider extends AbstractDebugContextProvider {
+ public ContextProvider() {
+ super(LaunchView.this);
+ // TODO Auto-generated constructor stub
+ }
+
private ISelection fContext = null;
protected void dispose() {
fContext = null;
- fListeners.clear();
}
/* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getPart()
- */
- public IWorkbenchPart getPart() {
- return LaunchView.this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
- */
- public void addDebugContextListener(IDebugContextListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
- */
- public void removeDebugContextListener(IDebugContextListener listener) {
- fListeners.remove(listener);
- }
-
- /* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getActiveContext()
*/
public synchronized ISelection getActiveContext() {
return fContext;
}
- protected void activate(final ISelection selection) {
+ protected void activate(ISelection selection) {
synchronized (this) {
fContext = selection;
}
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IDebugContextListener listener = (IDebugContextListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.contextActivated(selection, ContextProvider.this.getPart());
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
-
- }
+ fire(new DebugContextEvent(this, selection, DebugContextEvent.ACTIVATED));
}
protected void possibleContextChange(Object element) {
@@ -205,20 +171,7 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
return;
}
}
- Object[] listeners = fListeners.getListeners();
- final IStructuredSelection context = new StructuredSelection(element);
- for (int i = 0; i < listeners.length; i++) {
- final IDebugContextListener listener = (IDebugContextListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.contextChanged(context, ContextProvider.this.getPart());
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
-
- }
+ fire(new DebugContextEvent(this, fContext, DebugContextEvent.CHANGED));
}
}
@@ -246,43 +199,42 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
fLookupAction = new LookupSourceAction(this);
setAction(FIND_ACTION, new FindElementAction(this, (AsynchronousTreeViewer) getViewer()));
-
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- TerminateAction terminateAction = new TerminateAction();
- terminateAction.init(window);
- setAction(TERMINATE, terminateAction);
- DisconnectAction disconnectAction = new DisconnectAction();
- disconnectAction.init(window);
- setAction(DISCONNECT, disconnectAction);
- SuspendAction suspendAction = new SuspendAction();
- suspendAction.init(window);
- setAction(SUSPEND, suspendAction);
- ResumeAction resumeAction = new ResumeAction();
- resumeAction.init(window);
- setAction(RESUME, resumeAction);
- StepReturnAction stepReturnAction = new StepReturnAction();
- stepReturnAction.init(window);
- setAction(STEP_RETURN, stepReturnAction);
- StepOverAction stepOverAction = new StepOverAction();
- stepOverAction.init(window);
- setAction(STEP_OVER, stepOverAction);
- StepIntoAction stepIntoAction = new StepIntoAction();
- stepIntoAction.init(window);
- setAction(STEP_INTO, stepIntoAction);
- DropToFrameAction dropToFrameAction = new DropToFrameAction();
- dropToFrameAction.init(window);
- setAction(DROP_TO_FRAME, dropToFrameAction);
- TerminateAndRemoveAction terminateAndRemoveAction = new TerminateAndRemoveAction();
- terminateAndRemoveAction.init(window);
- setAction(TERMINATE_AND_REMOVE, terminateAndRemoveAction);
- TerminateAllAction terminateAll = new TerminateAllAction();
- terminateAll.init(window);
- setAction(TERMINATE_ALL, terminateAll);
- TerminateAndRelaunchAction terminateAndRelaunchAction = new TerminateAndRelaunchAction();
- terminateAndRelaunchAction.init(window);
- setAction(TERMINATE_AND_RELAUNCH, terminateAndRelaunchAction);
+ addCapabilityAction(new TerminateCommandAction(), TERMINATE);
+ addCapabilityAction(new DisconnectCommandAction(), DISCONNECT);
+ addCapabilityAction(new SuspendCommandAction(), SUSPEND);
+ addCapabilityAction(new ResumeCommandAction(), RESUME);
+ addCapabilityAction(new StepReturnCommandAction(), STEP_RETURN);
+ addCapabilityAction(new StepOverCommandAction(), STEP_OVER);
+ addCapabilityAction(new StepIntoCommandAction(), STEP_INTO);
+ addCapabilityAction(new DropToFrameCommandAction(), DROP_TO_FRAME);
+ addCapabilityAction(new TerminateAndRemoveAction(), TERMINATE_AND_REMOVE);
+ addCapabilityAction(new TerminateAndRelaunchAction(), TERMINATE_AND_RELAUNCH);
+ addCapabilityAction(new TerminateAllAction(), TERMINATE_ALL);
+ addCapabilityAction(new ToggleStepFiltersAction(), TOGGLE_STEP_FILTERS);
}
+
+ /**
+ * Initializes the action and associates it with the given id.
+ *
+ * @param capability
+ * @param actionID
+ */
+ private void addCapabilityAction(DebugCommandAction capability, String actionID) {
+ capability.init(this);
+ setAction(actionID, capability);
+ }
+
+ /**
+ * Disposes the given action.
+ *
+ * @param actionID
+ */
+ private void disposeCommandAction(String actionID) {
+ DebugCommandAction action = (DebugCommandAction) getAction(actionID);
+ action.dispose();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
*/
@@ -431,6 +383,8 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
tbm.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
tbm.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
+
+ tbm.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
}
/* (non-Javadoc)
@@ -461,28 +415,17 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
PropertyDialogAction properties = (PropertyDialogAction) getAction("Properties"); //$NON-NLS-1$
properties.dispose();
- AbstractDebugContextAction action = (AbstractDebugContextAction) getAction(TERMINATE);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(DISCONNECT);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(SUSPEND);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(RESUME);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(STEP_RETURN);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(STEP_OVER);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(STEP_INTO);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(DROP_TO_FRAME);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(TERMINATE_AND_REMOVE);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(TERMINATE_ALL);
- action.dispose();
- action = (AbstractDebugContextAction) getAction(TERMINATE_AND_RELAUNCH);
- action.dispose();
+ disposeCommandAction(TERMINATE);
+ disposeCommandAction(DISCONNECT);
+ disposeCommandAction(SUSPEND);
+ disposeCommandAction(RESUME);
+ disposeCommandAction(STEP_RETURN);
+ disposeCommandAction(STEP_OVER);
+ disposeCommandAction(STEP_INTO);
+ disposeCommandAction(DROP_TO_FRAME);
+ disposeCommandAction(TERMINATE_AND_REMOVE);
+ disposeCommandAction(TERMINATE_AND_RELAUNCH);
+ disposeCommandAction(TERMINATE_ALL);
}
/**
@@ -612,6 +555,8 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
menu.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
menu.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
+
+ menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
}
/**

Back to the top