/** @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ public boolean hasChildren(Object element) { if (element == TreeRoot.EMPTY_ROOT || element == TreeTermination.SEARCH_CANCELED) { return false; } // Only methods can have subelements, so there's no need to fool the // user into believing that there is more if (element instanceof MethodWrapper) { MethodWrapper methodWrapper = (MethodWrapper) element; if (methodWrapper.getMember().getElementType() != IRubyElement.METHOD) { return false; } if (shouldStopTraversion(methodWrapper)) { return false; } return true; } else if (element instanceof TreeRoot) { return true; } else if (element instanceof DeferredMethodWrapper) { // Err on the safe side by returning true even though // we don't know for sure that there are children. return true; } return false; // the "Update ..." placeholder has no children }
private boolean shouldStopTraversion(MethodWrapper methodWrapper) { return (methodWrapper.getLevel() > CallHierarchyUI.getDefault().getMaxCallDepth()) || methodWrapper.isRecursive(); }
public void run(IProgressMonitor pm) { fCalls = fMethodWrapper.getCalls(pm); }