/** * Helper method that recursively finds and removes all the blocks connected to the bottom of this * block, including this block. * * @param afterBlock - RenderableBlock we start removing at * @param widget - WorkspaceWidget that the block is using * @param container - Container the block is stored in */ private void removeAfterBlock( RenderableBlock afterBlock, WorkspaceWidget widget, Container container) { if (workspace.getEnv().getBlock(afterBlock.getBlockID()).getAfterBlockID() != Block.NULL) { removeAfterBlock( workspace .getEnv() .getRenderableBlock( workspace.getEnv().getBlock(afterBlock.getBlockID()).getAfterBlockID()), widget, container); } removeChildrenBlock(afterBlock, widget, container); }