/* * (non-Javadoc) * * @see org.xmind.core.ITopicRange#encloses(org.xmind.core.ITopic) */ public boolean encloses(ITopic subtopic) { if (subtopic == null) return false; ITopic parent = subtopic.getParent(); if (parent == null || !parent.equals(getParent())) return false; int startIndex = getStartIndex(); int endIndex = getEndIndex(); int subIndex = subtopic.getIndex(); return subIndex >= startIndex && subIndex <= endIndex; }
public void dispose() { if (topic != null) { ITopic parent = topic.getParent(); if (parent != null) { parent.remove(topic); branch = null; } else { if (branch != null) { branch.getStatus().deactivate(); branch.removeNotify(); removeBranchView(); branch.setParent(null); branch = null; } } topic = null; } }