Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2002-03-27 15:49:36 -0500
committerDarin Swanson2002-03-27 15:49:36 -0500
commitae42026f46211fcfbb5353a5beb1fb34736256b5 (patch)
treeab2361a0f57a403cc156f8db70ab97ab889667ce
parent6406870dc0d3f54794ae2639b317b205fd0e9b23 (diff)
downloadeclipse.platform.debug-ae42026f46211fcfbb5353a5beb1fb34736256b5.tar.gz
eclipse.platform.debug-ae42026f46211fcfbb5353a5beb1fb34736256b5.tar.xz
eclipse.platform.debug-ae42026f46211fcfbb5353a5beb1fb34736256b5.zip
Bug 7223 - Removing a breakpoint could select next breakpoint
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/BreakpointsView.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ExpressionViewEventHandler.java8
2 files changed, 18 insertions, 5 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/BreakpointsView.java
index e48513d54..23fa9e8a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/BreakpointsView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/BreakpointsView.java
@@ -286,7 +286,18 @@ public class BreakpointsView extends AbstractDebugView {
asyncExec(new Runnable() {
public void run() {
if (isAvailable()) {
- ((TableViewer)getViewer()).remove(breakpoint);
+ TableViewer viewer= (TableViewer)getViewer();
+ int[] indices= viewer.getTable().getSelectionIndices();
+ viewer.remove(breakpoint);
+ if (viewer.getSelection().isEmpty()) {
+ if (indices.length > 0) {
+ int index= Math.max(indices[0] - 1, 0);
+ viewer.getTable().select(index);
+ }
+ //fire the selection changed as does not occur when
+ //setting selection on the swt widget
+ viewer.setSelection(viewer.getSelection());
+ }
updateActions();
}
}
@@ -298,7 +309,7 @@ public class BreakpointsView extends AbstractDebugView {
* @see IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta)
*/
public void breakpointChanged(final IBreakpoint breakpoint, IMarkerDelta delta) {
- if (isAvailable()&& breakpoint.getMarker().exists()) {
+ if (isAvailable() && breakpoint.getMarker().exists()) {
asyncExec(new Runnable() {
public void run() {
if (isAvailable() && breakpoint.getMarker().exists()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ExpressionViewEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ExpressionViewEventHandler.java
index 57ce9baf8..ec5b63b46 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ExpressionViewEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ExpressionViewEventHandler.java
@@ -5,16 +5,14 @@ package org.eclipse.debug.internal.ui.views;
* All Rights Reserved.
*/
-import java.util.ArrayList;
import java.util.List;
-import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IExpressionListener;
import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.StructuredSelection;
/**
* Updates the expression view
@@ -72,6 +70,10 @@ public class ExpressionViewEventHandler extends VariablesViewEventHandler implem
decendants.add(expression);
// Remove the parent cache for the expression and its children
expressionProvider.removeCache(decendants.toArray());
+ IExpression[] expressions= DebugPlugin.getDefault().getExpressionManager().getExpressions();
+ if (expressions.length > 0) {
+ getTreeViewer().setSelection(new StructuredSelection(expressions[0]), true);
+ }
}
}
}

Back to the top