code: private void setSelectionStateOfAll(State state)
      {
          Objects.requireNonNull(state, "The state may not be null");
          List<Object> allNodes = JTrees.getAllNodes(getModel());
          for (Object node : allNodes)
          {
              setSelectionState(node, state);
          }
      }
docs: Set the selection state of all nodes to the given state
  
  @param state The state