Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2010-05-06 12:49:40 -0400
committerPawel Piech2010-05-06 12:49:40 -0400
commit4c86aa38cee434c4b04693565ceebbe40b23f104 (patch)
tree7a3d80275a16332c153c24679bd7d0e074e29b7e
parent4dd4658d22ada27f50ec555287ebf0ca30382270 (diff)
downloadeclipse.platform.debug-4c86aa38cee434c4b04693565ceebbe40b23f104.tar.gz
eclipse.platform.debug-4c86aa38cee434c4b04693565ceebbe40b23f104.tar.xz
eclipse.platform.debug-4c86aa38cee434c4b04693565ceebbe40b23f104.zip
Bug 305177 - import breakpoints does not refresh view properly
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java14
2 files changed, 15 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 1133a43dc..b30014d1d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -605,8 +605,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
// if a child exist in container, than recursively search into container. And also update the organizer of
// of container to the one in the refContainer's child.
} else if (element instanceof BreakpointContainer) {
- int index = Arrays.asList(children).indexOf(element);
- ModelDelta childDelta = containerDelta.addNode(element, index, IModelDelta.STATE, -1);
+ ModelDelta childDelta = containerDelta.addNode(element, container.getChildIndex(element), IModelDelta.STATE, -1);
BreakpointContainer.copyOrganizers((BreakpointContainer) element, (BreakpointContainer) refChildren[i]);
newBreakpoint = insertAddedElements((BreakpointContainer) element, (BreakpointContainer) refChildren[i], childDelta);
childDelta.setChildCount(((BreakpointContainer) element).getChildren().length);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
index caf556e3b..81bd9bff8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
@@ -398,6 +398,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
List breakpoints = destContainer.fBreakpoints;
destContainerDelta.addNode(breakpoint, index/*breakpoints.indexOf(breakpoint)*/, IModelDelta.ADDED|IModelDelta.INSTALL, 0);
+ destContainerDelta.setFlags(destContainerDelta.getFlags() | IModelDelta.EXPAND);
// add the breakpoints to the parent containers.
updateSelfAndAncestorsBreakpointCache(destContainer.getParent(), breakpoints, true);
@@ -539,6 +540,19 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
}
return getContainers();
}
+
+ /**
+ * Returns the index of the given child element (breakpoint or container.
+ *
+ * @param child Child to calculate index of.
+ * @return index of child
+ */
+ public int getChildIndex(Object child) {
+ if (fChildContainers.isEmpty()) {
+ return fBreakpoints.indexOf(child);
+ }
+ return fChildContainers.indexOf(child);
+ }
/**
* Returns the containers nested in this container, possibly empty.

Back to the top