private SelectionState getSelectionStatus() {
    boolean isRequiredSelectionEnabled = computeRequiredSelectionStatus();

    String stateMessage = "";
    final Object root = myTree.getModel().getRoot();
    if (root instanceof CheckedTreeNode) {

      final int[] selectedModulesCount = {0};

      TreeUtil.traverse((CheckedTreeNode)root, node -> {
        if (node instanceof DataNodeCheckedTreeNode &&
            ((DataNodeCheckedTreeNode)node).isChecked() &&
            myDependencyAwareDataKeys.contains((((DataNodeCheckedTreeNode)node).myDataNode.getKey()))) {
          selectedModulesCount[0]++;
        }
        return true;
      });
      stateMessage = ExternalSystemBundle.message("label.modules.selected", myModulesCount, selectedModulesCount[0]);
    }

    return new SelectionState(isRequiredSelectionEnabled, stateMessage);
  }
private SelectionState getSelectionStatus()