diff options
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. |