State (@NotNull ChangesBrowserNode<?> node) { if (getInclusionModel().isInclusionEmpty()) return State.NOT_SELECTED; boolean hasIncluded = false; boolean hasExcluded = false; for (Object item : allUnder(node).userObjects()) { State state = getInclusionModel().getInclusionState(item); if (state == State.SELECTED) { hasIncluded = true; } else if (state == State.NOT_SELECTED) { hasExcluded = true; } else { hasIncluded = true; hasExcluded = true; } if (hasIncluded && hasExcluded) break; } if (hasIncluded && hasExcluded) return State.DONT_CARE; if (hasIncluded) return State.SELECTED; return State.NOT_SELECTED; }