예제 #1
0
  /** @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
  }
예제 #2
0
 private boolean shouldStopTraversion(MethodWrapper methodWrapper) {
   return (methodWrapper.getLevel() > CallHierarchyUI.getDefault().getMaxCallDepth())
       || methodWrapper.isRecursive();
 }
예제 #3
0
 public void run(IProgressMonitor pm) {
   fCalls = fMethodWrapper.getCalls(pm);
 }