예제 #1
0
  private void remove(Object element, boolean refreshViewer) {
    // precondition here: fResult.getMatchCount(child) <= 0

    if (hasChildren(element)) {
      if (refreshViewer) fTreeViewer.refresh(element);
    } else {
      if (!hasMatches(element)) {
        fChildrenMap.remove(element);
        Object parent = getParent(element);
        if (parent != null) {
          removeFromSiblings(element, parent);
          remove(parent, refreshViewer);
        } else {
          removeFromSiblings(element, fResult);
          if (refreshViewer) fTreeViewer.refresh();
        }
      } else {
        if (refreshViewer) {
          fTreeViewer.refresh(element);
        }
      }
    }
  }
예제 #2
0
 private void insert(Object child, boolean refreshViewer) {
   int searchFor = ((Q7SearchQuery) fResult.getQuery()).getSearchFor();
   boolean isDependencySearch =
       searchFor == Q7SearchQuery.CONTEXTS_BY_ID
           || searchFor == Q7SearchQuery.TESTCASE_BY_ID
           || searchFor == Q7SearchQuery.VERIFICATION_BY_ID;
   if (isDependencySearch) {
     child = getParent(child);
   }
   Object parent = getParent(child);
   while (parent != null) {
     if (insertChild(parent, child)) {
       if (refreshViewer) fTreeViewer.add(parent, child);
     } else {
       if (refreshViewer) fTreeViewer.refresh(parent);
       return;
     }
     child = parent;
     parent = getParent(child);
   }
   if (insertChild(fResult, child)) {
     if (refreshViewer) fTreeViewer.add(fResult, child);
   }
 }
예제 #3
0
 public void clear() {
   initialize(fResult);
   fTreeViewer.refresh();
 }