Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2002-03-13 00:39:03 +0000
committerDarin Swanson2002-03-13 00:39:03 +0000
commitb5506a7eeecbdd6e0843c8c592a5fe0f7b3bf15d (patch)
tree6aa5817d3680c1a0083a717804ffc870db4f0d4e
parentf3a49c6c0fb324640e22001256ecad081437f1da (diff)
downloadeclipse.platform.debug-b5506a7eeecbdd6e0843c8c592a5fe0f7b3bf15d.tar.gz
eclipse.platform.debug-b5506a7eeecbdd6e0843c8c592a5fe0f7b3bf15d.tar.xz
eclipse.platform.debug-b5506a7eeecbdd6e0843c8c592a5fe0f7b3bf15d.zip
Bug 8937 - Feature Request - Select all in the breakpoints view
-rw-r--r--org.eclipse.debug.ui/plugin.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllBreakpointsAction.java72
3 files changed, 109 insertions, 47 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index a2b783b05..12b30f6b4 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -70,7 +70,7 @@ RemoveAllTerminatedAction.label=Remove &All Terminated
commonTabName=&Common
-SelectAll.label=Select &All (Alt+A)
+SelectAll.label=Select &All
CopyToClipboardAction.label=&Copy Stack
CopyVariablesToClipboardAction.label=Copy &Variables
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
index 5f819bfd0..715504cab 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
@@ -1,33 +1,19 @@
+package org.eclipse.debug.internal.ui.actions;
+
/*
* (c) Copyright IBM Corp. 2002.
* All Rights Reserved.
*/
-package org.eclipse.debug.internal.ui.actions;
-import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.debug.ui.IDebugViewAdapter;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IViewPart;
-public class SelectAllAction extends AbstractListenerActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) {
- doAction();
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action){
- doAction(null);
- }
+public abstract class SelectAllAction extends AbstractListenerActionDelegate {
/**
* @see AbstractDebugActionDelegate#isEnabledFor(Object)
@@ -42,36 +28,13 @@ public class SelectAllAction extends AbstractListenerActionDelegate {
protected String getHelpContextId() {
return null;
}
-
- protected void update(IAction action, ISelection s) {
- update();
- }
-
- protected void doAction() {
- if (!(getView() instanceof AbstractDebugView)) {
- return;
- }
- Viewer viewer= ((AbstractDebugView)getView()).getViewer();
- if (!(viewer instanceof TableViewer)) {
- return;
- }
- ((TableViewer)viewer).getTable().selectAll();
- }
-
- /**
- * Enable this action if there are any breakpoints to select
- */
- protected void update() {
- getAction().setEnabled(
- DebugPlugin.getDefault().getBreakpointManager().getBreakpoints().length == 0 ? false : true);
- }
-
+
/**
* @see AbstractDebugActionDelegate#setActionImages(IAction)
*/
protected void setActionImages(IAction action) {
}
-
+
/**
* @see IViewActionDelegate#init(IViewPart)
*/
@@ -81,13 +44,14 @@ public class SelectAllAction extends AbstractListenerActionDelegate {
getPage().addPartListener(this);
getPage().getWorkbenchWindow().addPageListener(this);
}
-
+
/**
* @see AbstractDebugActionDelegate#initialize(IAction, ISelection)
*/
protected boolean initialize(IAction action, ISelection selection) {
if (!isInitialized()) {
- IDebugViewAdapter debugView= (IDebugViewAdapter)getView().getAdapter(IDebugViewAdapter.class);
+ IDebugViewAdapter debugView =
+ (IDebugViewAdapter) getView().getAdapter(IDebugViewAdapter.class);
if (debugView != null) {
debugView.setAction(AbstractDebugView.SELECT_ALL_ACTION, action);
}
@@ -95,5 +59,31 @@ public class SelectAllAction extends AbstractListenerActionDelegate {
}
return false;
}
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action){
+ doAction(null);
+ }
-}
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) {
+ if (!(getView() instanceof AbstractDebugView)) {
+ return;
+ }
+ Viewer viewer = ((AbstractDebugView) getView()).getViewer();
+ if (!(viewer instanceof TreeViewer)) {
+ return;
+ }
+ ((TreeViewer) viewer).getTree().selectAll();
+ }
+
+ protected abstract void update();
+
+ protected void update(IAction action, ISelection selection) {
+ update();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllBreakpointsAction.java
new file mode 100644
index 000000000..31c08f2ef
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllBreakpointsAction.java
@@ -0,0 +1,72 @@
+package org.eclipse.debug.internal.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointListener;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.ui.AbstractDebugView;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewPart;
+
+
+public class SelectAllBreakpointsAction extends SelectAllAction implements IBreakpointListener {
+
+ protected void update() {
+ getAction().setEnabled(
+ DebugPlugin.getDefault().getBreakpointManager().getBreakpoints().length != 0);
+ }
+
+ /**
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ super.init(view);
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
+ }
+
+
+ public void dispose() {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
+ super.dispose();
+ }
+ /**
+ * @see IBreakpointListener#breakpointAdded(IBreakpoint)
+ */
+ public void breakpointAdded(IBreakpoint breakpoint) {
+ getAction().setEnabled(true);
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
+ }
+
+ /**
+ * @see IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta)
+ */
+ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+ update(null, null);
+ }
+
+ /**
+ * @see AbstractDebugActionDelegate#doAction(Object)
+ */
+ protected void doAction(Object element) {
+ if (!(getView() instanceof AbstractDebugView)) {
+ return;
+ }
+ Viewer viewer = ((AbstractDebugView) getView()).getViewer();
+ if (!(viewer instanceof TableViewer)) {
+ return;
+ }
+ ((TableViewer) viewer).getTable().selectAll();
+ }
+
+} \ No newline at end of file

Back to the top