/** * Insert the section descriptor into the section descriptor list. * * @param target * the section descriptor to insert. * @return <code>true</code> if the target descriptor was added to the * descriptors list. */ private boolean insertSectionDescriptor(ISectionDescriptor target) { if (target.getAfterSection().equals(TOP)) { getSectionDescriptors().add(0, target); return true; } for (int i = 0; i < getSectionDescriptors().size(); i++) { ISectionDescriptor descriptor = (ISectionDescriptor) getSectionDescriptors() .get(i); if (target.getAfterSection().equals(descriptor.getId())) { getSectionDescriptors().add(i + 1, target); return true; } else if (descriptor.getAfterSection().equals(target.getId())) { getSectionDescriptors().add(i, target); return true; } } return false; }