Exemple #1
0
  public void selectNodeOnLoad(final Condition<TreeNode> nodeFilter) {
    addTreeListener(
        new XDebuggerTreeListener() {
          @Override
          public void nodeLoaded(@NotNull RestorableStateNode node, String name) {
            if (nodeFilter.value(node)) {
              setSelectionPath(node.getPath());
            }
          }

          @Override
          public void childrenLoaded(
              @NotNull XDebuggerTreeNode node,
              @NotNull List<XValueContainerNode<?>> children,
              boolean last) {}
        });
  }
Exemple #2
0
  public void expandNodesOnLoad(final Condition<TreeNode> nodeFilter) {
    addTreeListener(
        new XDebuggerTreeListener() {
          @Override
          public void nodeLoaded(@NotNull RestorableStateNode node, String name) {
            if (nodeFilter.value(node) && !node.isLeaf()) {
              // cause children computing
              node.getChildCount();
            }
          }

          @Override
          public void childrenLoaded(
              @NotNull XDebuggerTreeNode node,
              @NotNull List<XValueContainerNode<?>> children,
              boolean last) {
            if (nodeFilter.value(node)) {
              expandPath(node.getPath());
            }
          }
        });
  }
 public XDebuggerTreeRestorer(final XDebuggerTree tree, Rectangle lastVisibleNodeRect) {
   myTree = tree;
   myLastVisibleNodeRect = lastVisibleNodeRect;
   tree.addTreeListener(this);
   tree.addTreeSelectionListener(this);
 }