Object element = getElement(children, refChildren[i]);
/** * Delete elements from existing container that doesn't exist in the reference container. * * @param container the existing container to delete the removed elements. * @param refContainer the reference container to compare elements that are removed. * @param containerDelta the delta of the existing container. */ private void deleteRemovedElements(BreakpointContainer container, BreakpointContainer refContainer, ModelDelta containerDelta) { Object[] children = container.getChildren(); Object[] refChildren = refContainer.getChildren(); // if a child of container doesn't exist in refContainer, than remove it from container for (int i = 0; i < children.length; ++i) { Object element = getElement(refChildren, children[i]); if (element == null) { if (children[i] instanceof BreakpointContainer) { BreakpointContainer.removeAll((BreakpointContainer) children[i], containerDelta); } else { BreakpointContainer.removeBreakpoint(container, (IBreakpoint) children[i], containerDelta); } } else if (element instanceof BreakpointContainer){ ModelDelta childDelta = containerDelta.addNode(children[i], IModelDelta.STATE); deleteRemovedElements((BreakpointContainer) children[i], (BreakpointContainer) element, childDelta); } } }